File: rules

package info (click to toggle)
slrnface 2.0-3
  • links: PTS
  • area: main
  • in suites: woody
  • size: 116 kB
  • ctags: 69
  • sloc: ansic: 559; makefile: 75; sh: 9
file content (76 lines) | stat: -rwxr-xr-x 2,179 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
#!/usr/bin/make -f

CFLAGS=-O
ifneq (,$(findstring debug,$(DEB_BUILD_OPTIONS)))
	CFLAGS += -g
endif

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

clean:
	$(checkdir)
	$(checkroot)
	-rm -rf debian/slrnface debian/files debian/substvars build-stamp
	-$(MAKE) clean


build: build-stamp
build-stamp:
	$(checkdir)
	$(MAKE) CFLAGS="$(CFLAGS)"
	touch build-stamp


install: build
	$(checkdir)
	$(checkroot)
	-rm -rf debian/slrnface debian/substvars
	mkdir -m755 debian/slrnface
	cd debian/slrnface && mkdir -m755 -p usr/bin usr/share/slrn/macros \
		usr/share/man/man1 usr/share/doc/slrnface/examples
	$(INSTALL_PROGRAM) -m755 -p slrnface debian/slrnface/usr/bin
	install -m644 slrnface.1 debian/slrnface/usr/share/man/man1
	install -m644 slrnface.sl debian/slrnface/usr/share/slrn/macros
	install -m644 README debian/slrnface/usr/share/doc/slrnface
	install -m644 mutt.patch debian/slrnface/usr/share/doc/slrnface/examples
	gzip -9 debian/slrnface/usr/share/man/man1/slrnface.1 \
		debian/slrnface/usr/share/doc/slrnface/examples/mutt.patch


# Build architecture-independent files here.
binary-indep: build install
# We have nothing to do by default.

# Build architecture-dependent files here.
binary-arch: build install
	$(checkdir)
	$(checkroot)
	mkdir -m755 -p debian/slrnface/DEBIAN
	install -m644 -p debian/copyright debian/README.Debian \
		debian/slrnface/usr/share/doc/slrnface
	install -m644 -p debian/changelog \
		debian/slrnface/usr/share/doc/slrnface/changelog.Debian
	gzip -9 debian/slrnface/usr/share/doc/slrnface/changelog.Debian
	install -m755 -p debian/postinst debian/prerm debian/slrnface/DEBIAN
	dpkg-shlibdeps -Tdebian/substvars -dDepends \
		debian/slrnface/usr/bin/slrnface
	dpkg-gencontrol -ldebian/changelog -isp -Tdebian/substvars -pslrnface \
		-Pdebian/slrnface
	cd debian/slrnface && find * -type f ! -regex '^DEBIAN/.*' -print0 | \
		xargs -r0 md5sum > DEBIAN/md5sums
	dpkg --build debian/slrnface ..


define checkdir
	test -f debian/rules
endef

define checkroot
	test root = "`whoami`"
endef

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