File: rules

package info (click to toggle)
cronolog 1.6.2-5.2
  • links: PTS
  • area: main
  • in suites: etch, etch-m68k
  • size: 196 kB
  • ctags: 7
  • sloc: makefile: 76; perl: 6
file content (127 lines) | stat: -rwxr-xr-x 2,552 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
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
#! /usr/bin/make -f

# Uncomment this to turn on verbose mode.
#export DH_VERBOSE=1

# DH_COMPAT has been replaced by the 'compat' file.
# This is the debhelper compatability version to use.
#export DH_COMPAT=4

# We use the DBS. Evil is as evil does.

TAR_DIR := cronolog-1.6.2
DESTDIR := $(CURDIR)/debian/tmp

CC := gcc
CFLAGS := -g -Wall 

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

include /usr/share/dbs/dbs-build.mk
include /usr/share/dbs/dpkg-arch.mk

# Test suite control - we run it, by default
with_check := yes

# To disable the test suite for all builds, uncomment the next line.
#with_check := disabled by hand

ifneq ($(WITHOUT_CHECK),)
	with_check := disabled by environment
endif

configure: $(STAMP_DIR)/configure
$(STAMP_DIR)/configure: setup
	dh_testdir

	cd $(BUILD_TREE) && CC="$(CC)" CFLAGS="$(CFLAGS)" ./configure --prefix=/usr

build-depends := $(STAMP_DIR)/build

ifeq ($(with_check),yes)
	build-depends += $(STAMP_DIR)/check
else    
	build-depends += $(STAMP_DIR)/no-check
endif

build: $(build-depends)

$(STAMP_DIR)/build: $(STAMP_DIR)/configure
	dh_testdir

	cd $(BUILD_TREE) && $(MAKE)

	touch $(STAMP_DIR)/build

check: $(STAMP_DIR)/check

$(STAMP_DIR)/check:
	dh_testdir
	@echo "Running test suite..."

	cd $(BUILD_TREE) && $(MAKE) check

	touch $(STAMP_DIR)/check

$(STAMP_DIR)/nocheck:
	@echo "Skipping test suite: $(with_check)"

	touch $(STAMP_DIR)/no-check

install: $(STAMP_DIR)/install

$(STAMP_DIR)/install:
	dh_testdir
	dh_testroot
	dh_clean -k

	cd $(BUILD_TREE) && $(MAKE) install DESTDIR=$(DESTDIR)

	mkdir -p $(DESTDIR)/usr/bin
	mv $(DESTDIR)/usr/sbin/cronolog $(DESTDIR)/usr/bin/cronolog
	mv $(DESTDIR)/usr/sbin/cronosplit $(DESTDIR)/usr/bin/cronosplit

	install -o root -g root -m755 debian/sbin-wrapper $(DESTDIR)/usr/sbin/cronolog

	touch $(STAMP_DIR)/install

clean:
	dh_testdir
	dh_testroot

	dh_clean
	-rm -rf build-tree $(STAMP_DIR)

binary-arch: $(STAMP_DIR)/install
	dh_testdir
	dh_testroot

	dh_installdirs -a
	dh_install -a
	dh_strip -a

	dh_installman -a
	dh_installinfo -a
	dh_perl -a
	dh_shlibdeps -a

	dh_installdocs -a build-tree/cronolog-1.6.2/NEWS build-tree/cronolog-1.6.2/README build-tree/cronolog-1.6.2/TODO
	dh_installchangelogs -a -k build-tree/cronolog-1.6.2/ChangeLog
	dh_compress -a
	dh_fixperms -a

	dh_md5sums -a
	dh_gencontrol -a
	dh_installdeb -a
	dh_builddeb -a

binary-indep:
# There aren't any arch-independant things to do.

binary: binary-arch # binary-indep

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