]> git.deb.at Git - pkg/abook.git/blob - debian/rules
Imported Debian patch 0.5.6-5
[pkg/abook.git] / debian / rules
1 #!/usr/bin/make -f
2 # debian/rules for abook
3 PKG = abook
4 TMP = $(CURDIR)/debian/$(PKG)
5
6 QUILT_STAMPFN = patch-stamp
7 include /usr/share/quilt/quilt.make
8
9 CFLAGS = -g -Wall
10 INSTALL = install
11 INSTALL_FILE    = $(INSTALL) -p    -oroot -groot -m644
12 INSTALL_PROGRAM = $(INSTALL) -p    -oroot -groot -m755
13 INSTALL_SCRIPT  = $(INSTALL) -p    -oroot -groot -m755
14 INSTALL_DIR     = $(INSTALL) -p -d -oroot -groot -m755
15 ifneq (,$(findstring noopt,$(DEB_BUILD_OPTIONS)))
16         CFLAGS += -O0
17 else
18         CFLAGS += -O2
19 endif
20 ifeq (,$(findstring nostrip,$(DEB_BUILD_OPTIONS)))
21         INSTALL_PROGRAM += -s
22 endif
23
24
25 # Uncomment this to turn on verbose mode.
26 #export DH_VERBOSE=1
27
28
29 clean: unpatch
30         $(checkdir)
31         $(checkroot)
32         rm -rf build-stamp $(TMP) debian/files debian/substvars
33         [ ! -f Makefile ] || $(MAKE) distclean
34
35
36 build: build-stamp
37 build-stamp: patch-stamp
38         $(checkdir)
39         ./configure --prefix=/usr --mandir=\$${prefix}/share/man \
40                  --infodir=\$${prefix}/share/info
41         $(MAKE) CFLAGS="$(CFLAGS)"
42         touch build-stamp
43
44
45 install: build
46         $(checkdir)
47         $(checkroot)
48         -rm -rf $(TMP)
49         $(INSTALL_DIR) $(TMP)
50         cd $(TMP) && $(INSTALL_DIR) usr/share/doc/$(PKG)/examples \
51                 usr/share/doc/$(PKG)/contrib
52         $(MAKE) prefix=$(TMP)/usr install INSTALL_PROGRAM="$(INSTALL_PROGRAM)"
53         $(INSTALL_FILE) ChangeLog $(TMP)/usr/share/doc/$(PKG)/changelog
54         $(INSTALL_FILE) ANNOUNCE AUTHORS BUGS FAQ README THANKS TODO \
55                 $(TMP)/usr/share/doc/$(PKG)
56         $(INSTALL_FILE) sample.abookrc contrib/mail2abook.py \
57                 contrib/vcard2abook.pl $(TMP)/usr/share/doc/$(PKG)/examples
58         $(INSTALL_FILE) contrib/abook+vim/README contrib/abook+vim/mail.vim \
59                 $(TMP)/usr/share/doc/$(PKG)/contrib
60         cd $(TMP)/usr/share && gzip -9 man/man1/abook.1 man/man5/abookrc.5 \
61                 doc/$(PKG)/examples/mail2abook.py doc/$(PKG)/changelog \
62                 doc/$(PKG)/contrib/mail.vim
63
64
65 # Build architecture-independent files here.
66 binary-indep: build install
67 # We have nothing to do by default.
68
69
70 # Build architecture-dependent files here.
71 binary-arch: build install
72         $(checkdir)
73         $(checkroot)
74         $(INSTALL_DIR) $(TMP)/DEBIAN $(TMP)/usr/share/menu
75         $(INSTALL_FILE) debian/menu $(TMP)/usr/share/menu/$(PKG)
76         $(INSTALL_FILE) debian/copyright $(TMP)/usr/share/doc/$(PKG)
77         $(INSTALL_FILE) debian/changelog \
78                 $(TMP)/usr/share/doc/$(PKG)/changelog.Debian
79         gzip -9 $(TMP)/usr/share/doc/$(PKG)/changelog.Debian
80         $(INSTALL_SCRIPT) debian/config debian/postinst debian/postrm \
81                 $(TMP)/DEBIAN
82         po2debconf debian/templates > $(TMP)/DEBIAN/templates
83         dpkg-shlibdeps -Tdebian/substvars -dDepends $(TMP)/usr/bin/abook
84         dpkg-gencontrol -ldebian/changelog -isp -Tdebian/substvars \
85                 -p$(PKG) -P$(TMP)
86         cd $(TMP) && find * -type f ! -regex '^DEBIAN/.*' -print0 | \
87                 xargs -r0 md5sum > DEBIAN/md5sums
88         dpkg --build $(TMP) ..
89
90
91 binary: binary-indep binary-arch
92
93
94 define checkdir
95         test -f debian/rules
96 endef
97
98 define checkroot
99         test root = "`whoami`"
100 endef
101
102 .PHONY: clean build install binary-indep binary-arch binary