File: rules

package info (click to toggle)
cfingerd 1.4.3-5
  • links: PTS, VCS
  • area: main
  • in suites: bullseye
  • size: 960 kB
  • sloc: ansic: 3,776; perl: 501; makefile: 134; sh: 73
file content (107 lines) | stat: -rwxr-xr-x 4,039 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
#! /usr/bin/make -f

#   Copyright (c) 1994-99 by joey@infodrom.org (Martin Schulze)
#
#   This program is free software; you can redistribute it and/or modify
#   it under the terms of the GNU General Public License as published by
#   the Free Software Foundation; version 2 dated June, 1991.
#
#   This program is distributed in the hope that it will be useful,
#   but WITHOUT ANY WARRANTY; without even the implied warranty of
#   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
#   GNU General Public License for more details.
#
#   You should have received a copy of the GNU General Public License
#   along with this program;  if not, write to the Free Software
#   Foundation, Inc., 675 Mass Ave., Cambridge, MA 02139, USA.

SHELL=/bin/bash

# The name and version of the source
#
package = $(shell grep "^Package: " debian/control|head -1|sed 's/Package: \(.*\)/\1/g')

installbin = install -g root -o root -m 755
installdoc = install -g root -o root -m 644

ifneq (,$(findstring debug,$(DEB_BUILD_OPTIONS)))
CFLAGS = -g -O2 -Wall
else
CFLAGS = -O2 -Wall
endif

build:
	-test -f Makefile.cfg || ./Configure -c config=/etc/cfingerd/cfingerd.conf \
		-c mandir=/usr/share/man -c man_owner=root -c man_group=root \
		-c cflags="$(CFLAGS)"
	dh_auto_build -- all
	touch stamp-build

clean: debclean
	rm -f stamp-build
	$(MAKE) clean
	rm -rf *~

debclean:
# Cleans debian binary directories to allow binary creation
	rm -rf debian/tmp
	rm -f debian/{files,substvars}

binary-indep:
# Nothing to be done here

binary-arch: debclean
	-test -f stamp-build || $(MAKE) -f debian/rules build
	$(installbin) -d debian/tmp/DEBIAN
	chmod -R g-ws debian/tmp
	$(installbin) debian/{preinst,postinst,prerm,postrm} debian/tmp/DEBIAN/
	$(installdoc) debian/conffiles debian/tmp/DEBIAN/
	#
	$(installbin) -d debian/tmp/usr/share/doc/$(package)
	$(installdoc) debian/copyright debian/tmp/usr/share/doc/$(package)/copyright
	$(installdoc) debian/changelog debian/tmp/usr/share/doc/$(package)/changelog.Debian
	$(installdoc) CREDITS FAQ RECOMMEND TODO debian/tmp/usr/share/doc/$(package)
	$(installdoc) CHANGES debian/tmp/usr/share/doc/$(package)/changelog
	$(installdoc) README debian/tmp/usr/share/doc/$(package)/readme
	gzip -9nf debian/tmp/usr/share/doc/$(package)/{changelog.Debian,changelog}
	gzip -9nf debian/tmp/usr/share/doc/$(package)/{readme,CREDITS,FAQ,RECOMMEND,TODO}
	#
	$(installbin) -d debian/tmp/usr/sbin
	$(installbin) $(STRIP) src/cfingerd debian/tmp/usr/sbin
	$(installbin) $(STRIP) userlist/userlist debian/tmp/usr/sbin
	#
	$(installbin) -d debian/tmp/usr/share/man/man{5,8}
	cd docs && $(MAKE) MANDIR=../debian/tmp/usr/share/man install
	$(installdoc) userlist/userlist.1 debian/tmp/usr/share/man/man8/userlist.8
	gzip -9n debian/tmp/usr/share/man/man?/*
	#
	$(installbin) -d debian/tmp/etc/cfingerd{,/scripts}
	$(installdoc) debian/{top_finger,bottom_finger}.txt debian/tmp/etc/cfingerd
	$(installdoc) debian/{noname,nouser,rejected}_banner.txt debian/tmp/etc/cfingerd
	$(installdoc) debian/cfingerd.conf debian/tmp/etc/cfingerd
	$(installbin) -d debian/tmp/etc/cron.weekly
	$(installbin) debian/cron debian/tmp/etc/cron.weekly/cfingerd
	$(installbin) -d debian/tmp/var/log
	#
#	$(installbin) -d debian/tmp/usr/doc/$(package)/scripts
#	$(installdoc) debian/{ping,uptime} debian/tmp/usr/doc/$(package)/scripts
#	$(installdoc) scripts/trace debian/tmp/usr/doc/$(package)/scripts
	$(installbin) -d debian/tmp/usr/share/doc/$(package)/examples
	$(installdoc) debian/{ping,uptime} debian/tmp/usr/share/doc/$(package)/examples
	$(installdoc) scripts/trace debian/tmp/usr/share/doc/$(package)/examples
	$(installdoc) debian/cfingerd.xinetd debian/tmp/usr/share/doc/$(package)/examples
	#
	dh_strip --tmpdir=debian/tmp
	dh_md5sums --tmpdir=debian/tmp
	dpkg-shlibdeps debian/tmp/usr/sbin/{cfingerd,userlist}
	dpkg-gencontrol -isp
	chmod -R og=rX debian/tmp
	dpkg --build debian/tmp ..

binary: binary-indep binary-arch

checkroot:
	$(checkdir)
	test root = "`whoami`"

.PHONY: binary binary-arch binary-indep clean checkroot