From 3e0bc66d4b1cafd3ee4377e96fa602ac03634f52 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 Signed-off-by: Josh Stompro Conflicts: Open-ILS/src/Makefile.am Open-ILS/src/support-scripts/marc_stream_importer.pl.in --- .../marc_stream_importer.conf.example} | 4 ++-- Open-ILS/src/Makefile.am | 11 ++++++++++- .../{marc_stream_importer.pl => marc_stream_importer.pl.in} | 7 ++++--- 3 files changed, 16 insertions(+), 6 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 253e8ab840..3a8f4fc851 100644 --- a/Open-ILS/src/Makefile.am +++ b/Open-ILS/src/Makefile.am @@ -41,7 +41,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 @@ -67,6 +68,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_at_events.srfsh \ $(supportscr)/purge_holds.srfsh \ $(supportscr)/purge_circulations.srfsh \ @@ -129,6 +131,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 = \ @@ -225,6 +228,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 "$@" @@ -264,6 +271,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 412d46646d..0562d0c653 100755 --- a/Open-ILS/src/support-scripts/marc_stream_importer.pl +++ b/Open-ILS/src/support-scripts/marc_stream_importer.pl.in @@ -21,8 +21,9 @@ use strict; use warnings; use Net::Server::PreFork; use base qw/Net::Server::PreFork/; +use FindBin; +require "$FindBin::Bin/oils_header.pl"; -require 'oils_header.pl'; use vars qw/$apputils $authtoken/; use Getopt::Long; @@ -56,7 +57,7 @@ my $auth_merge_profile_obj; # options my $help = 0; -my $osrf_config = '/openils/conf/opensrf_core.xml'; +my $osrf_config = '@sysconfdir@/opensrf_core.xml'; my $username = ''; my $password = ''; my $tempdir = ''; @@ -87,7 +88,7 @@ my $deprecated_queue; -my $net_server_conf = fileparse($0, '.pl').'.conf'; +my $net_server_conf = (-r "@sysconfdir@/marc_stream_importer.conf") ? "@sysconfdir@/marc_stream_importer.conf" : undef; GetOptions( 'osrf-config=s' => \$osrf_config, -- 2.11.0