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) NOKEYGEN=1 DESTDIR=$(CURDIR)/debian/tmp install
87 rm -r $(CURDIR)/debian/tmp/usr/share/doc/shibboleth*
88 rm -r $(CURDIR)/debian/tmp/var/run
89 rm $(CURDIR)/debian/tmp/etc/shibboleth/*.dist
90 rm $(CURDIR)/debian/tmp/etc/shibboleth/*.config
91 rm $(CURDIR)/debian/tmp/etc/shibboleth/shibd-osx.plist
92 rm $(CURDIR)/debian/tmp/etc/shibboleth/shibd-redhat
93 rm $(CURDIR)/debian/tmp/etc/shibboleth/shibd-suse
94 chmod +x $(CURDIR)/debian/tmp/etc/shibboleth/keygen.sh
95 mv $(CURDIR)/debian/tmp/etc/shibboleth/keygen.sh \
96 $(CURDIR)/debian/tmp/usr/sbin/shib-keygen
97 mv $(CURDIR)/debian/tmp/etc/shibboleth/metagen.sh \
98 $(CURDIR)/debian/tmp/usr/bin/shib-metagen
99 mv $(CURDIR)/debian/tmp/etc/shibboleth/shibd-debian \
100 $(CURDIR)/debian/libapache2-mod-shib2.shibd.init
102 mv $(CURDIR)/debian/tmp/usr/lib/shibboleth/mod_shib_22.so \
103 $(CURDIR)/debian/libapache2-mod-shib2/usr/lib/apache2/modules
104 rm $(CURDIR)/debian/tmp/usr/lib/shibboleth/mod_shib_22.la
105 pod2man $(CURDIR)/debian/man-pages/mdquery.pod --section 1 \
106 --center 'Shibboleth' --release $(VERSION) \
107 $(CURDIR)/debian/libapache2-mod-shib2/usr/share/man/man1/mdquery.1
108 pod2man $(CURDIR)/debian/man-pages/resolvertest.pod --section 1 \
109 --center 'Shibboleth' --release $(VERSION) \
110 $(CURDIR)/debian/libapache2-mod-shib2/usr/share/man/man1/resolvertest.1
111 pod2man $(CURDIR)/debian/man-pages/shib-metagen.pod --section 1 \
112 --center 'Shibboleth' --release $(VERSION) \
113 $(CURDIR)/debian/libapache2-mod-shib2/usr/share/man/man1/shib-metagen.1
114 pod2man $(CURDIR)/debian/man-pages/shib-keygen.pod --section 8 \
115 --center 'Shibboleth' --release $(VERSION) \
116 $(CURDIR)/debian/libapache2-mod-shib2/usr/share/man/man8/shib-keygen.8
117 pod2man $(CURDIR)/debian/man-pages/shibd.pod --section 8 \
118 --center 'Shibboleth' --release $(VERSION) \
119 $(CURDIR)/debian/libapache2-mod-shib2/usr/share/man/man8/shibd.8
120 dh_install -s -i --fail-missing
123 binary: binary-arch binary-indep
124 binary-arch: DH_OPTIONS=-a
125 binary-arch: install-stamp
129 dh_installdocs -A doc/NOTICE.txt
130 dh_installinit --name=shibd
135 DH_OPTIONS="" dh_makeshlibs -plibshibsp4
142 binary-indep: DH_OPTIONS=-i
143 binary-indep: install-stamp
147 dh_installdocs -A doc/NOTICE.txt
155 .PHONY: binary binary-arch binary-indep build build-arch build-indep clean