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