File: rules

package info (click to toggle)
cfengine 1.5.3-6
  • links: PTS
  • area: main
  • in suites: potato
  • size: 800 kB
  • ctags: 22
  • sloc: makefile: 153; perl: 63; ansic: 54; sh: 10
file content (122 lines) | stat: -rwxr-xr-x 3,019 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
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
#! /usr/bin/make -f

package	        := cfengine
PWD             := $(shell pwd)
CFLAGS          := -O2
INSTALL_PROGRAM := install -m755 -s
INSTALL_DATA    := install -m644

# Some special build options
ifneq (,$(findstring debug,$(DEB_BUILD_OPTIONS)))
  CFLAGS += -g
  ifneq (,$(findstring nostrip,$(DEB_BUILD_OPTIONS)))
    INSTALL_PROGRAM := install -m755
  endif
endif

# the dbs rules
TAR_DIR	:= cfengine-1.5.3
include debian/scripts/dbs-build.mk

# dpkg-arch rules
ifeq (,$(DEB_BUILD_GNU_TYPE))
  include debian/scripts/dpkg-arch.mk
endif

# Deps for generating debhelper scripts
dh_mak_deps := $(shell perl debian/scripts/dh_split makedeps)
dh_gen_deps := $(shell perl debian/scripts/dh_split gendeps)

build: $(STAMP_DIR)/stamp-build
$(STAMP_DIR)/stamp-build: $(patched)
	dh_testdir

	if [ ! -f $(STAMP_DIR)/stamp-configure ]; then \
		cd $(BUILD_TREE); \
		autoconf; \
		CFLAGS="$(CFLAGS)" ./configure \
		  --prefix=/usr --build=$(DEB_BUILD_GNU_TYPE) \
		  --host=$(DEB_HOST_GNU_TYPE); \
		cd $(PWD); \
		touch $(STAMP_DIR)/stamp-configure; \
	fi

	cd $(BUILD_TREE) && $(MAKE) CFLAGS="$(CFLAGS)" allnodoc

	touch $(STAMP_DIR)/stamp-build


clean:
	dh_testdir
	rm -rf $(STAMP_DIR) $(SOURCE_DIR)
	perl debian/scripts/dh_split clean
	dh_clean

install: build $(dh_mak_deps)
	dh_testdir
	dh_testroot
	dh_clean -k
	dh_installdirs

	cd $(BUILD_TREE) && $(MAKE) INSTALL_PROGRAM="$(INSTALL_PROGRAM)" \
		instnodoc prefix=$(PWD)/debian/tmp/usr

# Install example configurations
	$(INSTALL_DATA) debian/local/*.conf \
		debian/tmp/usr/share/doc/$(package)/examples/
	$(INSTALL_DATA) debian/tmp/usr/share/$(package)/* \
		debian/tmp/usr/share/doc/$(package)/examples/
	rm -rf debian/tmp/usr/share/$(package)

# Install default configuration
	install -m 755 -p  debian/local/cf.empty.conf \
		debian/tmp/etc/$(package)/$(package).conf

	dh_movefiles

binary-indep: build install $(dh_mak_deps)
	$(MAKE) -C $(BUILD_TREE)/doc
	dh_testdir -i
	dh_testroot -i
	
	$(INSTALL_DATA) -p $(BUILD_TREE)/doc/*.html \
		debian/cfengine-doc/usr/share/doc/cfengine-doc
	$(INSTALL_DATA) -p $(BUILD_TREE)/doc/*.info* \
		debian/cfengine-doc/usr/share/info
	$(INSTALL_DATA) -p debian/local/cfengine-tutorial \
		debian/local/cfengine-reference \
		debian/cfengine-doc/usr/share/doc-base

	dh_installchangelogs -i
	dh_compress -i
	dh_fixperms -i
	dh_installdeb -i
	dh_gencontrol -i
	dh_builddeb -i

binary-arch: build install $(dh_mak_deps)
	dh_testdir
	dh_testroot -a
	dh_installchangelogs -a $(BUILD_TREE)/VERSION.DIFF
	dh_installdocs -a
	# dh_installmanpages -a
	install -m 644 $(BUILD_TREE)/doc/cfengine.8 debian/tmp/usr/share/man/man8
	dh_installcron -a
	# dh_undocumented -a
	for man in `cat debian/undocumented`; do \
	    ln -s ../man7/undocumented.7.gz \
		debian/tmp/usr/share/man/man8/$${man}.gz; \
	done
	dh_installdeb -a
	dh_strip -a
	dh_compress -a
	dh_fixperms -a
	dh_md5sums -a
	dh_shlibdeps -a
	dh_gencontrol -a
	dh_builddeb -a

$(dh_mak_deps): $(dh_gen_deps)
	perl debian/scripts/dh_split

binary: binary-indep binary-arch