4 # Uncomment this to turn on verbose mode.
7 # This has to be exported to make some magic below work.
12 ifneq (,$(findstring noopt,$(DEB_BUILD_OPTIONS)))
13 DEBUG = --enable-debug
18 # Tell Autoconf the correct system types.
19 DEB_HOST_GNU_TYPE ?= $(shell dpkg-architecture -qDEB_HOST_GNU_TYPE)
20 DEB_BUILD_GNU_TYPE ?= $(shell dpkg-architecture -qDEB_BUILD_GNU_TYPE)
21 ifeq ($(DEB_BUILD_GNU_TYPE),$(DEB_HOST_GNU_TYPE))
22 SYSTEM = --build $(DEB_HOST_GNU_TYPE)
24 SYSTEM = --build $(DEB_BUILD_GNU_TYPE) --host $(DEB_HOST_GNU_TYPE)
27 # These variable is used only by get-orig-source, which will normally only be
29 DEBVERS := $(shell dpkg-parsechangelog | grep ^Version: | cut -d' ' -f2 \
31 VERSION := $(shell echo '$(DEBVERS)' | sed -e 's/[+-].*//' -e 's/~//g')
32 URL = http://shibboleth.internet2.edu/downloads/shibboleth/cppsp
34 # Download the upstream source and do the repackaging that we have to do for
35 # DFSG reasons. Depends on wget.
37 wget $(URL)/$(VERSION)/shibboleth-sp-$(VERSION).tar.gz
38 tar xfz shibboleth-sp-$(VERSION).tar.gz
39 rm shibboleth-sp-$(VERSION).tar.gz
40 rm shibboleth-$(VERSION)/schemas/WS-Trust.xsd
41 mv shibboleth-$(VERSION) shibboleth-sp2_$(DEBVERS).orig
42 tar cf shibboleth-sp2_$(DEBVERS).orig.tar \
43 shibboleth-sp2_$(DEBVERS).orig
44 rm -r shibboleth-sp2_$(DEBVERS).orig
45 gzip -9 shibboleth-sp2_$(DEBVERS).orig.tar
47 configure: configure-stamp
50 cp /usr/share/misc/config.guess config.guess
51 cp /usr/share/misc/config.sub config.sub
56 CFLAGS="$(CFLAGS)" CXXFLAGS="$(CXXFLAGS)" ./configure --prefix=/usr \
57 --sysconfdir=/etc --libexecdir=/usr/lib/shibboleth \
58 --localstatedir=/var --enable-apache-22 \
59 --with-apxs2=/usr/bin/apxs2 --disable-dependency-tracking \
63 build: build-arch build-indep
64 build-arch: build-stamp
66 build-stamp: configure-stamp
74 rm -f configure-stamp build-stamp install-stamp
75 [ ! -f Makefile ] || $(MAKE) distclean
76 find . -name Makefile.in -print0 | xargs -0r rm
77 dh_clean aclocal.m4 config.h config.h.in config.status configure \
78 config.guess config.sub libtool.m4 ltmain.sh \
79 debian/libapache2-mod-shib2.shibd.init
81 install: install-stamp
86 $(MAKE) DESTDIR=$(CURDIR)/debian/tmp install
87 rm -r $(CURDIR)/debian/tmp/usr/share/doc/shibboleth
88 rm $(CURDIR)/debian/tmp/etc/shibboleth/*.dist
89 rm $(CURDIR)/debian/tmp/etc/shibboleth/*.config
90 rm $(CURDIR)/debian/tmp/etc/shibboleth/shibd-osx.plist
91 rm $(CURDIR)/debian/tmp/etc/shibboleth/shibd-redhat
92 rm $(CURDIR)/debian/tmp/etc/shibboleth/sp-*.pem
93 chmod +x $(CURDIR)/debian/tmp/etc/shibboleth/keygen.sh
94 mv $(CURDIR)/debian/tmp/etc/shibboleth/keygen.sh \
95 $(CURDIR)/debian/tmp/usr/sbin/shib-keygen
96 mv $(CURDIR)/debian/tmp/etc/shibboleth/shibd-debian \
97 $(CURDIR)/debian/libapache2-mod-shib2.shibd.init
99 mv $(CURDIR)/debian/tmp/usr/lib/shibboleth/mod_shib_22.so \
100 $(CURDIR)/debian/libapache2-mod-shib2/usr/lib/apache2/modules
101 rm $(CURDIR)/debian/tmp/usr/lib/shibboleth/mod_shib_22.la
102 pod2man $(CURDIR)/debian/man-pages/mdquery.pod --section 1 \
103 --center 'Shibboleth' --release 2.0 \
104 $(CURDIR)/debian/libapache2-mod-shib2/usr/share/man/man1/mdquery.1
105 pod2man $(CURDIR)/debian/man-pages/resolvertest.pod --section 1 \
106 --center 'Shibboleth' --release 2.0 \
107 $(CURDIR)/debian/libapache2-mod-shib2/usr/share/man/man1/resolvertest.1
108 pod2man $(CURDIR)/debian/man-pages/shib-keygen.pod --section 8 \
109 --center 'Shibboleth' --release 2.0 \
110 $(CURDIR)/debian/libapache2-mod-shib2/usr/share/man/man8/shib-keygen.8
111 pod2man $(CURDIR)/debian/man-pages/shibd.pod --section 8 \
112 --center 'Shibboleth' --release 2.0 \
113 $(CURDIR)/debian/libapache2-mod-shib2/usr/share/man/man8/shibd.8
114 dh_install -s -i --fail-missing
117 binary: binary-arch binary-indep
118 binary-arch: DH_OPTIONS=-a
119 binary-arch: install-stamp
123 dh_installdocs -A doc/NOTICE.txt
124 dh_installinit --name=shibd
129 DH_OPTIONS="" dh_makeshlibs -plibshibsp2
136 binary-indep: DH_OPTIONS=-i
137 binary-indep: install-stamp
141 dh_installdocs -A doc/NOTICE.txt
149 .PHONY: binary binary-arch binary-indep build build-arch build-indep clean