2 # debian/rules for abook
4 TMP = $(CURDIR)/debian/$(PKG)
6 QUILT_STAMPFN = patch-stamp
7 include /usr/share/quilt/quilt.make
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)))
20 ifeq (,$(findstring nostrip,$(DEB_BUILD_OPTIONS)))
25 # Uncomment this to turn on verbose mode.
32 rm -rf build-stamp $(TMP) debian/files debian/substvars
33 [ ! -f Makefile ] || $(MAKE) distclean
37 build-stamp: patch-stamp
39 ./configure --prefix=/usr --mandir=\$${prefix}/share/man \
40 --infodir=\$${prefix}/share/info
41 $(MAKE) CFLAGS="$(CFLAGS)"
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
65 # Build architecture-independent files here.
66 binary-indep: build install
67 # We have nothing to do by default.
70 # Build architecture-dependent files here.
71 binary-arch: build install
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 \
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 \
86 cd $(TMP) && find * -type f ! -regex '^DEBIAN/.*' -print0 | \
87 xargs -r0 md5sum > DEBIAN/md5sums
88 dpkg --build $(TMP) ..
91 binary: binary-indep binary-arch
99 test root = "`whoami`"
102 .PHONY: clean build install binary-indep binary-arch binary