summaryrefslogtreecommitdiff
path: root/debian/rules
blob: c137da0dc6ec3b2ec113a17e35eaf8b30857c0dd (plain)
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
#!/usr/bin/make -f

include /usr/share/quilt/quilt.make

# hacks to avoid running these things during the build
export ACLOCAL    = : aclocal
export AUTOCONF   = : autoconf
export AUTOMAKE   = : automake
export AUTOHEADER = : autoheader

config: patch config.status
config.status: $(QUILT_STAMPFN)
	dh_testdir
	./configure --prefix=/usr \
		--enable-all-clocks --enable-parse-clocks --enable-SHM \
		--disable-debugging --sysconfdir=/var/lib/ntp \
		--disable-errorcache --with-sntp=no \
		--enable-linuxcaps \
		--disable-dependency-tracking

build: config build-stamp
build-stamp: config.status
	dh_testdir
	$(MAKE)
	touch $@

clean: clean-patched unpatch
clean-patched:
	dh_testdir
	dh_testroot
	rm -f build-stamp 
	-$(MAKE) -i -k distclean

	-test -r /usr/share/misc/config.sub && \
		cp -f /usr/share/misc/config.sub config.sub
	-test -r /usr/share/misc/config.guess && \
		cp -f /usr/share/misc/config.guess config.guess

	dh_clean

install: build-stamp
	dh_testdir
	dh_testroot
	dh_clean -k
	dh_installdirs

	$(MAKE) install bindir=`pwd`/debian/ntp/usr/sbin prefix=`pwd`/debian/ntp/usr

	# move the user-space programs from /usr/sbin to /usr/bin
	for file in ntpq ntpdc ntptrace; do \
		mv debian/ntp/usr/sbin/$$file debian/ntp/usr/bin/$$file || exit; \
	done

	install -D -m 0755 debian/ntp.ifup debian/ntp/etc/network/if-up.d/ntp
	install -D -m 0755 scripts/ntpsweep debian/ntp/usr/bin/ntpsweep

	install -D -m 0644 debian/ntpsweep.1 debian/ntp/usr/share/man/man1/ntpsweep.1
	install -D -m 0644 debian/ntpdate.1 debian/ntpdate/usr/share/man/man1/ntpdate.1
	install -D -m 0644 debian/ntpd.1 debian/ntp/usr/share/man/man1/ntpd.1
	for file in ntpdc ntp-keygen ntp-wait ntpq ntptrace tickadj ntptime; do \
		install -D -m 0644 debian/useless.1 debian/ntp/usr/share/man/man1/$$file.1 || exit; \
	done

	install -D -m 0644 debian/ntp.conf debian/ntp/etc/ntp.conf
	install -D -m 0644 debian/useless.5 debian/ntp/usr/share/man/man5/ntp.conf.5

	dh_movefiles --sourcedir=debian/ntp

binary-indep: build install
	dh_testdir -i
	dh_testroot -i
	dh_installdocs -i html
	rm -f debian/ntp-doc/usr/share/doc/ntp-doc/html/hints/solaris*
	dh_installexamples -i
	dh_installcron -i
	dh_installlogcheck -i
	dh_installchangelogs -i
	dh_compress -i
	dh_fixperms -i
	dh_installdeb -i
	dh_gencontrol -i
	dh_md5sums -i
	dh_builddeb -i

binary-arch: build install
	dh_testdir -a
	dh_testroot -a
	dh_installdocs -a
	dh_installexamples -a
	dh_installinit -pntp --update-rcd-params="defaults 23" 
	dh_installinit -pntpdate --update-rcd-params="start 51 S ." --init-script=ntpdate
	dh_installcron -a
	dh_installlogcheck -a
	dh_installchangelogs -a
	dh_strip -a
	dh_compress -a
	dh_fixperms -a
	dh_installdeb -a
	dh_shlibdeps -a
	dh_gencontrol -a
	dh_md5sums -a
	dh_builddeb -a

binary: binary-indep binary-arch
.PHONY: build clean binary-indep binary-arch binary install patch unpatch clean-patched