From 489cd05e2738d5cfc7bb5524428c8c3314883c5d Mon Sep 17 00:00:00 2001 From: gmc Date: Wed, 6 Apr 2011 22:06:42 +0000 Subject: [PATCH] install command-line MARC import tools in @prefix@/bin (corrected version after dealing with apparent git stash breakage) No longer need to keep the source tree around to use marc2are.pl, marc2sre.pl, marc2bre.pl, and parallel_pg_loader.pl. Signed-off-by: Galen Charlton git-svn-id: svn://svn.open-ils.org/ILS/trunk@20010 dcc99617-32d9-48b4-a31d-7c20da2025e4 --- Open-ILS/src/Makefile.am | 2 +- .../src/extras/import/{marc2are.pl => marc2are.pl.in} | 4 +--- .../src/extras/import/{marc2bre.pl => marc2bre.pl.in} | 8 +++----- .../src/extras/import/{marc2sre.pl => marc2sre.pl.in} | 4 ++-- .../{parallel_pg_loader.pl => parallel_pg_loader.pl.in} | 4 +--- configure.ac | 9 ++++++++- 6 files changed, 16 insertions(+), 15 deletions(-) rename Open-ILS/src/extras/import/{marc2are.pl => marc2are.pl.in} (96%) rename Open-ILS/src/extras/import/{marc2bre.pl => marc2bre.pl.in} (98%) rename Open-ILS/src/extras/import/{marc2sre.pl => marc2sre.pl.in} (99%) rename Open-ILS/src/extras/import/{parallel_pg_loader.pl => parallel_pg_loader.pl.in} (97%) diff --git a/Open-ILS/src/Makefile.am b/Open-ILS/src/Makefile.am index 7988b53eb0..e87bbd142b 100644 --- a/Open-ILS/src/Makefile.am +++ b/Open-ILS/src/Makefile.am @@ -138,7 +138,7 @@ if BUILDEGJAVA OILSJAVA_DIR = java endif -bin_SCRIPTS = $(core_scripts) $(reporter_scripts) $(installautojs) @srcdir@/extras/eg_config @srcdir@/extras/fast-extract +bin_SCRIPTS = $(core_scripts) $(reporter_scripts) $(installautojs) @srcdir@/extras/eg_config @srcdir@/extras/fast-extract @srcdir@/extras/import/marc2are.pl @srcdir@/extras/import/marc2bre.pl @srcdir@/extras/import/marc2sre.pl @srcdir@/extras/import/parallel_pg_loader.pl data_DATA = $(core_data) $(reporter_data) # Take care of which subdirectories to build, and which extra files to include in a distribution. diff --git a/Open-ILS/src/extras/import/marc2are.pl b/Open-ILS/src/extras/import/marc2are.pl.in similarity index 96% rename from Open-ILS/src/extras/import/marc2are.pl rename to Open-ILS/src/extras/import/marc2are.pl.in index 1eb86d43cf..d6a4c12c00 100755 --- a/Open-ILS/src/extras/import/marc2are.pl +++ b/Open-ILS/src/extras/import/marc2are.pl.in @@ -2,8 +2,6 @@ use strict; use warnings; -use lib '/openils/lib/perl5/'; - use OpenSRF::System; use OpenSRF::Application; use OpenSRF::EX qw/:try/; @@ -26,7 +24,7 @@ use MARC::Charset; MARC::Charset->ignore_errors(1); my ($count, $user, $password, $config, $marctype, $keyfile, @files, $quiet) = - (1, 'admin', 'open-ils', '/openils/conf/opensrf_core.xml', 'USMARC'); + (1, 'admin', 'open-ils', '@sysconfdir@/opensrf_core.xml', 'USMARC'); GetOptions( 'startid=i' => \$count, diff --git a/Open-ILS/src/extras/import/marc2bre.pl b/Open-ILS/src/extras/import/marc2bre.pl.in similarity index 98% rename from Open-ILS/src/extras/import/marc2bre.pl rename to Open-ILS/src/extras/import/marc2bre.pl.in index e5c9604dcb..d9de5c3f44 100755 --- a/Open-ILS/src/extras/import/marc2bre.pl +++ b/Open-ILS/src/extras/import/marc2bre.pl.in @@ -2,8 +2,6 @@ use strict; use warnings; -#use lib '/openils/lib/perl5/'; - use Error qw/:try/; use OpenILS::Utils::Fieldmapper; use Digest::MD5 qw/md5_hex/; @@ -24,7 +22,7 @@ use DBI; #MARC::Charset->ignore_errors(1); my ($id_field, $id_subfield, $recid, $user, $config, $idlfile, $marctype, $tcn_offset, $tcn_mapfile, $tcn_dumpfile, $used_id_file, $used_tcn_file, $enc, @files, @trash_fields, @req_fields, $use901, $quiet, $tcn_field, $tcn_subfield) = - ('', 'a', 0, 1, '/openils/conf/opensrf_core.xml', '/openils/conf/fm_IDL.xml', 'USMARC', 0); + ('', 'a', 0, 1, '@sysconfdir@/opensrf_core.xml', '@sysconfdir@/fm_IDL.xml', 'USMARC', 0); my ($db_driver, $db_host, $db_port, $db_name, $db_user, $db_pw) = ('Pg', 'localhost', 5432, 'evergreen', 'postgres', 'postgres'); @@ -43,11 +41,11 @@ GetOptions( 'tcn_mapfile=s' => \$tcn_mapfile, # external file which allows for matching specific record tcns to specific record ids, format = one id_number|tcn_number combo per line 'tcnfile=s' => \$tcn_dumpfile, # DEPRECATED, use tcn_dumpfile instead 'tcn_dumpfile=s' => \$tcn_dumpfile, # allows specification of a dumpfile for all used tcn values - 'config=s' => \$config, # location of OpenSRF core config file, defaults to /openils/conf/opensrf_core.xml + 'config=s' => \$config, # location of OpenSRF core config file, defaults to @sysconfdir@/opensrf_core.xml 'file=s' => \@files, # files to process (or you can simple list the files as unnamed arguments, i.e. @ARGV) 'required_fields=s' => \@req_fields, # skip any records missing these fields 'trash=s' => \@trash_fields, # fields to remove from all processed records - 'xml_idl=s' => \$idlfile, # location of XML IDL file, defaults to /openils/conf/fm_IDL.xml + 'xml_idl=s' => \$idlfile, # location of XML IDL file, defaults to @sysconfdir@/fm_IDL.xml 'dontuse=s' => \$used_id_file, # DEPRECATED, use used_id_file instead 'used_id_file=s' => \$used_id_file, # external file which prevents id collisions by specifying ids already in use in the database, format = one id number per line 'used_tcn_file=s' => \$used_tcn_file, # external file which prevents tcn collisions by specifying tcns already in use in the database, format = one tcn number per line diff --git a/Open-ILS/src/extras/import/marc2sre.pl b/Open-ILS/src/extras/import/marc2sre.pl.in similarity index 99% rename from Open-ILS/src/extras/import/marc2sre.pl rename to Open-ILS/src/extras/import/marc2sre.pl.in index 2ac5516098..a783d10c6b 100755 --- a/Open-ILS/src/extras/import/marc2sre.pl +++ b/Open-ILS/src/extras/import/marc2sre.pl.in @@ -25,7 +25,7 @@ my ($idsubfield, $bibfield, $bibsubfield, @files, $libmap, $quiet, $help); my $idfield = '004'; my $count = 1; my $user = 'admin'; -my $config = '/openils/conf/opensrf_core.xml'; +my $config = '@sysconfdir@/opensrf_core.xml'; my $marctype = 'USMARC'; my $parse_options = GetOptions( @@ -243,7 +243,7 @@ and generate SRE (serial.record_entry) JSON objects. =item * B<-c> I, B<--config>=I Specifies the OpenSRF configuration file used to connect to the OpenSRF router. -Defaults to F +Defaults to F<@sysconfdir@/opensrf_core.xml> =item * B<--idfield> I diff --git a/Open-ILS/src/extras/import/parallel_pg_loader.pl b/Open-ILS/src/extras/import/parallel_pg_loader.pl.in similarity index 97% rename from Open-ILS/src/extras/import/parallel_pg_loader.pl rename to Open-ILS/src/extras/import/parallel_pg_loader.pl.in index 43ddaa9ce5..f276f0b8d9 100755 --- a/Open-ILS/src/extras/import/parallel_pg_loader.pl +++ b/Open-ILS/src/extras/import/parallel_pg_loader.pl.in @@ -2,8 +2,6 @@ use strict; use warnings; -use lib '/openils/lib/perl5/'; - use OpenSRF::System; use OpenSRF::EX qw/:try/; use OpenSRF::Utils::SettingsClient; @@ -16,7 +14,7 @@ use Getopt::Long; my @files; my ($config, $output, @auto, @order, @wipe) = - ('/openils/conf/opensrf_core.xml', 'pg_loader-output'); + ('@sysconfdir@/opensrf_core.xml', 'pg_loader-output'); my $nocommit = 0; GetOptions( diff --git a/configure.ac b/configure.ac index 88a84dceeb..c1f5137f42 100644 --- a/configure.ac +++ b/configure.ac @@ -373,12 +373,19 @@ AC_CONFIG_FILES([Makefile Open-ILS/updates/Makefile Open-ILS/xul/staff_client/Makefile Open-ILS/src/extras/eg_config - Open-ILS/src/extras/fast-extract + Open-ILS/src/extras/import/marc2are.pl + Open-ILS/src/extras/import/marc2bre.pl + Open-ILS/src/extras/import/marc2sre.pl + Open-ILS/src/extras/import/parallel_pg_loader.pl Open-ILS/src/perlmods/Makefile Open-ILS/src/perlmods/lib/OpenILS/Utils/Cronscript.pm], [ if test -e "./Open-ILS/src/extras/eg_config"; then chmod 755 Open-ILS/src/extras/eg_config; fi; if test -e "./Open-ILS/src/extras/fast-extract"; then chmod 755 Open-ILS/src/extras/fast-extract; fi; + if test -e "./Open-ILS/src/extras/import/marc2are.pl"; then chmod 755 Open-ILS/src/extras/import/marc2are.pl; fi; + if test -e "./Open-ILS/src/extras/import/marc2bre.pl"; then chmod 755 Open-ILS/src/extras/import/marc2bre.pl; fi; + if test -e "./Open-ILS/src/extras/import/marc2sre.pl"; then chmod 755 Open-ILS/src/extras/import/marc2sre.pl; fi; + if test -e "./Open-ILS/src/extras/import/parallel_pg_loader.pl"; then chmod 755 Open-ILS/src/extras/import/parallel_pg_loader.pl; fi; ]) AC_OUTPUT -- 2.43.2