File: rules

package info (click to toggle)
nis 3.17.1-3
  • links: PTS
  • area: main
  • in suites: buster
  • size: 4,028 kB
  • sloc: ansic: 18,360; sh: 8,065; xml: 403; makefile: 389; perl: 41; awk: 21; sed: 16
file content (170 lines) | stat: -rwxr-xr-x 5,935 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
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
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
#! /usr/bin/make -f
#
#	debian/rules file for nis
#

# Package name.
p = nis

DEBDIR=$(shell pwd)/debian/tmp

YPSERV=ypserv-2.19
YPTOOLS=yp-tools-2.9
YPBIND=ypbind-mt-1.38

SHELL=/bin/bash
DEB_BUILD_GNU_TYPE := $(shell dpkg-architecture -qDEB_BUILD_GNU_TYPE)
DEB_HOST_GNU_TYPE := $(shell dpkg-architecture -qDEB_HOST_GNU_TYPE)

ifeq (,$(findstring noopt,$(DEB_BUILD_OPTIONS)))
        CFLAGS = "-O2 -Wall -g"
else
        CFLAGS = "-O0 -Wall -g"
endif
#ifeq (,$(findstring nostrip,$(DEB_BUILD_OPTIONS)))
#        INSTALL_PROGRAM += -s
#endif


define checkdir
	test -f $(YPBIND)/README
endef

all: build

build:
# Builds the binary package.
	dh_autoreconf
	-(cd $(YPTOOLS) && [ ! -f config.status ] && \
		CFLAGS=$(CFLAGS) ./configure \
		--prefix=/usr --mandir=/usr/share/man \
		--build=$(DEB_BUILD_GNU_TYPE) \
		--host=$(DEB_HOST_GNU_TYPE) )
	(cd $(YPTOOLS) && make)
	-(cd $(YPBIND) && [ ! -f config.status ] && \
		CFLAGS=$(CFLAGS) ./configure \
		--prefix=/usr --mandir=/usr/share/man \
		--sysconfdir=/etc --libexecdir=/usr/lib/yp \
		--disable-dbus-nm \
		--build=$(DEB_BUILD_GNU_TYPE) \
		--host=$(DEB_HOST_GNU_TYPE) )
	(cd $(YPBIND) && make )
	rm -f $(YPSERV)/sedscript
	-(cd $(YPSERV) && [ ! -f config.status ] && \
		AWK=/usr/bin/awk CFLAGS=$(CFLAGS) ./configure \
		--prefix=/usr --mandir=/usr/share/man \
		--sysconfdir=/etc \
		--libexecdir=/usr/lib/yp --enable-checkroot \
		--build=$(DEB_BUILD_GNU_TYPE) \
		--host=$(DEB_HOST_GNU_TYPE) )
	(cd $(YPSERV) && \
		make CPPFLAGS='-DSECURENETS=\"/etc/ypserv.securenets\"' )
	po2debconf -o debian/templates.gen debian/templates 
	touch build

# Undoes the effect of `make -f debian/rules build'.
clean:
	-(cd $(YPTOOLS) && [ -f Makefile ] && make distclean)
	-(cd $(YPBIND)  && [ -f Makefile ] && make distclean)
	-(cd $(YPSERV)  && [ -f Makefile ] && make distclean)
	rm -rf $(YPBIND)/rpcsvc
	-rm -rf $(DEBDIR)
	rm -rf $(YPSERV)/autom4te.cache
	rm -f build debian/{files,substvars,templates.gen}
	find . -name '*.bak' -o -name '*~' | xargs -r rm --
	rm -f */config.cache
	dh_autoreconf_clean
	rm -f debian/nis.debhelper.log

# Architecture independant files.
binary-indep:	build
	$(checkdir)

# Make a binary package.
binary-arch:	build checkroot
	-rm -rf $(DEBDIR)
	install -d -g root -m 755 $(DEBDIR)
	install -d -g root -m 755 $(DEBDIR)/DEBIAN
	install -d -g root -m 755 $(DEBDIR)/bin
	install -d -g root -m 755 $(DEBDIR)/etc/init.d
	install -d -g root -m 755 $(DEBDIR)/usr/{bin,sbin}
	install -d -g root -m 755 $(DEBDIR)/usr/lib/yp
	install -d -g root -m 755 $(DEBDIR)/usr/share/bug/nis
	install -d -g root -m 755 $(DEBDIR)/usr/share/lintian/overrides
	install -d -g root -m 755 $(DEBDIR)/var/yp
	install -d -g root -m 755 -o root $(DEBDIR)/usr/share/doc/nis
	install -d -g root -m 755 -o root $(DEBDIR)/usr/share/doc/nis/examples
	install -d -g root -m 755 -o root $(DEBDIR)/usr/share/nis
	install -d -g root -m 755 -o root $(DEBDIR)/usr/share/man/man{1,5,8}
	#
	(cd $(YPSERV) && make install DESTDIR=$(DEBDIR))
	rm -rf $(DEBDIR)/usr/include
	rm -f $(DEBDIR)/var/yp/securenets
	rm -f $(DEBDIR)/etc/{locale,netmasks,timezone}
	chown -R root:root $(DEBDIR)
	#
	(umask 022; cd $(YPTOOLS) && make install DESTDIR=$(DEBDIR))
	(umask 022; cd $(YPBIND)  && make install DESTDIR=$(DEBDIR))
	(cd $(DEBDIR)/bin     && rm domainname ypdomainname nisdomainname)
	(cd $(DEBDIR)/usr/bin && ln -sf yppasswd ypchsh)
	(cd $(DEBDIR)/usr/bin && ln -sf yppasswd ypchfn)
	strip $(DEBDIR)/usr/lib/yp/ypxfr
	strip $(DEBDIR)/usr/sbin/ypbind
	#
	#install -g root -m 755 $(YPBIND)/ypbind $(DEBDIR)/usr/sbin
	#install -g root -m 644 $(YPBIND)/ypbind.8 $(DEBDIR)/usr/share/man/man8
	install -g root -m 644 debian/yp.conf $(DEBDIR)/etc/yp.conf
	#
	chown -R root:root $(DEBDIR)
	chmod -R u+rw,o=u-w $(DEBDIR)
	#
	install -g root -m 755 debian/ypxfr_1perhour $(DEBDIR)/usr/lib/yp
	install -g root -m 755 debian/ypxfr_1perday $(DEBDIR)/usr/lib/yp
	install -g root -m 755 debian/ypxfr_2perday $(DEBDIR)/usr/lib/yp
	install -g root -m 755 debian/convert-ypserv-conf $(DEBDIR)/usr/lib/yp
	install -g root -m 755 debian/rc.nis $(DEBDIR)/etc/init.d/nis
	install -g root -m 644 debian/netgroup.sample $(DEBDIR)/etc/netgroup
	install -g root -m 644 debian/ypserv.securenets $(DEBDIR)/etc
	install -g root -m 644 debian/ypserv.conf.debian $(DEBDIR)/etc/ypserv.conf
	install -g root -m 644 debian/lintian-overrides $(DEBDIR)/usr/share/lintian/overrides/nis


	install -g root -m 755 debian/reportbug-script $(DEBDIR)/usr/share/bug/nis/script

	# Documentation.
	gzip -9f $(DEBDIR)/usr/share/man/man*/*
	install -g root -m 644 debian/nis.debian.howto $(DEBDIR)/usr/share/doc/nis
	install -g root -m 644 debian/changelog \
		$(DEBDIR)/usr/share/doc/nis/changelog.Debian
	install -g root -m 644 $(YPSERV)/ChangeLog \
		$(DEBDIR)/usr/share/doc/nis/changelog
	gzip -9f $(DEBDIR)/usr/share/doc/nis/* || true
	install -g root -m 644 debian/COPYRIGHT \
	  $(DEBDIR)/usr/share/doc/$(p)/copyright
	install -g root -m 644 debian/nis.default \
	  $(DEBDIR)/usr/share/$(p)
	(cd $(DEBDIR)/usr/share/doc/$(p)/examples && ln -s ../../../$(p)/nis.default ) 
	install -g root -m 644 $(YPSERV)/etc/ypserv.conf \
	  $(DEBDIR)/usr/share/doc/$(p)/examples
	#
	install -g root -m 644 debian/conffiles $(DEBDIR)/DEBIAN/conffiles
	install -g root -m 755 debian/preinst $(DEBDIR)/DEBIAN/preinst
	install -g root -m 755 debian/prerm $(DEBDIR)/DEBIAN/prerm
	install -g root -m 755 debian/postinst $(DEBDIR)/DEBIAN/postinst
	install -g root -m 755 debian/postrm $(DEBDIR)/DEBIAN/postrm
	install -g root -m 755 debian/config $(DEBDIR)/DEBIAN/config
	install -g root -m 644 debian/templates.gen $(DEBDIR)/DEBIAN/templates
	# Use some binaries to generate the dependencies.
	dpkg-shlibdeps `find $(DEBDIR) -type f -exec file '{}' ';' | grep ELF | awk -F: '{print $$1}'`
	dpkg-gencontrol -isp
	dpkg --build $(DEBDIR) ..
	rm -rf $(DEBDIR)

binary:	binary-indep binary-arch

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

dist:
	dpkg-source -b