]> git.deb.at Git - pkg/mmv.git/blob - debian/rules
82666b8056750f63a4995f59d81971ad92931d82
[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
40         -rm build
41
42 binary: binary-arch binary-indep
43
44 binary-indep:
45         $(checkdir)
46
47 binary-arch: build
48         $(checkdir)
49         test -f build || make -f debian/rules build
50 # Makes a binary package.
51         /bin/rm -rf debian/tmp
52         test -f stamp-build || make -f debian/rules build
53         install -d -g root -m 755 -o root debian/tmp
54         chmod g-s debian/tmp
55         install -d -g root -m 755 -o root debian/tmp/DEBIAN
56         install -d -g root -m 755 -o root debian/tmp/usr/bin
57         install -d -g root -m 755 -o root debian/tmp/usr/share/man/man1
58         $(INSTALL_PROGRAM) -g root -o root -m 755 mmv debian/tmp/usr/bin
59         install -g root -o root -m 644 mmv.1 debian/tmp/usr/share/man/man1
60         gzip -9f debian/tmp/usr/share/man/man1/mmv.1
61         (cd debian/tmp/usr/bin;\
62          ln -s mmv mcp; \
63          ln -s mmv mad; \
64          ln -s mmv mln;)
65         (cd debian/tmp/usr/share/man/man1;\
66          ln -s mmv.1.gz mcp.1.gz; \
67          ln -s mmv.1.gz mad.1.gz; \
68          ln -s mmv.1.gz mln.1.gz;)
69         install -d -g root -m 755 -o root debian/tmp/usr/share/doc/$(p)
70         install -g root -m 644 -o root READ.ME \
71                 debian/tmp/usr/share/doc/$(p)
72         install -g root -m 644 -o root debian/changelog \
73                 debian/tmp/usr/share/doc/$(p)/changelog.Debian
74         gzip -f9 debian/tmp/usr/share/doc/$(p)/*
75         install -g root -m 644 -o root debian/copyright \
76           debian/tmp/usr/share/doc/$(p)
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         dpkg-gencontrol -isp
81         dh_md5sums
82         dpkg --build debian/tmp && dpkg-name -o -s .. debian/tmp.deb
83
84 define checkdir
85         test -f mmv.1
86 endef