summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrew Shadura <andrew.shadura@collabora.co.uk>2016-06-21 12:19:17 +0200
committerAndrew Shadura <andrew@shadura.me>2016-06-21 12:45:03 +0200
commit0a444bf4b7fe0d562666072e235486a49651f813 (patch)
tree4d009c2412e69273eed808cea98b5d8a7196e2f5
parentafd7cade2009ea4e90e4aaec80a266ce8e05197e (diff)
Simplify debian/rules by porting it to the short dh form.
Signed-off-by: Andrew Shadura <andrew.shadura@collabora.co.uk>
-rwxr-xr-xdebian/rules68
1 files changed, 11 insertions, 57 deletions
diff --git a/debian/rules b/debian/rules
index 33eb6c6..380ec02 100755
--- a/debian/rules
+++ b/debian/rules
@@ -3,30 +3,11 @@
# Uncomment this to turn on verbose mode.
#export DH_VERBOSE=1
-
-# These are used for cross-compiling and for saving the configure script
-# from having to guess our platform (since we know it already)
-DEB_HOST_GNU_TYPE ?= $(shell dpkg-architecture -qDEB_HOST_GNU_TYPE)
-DEB_BUILD_GNU_TYPE ?= $(shell dpkg-architecture -qDEB_BUILD_GNU_TYPE)
-
-CFLAGS = -Wall -g
-
-ifneq (,$(findstring noopt,$(DEB_BUILD_OPTIONS)))
- CFLAGS += -O0
-else
- CFLAGS += -O2
-endif
-ifeq (,$(findstring nostrip,$(DEB_BUILD_OPTIONS)))
- INSTALL_PROGRAM += -s
-endif
-
confopts = --disable-subversion \
--disable-xmltoman \
--disable-lynx
-config.status: configure-stamp
-configure-stamp:
- dh_testdir
+override_dh_auto_configure:
[ ! -f ifplugd.spec ] || mv -f ifplugd.spec ifplugd.spec.ups
ifneq "$(wildcard /usr/share/misc/config.sub)" ""
cp -f /usr/share/misc/config.sub config.sub
@@ -35,19 +16,9 @@ ifneq "$(wildcard /usr/share/misc/config.guess)" ""
cp -f /usr/share/misc/config.guess config.guess
endif
[ ! -f doc/README.html ] || mv -f doc/README.html doc/README.html.ups
- ./configure --host=$(DEB_HOST_GNU_TYPE) --build=$(DEB_BUILD_GNU_TYPE) --prefix=/usr --mandir=\$${prefix}/share/man --sysconfdir=/etc CFLAGS="$(CFLAGS)" LDFLAGS="-Wl,-z,defs" $(confopts)
- touch $@
-
-build: build-stamp
-build-stamp: config.status
- dh_testdir
- $(MAKE)
- touch $@
+ dh_auto_configure -- $(confopts)
-clean:
- dh_testdir
- dh_testroot
- rm -f build-stamp configure-stamp
+override_dh_clean:
[ ! -f Makefile ] || $(MAKE) distclean
[ ! -f doc/README.html.ups ] || mv -f doc/README.html.ups doc/README.html
rm -f config.guess config.sub
@@ -55,11 +26,7 @@ clean:
debconf-updatepo
dh_clean
-install: build
- dh_testdir
- dh_testroot
- dh_clean -k
- dh_installdirs
+override_dh_auto_install:
$(MAKE) install DESTDIR=$(CURDIR)/debian/ifplugd
# now handled by debconf:
rm -f $(CURDIR)/debian/ifplugd/etc/ifplugd/ifplugd.conf
@@ -71,26 +38,13 @@ install: build
install -m 755 debian/ifstatus $(CURDIR)/debian/ifplugd/usr/sbin/
install -m 755 debian/bug/script $(CURDIR)/debian/ifplugd/usr/share/bug/ifplugd/
-binary-indep: build install
-
-binary-arch: build install
- dh_testdir
- dh_testroot
+override_dh_installchangelogs:
dh_installchangelogs doc/ChangeLog
- dh_installdocs
- dh_installdebconf
+
+override_dh_installinit:
dh_installinit --noscripts
- dh_installudev
- dh_installman
- dh_link
- dh_strip
- dh_compress
- dh_fixperms
- dh_installdeb
- dh_shlibdeps
- dh_gencontrol
- dh_md5sums
- dh_builddeb
-binary: binary-indep binary-arch
-.PHONY: build clean binary-indep binary-arch binary install
+%:
+ dh "$@" --with=autotools-dev
+
+.PHONY: override_dh_auto_configure override_dh_clean override_dh_auto_install override_dh_installinit override_dh_installchangelogs