]> git.deb.at Git - pkg/mmv.git/blob - debian/rules
Use dh_builddeb
[pkg/mmv.git] / debian / rules
1 #! /usr/bin/make -f
2
3 CC = gcc
4 LDFLAGS =
5 CFLAGS = -g -Wall -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64
6
7
8 ifneq (,$(filter noopt,$(DEB_BUILD_OPTIONS)))
9     CFLAGS += -O0
10 else
11     CFLAGS += -O2
12 endif
13
14 ifeq (,$(filter nostrip,$(DEB_BUILD_OPTIONS)))
15     LDFLAGS += -s
16 endif
17
18 ifneq (,$(filter parallel=%,$(DEB_BUILD_OPTIONS)))
19     NUMJOBS = $(patsubst parallel=%,%,$(filter parallel=%,$(DEB_BUILD_OPTIONS)))
20     MAKEFLAGS += -j$(NUMJOBS)
21 endif
22
23
24 # The package
25 p = mmv
26 # The version
27 v = $(shell dpkg-parsechangelog | sed -n 's/^Version: //p')
28 # The architecture
29 a = $(shell dpkg --print-architecture)
30
31 dir = `pwd`
32
33 build:
34 # Builds the binary package.
35         dh_testdir
36         $(MAKE) CC="$(CC)" LDFLAGS="$(LDFLAGS)" CFLAGS="$(CFLAGS)"
37         touch build
38
39 clean:
40 # Undoes the effect of `make -f debian/rules build'.
41         dh_testdir
42         dh_auto_clean
43         dh_clean build debian/substvars
44
45 binary: binary-arch binary-indep
46
47 binary-indep:
48         dh_testdir
49
50 binary-arch: build
51         dh_testdir
52         test -f build || $(MAKE) -f debian/rules build
53 # Makes a binary package.
54         /bin/rm -rf debian/tmp
55         test -f stamp-build || $(MAKE) -f debian/rules build
56         install -d -g root -m 755 -o root debian/tmp
57         chmod g-s debian/tmp
58         install -d -g root -m 755 -o root debian/tmp/DEBIAN
59         install -d -g root -m 755 -o root debian/tmp/usr/bin
60         install -d -g root -m 755 -o root debian/tmp/usr/share/man/man1
61         install -g root -o root -m 755 mmv debian/tmp/usr/bin
62         dh_strip
63         install -g root -o root -m 644 mmv.1 debian/tmp/usr/share/man/man1
64         gzip -9f debian/tmp/usr/share/man/man1/mmv.1
65         (cd debian/tmp/usr/bin;\
66          ln -s mmv mcp; \
67          ln -s mmv mad; \
68          ln -s mmv mln;)
69         (cd debian/tmp/usr/share/man/man1;\
70          ln -s mmv.1.gz mcp.1.gz; \
71          ln -s mmv.1.gz mad.1.gz; \
72          ln -s mmv.1.gz mln.1.gz;)
73         install -d -g root -m 755 -o root debian/tmp/usr/share/doc/$(p)
74         dh_installdocs
75         dh_installchangelogs
76         dh_lintian
77         chmod -R g-sw debian/tmp/usr/share/doc/$(p)
78         chown -R root.root debian/tmp/usr/share/doc/$(p)
79         dpkg-shlibdeps debian/tmp/usr/bin/mmv
80         dh_gencontrol
81         dh_md5sums
82         dh_builddeb