]> git.deb.at Git - pkg/mmv.git/blob - debian/rules
Use dh_installman
[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 -g root -o root -m 755 mmv debian/tmp/usr/bin
61         dh_strip
62         dh_installman
63         (cd debian/tmp/usr/bin;\
64          ln -s mmv mcp; \
65          ln -s mmv mad; \
66          ln -s mmv mln;)
67         (cd debian/tmp/usr/share/man/man1;\
68          ln -s mmv.1.gz mcp.1.gz; \
69          ln -s mmv.1.gz mad.1.gz; \
70          ln -s mmv.1.gz mln.1.gz;)
71         install -d -g root -m 755 -o root debian/tmp/usr/share/doc/$(p)
72         dh_installdocs
73         dh_installchangelogs
74         dh_compress
75         dh_lintian
76         dh_fixperms
77         dh_shlibdeps
78         dh_gencontrol
79         dh_md5sums
80         dh_builddeb