File: rules

package info (click to toggle)
openldap2 2.0.23-6.3
  • links: PTS
  • area: main
  • in suites: woody
  • size: 7,816 kB
  • ctags: 6,366
  • sloc: ansic: 86,391; sh: 9,816; makefile: 1,270; cpp: 1,107; sql: 838; php: 700; perl: 134; tcl: 40
file content (215 lines) | stat: -rwxr-xr-x 8,521 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
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
#!/usr/bin/make -f

rootdir		:= $(shell pwd)
tmpdir		:= $(rootdir)/debian/tmp
builddir	:= $(rootdir)/debian/build

$(builddir)/Makefile:
	mkdir -p $(builddir)
	cd $(builddir) ; $(rootdir)/configure \
		--enable-debug --enable-syslog --enable-proctitle \
		--enable-cache --enable-referrals --enable-ipv6 \
		--enable-local --with-cyrus-sasl --with-readline \
		--with-threads --enable-slapd --enable-cleartext \
		--enable-crypt --enable-passwd --enable-spasswd \
		--enable-multimaster --enable-phonetic --enable-rlookups \
		--enable-wrappers --enable-dynamic --disable-dnssrv \
		--enable-ldap --enable-ldbm --enable-shell --enable-sql \
		--enable-slurpd --enable-shared --without-tls \
		--prefix=/usr --localstatedir=/var/lib \
		--sysconfdir=/etc --libexecdir='$${prefix}'/sbin \
		--mandir='$${prefix}'/share/man --with-subdir=ldap
	$(MAKE) -C $(builddir) depend

build: $(builddir)/Makefile
	$(MAKE) -C $(builddir)

binary: binary-arch

binary-indep:

binary-arch: build
	rm -rf $(tmpdir) debian/ldap-gateways debian/ldap-utils 
	rm -rf debian/libldap2-dev debian/libldap2 debian/slapd

	install -d -o root -g root -m 755 $(tmpdir)
	$(MAKE) -C $(builddir) DESTDIR=$(tmpdir) install
	mv $(tmpdir)/usr/bin/ud $(tmpdir)/usr/bin/ud-ldap
	mv $(tmpdir)/usr/share/man/man1/ud.1 \
		$(tmpdir)/usr/share/man/man1/ud-ldap.1
	mv $(tmpdir)/usr/sbin/in.xfingerd $(tmpdir)/usr/sbin/in.ldapfingerd
	mv $(tmpdir)/usr/share/man/man8/in.xfingerd.8 \
			$(tmpdir)/usr/share/man/man8/in.ldapfingerd.8
	find $(tmpdir) -type f -a -name \*.default | xargs rm
	chmod -R u+w $(tmpdir)
	chmod -R g-w $(tmpdir)

# Split off ldap-gateways
	install -d -o root -g root -m 755 debian/ldap-gateways/usr/sbin
	install -d -o root -g root -m 755 debian/ldap-gateways/usr/share/man/man8
	install -d -o root -g root -m 755 debian/ldap-gateways/usr/share/ldap

	set -e ; for cmd in go500 go500gw mail500 rp500 fax500 xrpcomp \
		rcpt500 maildap in.ldapfingerd ; do \
		mv $(tmpdir)/usr/sbin/$$cmd debian/ldap-gateways/usr/sbin ; \
		if [ -e $(tmpdir)/usr/share/man/man8/$$cmd.8 -o -L $(tmpdir)/usr/share/man/man8/$$cmd.8 ] ; then \
			mv  $(tmpdir)/usr/share/man/man8/$$cmd.8 \
				debian/ldap-gateways/usr/share/man/man8/ ; \
		fi ; \
		if [ -e $(tmpdir)/usr/share/ldap/$$cmd.help ] ; then \
			mv  $(tmpdir)/usr/share/ldap/$$cmd.help \
				debian/ldap-gateways/usr/share/ldap/ ; \
		fi ; \
	done 

# Split off ldap-utils
	install -d -o root -g root -m 755 debian/ldap-utils/usr/bin
	install -d -o root -g root -m 755 debian/ldap-utils/usr/share/man/man1
	set -e ; for cmd in ldapsearch ldapmodify ldapdelete ldapmodrdn \
		ldapadd ldappasswd ud-ldap ; do \
		mv $(tmpdir)/usr/bin/$$cmd debian/ldap-utils/usr/bin/ ; \
		if [ -e $(tmpdir)/usr/share/man/man1/$$cmd.1 -o -L $(tmpdir)/usr/share/man/man1/$$cmd.1 ] ; then \
			mv  $(tmpdir)/usr/share/man/man1/$$cmd.1 \
				debian/ldap-utils/usr/share/man/man1/ ; \
		fi ; \
	done 
	install -d -o root -g root -m 755 debian/ldap-utils/usr/share/man/man5
	set -e ; for i in ud.conf ldapfriendly ; do \
		mv $(tmpdir)/usr/share/man/man5/$$i.5 \
			debian/ldap-utils/usr/share/man/man5/ ; \
	done
	install -d -o root -g root -m 755 debian/ldap-utils/usr/share/ldap
	mv $(tmpdir)/usr/share/ldap/ldapfriendly \
		debian/ldap-utils/usr/share/ldap/

# Split off libldap2-dev
	install -d -o root -g root -m 755 debian/libldap2-dev/usr/share/man
	mv $(tmpdir)/usr/share/man/man3 debian/libldap2-dev/usr/share/man/

	mv $(tmpdir)/usr/include debian/libldap2-dev/usr/

	install -d -o root -g root -m 755 debian/libldap2-dev/usr/lib
	mv $(tmpdir)/usr/lib/*.so debian/libldap2-dev/usr/lib/
	mv $(tmpdir)/usr/lib/*.a debian/libldap2-dev/usr/lib/
	mv $(tmpdir)/usr/lib/*.la debian/libldap2-dev/usr/lib/

# Split off libldap2
	install -d -o root -g root -m 755 debian/libldap2/usr/share/man/man5
	set -e ; for p in ldap.conf.5 ldapfilter.conf.5 \
		ldapsearchprefs.conf.5 ldaptemplates.conf.5 ; do \
		mv $(tmpdir)/usr/share/man/man5/$$p \
			debian/libldap2/usr/share/man/man5/ ; \
	done
	install -d -o root -g root -m 755 debian/libldap2/etc/ldap
	set -e ; for p in ldap.conf ldapfilter.conf \
		ldapsearchprefs.conf ldaptemplates.conf ; do \
		mv $(tmpdir)/etc/ldap/$$p debian/libldap2/etc/ldap/ ; \
	done

	install -d -o root -g root -m 755 debian/libldap2/usr/lib
	mv $(tmpdir)/usr/lib/liblber.so.* debian/libldap2/usr/lib/
	mv $(tmpdir)/usr/lib/libldap.so.* debian/libldap2/usr/lib/
	mv $(tmpdir)/usr/lib/libldap_r.so.* debian/libldap2/usr/lib/

# Split off slapd
	install -d -o root -g root -m 755 debian/slapd/var/lib/ldap
	install -d -o root -g root -m 755 debian/slapd/var/spool/slurpd
	install -d -o root -g root -m 755 debian/slapd/etc/ldap
	mv $(tmpdir)/etc/ldap/schema debian/slapd/etc/ldap/
	install -d -o root -g root -m 755 debian/slapd/usr/sbin
	install -d -o root -g root -m 755 debian/slapd/usr/share/man/man8
	set -e ; for cmd in slapd slapadd slapcat slapindex slappasswd slurpd ; do \
		mv $(tmpdir)/usr/sbin/$$cmd debian/slapd/usr/sbin/ ; \
		if [ -e $(tmpdir)/usr/share/man/man8/$$cmd.8 ] ; then \
			mv  $(tmpdir)/usr/share/man/man8/$$cmd.8 \
				debian/slapd/usr/share/man/man8/ ; \
		fi ; \
	done 
	install -d -o root -g root -m 755 debian/slapd/usr/share/man/man5
	set -e ; for i in ldif slapd.conf slapd.replog ; do \
		mv $(tmpdir)/usr/share/man/man5/$$i.5 \
			debian/slapd/usr/share/man/man5/ ; \
	done

# Install extra stuff
	install -d -o root -g root -m 755 debian/slapd/usr/share/doc/slapd
	install -p -o root -g root -m 644 debian/slapd.conf \
		debian/slapd/usr/share/doc/slapd/

	install -d -o root -g root -m 755 debian/slapd/etc/init.d
	install -p -o root -g root -m 755 debian/slapd.init \
		debian/slapd/etc/init.d/slapd

# Do the Debian dance
	find debian -regex 'debian/[a-z0-9-]*/usr/share/man/.*' -type f \
		-exec gzip -9 {} \;
	set -e ; for f in $$(find debian -regex 'debian/[a-z0-9-]*/usr/share/man/.*' -type l ) ; do \
		t=$$(readlink $$f) ; \
		rm $$f ; ln -s $$t.gz $$f.gz ; \
	done

	set -e ; for pkg in ldap-gateways ldap-utils libldap2 libldap2-dev \
				slapd ; do \
		install -d -o root -g root -m 755 debian/$$pkg/usr/share/doc/$$pkg ; \
		install -p -o root -g root -m 644 debian/changelog \
			debian/$$pkg/usr/share/doc/$$pkg/changelog.Debian ; \
		gzip -9f debian/$$pkg/usr/share/doc/$$pkg/changelog.Debian ; \
		install -p -o root -g root -m 644 debian/copyright \
			debian/$$pkg/usr/share/doc/$$pkg/ ; \
	done

# Build the packages
	install -d -o root -g root -m 755 debian/libldap2/DEBIAN
	install -p -o root -g root -m 644 debian/libldap2.conffiles \
		debian/libldap2/DEBIAN/conffiles
	install -p -o root -g root -m 644 debian/libldap2.shlibs \
		debian/libldap2/DEBIAN/shlibs
	install -p -o root -g root -m 755 debian/libldap2.postinst \
		debian/libldap2/DEBIAN/postinst
	install -p -o root -g root -m 755 debian/libldap2.prerm \
		debian/libldap2/DEBIAN/prerm

	set -e ; for pkg in ldap-gateways ldap-utils libldap2-dev ; do \
		install -d -o root -g root -m 755 debian/$$pkg/DEBIAN ; \
		sed -e "s/@PK@/$$pkg/g" debian/general.postinst > \
			debian/$$pkg/DEBIAN/postinst ; \
		sed -e "s/@PK@/$$pkg/g" debian/general.prerm > \
			debian/$$pkg/DEBIAN/prerm ; \
		chown root.root debian/$$pkg/DEBIAN/* ; \
		chmod 755 debian/$$pkg/DEBIAN/* ; \
	done

	install -d -o root -g root -m 755 debian/slapd/DEBIAN
	install -p -o root -g root -m 644 debian/slapd.conffiles \
		debian/slapd/DEBIAN/conffiles

	debconf-mergetemplate debian/slapd.templates.de debian/slapd.templates \
		> debian/slapd/DEBIAN/templates
	chmod 644 debian/slapd/DEBIAN/templates

	set -e ; for f in config prerm postinst postrm ; do \
		install -p -o root -g root -m 755 debian/slapd.$$f \
			debian/slapd/DEBIAN/$$f ; \
	done

	set -e ; for pkg in ldap-gateways ldap-utils libldap2-dev libldap2 \
			slapd ; do \
		rm -f debian/substvars ; \
		lst="$$( test -d debian/$$pkg/usr/lib && find debian/$$pkg/usr/lib -type f -a -regex '.*\.so\..*'; \
			test -d debian/$$pkg/usr/bin && find debian/$$pkg/usr/bin -type f ; \
			test -d debian/$$pkg/usr/sbin && find debian/$$pkg/usr/sbin -type f ; true )" ; \
		test -n "$$lst" && ( \
			strip --strip-unneeded --remove-section=.comment --remove-section=.note $$lst || true ; \
			dpkg-shlibdeps $$lst ) ; \
		dpkg-gencontrol -isp -p$$pkg -Pdebian/$$pkg ; \
		dpkg --build debian/$$pkg .. ; \
	done

clean:
	rm -rf debian/build
	rm -f debian/files debian/substvars
	rm -rf $(tmpdir) debian/ldap-gateways debian/ldap-utils 
	rm -rf debian/libldap2-dev debian/libldap2 debian/slapd

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