]> git.deb.at Git - pkg/mmv.git/blob - debian/rules
7bfcfaf98001947059dcfc8898f16ec357fa01fa
[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         test -f stamp-build || $(MAKE) -f debian/rules build
55         dh_installdirs
56         dh_auto_install
57         dh_strip
58         (cd debian/mmv/usr/bin;\
59          ln -s mmv mcp; \
60          ln -s mmv mad; \
61          ln -s mmv mln;)
62         (cd debian/mmv/usr/share/man/man1;\
63          ln -s mmv.1.gz mcp.1.gz; \
64          ln -s mmv.1.gz mad.1.gz; \
65          ln -s mmv.1.gz mln.1.gz;)
66         install -d -g root -m 755 -o root debian/mmv/usr/share/doc/$(p)
67         dh_installdocs
68         dh_installchangelogs
69         dh_compress
70         dh_lintian
71         dh_fixperms
72         dh_shlibdeps
73         dh_gencontrol
74         dh_md5sums
75         dh_builddeb