File: rules

package info (click to toggle)
crywrap 0.2.1-4
  • links: PTS
  • area: main
  • in suites: sarge
  • size: 784 kB
  • ctags: 241
  • sloc: sh: 2,751; ansic: 1,979; makefile: 166
file content (102 lines) | stat: -rwxr-xr-x 3,487 bytes parent folder | download | duplicates (2)
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
#! /usr/bin/make -f
## Written by Gergely Nagy <algernon@debian.org>
## This is under GPL v2.

PACKAGE		 = crywrap
PKGDIR		 = ${CURDIR}/debian/${PACKAGE}

CFLAGS		?= -g
BGT		:= $(shell dpkg-architecture -qDEB_BUILD_GNU_TYPE)
HGT		:= $(shell dpkg-architecture -qDEB_HOST_GNU_TYPE)

EXTRAVERSION	 = \" Debian ($(shell dpkg-architecture -qDEB_HOST_ARCH))\"

ifneq (,$(findstring noopt,${DEB_BUILD_OPTIONS}))
CFLAGS		+= -O0
else
CFLAGS		+= -O2
endif

debian/build-${BGT}/config.status: configure
	test -e debian/control
	install -d debian/build-${BGT} && cd debian/build-${BGT} && \
	../../configure -C --prefix=/usr --sysconfdir=/etc \
			--mandir=/usr/share/man \
			--build=${BGT} --host=${HGT} \
			${CONFIG_FLAGS} CFLAGS="${CFLAGS}"

build: debian/build-${BGT}/config.status
	test -e debian/control
	${MAKE} -C debian/build-${BGT} EXTRAVERSION="${EXTRAVERSION}" V=1 \
		WITH_SNAPSHOT=""

clean:
	test -e debian/control && test "x`whoami`" = "xroot"
	rm -rf debian/${PACKAGE}.substvars ${PKGDIR} debian/files
	-${MAKE} -C debian/build-${BGT} distclean V=1
	rm -rf ${PKGDIR} debian/build-${BGT}

install: build
	test -e debian/control && test "x`whoami`" = "xroot"
	install -d ${PKGDIR}/usr/share/doc/${PACKAGE} \
		   ${PKGDIR}/etc/init.d \
		   ${PKGDIR}/etc/default \
		   ${PKGDIR}/etc/crywrap \
		   ${PKGDIR}/usr/share/${PACKAGE}
	${MAKE} -C debian/build-${BGT} install DESTDIR=${PKGDIR} V=1
	install -m 0755 etc/crywrap-init.d ${PKGDIR}/etc/init.d/crywrap
	install -m 0644 etc/crywrap.conf ${PKGDIR}/etc/default/crywrap
	install -m 0755 utils/sslwrap \
		${PKGDIR}/usr/share/${PACKAGE}/
	install -m 0644 NEWS THANKS debian/README.Debian \
		${PKGDIR}/usr/share/doc/${PACKAGE}/

binary-crywrap: install
	test -e debian/control && test "x`whoami`" = "xroot"
## Install debian-specific stuff
# ..the changelogs..
	find . -name 'ChangeLog*' -maxdepth 1 -print0 | xargs -r0 -i@ \
	 sh -c "gzip -9fc @ >${PKGDIR}/usr/share/doc/${PACKAGE}/@.gz"
	ln -sf ChangeLog.gz ${PKGDIR}/usr/share/doc/${PACKAGE}/changelog.gz
	gzip -9fc debian/changelog >${PKGDIR}/usr/share/doc/${PACKAGE}/changelog.Debian.gz
# ..the copyright file..
	install -m 0644 debian/copyright ${PKGDIR}/usr/share/doc/${PACKAGE}
## Gzip manual page...
	gzip -9f ${PKGDIR}/usr/share/man/man8/crywrap.8
## Strip binaries
ifeq (,$(findstring nostrip,${DEB_BUILD_OPTIONS}))
	strip --remove-section=.comment --remove-section=.note \
		${PKGDIR}/usr/sbin/crywrap
endif
## Fix permissions
	find ${PKGDIR} -print0 2>/dev/null | xargs -0r chown \
						   --no-dereference 0.0
	find ${PKGDIR} ! -type l -print 0 2>/dev/null | xargs -0r \
		chmod go=rX,u+rw,a-s
## Generate ${shlibs:Depends}
	dpkg-shlibdeps -Tdebian/${PACKAGE}.substvars -dDepends \
			${PKGDIR}/usr/sbin/crywrap
## Install stuff to DEBIAN/
	install -d ${PKGDIR}/DEBIAN
	install -m 0755 debian/maint/postinst debian/maint/postrm \
			debian/maint/prerm ${PKGDIR}/DEBIAN/
	cd ${PKGDIR} >/dev/null ;\
	 find etc -type f -printf "/%p\n" >DEBIAN/conffiles
## Generate DEBIAN/md5sums
	cd ${PKGDIR} >/dev/null ;\
	 find * -type f ! -regex '^DEBIAN/.*' -print0 | xargs -r0 md5sum > DEBIAN/md5sums
## Generate DEBIAN/control
	dpkg-gencontrol -isp -p${PACKAGE} -Tdebian/${PACKAGE}.substvars \
			-P${PKGDIR}
## Build the binary package
	dpkg --build ${PKGDIR} ..

binary-indep:
binary-arch: binary-crywrap

binary: binary-indep binary-arch

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

# arch-tag: 66f7ca01-8a22-4aa0-b391-98bd81963a79