[1] | 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=1
|
---|
| 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 | touch build-stamp
|
---|
| 30 |
|
---|
| 31 | clean:
|
---|
| 32 | dh_testdir
|
---|
| 33 | dh_testroot
|
---|
| 34 | rm -f build-stamp
|
---|
| 35 | -[ -f Makefile ] && $(MAKE) distclean
|
---|
| 36 | dh_clean
|
---|
| 37 |
|
---|
| 38 | install: build
|
---|
| 39 | dh_testdir
|
---|
| 40 | dh_testroot
|
---|
| 41 | dh_clean -k
|
---|
| 42 | dh_installdirs
|
---|
| 43 |
|
---|
| 44 | # Fix the permissions
|
---|
| 45 | #chmod o-rX `pwd`/debian/tmp/var/log/samhain \
|
---|
| 46 | # `pwd`/debian/tmp/var/run/samhain \
|
---|
| 47 | # `pwd`/debian/tmp/var/state/samhain \
|
---|
| 48 | # `pwd`/debian/tmp/etc/samhain
|
---|
| 49 |
|
---|
| 50 | $(MAKE) install install-boot DESTDIR=`pwd`/debian/tmp
|
---|
| 51 |
|
---|
| 52 | # However, remove the rc.d links
|
---|
| 53 | -rm -rf `pwd`/debian/tmp/etc/rc?.d
|
---|
| 54 |
|
---|
| 55 | # install -m 755 encode `pwd`/debian/tmp/usr/bin/samhain_encode
|
---|
| 56 |
|
---|
| 57 | # install -m 644 profiles/debianlinux_i386/samhainrc `pwd`/debian/tmp@myconffile@
|
---|
| 58 | # install -m 644 debian/samhain.logrotate `pwd`/debian/tmp/etc/logrotate.d/samhain
|
---|
| 59 |
|
---|
| 60 | # Build architecture-independent files here.
|
---|
| 61 | binary-indep: build install
|
---|
| 62 | # We have nothing to do by default.
|
---|
| 63 |
|
---|
| 64 |
|
---|
| 65 | # Build architecture-dependent files here.
|
---|
| 66 | binary-arch: build install
|
---|
| 67 | # dh_testversion
|
---|
| 68 | dh_testdir
|
---|
| 69 | dh_testroot
|
---|
| 70 | dh_installdebconf
|
---|
| 71 | dh_installdocs
|
---|
[68] | 72 | [ -f debian/tmp/usr/share/doc/@install_name@/MANUAL-2_3.html.tar ] && \
|
---|
[1] | 73 | cd debian/tmp/usr/share/doc/@install_name@ && \
|
---|
[68] | 74 | tar xf MANUAL-2_3.html.tar && mv MANUAL-2_3 manual.html && \
|
---|
| 75 | rm -f MANUAL-2_3.html.tar
|
---|
[1] | 76 | dh_installexamples @top_srcdir@/scripts/example_pager.pl \
|
---|
| 77 | @top_srcdir@/scripts/example_sms.pl \
|
---|
| 78 | @top_srcdir@/scripts/report.pl \
|
---|
| 79 | @top_srcdir@/scripts/concat.pl \
|
---|
| 80 | @top_srcdir@/scripts/samhain.logrotator \
|
---|
| 81 | @top_srcdir@/scripts/samhainadmin.pl \
|
---|
| 82 | @top_srcdir@/scripts/check_samhain.pl \
|
---|
| 83 | @top_srcdir@/yulerc.template \
|
---|
| 84 | @top_srcdir@/samhainrc.linux
|
---|
| 85 | dh_installmenu
|
---|
| 86 | dh_installinit -- defaults 19
|
---|
| 87 | [ -f debian/postinst.debhelper ] && \
|
---|
| 88 | cd debian && \
|
---|
| 89 | cat postinst.debhelper | \
|
---|
| 90 | sed 's%/etc/init.d/@install_name@ start%:%' > postinst.tmp && \
|
---|
| 91 | mv postinst.tmp postinst.debhelper
|
---|
[65] | 92 | [ -f debian/postinst.debhelper ] && \
|
---|
| 93 | cd debian && \
|
---|
| 94 | cat postinst.debhelper | \
|
---|
| 95 | sed 's%invoke-rc.d @install_name@ start%:%' > postinst.tmp && \
|
---|
| 96 | mv postinst.tmp postinst.debhelper
|
---|
[1] | 97 | [ -f debian/prerm.debhelper ] && \
|
---|
| 98 | cd debian && \
|
---|
| 99 | cat prerm.debhelper | \
|
---|
| 100 | sed 's%/etc/init.d/@install_name@ stop%/etc/init.d/@install_name@ stop || echo service @install_name@ already stopped%' > prerm.tmp && \
|
---|
| 101 | mv prerm.tmp prerm.debhelper
|
---|
[65] | 102 | [ -f debian/prerm.debhelper ] && \
|
---|
| 103 | cd debian && \
|
---|
| 104 | cat prerm.debhelper | \
|
---|
| 105 | sed 's%invoke-rc.d @install_name@ stop%invoke-rc.d @install_name@ stop || echo service @install_name@ already stopped%' > prerm.tmp && \
|
---|
| 106 | mv prerm.tmp prerm.debhelper
|
---|
[1] | 107 | # dh_installmanpages
|
---|
| 108 | dh_installchangelogs @top_srcdir@/docs/Changelog
|
---|
| 109 | dh_link
|
---|
| 110 | # dh_strip
|
---|
| 111 | dh_compress
|
---|
| 112 | dh_fixperms
|
---|
| 113 | dh_installdeb
|
---|
| 114 | dh_shlibdeps
|
---|
| 115 | dh_gencontrol
|
---|
| 116 | dh_md5sums
|
---|
| 117 | dh_builddeb
|
---|
| 118 |
|
---|
| 119 |
|
---|
| 120 | define checkdir
|
---|
| 121 | test -f debian/rules
|
---|
| 122 | endef
|
---|
| 123 |
|
---|
| 124 | binary: binary-indep binary-arch
|
---|
| 125 | .PHONY: build clean binary-indep binary-arch binary install
|
---|
| 126 |
|
---|