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
|
#!/usr/bin/make -f
# Uncomment this to turn on verbose mode.
#export DH_VERBOSE=1
PKG_APACHE2 := libapache2-mod-dacs
PKG_DACS := dacs
PKG_LIBDACS := $(shell grep -E '^Package: libdacs[0-9]+' debian/control |\
awk '{print $$2}')
DPKG_EXPORT_BUILDFLAGS=1
include /usr/share/dpkg/buildflags.mk
ext_lib := $(CURDIR)/ext_lib
ext_lib_mkdir = $(shell mkdir -p $(shell dirname $(ext_lib)/$(strip $(1))))
ext_lib_link = $(shell : $(call ext_lib_mkdir, $(2)); \
[ -L $(ext_lib)/$(strip $(2)) ] || \
ln -s $(1) $(ext_lib)/$(strip $(2)) \
)
LIB_version_current := $(shell awk -F '=' '/^LIBCURRENT=/{print $$2}' src/configure.ac)
LIB_version_age := $(shell awk -F '=' '/^LIBAGE=/{print $$2}' src/configure.ac)
LIB_soname := $(shell expr $(LIB_version_current) - $(LIB_version_age))
override_dh_auto_configure:
if [ ! "libdacs$(LIB_soname)" = "$(PKG_LIBDACS)" ]; then \
echo "Soname bump in debian/control missing; new soname: $(LIB_soname)" ;\
exit 1 ;\
fi
#Linking external libraries and programs
# Apache
$(call ext_lib_link, /usr/bin/apxs2, apache/bin/apxs)
$(call ext_lib_link, /usr/share/apache2/build, apache/build)
$(call ext_lib_link, /usr/include/apr-1.0, apache/include/apr-1)
$(call ext_lib_mkdir, apache/conf/httpd.conf)
touch $(ext_lib)/apache/conf/httpd.conf
set -e ;\
cd src ;\
./configure \
--prefix=/usr \
--localstatedir=/var \
--disable-prefix-check \
--sysconfdir=/etc/dacs \
--includedir=/usr/include/dacs \
--disable-bdb \
--enable-access-tokens \
--enable-apache-auth \
--enable-cas-auth \
--enable-cert-auth \
--enable-ldap-auth \
--enable-local-roles \
--enable-native-auth \
--enable-pam-auth \
--enable-token-auth \
--enable-unix-auth \
--enable-unix-roles \
--enable-user-info \
--with-htdocs=/usr/share/dacs \
--with-federations-root=/etc/dacs/federations \
--with-dacs-log=/var/log/dacs/error_log \
--with-ssl=/usr \
--with-expat=/usr \
--with-cgi-bin=/usr/lib/cgi-bin/dacs \
--with-apxs=/usr/bin/apxs2 \
--with-apache=$(ext_lib)/apache \
$(CONFFLAGS)
override_dh_auto_build:
echo "root" > src/.ownername
echo "www-data" > src/.groupname
$(MAKE) -C $(CURDIR)/src
$(MAKE) -C $(CURDIR)/apache tag
$(MAKE) -C $(CURDIR)/src/tests
ifeq ($(filter nodoc, $(DEB_BUILD_OPTIONS)),)
ln -s /usr/share/xml/docbook/stylesheet/nwalsh $(CURDIR)/man/docbook-xsl
$(MAKE) -B -C $(CURDIR)/man mansrc html index
endif
override_dh_install:
$(MAKE) -C $(CURDIR)/src install DESTDIR=$(CURDIR)/debian/tmp
$(MAKE) -C $(CURDIR)/apache install DESTDIR=$(CURDIR)/debian/tmp
# misc stuff is installed via dh_installdoc and similar tools
rm -rf $(CURDIR)/debian/tmp/usr/www/misc
#remove broken links
rm $(CURDIR)/debian/tmp/usr/www/man/css
rm $(CURDIR)/debian/tmp/usr/www/man/misc
#fix examples directory name
mkdir -p $(CURDIR)/debian/tmp/usr/share/doc/dacs-examples
mv $(CURDIR)/debian/tmp/usr/www/* $(CURDIR)/debian/tmp/usr/share/doc/dacs-examples
#remove empty dirs
rmdir $(CURDIR)/debian/tmp/usr/lib/cgi-bin/dacs-native
rmdir $(CURDIR)/debian/tmp/usr/tmp
#remove preformatted manpages
rm -rf $(CURDIR)/debian/tmp/usr/share/man/cat*
#library tweaks
chrpath -d $(CURDIR)/debian/tmp/usr/lib/libdacs.so
find $(CURDIR)/debian/tmp/usr/lib/cgi-bin/dacs -type f -not -name dacs_error | xargs chrpath -d
find $(CURDIR)/debian/tmp/usr/bin -type f -not -name dacsinit | xargs chrpath -d
chrpath -d $(CURDIR)/debian/tmp/usr/sbin/*
rm $(CURDIR)/debian/tmp/usr/lib/libdacs.la
dh_install --fail-missing
override_dh_installchangelogs:
dh_installchangelogs HISTORY
override_dh_clean:
[ ! -f $(CURDIR)/src/Makefile ] || $(MAKE) -C $(CURDIR)/src distclean
[ ! -f $(CURDIR)/apache/Makefile ] || $(MAKE) -C $(CURDIR)/apache distclean
rm -f man/docbook-xsl
rm -f man/*.html
rm -f man/*.man
rm -f man/*.[0-9]
rm -rf $(ext_lib)
rm -rf html/handlers/dacs_pam_handler \
src/.build_notes \
src/.defaults \
src/config.log \
src/config.nice \
src/configure.lineno \
src/defs.mk \
src/defs.vars \
src/expr.loT \
src/libtool \
src/tests/Makefile \
tools/perl/DACScheck.pm
rm -f src/.ownername src/.groupname
dh_clean
%:
dh $@ --with apache2,autotools_dev
|