File: rules

package info (click to toggle)
cfengine 1.6.5-1sarge1
  • links: PTS
  • area: main
  • in suites: sarge
  • size: 1,596 kB
  • ctags: 22
  • sloc: makefile: 170; perl: 74; sh: 48
file content (124 lines) | stat: -rwxr-xr-x 2,931 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
123
124
#! /usr/bin/make -f

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

# Some special build options
ifneq (,$(findstring debug,$(DEB_BUILD_OPTIONS)))
  CFLAGS += -g
endif

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

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

configure: $(STAMP_DIR)/stamp-configure

$(STAMP_DIR)/stamp-configure: $(patched)
	dh_testdir
	cd $(BUILD_TREE) && \
	CFLAGS="$(CFLAGS)" ./configure \
	  --prefix=/usr --build=$(DEB_BUILD_GNU_TYPE) \
	  --host=$(DEB_HOST_GNU_TYPE) --with-ssl && \
	cd $(PWD) && \
	touch $(STAMP_DIR)/stamp-configure

build: $(STAMP_DIR)/stamp-build

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

	cd $(BUILD_TREE) && $(MAKE) SUBDIRS="pub src bin contrib inputs" \
		CFLAGS="$(CFLAGS)"

	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) SUBDIRS="pub src bin contrib inputs" \
		INSTALL_PROGRAM="$(INSTALL_PROGRAM)" \
		install prefix=$(PWD)/debian/tmp/usr

# Install example configurations

	mv debian/tmp/usr/share/$(package)/* \
		debian/tmp/usr/share/doc/$(package)/examples/
	rmdir debian/tmp/usr/share/$(package)/
#	$(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

install-indep: build $(dh_mak_deps)
	dh_testdir
	dh_testroot
	dh_clean -k
	dh_installdirs
	cd $(BUILD_TREE) && $(MAKE) SUBDIRS="doc" \
		INSTALL_PROGRAM="$(INSTALL_PROGRAM)" \
		install prefix=$(PWD)/debian/tmp/usr


binary-indep: configure install-indep $(dh_mak_deps)
	$(MAKE) -C $(BUILD_TREE) SUBDIRS=doc
	dh_testdir -i
	dh_testroot -i
	dh_installdocs -i $(BUILD_TREE)/doc/cfengine-Tutorial $(BUILD_TREE)/doc/cfengine-Reference
	dh_installinfo -i $(BUILD_TREE)/doc/*.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)/ChangeLog
	dh_installdocs -a $(BUILD_TREE)/README

	dh_installman -a
	dh_installcron -a
	dh_undocumented -a
	dh_installexamples -pcfengine $(BUILD_TREE)/contrib/cfengine.el \
		debian/local/*.conf
	dh_installdeb -a
	dh_strip -a
	dh_compress -a
	dh_fixperms -a
	dh_md5sums -a
	dh_shlibdeps -a
	dh_gencontrol -a
	dh_builddeb -a

binary: binary-indep binary-arch