File: rules

package info (click to toggle)
debdelta 0.70%2Bnmu1
  • links: PTS
  • area: main
  • in suites: forky, trixie
  • size: 984 kB
  • sloc: python: 6,511; perl: 1,398; sh: 965; xml: 736; ansic: 215; makefile: 116; awk: 21
file content (131 lines) | stat: -rwxr-xr-x 4,578 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
#!/usr/bin/make -f
# Sample debian/rules file; from GNU Hello,  Copyright 1994,1995 by Ian Jackson.

package = debdelta

D = debian/debdelta

BUILD_DATE := $(shell dpkg-parsechangelog --show-field Date)

docdir = $(D)/usr/share/doc/$(package)
mandir = $(D)/usr/share/man/man1/

D2 = debian/debdelta-doc

docdir2 = $(D2)/usr/share/doc/$(package)
docdir2doc = $(D2)/usr/share/doc/$(package)-doc

PO_FILES := $(wildcard po/*.po)
MO_FILES := $(patsubst %.po,%.mo,$(PO_FILES))
LANGS := $(patsubst po/%.po,%,$(PO_FILES))

include /usr/share/dpkg/architecture.mk
-include /usr/share/dpkg/buildtools.mk
STRIP = $(DEB_HOST_GNU_TYPE)-strip
INSTALL_PROGRAM = install --strip-program=$(STRIP)

CPPFLAGS:=$(shell dpkg-buildflags --get CPPFLAGS)
CFLAGS:=$(shell dpkg-buildflags --get CFLAGS)
CXXFLAGS:=$(shell dpkg-buildflags --get CXXFLAGS)
LDFLAGS:=$(shell dpkg-buildflags --get LDFLAGS)

ifeq (,$(findstring nostrip,$(DEB_BUILD_OPTIONS)))
  INSTALL_PROGRAM += -s
endif

minibzip2: minigzip.c
	$(CC) -DBZIP $(CFLAGS) $(CPPFLAGS) minigzip.c -o minibzip2  $(LDFLAGS) -lbz2

minigzip: minigzip.c
	$(CC) $(CFLAGS) $(CPPFLAGS) minigzip.c -o minigzip $(LDFLAGS) -lz

build-arch: minibzip2 minigzip
	$(checkdir)
	touch build

build-indep:

build: build-arch build-indep

clean:
	$(checkdir)
	rm -f build *~ */*~ debian/files* debian/substvars
	rm -f minigzip minibzip2
	rm -rf $(D) $(D2)

binary-indep:	build
	$(checkdir)
	rm -rf $(D2)
	install -d $(D2)/DEBIAN  $(docdir2)  $(docdir2doc)
	cp -p doc/debdelta_suite.pdf debian/copyright debian/changelog $(docdir2doc)
	chmod -c 0644 $(docdir2doc)/*
	cd $(docdir2doc) && gzip -9n changelog
	cp -rp doc/html  $(docdir2doc)
	ln -s ../debdelta-doc/debdelta_suite.pdf  $(docdir2)
	ln -s ../debdelta-doc/html  $(docdir2)
	# build package
	dpkg-gencontrol -Pdebian/debdelta-doc -pdebdelta-doc
	find debian/debdelta-doc -newermt '$(BUILD_DATE)' -print0 | \
		xargs -0r touch --no-dereference --date='$(BUILD_DATE)'
	# Ensure correct mode for files for reproducible builds
	chmod -c 0755 $(docdir2doc)/html/
	chmod -c 0644 $(docdir2doc)/html/*
	dpkg-deb --root-owner-group --build $(D2) ..

binary-arch:	build
	$(checkdir)
	rm -rf $(D)
	# dirs
	install -d $(D)/DEBIAN $(D)/usr/bin $(docdir) $(mandir) $(D)/usr/lib/debdelta $(D)/usr/share/debdelta $(D)/usr/share/keyrings
	set -e ; for L in $(LANGS) ; do install -d $(D)/usr/share/locale/$${L}/LC_MESSAGES ; done
	# control
	install -m 755 debian/postrm $(D)/DEBIAN/
	install -m 755 debian/postinst $(D)/DEBIAN/
	# /usr/share
	set -e ; for L in $(LANGS) ; do cp -p po/$${L}.mo $(D)/usr/share/locale/$${L}/LC_MESSAGES/debdelta.mo ; chmod -c 0644 $(D)/usr/share/locale/$${L}/LC_MESSAGES/debdelta.mo ; done
	install debpatch.sh $(D)/usr/share/debdelta
	install contrib/debmirror-delta-security $(D)/usr/share/debdelta/
	install contrib/debmirror-marshal-deltas $(D)/usr/share/debdelta/
	install contrib/debmarshal_list_useless_debs $(D)/usr/share/debdelta/
	install contrib/dpkg-sig $(D)/usr/share/debdelta
	cp -p contrib/debmirror*trash_option.patch  $(D)/usr/share/debdelta
	ln -s ../../bin/debdelta  $(D)/usr/share/debdelta/debpatch-url
	cp -p keyrings/pubring.gpg $(D)/usr/share/keyrings/debian-debdelta-archive-keyring.gpg
	chmod 0644 -c $(D)/usr/share/keyrings/debian-debdelta-archive-keyring.gpg
	# /usr/lib
	$(INSTALL_PROGRAM)  minigzip $(D)/usr/lib/debdelta/minigzip
	$(INSTALL_PROGRAM)  minibzip2 $(D)/usr/lib/debdelta/minibzip2
	# /etc
	install -d $(D)/etc/debdelta
	cp -p etc/sources.conf $(D)/etc/debdelta/sources.conf
	chmod -c 0644  $(D)/etc/debdelta/sources.conf
	echo /etc/debdelta/sources.conf >> $(D)/DEBIAN/conffiles
	# /usr/bin
	install debdelta $(D)/usr/bin/debdelta
	ln -s debdelta  $(D)/usr/bin/debpatch
	ln -s debdelta  $(D)/usr/bin/debdeltas
	ln -s debdelta  $(D)/usr/bin/debdelta-upgrade
	# /usr/share/doc
	cp -p FAQ README.features debian/copyright debian/changelog $(docdir)
	chmod -c 0644 $(docdir)/*
	cd $(docdir) && gzip -9n changelog FAQ
	# man
	cp -p *.1 $(mandir)
	chmod -c 0644 $(mandir)*.1
	gzip -9n $(mandir)/*.1 
	# build package
	dpkg-shlibdeps $(D)/usr/lib/debdelta/minigzip  $(D)/usr/lib/debdelta/minibzip2
	dpkg-gencontrol -Pdebian/debdelta -pdebdelta
	find debian/debdelta -newermt '$(BUILD_DATE)' -print0 | \
		xargs -0r touch --no-dereference --date='$(BUILD_DATE)'
	# Ensure correct mode for files for reproducible builds
	chmod -c 0644 $(D)/usr/share/debdelta/*.patch
	dpkg-deb --root-owner-group --build $(D) ..

define checkdir
	test -f debdelta -a -f debian/rules
endef

binary: binary-indep binary-arch

.PHONY: binary binary-arch binary-indep clean checkroot