#!/bin/bash
-# (C) Copyright 2010-2017 Georgia Public Library Service
-# and Emerald Data Networks
-# Josh Lamos <jlamos@emeralddata.net>
-# Andy Witter <awitter@emeralddata.net>
+# (C) Copyright 2010-2021 Georgia Public Library Service
+# and Emerald Data Networks
+# Josh Lamos <jlamos@emeralddata.net>
+# Andy Witter <awitter@emeralddata.net>
# Chris Sharp <csharp@georgialibaries.org>
#
-# 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 <http://www.gnu.org/licenses/>.
+# You should have received a copy of the GNU General Public License
+# along with this program. If not, see <http://www.gnu.org/licenses/>.
#
-# 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"
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"
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
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 () {
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 && \
############### 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 <build>/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/<src> isn't available anymore
mkdir -p "${DEST_ROOT}${EVERGREEN_PREFIX}/bin"
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/<src> 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