File: rules

package info (click to toggle)
arpwatch 2.1a13-2
  • links: PTS
  • area: main
  • in suites: etch, etch-m68k, sarge
  • size: 1,820 kB
  • ctags: 36
  • sloc: perl: 340; sh: 236; makefile: 202
file content (155 lines) | stat: -rwxr-xr-x 4,118 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
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
#!/usr/bin/make -f
# Sample debian/rules that uses debhelper.
# GNU copyright 1997 to 1999 by Joey Hess.
# Modified for arpwatch based on Adam Heath's and Ben Collins' work in 2001 by
# KELEMEN Peter <fuji@debian.org>

# Some local stuff.
package = arpwatch
DESTDIR = $(CURDIR)/debian/$(package)
LOCALDIR = $(CURDIR)/debian/local
CC = gcc
CFLAGS := -O2 -Wall
IEN := install -m755
IE := $(IEN) -s
ID := install -m644
ifneq (,$(findstring debug,$(DEB_BUILD_OPTIONS)))
	CFLAGS += -g
	ifneq (,$(findstring nostrip,$(DEB_BUILD_OPTIONS)))
		IE := $(IEN)
	endif
endif
# DBS
TAR_DIR := arpwatch-2.1a13
include debian/scripts/dbs-build.mk
# dpkg-arch
ifeq (,$(DEB_BUILD_GNU_TYPE))
	include debian/scripts/dpkg-arch.mk
endif
# features
configure_args :=
configure_args += --prefix=/usr --mandir=\$${prefix}/share/man\
	--infodir=\$${prefix}/share/info
ifneq ($(DEB_HOST_GNU_TYPE),$(DEB_BUILD_GNU_TYPE))
	configure_args += --build=$(DEB_BUILD_GNU_TYPE)
endif

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

# This is the debhelper compatability version to use.
export DH_COMPAT=3

configure: configure-stamp
configure-stamp:
	dh_testdir
	# Add here commands to configure the package.

	touch configure-stamp

build: $(STAMP_DIR)/pre-build-stamp $(STAMP_DIR)/build-stamp

$(STAMP_DIR)/pre-build-stamp: $(unpacked) $(patched)
	dh_testdir
	cd $(BUILD_TREE) && chmod +w * && CFLAGS="$(CFLAGS)" CC="$(CC)" \
		./configure $(configure_args) --host=$(DEB_BUILD_GNU_TYPE)
	#$(MAKE) depend -C $(BUILD_TREE)
	touch $(STAMP_DIR)/pre-build-stamp

$(STAMP_DIR)/build-stamp:
	dh_testdir
	cd $(BUILD_TREE) && $(MAKE)
	touch $(STAMP_DIR)/build-stamp

##build: configure-stamp build-stamp
##build-stamp:
##	dh_testdir
##
##	# Add here commands to compile the package.
##	$(MAKE)
##	#/usr/bin/docbook-to-man debian/arpwatch.sgml > arpwatch.1
##
##	touch build-stamp

clean:
	dh_testdir
	rm -rf $(SOURCE_DIR) $(STAMP_DIR)
	perl debian/scripts/dh_split clean
##	dh_testroot
##	rm -f build-stamp configure-stamp
##
##	# Add here commands to clean up after the build process.
##	-$(MAKE) distclean
##
	dh_clean

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

	# Add here commands to install the package into debian/arpwatch.
	$(MAKE) DESTDIR=$(DESTDIR) install -C $(BUILD_TREE) #prefix=$(DESTDIR)

	$(ID) $(LOCALDIR)/ethercodes.dat $(DESTDIR)/usr/share/arpwatch

	chmod 0700 $(DESTDIR)/var/lib/arpwatch

	$(IEN) $(BUILD_TREE)/arp2ethers $(DESTDIR)/usr/sbin
	$(IEN) $(BUILD_TREE)/arpfetch $(DESTDIR)/usr/sbin
	$(IEN) $(BUILD_TREE)/bihourly $(DESTDIR)/usr/sbin
	$(IEN) $(BUILD_TREE)/massagevendor $(DESTDIR)/usr/sbin
	$(IEN) $(LOCALDIR)/dmassagevendor $(DESTDIR)/usr/sbin

	$(ID) $(BUILD_TREE)/arpwatch.8 $(DESTDIR)/usr/share/man/man8
	$(ID) $(BUILD_TREE)/arpsnmp.8 $(DESTDIR)/usr/share/man/man8
	$(ID) $(BUILD_TREE)/arp2ethers.8 $(DESTDIR)/usr/share/man/man8
	$(ID) $(BUILD_TREE)/arpfetch.8 $(DESTDIR)/usr/share/man/man8
	$(ID) $(BUILD_TREE)/bihourly.8 $(DESTDIR)/usr/share/man/man8
	$(ID) $(BUILD_TREE)/massagevendor.8 $(DESTDIR)/usr/share/man/man8
	$(ID) $(LOCALDIR)/dmassagevendor.8 $(DESTDIR)/usr/share/man/man8
	$(ID) $(LOCALDIR)/arpwatch.conf $(DESTDIR)/etc/arpwatch.conf

	cp $(LOCALDIR)/override $(DESTDIR)/usr/share/lintian/overrides/$(package)

	# Namespace cleanup here.

# Build architecture-independent files here.
binary-indep: build install
# We have nothing to do by default.

# Build architecture-dependent files here.
binary-arch: build install $(dh_mak_deps)
	dh_testdir
	dh_testroot
#	dh_installdebconf	
	dh_installdocs
	dh_installexamples
	dh_installmenu
#	dh_installlogrotate
#	dh_installemacsen
#	dh_installpam
#	dh_installmime
	dh_installinit -- defaults 40
	dh_installcron
	dh_installman
	dh_installinfo
#	dh_undocumented
	dh_installchangelogs
	dh_link
ifeq (,$(findstring nostrip,$(DEB_BUILD_OPTIONS)))
	dh_strip
endif
	dh_compress
	dh_fixperms --exclude=/var/lib/arpwatch
#	dh_makeshlibs
	dh_installdeb
#	dh_perl
	dh_shlibdeps
	dh_gencontrol
	dh_md5sums
	dh_builddeb

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