install command-line MARC import tools in @prefix@/bin
authorgmc <gmc@dcc99617-32d9-48b4-a31d-7c20da2025e4>
Wed, 6 Apr 2011 22:06:42 +0000 (22:06 +0000)
committergmc <gmc@dcc99617-32d9-48b4-a31d-7c20da2025e4>
Wed, 6 Apr 2011 22:06:42 +0000 (22:06 +0000)
(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 <gmc@esilibrary.com>

git-svn-id: svn://svn.open-ils.org/ILS/trunk@20010 dcc99617-32d9-48b4-a31d-7c20da2025e4

Open-ILS/src/Makefile.am
Open-ILS/src/extras/import/marc2are.pl.in [moved from Open-ILS/src/extras/import/marc2are.pl with 96% similarity]
Open-ILS/src/extras/import/marc2bre.pl.in [moved from Open-ILS/src/extras/import/marc2bre.pl with 98% similarity]
Open-ILS/src/extras/import/marc2sre.pl.in [moved from Open-ILS/src/extras/import/marc2sre.pl with 99% similarity]
Open-ILS/src/extras/import/parallel_pg_loader.pl.in [moved from Open-ILS/src/extras/import/parallel_pg_loader.pl with 97% similarity]
configure.ac

index 7988b53..e87bbd1 100644 (file)
@@ -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.
similarity index 96%
rename from Open-ILS/src/extras/import/marc2are.pl
rename to Open-ILS/src/extras/import/marc2are.pl.in
index 1eb86d4..d6a4c12 100755 (executable)
@@ -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,
similarity index 98%
rename from Open-ILS/src/extras/import/marc2bre.pl
rename to Open-ILS/src/extras/import/marc2bre.pl.in
index e5c9604..d9de5c3 100755 (executable)
@@ -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
similarity index 99%
rename from Open-ILS/src/extras/import/marc2sre.pl
rename to Open-ILS/src/extras/import/marc2sre.pl.in
index 2ac5516..a783d10 100755 (executable)
@@ -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<config-file>, B<--config>=I<config-file>
 
 Specifies the OpenSRF configuration file used to connect to the OpenSRF router.
-Defaults to F</openils/conf/opensrf_core.xml>
+Defaults to F<@sysconfdir@/opensrf_core.xml>
 
 =item * B<--idfield> I<MARC-field>
 
@@ -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(
index 88a84dc..c1f5137 100644 (file)
@@ -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