Skip to content
This repository
tag: DEB_5_4_2_4
Fetching contributors…

Cannot retrieve contributors at this time

executable file 171 lines (154 sloc) 5.985 kb
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171
#!/usr/bin/make -f
#
# Copyright 2000,2001,2002,2003,2005,2006,2007 by Stefan Hornburg (Racke) <racke@linuxia.de>
#
# 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 2 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.
#
# You should have received a copy of the GNU General Public
# License along with this program; if not, write to the Free
# Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston,
# MA 02110-1301 USA.

# Uncomment this to turn on verbose mode.
#export DH_VERBOSE=1

# This is the debhelper compatability version to use.
export DH_COMPAT=2

ifndef PERL
PERL = /usr/bin/perl
endif
TMP = $(shell pwd)/debian/tmp

IC_VERSION := $(shell dpkg-parsechangelog | perl -ne 'print $$1 if /^Version: (.*?)-(.*)$$/')
IC_MAJOR_VERSION := $(shell dpkg-parsechangelog | perl -ne 'print $$1 if /^Version: (\d+\.\d+)(.*?)-(.*)$$/')

build: build-stamp
build-stamp:
dh_testdir

# Compile main stuff
touch _allow_threads
env $(PERL) Makefile.PL force=1 \
INTERCHANGE_USER=interchange \
PREFIX=/usr/lib/interchange
$(MAKE)
pod2man debian/interchangeconfig > blib/man1/interchangeconfig.1p
pod2man eg/te > blib/man1/te.1p

touch build-stamp

clean:
dh_testdir
dh_testroot
debconf-updatepo
rm -f build-stamp install-stamp

# Add here commands to clean up after the build process.
-$(MAKE) clean

dh_clean

install: build
dh_testdir
dh_testroot
dh_clean -k
dh_installdirs

# Add here commands to install the package into debian/tmp.
env MINIVEND_FORCE_THREADS=1 $(MAKE) install PREFIX=$(TMP)/usr INSTALLARCHLIB=$(TMP)/usr/lib/interchange INSTALLPRIVLIB=$(TMP)/usr/lib/interchange INSTALLMAN1DIR=$(TMP)/usr/share/man/man1 INSTALLMAN3DIR=$(TMP)/usr/share/man/man3 INSTALLSCRIPT=$(TMP)/usr/lib/interchange/bin NOCPANINSTALL=1 INTERCHANGE_USER=interchange

# Sample configuration file not needed (code in interchange.PL
# to determine configuration file location will stop to work too)
rm $(TMP)/usr/lib/interchange/interchange.cfg.dist
# Create symbolic link for the configuration files. Makes
# more sense than script hacking.
ln -s /etc/interchange/interchange.cfg $(TMP)/usr/lib/interchange
mkdir -p $(TMP)/etc/interchange
mv $(TMP)/usr/lib/interchange/etc/jobs $(TMP)/etc/interchange/jobs
rm -r $(TMP)/usr/lib/interchange/etc
ln -s /etc/interchange $(TMP)/usr/lib/interchange/etc
# Setup wrapper and config script
mkdir -p $(TMP)/usr/sbin
cp debian/interchange.wrapper $(TMP)/usr/sbin/interchange
cp debian/interchangeconfig $(TMP)/usr/sbin/interchangeconfig
mkdir -p $(TMP)/usr/bin
cp debian/makecat.wrapper $(TMP)/usr/bin/makecat
cp eg/te $(TMP)/usr/bin
chmod +x $(TMP)/usr/sbin/interchange $(TMP)/usr/sbin/interchangeconfig \
$(TMP)/usr/bin/makecat $(TMP)/usr/bin/te
# Setup configuration directory
mkdir -p $(TMP)/etc/interchange/
cp debian/interchange.cfg debian/catalogs.cfg debian/makecat.cfg \
debian/robots.cfg $(TMP)/etc/interchange
# build Interchange control program(s)
mkdir -p $(TMP)/usr/lib/cgi-bin/ic
$(PERL) scripts/compile_link \
--socket=/var/run/interchange/interchange.sock \
--port=7786 \
--host=127.0.0.1 \
--source=dist/src \
--build=$(TMP)/usr/lib/cgi-bin/ic
cd $(TMP)/usr/lib/cgi-bin/ic; rm compile.pl config* mod_perl_tlink.pl mvctl.c syscfg* testcgi tlink.* vlink.* cpan_local_install
# Add link sources
mkdir -p $(TMP)/usr/lib/interchange/src
for file in dist/src/*; do if test -f $$file; then cp $$file $(TMP)/usr/lib/interchange/src; fi; done
# UI images and stuff
mkdir -p $(TMP)/var/www/interchange-5
for dir in $(TMP)/usr/lib/interchange/share/interchange-5/*; do mv $$dir $(TMP)/var/www/interchange-5; done
chmod -x -R $(TMP)/var/www/interchange-5
rm -r $(TMP)/usr/lib/interchange/share/interchange-5
# remove unneeded stuff
rm $(TMP)/usr/lib/interchange/error.log
rm $(TMP)/usr/lib/interchange/*.pl
rm $(TMP)/usr/lib/interchange/_session_storable
rm $(TMP)/usr/lib/interchange/_uid
rm -rf $(TMP)/usr/lib/interchange/auto/Interchange
# remove Business::UPS manual page (conflicts with libbusiness-ups-perl)
rm $(TMP)/usr/share/man/man3/Business::UPS.3pm
# install logrotate configuration file
install -m 0755 -d $(TMP)/etc/logrotate.d/
install -m 0644 debian/interchange.logrotate $(TMP)/etc/logrotate.d/interchange
# install global usertags for standard demo
mkdir -p $(TMP)/usr/lib/interchange/usertag/standard
install -m 0755 dist/standard/config/*.tag $(TMP)/usr/lib/interchange/usertag/standard

# make VERSION file
echo 'Variable MAJOR_VERSION $(IC_MAJOR_VERSION)' > $(TMP)/usr/lib/interchange/VERSION
echo 'Variable VERSION $(IC_VERSION)' >> $(TMP)/usr/lib/interchange/VERSION
dh_movefiles
touch install-stamp

# Build architecture-independent files here.
binary-indep: build install
dh_testdir
dh_testroot
dh_installdebconf -i
dh_installdocs -i -A README.debian
# no init.d script
# no cron scripts
dh_installchangelogs -i
dh_compress -i
dh_fixperms -i
dh_installdeb -i
dh_shlibdeps -i
dh_perl -i usr/lib/interchange
dh_gencontrol -i
dh_md5sums -i
dh_builddeb -i

# Build architecture-dependent files here.
binary-arch: build install
dh_testdir
dh_testroot
dh_installdebconf -a
dh_installdocs -a -A README.debian
# install init.d script
dh_installinit -a -- defaults 21 19
# install cron script
dh_installcron -a
dh_installchangelogs -a
dh_strip -a
dh_compress -a
dh_fixperms -a
# You may want to make some executables suid here.
dh_installdeb -a
dh_shlibdeps -a
dh_perl -a usr/lib/interchange
dh_gencontrol -a
dh_md5sums -a
dh_builddeb -a

binary: binary-indep binary-arch
.PHONY: build clean binary-indep binary-arch binary install
Something went wrong with that request. Please try again.