File: rules

package info (click to toggle)
ipsvd 0.11.0-2
  • links: PTS
  • area: main
  • in suites: sarge
  • size: 116 kB
  • ctags: 7
  • sloc: makefile: 60
file content (75 lines) | stat: -rwxr-xr-x 2,059 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
#!/usr/bin/make -f

STRIP =strip
ifneq (,$(findstring nostrip,$(DEB_BUILD_OPTIONS)))
  STRIP =: nostrip
endif

CFLAGS =-g -O2 -Wall
LDFLAGS =-Os
CC =gcc
ifneq (,$(findstring diet,$(DEB_BUILD_OPTIONS)))
  CC =diet -v -Os gcc -nostdinc
endif

DIR =$(shell pwd)/debian/ipsvd

unpack: deb-checkdir unpack-stamp
unpack-stamp:
	tar xzf ipsvd-0.11.0.tar.gz
	ln -s ipsvd-0.11.0 net/ipsvd
	(cd net/ipsvd && patch -p0) <debian/diff/sslio.check.diff
	echo '$(CC) $(CFLAGS)' >net/ipsvd/src/conf-cc
	echo '$(CC) $(LDFLAGS)' >net/ipsvd/src/conf-ld
	touch unpack-stamp

build: deb-checkdir build-stamp
build-stamp: unpack-stamp
	-gcc -v
	$(MAKE) -Cnet/ipsvd/src default check
	if test -r /usr/include/matrixSsl.h; then \
	  (cd net/ipsvd/src && \
	  ./compile sslio.c && ./compile sslerror_str.c && \
	  ./load sslio uidgid.o sslerror_str.o unix.a byte.a time.a -lmatrixssl && \
	  ./check-local sslio); \
	fi
	touch build-stamp

clean: deb-checkdir deb-checkuid
	rm -rf net
	rm -f unpack-stamp build-stamp
	rm -rf '$(DIR)'
	rm -f debian/files debian/substvars changelog

install: deb-checkdir deb-checkuid build-stamp
	rm -rf '$(DIR)'
	# programs
	install -d -m0755 '$(DIR)'/usr/bin
	for i in tcpsvd udpsvd ipsvd-cdb; do \
	  install -m0755 net/ipsvd/src/$$i '$(DIR)'/usr/bin/ || exit 1; \
	done
	test ! -x net/ipsvd/src/sslio || \
	  install -m0755 net/ipsvd/src/sslio '$(DIR)'/usr/bin/
	$(STRIP) -R .comment -R .note '$(DIR)'/usr/bin/*
	# man pages
	for i in 5 7 8; do \
	  install -d -m0755 '$(DIR)'/usr/share/man/man$$i && \
	  for j in net/ipsvd/man/*.$$i; do \
	    install -m0644 $$j '$(DIR)'/usr/share/man/man$$i/ || exit 1; \
	  done || exit 1; \
	done
	gzip -9 '$(DIR)'/usr/share/man/man?/*.?
	# changelog
	rm -f changelog && ln -s net/ipsvd/package/CHANGES changelog

binary-indep:

binary-arch: install ipsvd.deb
	test '$(CC)' != 'gcc' || dpkg-shlibdeps '$(DIR)'/usr/bin/*
	dpkg-gencontrol -isp -pipsvd -P'$(DIR)'
	dpkg -b '$(DIR)' ..

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

include debian/implicit