1
0
mirror of git://projects.qi-hardware.com/xburst-tools.git synced 2025-04-21 12:27:27 +03:00

debian/rules: rewrite as a minimal debian/rules file (using dh)

This makes the packaging easier to read and modify.

Features added:

 * runs ‘make’ with the -j option for a tiny speedup
 * uses appropriate compiler flags even when run directly instead of
   through dpkg-buildpackage
 * after interrupting a partial build, there is no need any more
   for (fake) root privileges to clean up
 * after interrupting a partial build, ‘debian/rules clean’ will
   work without running autoreconf again.

Features retained:

 * ‘debian/rules -n <target>’ provides the list of commands used
   to make that target.

Signed-off-by: Jonathan Nieder <jrnieder@gmail.com>
This commit is contained in:
Jonathan Nieder
2010-04-04 22:42:07 -05:00
committed by Xiangfu Liu
parent da4424df4b
commit 3d82483481
4 changed files with 146 additions and 105 deletions

View File

@@ -1,111 +1,31 @@
#!/usr/bin/make -f
# -*- makefile -*-
# Sample debian/rules that uses debhelper.
# This file was originally written by Joey Hess and Craig Small.
# As a special exception, when this file is copied by dh-make into a
# dh-make output file, you may use that output file without restriction.
# This special exception was added by Craig Small in version 0.37 of dh-make.
# This file is in the public domain.
# You may freely use, modify, distribute, and relicense it.
# Uncomment this to turn on verbose mode.
#export DH_VERBOSE=1
build clean install binary-arch binary-indep binary:
+dh --parallel $(opt_no_act) $@
override_dh_auto_clean:
dh_auto_clean
sh debian/clean.sh
# 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)
ifneq ($(DEB_HOST_GNU_TYPE),$(DEB_BUILD_GNU_TYPE))
CROSS= --build $(DEB_BUILD_GNU_TYPE) --host $(DEB_HOST_GNU_TYPE)
else
CROSS= --build $(DEB_BUILD_GNU_TYPE)
override_dh_auto_configure:
AUTOMAKE="automake --foreign" autoreconf -is
dh_auto_configure -- $(opt_optimize) $(opt_quiet) LDFLAGS=-Wl,-z,defs
opt_optimize = CFLAGS="-g -O2"
opt_no_act =
opt_quiet =
ifneq (,$(filter noopt,$(DEB_BUILD_OPTIONS)))
opt_optimize = CFLAGS="-g -O0"
endif
configure:
./autogen.sh
config.status: configure
dh_testdir
# Add here commands to configure the package.
ifneq "$(wildcard /usr/share/misc/config.sub)" ""
cp -f /usr/share/misc/config.sub config.sub
ifneq (,$(findstring n,$(MAKEFLAGS)))
opt_no_act = --no-act
endif
ifneq "$(wildcard /usr/share/misc/config.guess)" ""
cp -f /usr/share/misc/config.guess config.guess
ifneq (,$(filter quiet,$(DEB_BUILD_OPTIONS)))
opt_quiet = --quiet
MAKEFLAGS += --quiet
endif
./configure $(CROSS) --prefix=/usr --sysconfdir=/etc --mandir=\$${prefix}/share/man --infodir=\$${prefix}/share/info CFLAGS="$(CFLAGS)" LDFLAGS="-Wl,-z,defs"
build: build-stamp
build-stamp: config.status
dh_testdir
# Add here commands to compile the package.
$(MAKE)
#docbook-to-man debian/usbboot.sgml > usbboot.1
touch $@
clean:
dh_testdir
dh_testroot
rm -f build-stamp
rm -f debian/stamp-autothings-update
@# Delete generated files, we don't want them in the diff.
rm -f aclocal.m4 config.h.in configure Makefile.in m4/install-sh
rm -f m4/missing m4/depcomp src/Makefile.in src/xburst-tools_version.h
# Add here commands to clean up after the build process.
[ ! -f Makefile ] || $(MAKE) distclean
rm -f config.sub config.guess
dh_clean
install: build
dh_testdir
dh_testroot
dh_prep
dh_installdirs
# Add here commands to install the package into debian/xburst-tools.
$(MAKE) DESTDIR=$(CURDIR)/debian/xburst-tools install
# Build architecture-independent files here.
binary-indep: install
# We have nothing to do by default.
# Build architecture-dependent files here.
binary-arch: install
dh_testdir
dh_testroot
dh_installchangelogs ChangeLog
dh_installdocs
# dh_installexamples
# dh_install
# dh_installmenu
# dh_installdebconf
# dh_installlogrotate
# dh_installemacsen
# dh_installpam
# dh_installmime
# dh_python
# dh_installinit
# dh_installcron
# dh_installinfo
dh_installman
dh_link
dh_strip
dh_compress
dh_fixperms
# dh_perl
# dh_makeshlibs
dh_installdeb
dh_shlibdeps
dh_gencontrol
dh_md5sums
dh_builddeb
binary: binary-indep binary-arch
.PHONY: build clean binary-indep binary-arch binary install