Code

copyright, rules: Install and reference the AUTHORS file.
[pkg-liboping.git] / debian / rules
index 8fb4a07cbe811db36e6ea74874c55f9c74170aa3..a8d386ca675b3f0e93b78491901a6346bb4d0717 100755 (executable)
@@ -19,34 +19,58 @@ else
        CFLAGS += -O2
 endif
 
-config.status: configure
+include /usr/share/dpatch/dpatch.make
+
+# $srcver-$perlver-$debrev
+LIBPERL_VERSION := $(shell pm_ver=`perl -MExtUtils::MM -e \
+               'print MM->parse_version("bindings/perl/lib/Net/Oping.pm");'`; \
+       pkg_ver=`dpkg-parsechangelog | egrep '^Version:' | cut -d' ' -f2`; \
+       echo -n "$${pkg_ver%-*}-$$pm_ver-$${pkg_ver\#\#*-}")
+
+config.status: configure $(DPATCH_STAMPFN)
        dh_testdir
-       CFLAGS="$(CFLAGS)" ./configure --host=$(DEB_HOST_GNU_TYPE) \
-                       --build=$(DEB_BUILD_GNU_TYPE) --prefix=/usr \
-                       --mandir=\$${prefix}/share/man
+       
+       for file in config.guess config.sub; do \
+               mv $$file $$file.upstream; \
+               ln -s /usr/share/misc/$$file .; \
+       done
+       
+       CFLAGS="$(CFLAGS)" ./configure \
+                       --host=$(DEB_HOST_GNU_TYPE) \
+                       --build=$(DEB_BUILD_GNU_TYPE) \
+                       --prefix=/usr \
+                       --mandir=\$${prefix}/share/man \
+                       --with-perl-bindings="INSTALLDIRS=vendor"
 
 build: build-stamp
 
 build-stamp:  config.status
        dh_testdir
        
-       $(MAKE)
+       $(MAKE) LD_RUN_PATH=""
        
        touch build-stamp
 
-clean:
+clean: unpatch
        dh_testdir
        dh_testroot
-       rm -f build-stamp 
+       rm -f build-stamp
+       
+       [ ! -f Makefile ] || $(MAKE) distclean
        
-       -$(MAKE) distclean
+       for file in config.guess config.sub; do \
+               if [ -e $$file.upstream ]; then \
+                       rm -f $$file; \
+                       mv $$file.upstream $$file; \
+               fi \
+       done
        
-       dh_clean 
+       dh_clean
 
 install: build
        dh_testdir
        dh_testroot
-       dh_clean -k 
+       dh_clean -k
        dh_installdirs
        
        $(MAKE) install DESTDIR=$(CURDIR)/debian/tmp
@@ -61,10 +85,14 @@ binary-indep:
 binary-arch: build install
        dh_testdir
        dh_testroot
-       dh_installchangelogs ChangeLog
-       dh_installdocs -A README
+       dh_installchangelogs -Nlibnet-oping-perl ChangeLog
+       dh_installchangelogs -plibnet-oping-perl bindings/perl/Changes
+       dh_installdocs -A AUTHORS
+       dh_installdocs -A -Nlibnet-oping-perl README
+       dh_installdocs -plibnet-oping-perl bindings/perl/README
        dh_installman
-       dh_install --sourcedir=debian/tmp --list-missing
+       dh_install --sourcedir=debian/tmp --fail-missing
+       dh_perl -plibnet-oping-perl
        dh_link
        dh_strip
        dh_compress
@@ -72,10 +100,11 @@ binary-arch: build install
        dh_makeshlibs
        dh_installdeb
        dh_shlibdeps -ldebian/liboping0/usr/lib/
-       dh_gencontrol
+       dh_gencontrol -Nlibnet-oping-perl
+       dh_gencontrol -plibnet-oping-perl -u-v$(LIBPERL_VERSION)
        dh_md5sums
        dh_builddeb
 
 binary: binary-indep binary-arch
-.PHONY: build clean binary-indep binary-arch binary install 
+.PHONY: build clean binary-indep binary-arch binary install