File: rules

package info (click to toggle)
tmpreaper 1.4.8
  • links: PTS
  • area: main
  • in suites: slink
  • size: 76 kB
  • ctags: 52
  • sloc: ansic: 520; makefile: 73; sh: 10
file content (74 lines) | stat: -rwxr-xr-x 1,479 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
#!/usr/bin/make -f
# -*- makefile -*-
package=tmpreaper

SHELL := /bin/sh
# `egcc' compiles much more quickly.
CC = gcc

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

# DH_VERBOSE = 1
export VERSION #DH_VERBOSE
# --------------------------------------------------------------

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
	make VERSION="$(VERSION)" all 
	touch build-stamp

clean:
	dh_testdir
	dh_testroot
	$(MAKE) clean
	dh_clean build-stamp

binary-arch: build
	dh_testdir
	dh_testroot
	dh_clean -k
	dh_installdirs
	$(MAKE) PREFIX=debian/tmp install
	dh_installdocs
	dh_installcron
	dh_installmanpages
	dh_installchangelogs
	dh_strip
	dh_compress
	dh_fixperms
	dh_installdeb
	dh_shlibdeps
	dh_gencontrol
	dh_md5sums
	dh_builddeb

binary: binary-arch

.PHONY: build clean binary-arch binary