1 | #!/usr/bin/make -f
|
---|
2 | # Samhain debian/rules
|
---|
3 | # GNU copyright 20001 to 2003 by Javier Fernandez-Sanguino
|
---|
4 | # based on
|
---|
5 | # Sample debian/rules that uses debhelper.
|
---|
6 | # GNU copyright 1997 to 1999 by Joey Hess.
|
---|
7 | # Modified to use mydefargs by Rainer Wichmann.
|
---|
8 | #
|
---|
9 |
|
---|
10 | # Uncomment this to turn on verbose mode.
|
---|
11 | #export DH_VERBOSE=1
|
---|
12 |
|
---|
13 | # This is the debhelper compatability version to use.
|
---|
14 | export DH_COMPAT=4
|
---|
15 |
|
---|
16 | package=@install_name@
|
---|
17 |
|
---|
18 | # CAVEAT: including the --enable-base= option is for packages to be
|
---|
19 | # distributed INTERNALLY on your network, NOT for packages
|
---|
20 | # to be distributed to THIRD PARTIES
|
---|
21 |
|
---|
22 | build: build-stamp
|
---|
23 | build-stamp:
|
---|
24 | dh_testdir
|
---|
25 | @top_srcdir@/configure @mydefargs@
|
---|
26 | $(MAKE)
|
---|
27 | echo '#!/bin/sh' > ./sstrip
|
---|
28 | echo 'echo "*** SSTRIP DISABLED ***"' >> ./sstrip
|
---|
29 | if ! test x$(PASSWORD) = x; then \
|
---|
30 | if test -f samhain_setpwd; then \
|
---|
31 | ./samhain_setpwd samhain new $(PASSWORD); \
|
---|
32 | rm samhain; \
|
---|
33 | mv samhain.new samhain; \
|
---|
34 | fi; \
|
---|
35 | fi
|
---|
36 | touch build-stamp
|
---|
37 |
|
---|
38 | clean:
|
---|
39 | dh_testdir
|
---|
40 | dh_testroot
|
---|
41 | rm -f build-stamp
|
---|
42 | -[ -f Makefile ] && $(MAKE) distclean
|
---|
43 | dh_clean
|
---|
44 |
|
---|
45 | install: build
|
---|
46 | dh_testdir
|
---|
47 | dh_testroot
|
---|
48 | dh_clean -k
|
---|
49 | dh_installdirs
|
---|
50 |
|
---|
51 | # Fix the permissions
|
---|
52 | #chmod o-rX `pwd`/debian/tmp/var/log/samhain \
|
---|
53 | # `pwd`/debian/tmp/var/run/samhain \
|
---|
54 | # `pwd`/debian/tmp/var/lib/samhain \
|
---|
55 | # `pwd`/debian/tmp/etc/samhain
|
---|
56 |
|
---|
57 | # $(MAKE) install install-boot DESTDIR=`pwd`/debian/tmp
|
---|
58 | $(MAKE) install install-boot DESTDIR=`pwd`/debian/@install_name@
|
---|
59 |
|
---|
60 | # However, remove the rc.d links
|
---|
61 | -rm -rf `pwd`/debian/tmp/etc/rc?.d
|
---|
62 |
|
---|
63 | # install -m 755 encode `pwd`/debian/tmp/usr/bin/samhain_encode
|
---|
64 |
|
---|
65 | # install -m 644 profiles/debianlinux_i386/samhainrc `pwd`/debian/tmp@myconffile@
|
---|
66 | # install -m 644 debian/samhain.logrotate `pwd`/debian/tmp/etc/logrotate.d/samhain
|
---|
67 |
|
---|
68 | # Build architecture-independent files here.
|
---|
69 | binary-indep: build install
|
---|
70 | # We have nothing to do by default.
|
---|
71 |
|
---|
72 |
|
---|
73 | # Build architecture-dependent files here.
|
---|
74 | binary-arch: build install
|
---|
75 | # dh_testversion
|
---|
76 | dh_testdir
|
---|
77 | dh_testroot
|
---|
78 | dh_installdebconf
|
---|
79 | dh_installdocs
|
---|
80 | [ -f debian/@install_name@/usr/share/doc/@install_name@/MANUAL-2_4.html.tar ] && \
|
---|
81 | cd debian/@install_name@/usr/share/doc/@install_name@ && \
|
---|
82 | tar xf MANUAL-2_4.html.tar && mv MANUAL-2_4 manual.html && \
|
---|
83 | rm -f MANUAL-2_4.html.tar && \
|
---|
84 | mv MANUAL-2_4.pdf manual.pdf
|
---|
85 | dh_installexamples @top_srcdir@/scripts/example_pager.pl \
|
---|
86 | @top_srcdir@/scripts/example_sms.pl \
|
---|
87 | @top_srcdir@/scripts/concat.pl \
|
---|
88 | @top_srcdir@/scripts/samhain.logrotator \
|
---|
89 | @top_srcdir@/scripts/samhainadmin.pl \
|
---|
90 | @top_srcdir@/scripts/check_samhain.pl \
|
---|
91 | @top_srcdir@/yulerc.template \
|
---|
92 | @top_srcdir@/samhainrc.linux
|
---|
93 | dh_installmenu
|
---|
94 | dh_installinit -- defaults 19
|
---|
95 | [ -f debian/@install_name@.postinst.debhelper ] && \
|
---|
96 | cd debian && \
|
---|
97 | cat @install_name@.postinst.debhelper | \
|
---|
98 | sed 's%/etc/init.d/@install_name@ start%:%' > postinst.tmp && \
|
---|
99 | mv postinst.tmp @install_name@.postinst.debhelper
|
---|
100 | [ -f debian/@install_name@.postinst.debhelper ] && \
|
---|
101 | cd debian && \
|
---|
102 | cat @install_name@.postinst.debhelper | \
|
---|
103 | sed 's%invoke-rc.d @install_name@ start%:%' > postinst.tmp && \
|
---|
104 | mv postinst.tmp @install_name@.postinst.debhelper
|
---|
105 | [ -f debian/@install_name@.prerm.debhelper ] && \
|
---|
106 | cd debian && \
|
---|
107 | cat @install_name@.prerm.debhelper | \
|
---|
108 | sed 's%/etc/init.d/@install_name@ stop%/etc/init.d/@install_name@ stop || echo service @install_name@ already stopped%' > prerm.tmp && \
|
---|
109 | mv prerm.tmp @install_name@.prerm.debhelper
|
---|
110 | [ -f debian/@install_name@.prerm.debhelper ] && \
|
---|
111 | cd debian && \
|
---|
112 | cat @install_name@.prerm.debhelper | \
|
---|
113 | sed 's%invoke-rc.d @install_name@ stop%invoke-rc.d @install_name@ stop || echo service @install_name@ already stopped%' > prerm.tmp && \
|
---|
114 | mv prerm.tmp @install_name@.prerm.debhelper
|
---|
115 | # dh_installmanpages
|
---|
116 | dh_installchangelogs @top_srcdir@/docs/Changelog
|
---|
117 | dh_link
|
---|
118 | dh_strip
|
---|
119 | dh_compress
|
---|
120 | dh_fixperms
|
---|
121 | dh_installdeb
|
---|
122 | dh_shlibdeps
|
---|
123 | dh_gencontrol
|
---|
124 | dh_md5sums
|
---|
125 | dh_builddeb
|
---|
126 |
|
---|
127 |
|
---|
128 | define checkdir
|
---|
129 | test -f debian/rules
|
---|
130 | endef
|
---|
131 |
|
---|
132 | binary: binary-indep binary-arch
|
---|
133 | .PHONY: build clean binary-indep binary-arch binary install
|
---|
134 |
|
---|