Remove the minor version number from README.Debian
[shibboleth/sp.git] / debian / rules
1 #!/usr/bin/make -f
2 # -*- makefile -*-
3
4 # Uncomment this to turn on verbose mode.
5 #export DH_VERBOSE=1
6
7 # This has to be exported to make some magic below work.
8 export DH_OPTIONS
9
10 CFLAGS = -g
11 CXXFLAGS = -g
12 ifneq (,$(findstring noopt,$(DEB_BUILD_OPTIONS)))
13     DEBUG = --enable-debug
14 else
15     DEBUG =
16 endif
17
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)
23 else
24     SYSTEM = --build $(DEB_BUILD_GNU_TYPE) --host $(DEB_HOST_GNU_TYPE)
25 endif
26
27 # These variable is used only by get-orig-source, which will normally only be
28 # run by maintainers.
29 VERSION = 2.1
30 DEBVERS = dfsg1
31 URL     = http://shibboleth.internet2.edu/downloads/shibboleth/cppsp
32
33 # Download the upstream source and do the repackaging that we have to do for
34 # DFSG reasons.  Depends on wget.
35 get-orig-source:
36         wget $(URL)/$(VERSION)/shibboleth-sp-$(VERSION).tar.gz
37         tar xfz shibboleth-sp-$(VERSION).tar.gz
38         rm shibboleth-sp-$(VERSION).tar.gz
39         rm shibboleth-$(VERSION)/schemas/WS-Trust.xsd
40         mv shibboleth-$(VERSION) shibboleth-sp2_$(VERSION).$(DEBVERS).orig
41         tar cf shibboleth-sp2_$(VERSION).$(DEBVERS).orig.tar \
42             shibboleth-sp2_$(VERSION).$(DEBVERS).orig
43         rm -r shibboleth-sp2_$(VERSION).$(DEBVERS).orig
44         gzip -9 shibboleth-sp2_$(VERSION).$(DEBVERS).orig.tar
45
46 configure: configure-stamp
47 configure-stamp:
48         dh_testdir
49         cp /usr/share/misc/config.guess config.guess
50         cp /usr/share/misc/config.sub config.sub
51         rm -f libtool.m4
52         libtoolize --force
53         autoreconf --force
54         rm -rf autom4te.cache
55         CFLAGS="$(CFLAGS)" CXXFLAGS="$(CXXFLAGS)" ./configure --prefix=/usr \
56             --sysconfdir=/etc --libexecdir=/usr/lib/shibboleth \
57             --localstatedir=/var --enable-apache-22 \
58             --with-apxs2=/usr/bin/apxs2 --disable-dependency-tracking \
59             $(SYSTEM)
60         touch $@
61
62 build: build-arch build-indep
63 build-arch: build-stamp
64 build-indep:
65 build-stamp: configure-stamp
66         dh_testdir
67         $(MAKE)
68         touch $@
69
70 clean:
71         dh_testdir
72         dh_testroot
73         rm -f configure-stamp build-stamp install-stamp
74         [ ! -f Makefile ] || $(MAKE) distclean
75         find . -name Makefile.in -print0 | xargs -0r rm
76         dh_clean aclocal.m4 config.h config.h.in config.status configure \
77             config.guess config.sub libtool.m4 ltmain.sh \
78             debian/libapache2-mod-shib2.shibd.init
79
80 install: install-stamp
81 install-stamp:
82         dh_testdir
83         dh_testroot
84         dh_clean -k
85         $(MAKE) DESTDIR=$(CURDIR)/debian/tmp install
86         rm -r $(CURDIR)/debian/tmp/usr/share/doc/shibboleth
87         rm $(CURDIR)/debian/tmp/etc/shibboleth/*.dist
88         rm $(CURDIR)/debian/tmp/etc/shibboleth/*.config
89         rm $(CURDIR)/debian/tmp/etc/shibboleth/shibd-osx.plist
90         rm $(CURDIR)/debian/tmp/etc/shibboleth/shibd-redhat
91         rm $(CURDIR)/debian/tmp/etc/shibboleth/sp-*.pem
92         chmod +x $(CURDIR)/debian/tmp/etc/shibboleth/keygen.sh
93         mv $(CURDIR)/debian/tmp/etc/shibboleth/keygen.sh \
94             $(CURDIR)/debian/tmp/usr/sbin/shib-keygen
95         mv $(CURDIR)/debian/tmp/etc/shibboleth/shibd-debian \
96             $(CURDIR)/debian/libapache2-mod-shib2.shibd.init
97         dh_installdirs -s -i
98         mv $(CURDIR)/debian/tmp/usr/lib/shibboleth/mod_shib_22.so \
99             $(CURDIR)/debian/libapache2-mod-shib2/usr/lib/apache2/modules
100         rm $(CURDIR)/debian/tmp/usr/lib/shibboleth/mod_shib_22.la
101         pod2man $(CURDIR)/debian/man-pages/mdquery.pod --section 1 \
102             --center 'Shibboleth' --release 2.0 \
103             $(CURDIR)/debian/libapache2-mod-shib2/usr/share/man/man1/mdquery.1
104         pod2man $(CURDIR)/debian/man-pages/resolvertest.pod --section 1 \
105             --center 'Shibboleth' --release 2.0 \
106             $(CURDIR)/debian/libapache2-mod-shib2/usr/share/man/man1/resolvertest.1
107         pod2man $(CURDIR)/debian/man-pages/shib-keygen.pod --section 8 \
108             --center 'Shibboleth' --release 2.0 \
109             $(CURDIR)/debian/libapache2-mod-shib2/usr/share/man/man8/shib-keygen.8
110         pod2man $(CURDIR)/debian/man-pages/shibd.pod --section 8 \
111             --center 'Shibboleth' --release 2.0 \
112             $(CURDIR)/debian/libapache2-mod-shib2/usr/share/man/man8/shibd.8
113         dh_install -s -i --fail-missing
114         touch $@
115
116 binary: binary-arch binary-indep
117 binary-arch: DH_OPTIONS=-a
118 binary-arch: install-stamp
119         dh_testdir
120         dh_testroot
121         dh_installchangelogs
122         dh_installdocs -A doc/NOTICE.txt
123         dh_installinit --name=shibd
124         dh_installlogcheck
125         dh_strip
126         dh_compress
127         dh_fixperms
128         DH_OPTIONS="" dh_makeshlibs -plibshibsp1
129         dh_installdeb
130         dh_shlibdeps
131         dh_gencontrol
132         dh_md5sums
133         dh_builddeb
134
135 binary-indep: DH_OPTIONS=-i
136 binary-indep: install-stamp
137         dh_testdir
138         dh_testroot
139         dh_installchangelogs
140         dh_installdocs -A doc/NOTICE.txt
141         dh_compress
142         dh_fixperms
143         dh_installdeb
144         dh_gencontrol
145         dh_md5sums
146         dh_builddeb
147
148 .PHONY: binary binary-arch binary-indep build build-arch build-indep clean
149 .PHONY: install