Preparing a new Debian package release
[conkeror.git] / debian / rules
blobe3c6e724a3e2e9d762cbd4ea1f4ebabb5b354492
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 UPSTREAM_VERSION := $(shell grep ^Version= application.ini | sed -e 's/^Version=//')
11 DEBIAN_VERSION := $(shell echo -n `head -1 debian/changelog | sed -e 's/^.*(\(.*\)).*$$/\\1/'`)
13 BUILDID := $(shell echo -n `whoami`@`hostname`)_$(shell date +%s)
15 include /usr/share/quilt/quilt.make
17 configure: configure-stamp
18 configure-stamp: $(QUILT_STAMPFN)
19 dh_testdir
20 # Add here commands to configure the package.
22 touch configure-stamp
24 # Architecture
25 build: build-arch build-indep
27 build-arch: build-arch-stamp
28 build-arch-stamp: configure-stamp
29 # Add here commands to compile the arch part of the package.
30 make
32 touch $@
34 build-indep: build-indep-stamp
35 build-indep-stamp: configure-stamp
36 # Add here commands to compile the indep part of the package.
37 #$(MAKE) doc
39 touch $@
41 clean: unpatch
42 dh_testdir
43 dh_testroot
44 rm -f build-arch-stamp build-indep-stamp configure-stamp
46 # Add here commands to clean up after the build process.
47 $(MAKE) clean
49 dh_clean
51 install: install-indep install-arch
52 install-indep:
53 dh_testdir
54 dh_testroot
55 dh_prep -i
56 dh_installdirs -i
57 dh_desktop
59 # Add here commands to install the indep part of the package into
60 # debian/<package>
61 cp -pr branding chrome components content contrib defaults \
62 locale modules search-engines help style \
63 $(CURDIR)/debian/conkeror/usr/share/conkeror/
64 # Add generated Build ID and Debian version to version output
65 sed -e 's/BuildID=git/BuildID=${BUILDID}/;s/^Version=\(.*\)$$/Version=\1 (Debian-${DEBIAN_VERSION})/' application.ini \
66 > $(CURDIR)/debian/conkeror/usr/share/conkeror/application.ini
67 # Use Debian version for M-x version output
68 sed -e 's/\$$CONKEROR_VERSION\$$/${UPSTREAM_VERSION} (Debian-${DEBIAN_VERSION})/' components/application.js \
69 > $(CURDIR)/debian/conkeror/usr/share/conkeror/components/application.js
70 cp -p debian/conkeror.bin $(CURDIR)/debian/conkeror/usr/bin/conkeror
71 cp -p debian/conkeror.desktop $(CURDIR)/debian/conkeror/usr/share/applications/
72 dh_install -i
74 install-arch:
75 dh_testdir
76 dh_testroot
77 dh_prep -s
78 dh_installdirs -s
80 # Add here commands to install the arch part of the package into
81 # debian/tmp.
82 cp -p conkeror-spawn-helper $(CURDIR)/debian/conkeror-spawn-process-helper/usr/lib/conkeror/
83 ln -s /usr/lib/conkeror/conkeror-spawn-helper $(CURDIR)/debian/conkeror-spawn-process-helper/usr/share/conkeror/
85 dh_install -s
87 # Must not depend on anything. This is to be called by
88 # binary-arch/binary-indep in another 'make' thread.
89 binary-common:
90 dh_testdir
91 dh_testroot
92 dh_installchangelogs
93 dh_installdocs
94 # dh_installexamples
95 dh_installmenu
96 # dh_installemacsen
97 dh_installman
98 dh_desktop
99 dh_link
100 dh_strip
101 dh_compress
102 dh_fixperms
103 dh_makeshlibs
104 dh_installdeb
105 dh_shlibdeps
106 dh_gencontrol
107 dh_md5sums
108 dh_builddeb
110 # Build architecture independant packages using the common target.
111 binary-indep: build-indep install-indep
112 $(MAKE) -f debian/rules DH_OPTIONS=-i binary-common
114 # Build architecture dependant packages using the common target.
115 binary-arch: build-arch install-arch
116 $(MAKE) -f debian/rules DH_OPTIONS=-s binary-common
118 binary: binary-arch binary-indep
119 .PHONY: build clean binary-indep binary-arch binary install install-indep install-arch configure