From fdcd37377116e3d8d91fc396876d4550b9baaa71 Mon Sep 17 00:00:00 2001 From: Galen Charlton Date: Wed, 22 Apr 2015 17:37:29 +0000 Subject: [PATCH] LP#741788: install the MARC stream importer better This patch ensures that marc_stream_importer.pl gets install in the Evergreen binary directory and that an example configuration file gets installed in the appropriate configuration directory (rather than, as in the past, the Evergreen bindir). Signed-off-by: Galen Charlton --- .../marc_stream_importer.conf.example} | 4 ++-- Open-ILS/src/Makefile.am | 11 ++++++++++- .../{marc_stream_importer.pl => marc_stream_importer.pl.in} | 9 ++++----- 3 files changed, 16 insertions(+), 8 deletions(-) rename Open-ILS/{src/support-scripts/marc_stream_importer.conf => examples/marc_stream_importer.conf.example} (81%) rename Open-ILS/src/support-scripts/{marc_stream_importer.pl => marc_stream_importer.pl.in} (98%) diff --git a/Open-ILS/src/support-scripts/marc_stream_importer.conf b/Open-ILS/examples/marc_stream_importer.conf.example similarity index 81% rename from Open-ILS/src/support-scripts/marc_stream_importer.conf rename to Open-ILS/examples/marc_stream_importer.conf.example index 329b247aff..7521db51cd 100644 --- a/Open-ILS/src/support-scripts/marc_stream_importer.conf +++ b/Open-ILS/examples/marc_stream_importer.conf.example @@ -5,9 +5,9 @@ user opensrf group opensrf ### logging ? -log_file /openils/var/log/marc_stream_importer.log +log_file LOCALSTATEDIR/log/marc_stream_importer.log log_level 3 -pid_file /openils/var/run/marc_stream_importer.pid +pid_file LOCALSTATEDIR/run/marc_stream_importer.pid ### access control # allow .+\.(net|com) diff --git a/Open-ILS/src/Makefile.am b/Open-ILS/src/Makefile.am index 07d90f9f87..32475f540c 100644 --- a/Open-ILS/src/Makefile.am +++ b/Open-ILS/src/Makefile.am @@ -45,7 +45,8 @@ sysconf_DATA = $(examples)/action_trigger_filters.json.example \ $(examples)/lib_ips.txt.example \ $(examples)/oils_yaz.xml.example \ $(examples)/kpac.xml.example \ - $(examples)/oils_z3950.xml.example + $(examples)/oils_z3950.xml.example \ + $(examples)/marc_stream_importer.conf.example #---------------------------- # Build ILS CORE @@ -70,6 +71,7 @@ core_scripts = $(examples)/oils_ctl.sh \ $(supportscr)/juv_to_adult.srfsh \ $(supportscr)/thaw_expired_frozen_holds.srfsh \ $(supportscr)/long-overdue-status-update.pl \ + $(supportscr)/oils_header.pl \ $(supportscr)/purge_holds.srfsh \ $(supportscr)/purge_circulations.srfsh \ $(supportscr)/purge_pending_users.srfsh \ @@ -146,6 +148,7 @@ gen_scripts = \ $(supportscr)/authority_authority_linker.pl \ $(supportscr)/eg_db_config \ $(supportscr)/marc_export \ + $(supportscr)/marc_stream_importer.pl \ $(supportscr)/offline-blocked-list.pl gen_docs = \ @@ -242,6 +245,10 @@ $(supportscr)/marc_export: Makefile $(supportscr)/marc_export.in $(do_subst) $(supportscr)/marc_export.in > "$@" chmod 755 "$@" +$(supportscr)/marc_stream_importer.pl: Makefile $(supportscr)/marc_stream_importer.pl.in + $(do_subst) $(supportscr)/marc_stream_importer.pl.in > "$@" + chmod 755 "$@" + $(supportscr)/offline-blocked-list.pl: Makefile $(supportscr)/offline-blocked-list.pl.in $(do_subst) $(supportscr)/offline-blocked-list.pl.in > "$@" chmod 755 "$@" @@ -281,6 +288,8 @@ ilscore-install: sed -i 's|LOCALSTATEDIR|@localstatedir@|g' '$(DESTDIR)@sysconfdir@/opensrf.xml.example' sed -i 's|SYSCONFDIR|@sysconfdir@|g' '$(DESTDIR)@sysconfdir@/opensrf.xml.example' sed -i 's|LIBDIR|@libdir@|g' '$(DESTDIR)@sysconfdir@/opensrf.xml.example' + sed -i 's|LOCALSTATEDIR|@localstatedir@|g' '$(DESTDIR)@sysconfdir@/marc_stream_importer.conf.example' + sed -i 's|SYSCONFDIR|@sysconfdir@|g' '$(DESTDIR)@sysconfdir@/marc_stream_importer.conf.example' sed -i 's|BINDIR|@bindir@|g' '$(DESTDIR)@bindir@/autogen.sh' sed -i 's|LOCALSTATEDIR|@localstatedir@|g' '$(DESTDIR)@bindir@/autogen.sh' sed -i 's|SYSCONFDIR|@sysconfdir@|g' '$(DESTDIR)@bindir@/autogen.sh' diff --git a/Open-ILS/src/support-scripts/marc_stream_importer.pl b/Open-ILS/src/support-scripts/marc_stream_importer.pl.in similarity index 98% rename from Open-ILS/src/support-scripts/marc_stream_importer.pl rename to Open-ILS/src/support-scripts/marc_stream_importer.pl.in index d418fb6c2c..c4328a2621 100755 --- a/Open-ILS/src/support-scripts/marc_stream_importer.pl +++ b/Open-ILS/src/support-scripts/marc_stream_importer.pl.in @@ -22,7 +22,6 @@ use MARC::File::XML ( BinaryEncoding => 'UTF-8' ); use MARC::File::USMARC; use Data::Dumper; -use File::Basename qw/fileparse/; use File::Temp qw/tempfile/; use Getopt::Long qw(:DEFAULT GetOptionsFromArray); use Pod::Usage; @@ -33,7 +32,8 @@ use OpenSRF::AppSession; use OpenSRF::EX qw/:try/; use OpenILS::Utils::Cronscript; use OpenSRF::Transport::PeerHandle; -require 'oils_header.pl'; +use FindBin; +require "$FindBin::Bin/oils_header.pl"; use vars qw/$apputils/; my $vl_ses; @@ -44,7 +44,7 @@ my %defaults = ( 'buffsize=i' => 4096, 'merge-profile=i' => 0, 'source=i' => 1, -# 'osrf-config=s' => '/openils/conf/opensrf_core.xml', +# 'osrf-config=s' => '@sysconfdir@/opensrf_core.xml', 'user=s' => 'admin', 'password=s' => '', 'tempdir=s' => '', @@ -108,8 +108,7 @@ my $wait_time = $real_opts->{wait}; my $authtoken = ''; # DEFAULTS for Net::Server -my $filename = fileparse($0, '.pl'); -my $conf_file = (-r "$filename.conf") ? "$filename.conf" : undef; +my $conf_file = (-r "@sysconfdir@/marc_stream_importer.conf") ? "@sysconfdir@/marc_stream_importer.conf" : undef; # $conf_file is the Net::Server config for THIS script (not EG), if it exists and is readable -- 2.11.0