File: rules

package info (click to toggle)
swaks 20240103.0-2
  • links: PTS, VCS
  • area: main
  • in suites: sid, trixie
  • size: 992 kB
  • sloc: perl: 3,249; makefile: 46; sh: 24
file content (59 lines) | stat: -rwxr-xr-x 1,904 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
#!/usr/bin/make -f
INSTALL = install
INSTALL_FILE    = $(INSTALL) -p    -m  644
INSTALL_PROGRAM = $(INSTALL) -p    -m  755
INSTALL_SCRIPT  = $(INSTALL) -p    -m  755
# also clear sticky bit
INSTALL_DIR     = $(INSTALL) -p -d -m  =0755
BUILD_DATE = $(shell date --date=@$(SOURCE_DATE_EPOCH) '+%Y-%m-%dT%H:%M:%S%z')

build:
# nothing to do
build-arch:
# nothing to do
build-indep:
# nothing to do

clean:
	test -d debian
	-rm -rf debian/tmp debian/files

binary-indep: build
	test -d debian
	$(INSTALL_DIR) debian/tmp/DEBIAN \
		debian/tmp/usr/bin debian/tmp/usr/share/man/man1 \
		debian/tmp/usr/share/doc/swaks/examples
	find debian/tmp -type d -exec chmod =0755 {} +
	$(INSTALL_SCRIPT) swaks debian/tmp/usr/bin/
	pod2man --center=SWAKS --section=1 \
		swaks debian/tmp/usr/share/man/man1/swaks.1
	$(INSTALL_FILE)	debian/changelog \
		debian/tmp/usr/share/doc/swaks/changelog.Debian
	$(INSTALL_FILE) doc/Changes.txt \
		debian/tmp/usr/share/doc/swaks/changelog
	$(INSTALL_FILE) README.txt \
		debian/tmp/usr/share/doc/swaks/
	$(INSTALL_FILE)	debian/copyright \
		debian/tmp/usr/share/doc/swaks/
	$(INSTALL_FILE) doc/recipes.txt debian/tmp/usr/share/doc/swaks/examples/
	find debian/tmp/usr/share/man/man1 debian/tmp/usr/share/doc/swaks/ \
		-type f -size +4096c -exec gzip -v9n {} +
	(cd debian/tmp; find -name DEBIAN -prune -o \
			\( -type f -printf '%P\0' \) \
				| env LC_COLLATE=C.UTF-8 sort -z \
				| xargs -0r md5sum > DEBIAN/md5sums && \
					chmod 644 DEBIAN/md5sums )
	dpkg-gencontrol -isp
	# fix permissions
	find debian/tmp/usr/share/man debian/tmp/usr/share/doc \
		-type f -exec chmod 644 {} +
	find debian/tmp -newermt '$(BUILD_DATE)' -exec \
		touch --no-dereference --date='$(BUILD_DATE)' {} +
	dpkg-deb --root-owner-group --build debian/tmp ..

binary-arch:
	#nothing to do

binary:	binary-indep binary-arch

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