Debian package: Use more debhelper magic
[conkeror.git] / debian / rules
blob584c6508d74c8b30122d1a427a363996b4eac07c
1 #!/usr/bin/make -f
2 # -*- makefile -*-
3 # Uncomment this to turn on verbose mode.
4 #export DH_VERBOSE=1
6 # This has to be exported to make some magic below work.
7 export DH_OPTIONS
9 # Generating a xulrunner build id and other strings
10 DEBIAN_VERSION := $(shell echo -n `head -1 debian/changelog | sed -e 's/^.*(\(.*\)).*$$/\\1/'`)
12 BUILDID := $(shell echo -n `whoami`@`hostname`)_$(shell date +%s)
14 DPKG_EXPORT_BUILDFLAGS = 1
15 include /usr/share/dpkg/buildflags.mk
17 configure: configure-stamp
18 configure-stamp:
19 dh_testdir
20 touch $@
22 build: build-arch build-indep
23 build-arch: build-arch-stamp
24 build-arch-stamp: configure-stamp
25 dh_auto_build
26 touch $@
28 build-indep: build-indep-stamp
29 build-indep-stamp: configure-stamp
30 touch $@
32 clean:
33 dh_testdir
34 dh_testroot
35 dh_auto_clean
36 dh_clean
38 install: install-indep install-arch
39 install-indep:
40 dh_testdir
41 dh_testroot
42 dh_prep -i
43 dh_installdirs -i
45 # Add generated Build ID and Debian version to version output
46 sed -e 's/BuildID=git/BuildID=${BUILDID}/;s/^Version=\(.*\)$$/Version=\1 (Debian-${DEBIAN_VERSION})/' application.ini \
47 > $(CURDIR)/debian/conkeror/usr/share/conkeror/application.ini
49 # Use Debian version for M-x version output
50 sed -e 's/Version=\(.*\)/Version=\1 (Debian-${DEBIAN_VERSION})/' components/application.js \
51 > $(CURDIR)/debian/conkeror/usr/share/conkeror/components/application.js
53 dh_install -i
55 install-arch:
56 dh_testdir
57 dh_testroot
58 dh_prep -s
59 dh_installdirs -s
60 dh_link -s
61 dh_install -s
63 # Must not depend on anything. This is to be called by
64 # binary-arch/binary-indep in another 'make' thread.
65 binary-common:
66 dh_testdir
67 dh_testroot
68 dh_installchangelogs
69 dh_installdocs
70 # dh_installexamples
71 dh_installmenu
72 # dh_installemacsen
73 dh_installman
74 dh_bugfiles
75 dh_lintian
76 dh_link
77 dh_strip
78 dh_compress
79 dh_fixperms
80 dh_makeshlibs
81 dh_installdeb
82 dh_shlibdeps
83 dh_gencontrol
84 dh_md5sums
85 dh_builddeb
87 # Build architecture independant packages using the common target.
88 binary-indep: build-indep install-indep
89 $(MAKE) -f debian/rules DH_OPTIONS=-i binary-common
91 # Build architecture dependant packages using the common target.
92 binary-arch: build-arch install-arch
93 $(MAKE) -f debian/rules DH_OPTIONS=-s binary-common
95 binary: binary-arch binary-indep
96 .PHONY: build clean binary-indep binary-arch binary install install-indep install-arch configure