]> git.deb.at Git - pkg/mmv.git/blob - debian/rules
de490b25002e6b2f200e63f9c777a4027a5d1dc7
[pkg/mmv.git] / debian / rules
1 #! /usr/bin/make -f
2
3 INSTALL_PROGRAM=install
4 CC = gcc
5 LDFLAGS =
6 CFLAGS = -O2 -Wall -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64
7
8
9 ifneq (,$(findstring debug,$(DEB_BUILD_OPTIONS)))
10 CFLAGS += -g
11 endif
12
13 ifeq (,$(findstring nostrip,$(DEB_BUILD_OPTIONS)))
14 INSTALL_PROGRAM += -s
15 LDFLAGS += -s
16 endif
17
18
19 # The package
20 p = mmv
21 # The version
22 v = $(shell dpkg-parsechangelog | sed -n 's/^Version: //p')
23 # The architecture
24 a = $(shell dpkg --print-architecture)
25
26 dir = `pwd`
27
28 build:
29 # Builds the binary package.
30         $(checkdir)
31         make CC="$(CC)" LDFLAGS="$(LDFLAGS)" CFLAGS="$(CFLAGS)"
32         touch build
33
34 clean:
35 # Undoes the effect of `make -f debian/rules build'.
36         $(checkdir)
37         -make clean
38         -rm -f debian/files* debian/substvars* debian/*~ core */core *~
39         -rm -rf debian/tmp build
40
41 binary: binary-arch binary-indep
42
43 binary-indep:
44         $(checkdir)
45
46 binary-arch: build
47         $(checkdir)
48         test -f build || make -f debian/rules build
49 # Makes a binary package.
50         /bin/rm -rf debian/tmp
51         test -f stamp-build || make -f debian/rules build
52         install -d -g root -m 755 -o root debian/tmp
53         chmod g-s debian/tmp
54         install -d -g root -m 755 -o root debian/tmp/DEBIAN
55         install -d -g root -m 755 -o root debian/tmp/usr/bin
56         install -d -g root -m 755 -o root debian/tmp/usr/share/man/man1
57         $(INSTALL_PROGRAM) -g root -o root -m 755 mmv debian/tmp/usr/bin
58         install -g root -o root -m 644 mmv.1 debian/tmp/usr/share/man/man1
59         gzip -9f debian/tmp/usr/share/man/man1/mmv.1
60         (cd debian/tmp/usr/bin;\
61          ln -s mmv mcp; \
62          ln -s mmv mad; \
63          ln -s mmv mln;)
64         (cd debian/tmp/usr/share/man/man1;\
65          ln -s mmv.1.gz mcp.1.gz; \
66          ln -s mmv.1.gz mad.1.gz; \
67          ln -s mmv.1.gz mln.1.gz;)
68         install -d -g root -m 755 -o root debian/tmp/usr/share/doc/$(p)
69         install -g root -m 644 -o root READ.ME \
70                 debian/tmp/usr/share/doc/$(p)
71         install -g root -m 644 -o root debian/changelog \
72                 debian/tmp/usr/share/doc/$(p)/changelog.Debian
73         gzip -f9 debian/tmp/usr/share/doc/$(p)/*
74         install -g root -m 644 -o root debian/copyright \
75           debian/tmp/usr/share/doc/$(p)
76         install -g root -m 755 -o root debian/postinst debian/prerm \
77                 debian/tmp/DEBIAN
78         chmod -R g-sw debian/tmp/usr/share/doc/$(p)
79         chown -R root.root debian/tmp/usr/share/doc/$(p)
80         dpkg-shlibdeps debian/tmp/usr/bin/mmv
81         dpkg-gencontrol -isp
82         dh_md5sums
83         dpkg --build debian/tmp && dpkg-name -o -s .. debian/tmp.deb
84
85 define checkdir
86         test -f mmv.1
87 endef