File: rules

package info (click to toggle)
tmpreaper 1.6.17
  • links: PTS
  • area: main
  • in suites: bookworm
  • size: 684 kB
  • sloc: ansic: 1,672; sh: 1,176; makefile: 78
file content (91 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
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
#!/usr/bin/make -f
# -*- makefile -*-
package=tmpreaper

SHELL := /bin/sh
CC = gcc

VERSION=$(shell dpkg-parsechangelog 2>/dev/null | perl -ne 'print "$$1_DEB" if /^Version:\s+(.*)/')

export VERSION
# --------------------------------------------------------------

debian_version = $(shell dpkg-parsechangelog 2>/dev/null \
		     | sed -n -e 's/^Version: \([[:digit:]]\+:\)*\([^\+]*\).*/\2/p')

define check_cvs_status
	@echo "Checking CVS status for uncommited changes..."
	@if expr $$(cvs status 2>/dev/null	\
		    | grep '^File:'		\
		    | grep -vc 'Up-to-date')	\
	   '>' 0;				\
	then					\
	   echo "There are uncommited changes."; \
	   exit 1;				\
	else					\
	   echo "done."				\
	   exit 0;				\
	fi
endef

retag:
	$(check_cvs_status)
	cvs -Q tag -F debian_version_$(subst .,_,$(debian_version))

.PHONY:	 retag

# ======================================================================

build: build-stamp
build-stamp:
	dh_testdir
	./configure --prefix=/usr --mandir=/usr/share/man
	make CPPFLAGS="-DDEBIAN" tmpreaper
	./tmpreaper -h 2>&1 | grep 'tmpreaper -- Version: '$(debian_version)-DEB || (echo "You forgot to fix the VERSION in configure.ac!"; exit 1)
	touch build-stamp

clean:
	dh_testdir
	dh_testroot
	-[ -s Makefile ] && $(MAKE) clean mostlyclean-am
	# automake
	# autoconf
	-[ -s Makefile ] && $(MAKE) clean
	dh_clean stamp-h config.status config.log config.h Makefile build-stamp tmpreaper tmpreaper.8 stamp-h.in debian/substvars
	rm -rf .deps
	debconf-updatepo
	sleep 1
	touch stamp-h.in

binary-arch: build
	dh_testdir
	dh_testroot
	dh_prep
	dh_installdirs
	$(MAKE) DESTDIR=debian/tmpreaper install
	dh_installdocs
	dh_installcron
	dh_installdebconf
	install -m 644 debian/tmpreaper.conf   debian/tmpreaper/etc
	install -m 644 debian/tmpreaper.conf.5 debian/tmpreaper/usr/share/man/man5
	install -m 644 debian/README.security  debian/tmpreaper/usr/share/doc/tmpreaper
	# dh_installmanpages
	dh_installchangelogs
	dh_strip
	dh_compress
	dh_fixperms
	dh_installdeb
	dh_shlibdeps
	dh_gencontrol
	dh_md5sums
	dh_builddeb

binary: binary-arch

build-arch:
	CFLAGS="-DDEBIAN" dh build-arch

%:
	dh $@

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