From 065bfcce26d96d0134f6be0dbd9348ed58a80009 Mon Sep 17 00:00:00 2001 From: Chris Sharp Date: Wed, 13 Oct 2021 15:13:08 -0400 Subject: [PATCH] clean-up whitespace, comments, and add autoreconf -i step --- build_evergreen2_debs | 117 ++++++++++---------------------------------------- 1 file changed, 23 insertions(+), 94 deletions(-) diff --git a/build_evergreen2_debs b/build_evergreen2_debs index 97a4923..d929bed 100755 --- a/build_evergreen2_debs +++ b/build_evergreen2_debs @@ -1,41 +1,35 @@ #!/bin/bash -# (C) Copyright 2010-2017 Georgia Public Library Service -# and Emerald Data Networks -# Josh Lamos -# Andy Witter +# (C) Copyright 2010-2021 Georgia Public Library Service +# and Emerald Data Networks +# Josh Lamos +# Andy Witter # Chris Sharp # -# This program is free software: you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation, either version 3 of the License, or -# (at your option) any later version. +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. # -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. # -# You should have received a copy of the GNU General Public License -# along with this program. If not, see . +# You should have received a copy of the GNU General Public License +# along with this program. If not, see . # -# set -x -SCRIPT_VERSION=18.04.5 +# set -x +SCRIPT_VERSION=18.04.6 OPENILS_BIN="/openils/bin" export PATH=$OPENILS_BIN:$PATH -# WORKDIR="/home/opensrf/develop/evergreen2/current" # use current directory WORKDIR="$(dirname $(readlink -f -- $0))" echo;echo "WORKDIR is: $WORKDIR" echo -#WORKDIR=`pwd` -#if [ ! -z $1 ]; then -# VERSION=$1 -#else VERSION="3.6.1" -#fi echo "Building evergreen-ils $VERSION" # Customized files need to build the package. BUILDFILESDIR="${WORKDIR}/files_for_build" @@ -52,7 +46,6 @@ BUILD_TYPE_FILE="Last_Build_Type.txt" echo;echo "customizations file is: $EG_CUSTOMIZATIONS_FILE" EVERGREEN_PREFIX="/openils" -#ORIG_FOLDER="/home/opensrf/develop/evergreen2/" ORIG_PKGFILE="../${PKGFILE}" SOURCE_FOLDER="${WORKDIR}/${NEWPKGNAME}" DEST_ROOT="${SOURCE_FOLDER}/debian/evergreen-ils" @@ -97,19 +90,6 @@ fi echo Building $BUILDTYPE version..;echo echo -#echo "Select build with TPAC or OPAC enabled." -#select PAC in TPAC OPAC -# do -# case $PAC in -# TPAC ) echo You selected $PAC; echo; sleep 1; break ;; -# OPAC ) echo You selected $PAC; echo; sleep 1; break ;; -# * ) echo; echo "You must select 1 or 2";; -# esac -#done -#echo Building with $PAC enabled.;echo -#WHY U BREAK STUFF?!?! -#exit - cd $WORKDIR @@ -129,7 +109,7 @@ if [ "$1" = "b" ] || [ "$1" = "-b" ] echo echo "Running dpkg-buildpackage -b -nc -uc -us" sleep 1 - dpkg-buildpackage -b -nc -uc -us + dpkg-buildpackage -b -nc -uc -us -rsudo } else BuildPackage () { @@ -194,6 +174,9 @@ cp -f ${ORIG_PKGFILE} ${WORKDIR}/${NEWPKGFILE} && \ cd $SOURCE_FOLDER && \ echo "Running dh_make on $NEWPKGFILE" && \ sleep 1 && \ +# add this step for tarballs created from git +# harmless if not +autoreconf -i dh_make -s -n echo "Restoring rules file." && \ sleep 2 && \ @@ -245,74 +228,25 @@ fi ############### intead of destination target ${SOURCE_FOLDER}/debian/evergreen-ils/openils ###################### echo && \ ## Standard build failed due mixing of paths . -#sed -i 's^$(perldir)^$(DESTDIR)$(perldir)^g' ${SOURCE_FOLDER}/Open-ILS/src/Makefile.am sed -i 's^$(perldir)^$(DESTDIR)$(perldir)^g' ${SOURCE_FOLDER}/Open-ILS/src/Makefile.in - - sed -i 's^reportsdir = $(DESTDIR)$(WEBDIR)/reports^reportsdir = $(WEBDIR)/reports^g' ${SOURCE_FOLDER}/Open-ILS/web/Makefile.in -#sed -i 's^reportsdir = $(DESTDIR)$(WEBDIR)/reports^reportsdir = $(WEBDIR)/reports^g' ${SOURCE_FOLDER}/Open-ILS/web/Makefile.am - - - -#for building the staff client, wants to install it in /openils/var/web/xul on the *build* system - -#first off, someone used {} instead of () for 1 instance of WEBDIR -#sed -i 's^${WEBDIR}^$(WEBDIR)^g' ${SOURCE_FOLDER}/Open-ILS/xul/staff_client/Makefile.in -#sed -i 's^${WEBDIR}^$(WEBDIR)^g' ${SOURCE_FOLDER}/Open-ILS/xul/staff_client/Makefile.am -#now fix the path -#sed -i 's^$(WEBDIR)^$(DESTDIR)$(WEBDIR)^g' ${SOURCE_FOLDER}/Open-ILS/xul/staff_client/Makefile.in -#sed -i 's^$(WEBDIR)^$(DESTDIR)$(WEBDIR)^g' ${SOURCE_FOLDER}/Open-ILS/xul/staff_client/Makefile.am - - -#sed -i 's/$(DESTDIR)$(oilsincludedir)/$(oilsincludedir)/g' ${SOURCE_FOLDER}/Open-ILS/src/Makefile.am sed -i 's/$(DESTDIR)$(oilsincludedir)/$(oilsincludedir)/g' ${SOURCE_FOLDER}/Open-ILS/src/Makefile.in ##################################################################################################################### ##################################################################################################################### - - ####FIXME ##Debian doesn't like having the same files provided by multiple packages. Rename the example files provided by evergreen that conflict with opensrf. - - sed -i 's/opensrf.xml.example/opensrf.xml.evergreen.example/g' ${SOURCE_FOLDER}/Open-ILS/src/Makefile.in sed -i 's/opensrf.xml.example/opensrf.xml.evergreen.example/g' ${SOURCE_FOLDER}/Open-ILS/src/Makefile.am sed -i 's/opensrf_core.xml.example/opensrf_core.xml.evergreen.example/g' ${SOURCE_FOLDER}/Open-ILS/src/Makefile.in sed -i 's/opensrf_core.xml.example/opensrf_core.xml.evergreen.example/g' ${SOURCE_FOLDER}/Open-ILS/src/Makefile.am -echo "HERE I AM, HEERE I AM, HOW DO YOU DO?" mv ${SOURCE_FOLDER}/Open-ILS/examples/opensrf.xml.example ${SOURCE_FOLDER}/Open-ILS/examples/opensrf.xml.evergreen.example mv ${SOURCE_FOLDER}/Open-ILS/examples/opensrf_core.xml.example ${SOURCE_FOLDER}/Open-ILS/examples/opensrf_core.xml.evergreen.example mkdir -p ${SOURCE_FOLDER}/debian/evergreen-ils/etc/apache2/mods-available/ -#mkdir -p ${SOURCE_FOLDER}/debian/evergreen-ils/etc/apache2/sites-available -#cp -Rv ${SOURCE_FOLDER}/Open-ILS/examples/apache/eg.conf ${SOURCE_FOLDER}/debian/evergreen-ils/etc/apache2/sites-available/ -#cp -Rv ${SOURCE_FOLDER}/Open-ILS/examples/apache/eg_vhost.conf ${SOURCE_FOLDER}/debian/evergreen-ils/etc/apache2/ -#cp -Rv ${SOURCE_FOLDER}/Open-ILS/examples/apache/startup.pl ${SOURCE_FOLDER}/debian/evergreen-ils/etc/apache2/ - -#fix apxs2 install stuff -####APACHE_CONF=${DEST_ROOT}/etc/apache2/ -####APACHE_MODS=${DEST_ROOT}/usr/lib/apache2/modules/ -#mkdir -pv $APACHE_CONF -#mkdir -pv $APACHE_MODS -#mkdir -pv ${DEST_ROOT}/etc/apache2/mods-available - -#APXS2 tries to install the mods in the final destination on *this* system, (/etc/apache2...) We need to override this to go into the /debian/evergreen-ils/etc... folder. -#We fix the .load files apxs2 creates in postinst or rules. -####APACHE_IN=${SOURCE_FOLDER}/Open-ILS/src/apachemods/Makefile.in -####APACHE_AM=${SOURCE_FOLDER}/Open-ILS/src/apachemods/Makefile.am -####sed -i "s^(APXS2) -i -a @srcdir@/mod_xmlent.la^(APXS2) -S LIBEXECDIR='$APACHE_MODS' -S SYSCONFDIR='$APACHE_CONF' -i -a @srcdir@/mod_xmlent.la^g" ${APACHE_IN} -####sed -i "s^(APXS2) -i -a @srcdir@/mod_xmlent.la^(APXS2) -S LIBEXECDIR='$APACHE_MODS' -S SYSCONFDIR='$APACHE_CONF' -i -a @srcdir@/mod_xmlent.la^g" ${APACHE_AM} -####sed -i "s^(APXS2) -i -a @srcdir@/mod_idlchunk.la^(APXS2) -S LIBEXECDIR='$APACHE_MODS' -S SYSCONFDIR='$APACHE_CONF' -i -a @srcdir@/mod_idlchunk.la^g" ${APACHE_IN} -####sed -i "s^(APXS2) -i -a @srcdir@/mod_idlchunk.la^(APXS2) -S LIBEXECDIR='$APACHE_MODS' -S SYSCONFDIR='$APACHE_CONF' -i -a @srcdir@/mod_idlchunk.la^g" ${APACHE_AM} - -#fix apache .load path screwups - -###TODO: not sure if this is necessary anymore. I think we do this in rules or postinst now. -#echo "LoadModule xmlent_module /usr/lib/apache2/modules/mod_xmlent.so" > "${DEST_ROOT}/etc/apache2/mods-available/xmlent.load" - #copy support scripts into openils/bin since /home/opensrf/ isn't available anymore mkdir -p "${DEST_ROOT}${EVERGREEN_PREFIX}/bin" @@ -322,24 +256,19 @@ echo "Copying support scripts and sql scripts" cp -r ${SOURCE_FOLDER}/Open-ILS/src/support-scripts/* "${DEST_ROOT}${EVERGREEN_PREFIX}/bin/" cp -r ${SOURCE_FOLDER}/Open-ILS/src/sql "${DEST_ROOT}${EVERGREEN_PREFIX}/share/doc/examples/" - +#TODO: Not sure this should be even in this package. Move to libdbi? +mkdir -p ${DEST_ROOT}/etc/ld.so.conf.d +echo "/usr/lib/dbd" > ${DEST_ROOT}/etc/ld.so.conf.d/eg.conf ### eg_db_config is expecting certain relative paths. Since we no longer operate from /home/opensrf/ we need to make minor tweaks. sed -i "s^../extras/eg_config^eg_config^g" ${SOURCE_FOLDER}/Open-ILS/src/support-scripts/eg_db_config.in #one sed to rule them all sed -i "s^../sql/Pg/^../share/doc/examples/sql/Pg/^g" ${SOURCE_FOLDER}/Open-ILS/src/support-scripts/eg_db_config.in -#sed -i "s^../sql/Pg/build-db.sh^../share/doc/examples/sql/Pg/build-db.sh^g" ${DEST_ROOT}/openils/bin/eg_db_config.pl -#sed -i "s^./../sql/Pg/create_database_9_1.sql - -### make eg_startup executable. -chmod 755 ${DEST_ROOT}/etc/apache2/eg_startup #TODO: Not sure this should be even in this package. Move to libdbi? mkdir -p ${DEST_ROOT}/etc/ld.so.conf.d echo "/usr/lib/dbd" > ${DEST_ROOT}/etc/ld.so.conf.d/eg.conf - - echo echo "Source Folder is: ${SOURCE_FOLDER}" sleep 3 -- 2.11.0