Generate shlibs for the correct binary package
[shibboleth/sp.git] / debian / rules
index 33508ac..a7a9f12 100755 (executable)
@@ -26,9 +26,10 @@ endif
 
 # These variable is used only by get-orig-source, which will normally only be
 # run by maintainers.
-VERSION = 2.0
-DEBVERS = dfsg1
-URL     = http://shibboleth.internet2.edu/downloads/shibboleth/cppsp
+DEBVERS := $(shell dpkg-parsechangelog | grep ^Version: | cut -d' ' -f2 \
+               | cut -d- -f1)
+VERSION := $(shell echo '$(DEBVERS)' | sed -e 's/[+-].*//' -e 's/~//g')
+URL      = http://shibboleth.internet2.edu/downloads/shibboleth/cppsp
 
 # Download the upstream source and do the repackaging that we have to do for
 # DFSG reasons.  Depends on wget.
@@ -37,11 +38,11 @@ get-orig-source:
        tar xfz shibboleth-sp-$(VERSION).tar.gz
        rm shibboleth-sp-$(VERSION).tar.gz
        rm shibboleth-$(VERSION)/schemas/WS-Trust.xsd
-       mv shibboleth-$(VERSION) shibboleth-sp_$(VERSION).$(DEBVERS).orig
-       tar cf shibboleth-sp2_$(VERSION).$(DEBVERS).orig.tar \
-           shibboleth-sp_$(VERSION).$(DEBVERS).orig
-       rm -r shibboleth-sp_$(VERSION).$(DEBVERS).orig
-       gzip -9 shibboleth-sp_$(VERSION).$(DEBVERS).orig.tar
+       mv shibboleth-$(VERSION) shibboleth-sp2_$(DEBVERS).orig
+       tar cf shibboleth-sp2_$(DEBVERS).orig.tar \
+           shibboleth-sp2_$(DEBVERS).orig
+       rm -r shibboleth-sp2_$(DEBVERS).orig
+       gzip -9 shibboleth-sp2_$(DEBVERS).orig.tar
 
 configure: configure-stamp
 configure-stamp:
@@ -83,7 +84,8 @@ install-stamp:
        dh_testroot
        dh_clean -k
        $(MAKE) DESTDIR=$(CURDIR)/debian/tmp install
-       rm -r $(CURDIR)/debian/tmp/usr/share/doc/shibboleth
+       rm -r $(CURDIR)/debian/tmp/usr/share/doc/shibboleth*
+       rm -r $(CURDIR)/debian/tmp/var/run
        rm $(CURDIR)/debian/tmp/etc/shibboleth/*.dist
        rm $(CURDIR)/debian/tmp/etc/shibboleth/*.config
        rm $(CURDIR)/debian/tmp/etc/shibboleth/shibd-osx.plist
@@ -125,7 +127,7 @@ binary-arch: install-stamp
        dh_strip
        dh_compress
        dh_fixperms
-       DH_OPTIONS="" dh_makeshlibs -plibshibsp1
+       DH_OPTIONS="" dh_makeshlibs -plibshibsp3
        dh_installdeb
        dh_shlibdeps
        dh_gencontrol