File: rules

package info (click to toggle)
slrnface 2.1.1-6
  • links: PTS
  • area: main
  • in suites: jessie, jessie-kfreebsd, lenny, squeeze, wheezy
  • size: 128 kB
  • ctags: 98
  • sloc: ansic: 811; makefile: 88
file content (92 lines) | stat: -rwxr-xr-x 2,328 bytes parent folder | download | duplicates (3)
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
#!/usr/bin/make -f
# rules file for slrnface

PACKAGE = slrnface
TMP = $(CURDIR)/debian/$(PACKAGE)

C_FLAGS = -g
INSTALL = install
INSTALL_FILE    = $(INSTALL) -p    -oroot -groot -m644
INSTALL_PROGRAM = $(INSTALL) -p    -oroot -groot -m755
INSTALL_SCRIPT  = $(INSTALL) -p    -oroot -groot -m755
INSTALL_DIR     = $(INSTALL) -p -d -oroot -groot -m755

ifneq (,$(findstring noopt,$(DEB_BUILD_OPTIONS)))
	C_FLAGS += -O0
else
	C_FLAGS += -O
endif
ifeq (,$(findstring nostrip,$(DEB_BUILD_OPTIONS)))
	INSTALL_PROGRAM += -s
	STRIP = true
endif


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


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


install: build
	$(checkdir)
	$(checkroot)
	-rm -rf $(TMP) debian/substvars
	$(INSTALL_DIR) $(TMP)
	cd $(TMP) && $(INSTALL_DIR) usr/share/doc/$(PACKAGE)/examples
	$(MAKE) install prefix=$(TMP)/usr
	-test "$(STRIP)" = "true" && \
		strip --remove-section=.comment --remove-section=.note \
			--strip-unneeded $(TMP)/usr/bin/slrnface
	$(INSTALL_FILE) README doc/Problems doc/Protocol \
		$(TMP)/usr/share/doc/$(PACKAGE)
	$(INSTALL_FILE) mutt.patch \
		$(TMP)/usr/share/doc/$(PACKAGE)/examples
	gzip -9 $(TMP)/usr/share/man/man1/slrnface.1 \
		$(TMP)/usr/share/doc/$(PACKAGE)/Problems \
		$(TMP)/usr/share/doc/$(PACKAGE)/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)
	$(INSTALL_DIR) $(TMP)/DEBIAN
	$(INSTALL_FILE) debian/copyright debian/README.Debian \
		$(TMP)/usr/share/doc/$(PACKAGE)
	$(INSTALL_FILE) debian/changelog \
		$(TMP)/usr/share/doc/$(PACKAGE)/changelog.Debian
	gzip -9 $(TMP)/usr/share/doc/$(PACKAGE)/changelog.Debian
	dpkg-shlibdeps -Tdebian/substvars -dDepends \
		$(TMP)/usr/bin/slrnface
	dpkg-gencontrol -ldebian/changelog -isp -Tdebian/substvars -pslrnface \
		-P$(TMP)
	cd $(TMP) && find * -type f ! -regex '^DEBIAN/.*' -print0 | \
		xargs -r0 md5sum > DEBIAN/md5sums
	dpkg --build $(TMP) ..


binary: binary-indep binary-arch

define checkdir
	test -f debian/rules
endef

define checkroot
	test root = "`whoami`"
endef

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