File: rules

package info (click to toggle)
liblockfile 1.06.1
  • links: PTS
  • area: main
  • in suites: etch, etch-m68k
  • size: 172 kB
  • ctags: 42
  • sloc: ansic: 727; makefile: 151; sh: 51
file content (124 lines) | stat: -rwxr-xr-x 3,939 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
#

# libnfslock
NMVER	= 0
NSOVER	= 0.1

# liblockfile
MVER	= 1
SOVER	= 1.0

tmp	= debian/tmp

build:	config.status
	$(checkdir)
	make
	touch build

config.status:
	./configure --enable-shared --prefix=/usr \
		--with-mailgroup --mandir=/usr/share/man
	
clean:
	[ ! -f Makefile ] || make distclean
	-rm -rf build $(tmp)* debian/files debian/substvars

binary-indep: checkroot
	$(checkdir)

binary-arch: checkroot
	$(checkdir)
	#
	#	First, liblockfile.so.1
	#
	-rm -rf $(tmp)*
	install -d -o root -m 755 $(tmp)
	install -d -o root -m 755 $(tmp)/DEBIAN
	install -d -o root -m 755 $(tmp)/usr/lib
	install -d -o root -m 755 $(tmp)/usr/bin
	install -d -o root -m 755 $(tmp)/usr/share/man/man1
	install -d -o root -m 755 $(tmp)/usr/share/doc/liblockfile1
	#
	install -o root -m 755 debian/postrm $(tmp)/DEBIAN
	install -o root -m 644 debian/shlibs $(tmp)/DEBIAN
	install -o root -m 644 -s liblockfile.so \
		$(tmp)/usr/lib/liblockfile.so.$(SOVER)
	install -o root -m 644 dotlockfile.1 $(tmp)/usr/share/man/man1
	gzip -9f $(tmp)/usr/share/man/*/*
	install -g mail -m 2755 -s dotlockfile $(tmp)/usr/bin/dotlockfile
	ln -s liblockfile.so.$(SOVER) $(tmp)/usr/lib/liblockfile.so.$(MVER)
	install -o root -m 644 debian/changelog \
		$(tmp)/usr/share/doc/liblockfile1/changelog
	gzip -9f $(tmp)/usr/share/doc/liblockfile1/*
	install -o root -m 644 COPYRIGHT \
		$(tmp)/usr/share/doc/liblockfile1/copyright
	dpkg-shlibdeps liblockfile.so
	dpkg-gencontrol -pliblockfile1 -P$(tmp) -isp
	dpkg --build $(tmp) ..
	#
	#	Now build liblockfile-dev
	#
	-rm -rf $(tmp)*
	install -d -o root -m 755 $(tmp)
	install -d -o root -m 755 $(tmp)/DEBIAN
	install -d -o root -m 755 $(tmp)/usr/lib
	install -d -o root -m 755 $(tmp)/usr/include
	install -d -o root -m 755 $(tmp)/usr/share/man/man3
	install -d -o root -m 755 $(tmp)/usr/share/doc/liblockfile-dev
	#
	install -o root -m 644 lockfile.h maillock.h $(tmp)/usr/include
	ln -s liblockfile.so.$(SOVER) $(tmp)/usr/lib/liblockfile.so
	install -o root -m 644 liblockfile.a $(tmp)/usr/lib
	install -o root -m 644 maillock.3 $(tmp)/usr/share/man/man3
	install -o root -m 644 lockfile_create.3 $(tmp)/usr/share/man/man3
	gzip -9f $(tmp)/usr/share/man/*/*
	ln -sf lockfile_create.3.gz $(tmp)/usr/share/man/man3/lockfile_check.3.gz
	ln -sf lockfile_create.3.gz $(tmp)/usr/share/man/man3/lockfile_touch.3.gz
	ln -sf lockfile_create.3.gz $(tmp)/usr/share/man/man3/lockfile_remove.3.gz
	ln -sf maillock.3.gz $(tmp)/usr/share/man/man3/mailunlock.3.gz
	ln -sf maillock.3.gz $(tmp)/usr/share/man/man3/touchlock.3.gz
	install -o root -m 644 debian/changelog \
		$(tmp)/usr/share/doc/liblockfile-dev/changelog
	gzip -9f $(tmp)/usr/share/doc/liblockfile-dev/*
	install -o root -m 644 COPYRIGHT \
		$(tmp)/usr/share/doc/liblockfile-dev/copyright
	dpkg-gencontrol -pliblockfile-dev -P$(tmp) -isp
	dpkg --build $(tmp) ..


binary-nfslock:	checkroot
	#
	#	build libnfslock (OBSOLETE)
	#
	-rm -rf $(tmp)*
	install -d -o root -m 755 $(tmp)
	install -d -o root -m 755 $(tmp)/DEBIAN
	install -d -o root -m 755 $(tmp)/lib
	install -d -o root -m 755 $(tmp)/usr/share/doc/libnfslock
	#
	install -o root -m 644 debian/shlibs.nfslock $(tmp)/DEBIAN/shlibs
	install -o root -m 755 debian/postinst.nfs $(tmp)/DEBIAN/postinst
	install -o root -m 755 debian/prerm.nfs $(tmp)/DEBIAN/prerm
	install -o root -m 644 nfslock.so.$(NSOVER) $(tmp)/lib
	ln -s nfslock.so.$(NSOVER) $(tmp)/lib/nfslock.so.$(NMVER)
	ln -s nfslock.so.$(NSOVER) $(tmp)/lib/nfslock.so
	install -o root -m 644 debian/changelog \
		$(tmp)/usr/share/doc/libnfslock/changelog
	gzip -9f $(tmp)/usr/share/doc/libnfslock/*
	install -o root -m 644 COPYRIGHT \
		$(tmp)/usr/share/doc/libnfslock/copyright
	dpkg-gencontrol -plibnfslock -P$(tmp)
	dpkg --build $(tmp) ..

define checkdir
	test -f lockfile.c -a -f debian/rules
endef

binary: binary-indep binary-arch

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

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