]> git.proxmox.com Git - mirror_smartmontools-debian.git/blob - debian/rules
e51bc08467815ef02ba0be423c6d847da1d95340
[mirror_smartmontools-debian.git] / debian / rules
1 #!/usr/bin/make -f
2 # Sample debian/rules that uses debhelper.
3 # GNU copyright 1997 to 1999 by Joey Hess.
4
5 # Uncomment this to turn on verbose mode.
6 #export DH_VERBOSE=1
7
8 # for quilt
9 include /usr/share/quilt/quilt.make
10
11
12 CFLAGS += -fsigned-char -Wall
13 ifneq (,$(findstring noopt,$(DEB_BUILD_OPTIONS)))
14 CFLAGS += -O0
15 else
16 CFLAGS += -O2
17 endif
18 ifeq (,$(findstring nostrip,$(DEB_BUILD_OPTIONS)))
19 INSTALL_PROGRAM = install -s
20 else
21 INSTALL_PROGRAM = install
22 endif
23
24 PACKAGE = smartmontools
25 SRC_VERSION := $(shell dpkg-parsechangelog | sed -ne 's/^Version: \(.*\)-.*/\1/p'| cut -d':' -f2)
26 SVN_REVISION := $(shell echo $(SRC_VERSION) | awk -F"+" '{ print $$2 }' | sed 's/svn//' )
27 TARBALL = $(PACKAGE)_$(SRC_VERSION).orig.tar.gz
28
29 get-orig-source:
30 rm -rf get-orig-source $(TARBALL)
31 mkdir get-orig-source
32 svn export -r $(SVN_REVISION) https://smartmontools.svn.sourceforge.net/svnroot/smartmontools/trunk/smartmontools/ \
33 get-orig-source/$(PACKAGE)-$(SRC_VERSION).orig
34 #rm -rf get-orig-source/$(PACKAGE)-$(SRC_VERSION).orig/debian
35 #cd get-orig-source/$(PACKAGE)-$(SRC_VERSION).orig/ ; sh ../../debian/remove-nonfree.sh
36 GZIP=--best tar czf $(TARBALL) -C get-orig-source $(PACKAGE)-$(SRC_VERSION).orig
37 rm -rf get-orig-source
38 echo " "$(TARBALL)" created; move it to the right destination to build the package"
39
40 configure: configure-stamp
41 configure-stamp: debian/stamp-patched
42 dh_testdir
43 ./autogen.sh
44 CFLAGS="${CFLAGS}" ./configure --prefix=/usr \
45 --sysconfdir=/etc \
46 --mandir=/usr/share/man \
47 --with-initscriptdir=/etc/init.d \
48 --with-docdir=/usr/share/doc/smartmontools
49
50 touch configure-stamp
51
52
53 build: build-stamp
54 build-stamp: configure-stamp
55 dh_testdir
56
57 # Add here commands to compile the package.
58 $(MAKE)
59
60 #/usr/bin/docbook-to-man debian/smartmontools.sgml > smartmontools.1
61
62 touch build-stamp
63
64 clean: unpatch
65 dh_testdir
66 dh_testroot
67 # rm -f debian/logcheck.logcheck.ignore.*
68
69 # Add here commands to clean up after the build process.
70 [ ! -f Makefile ] || $(MAKE) distclean
71 rm -f build-stamp configure-stamp \
72 Makefile.in examplescripts/Makefile.in aclocal.m4 configure
73 dh_clean
74
75 install: build
76 dh_testdir
77 dh_testroot
78 dh_prep
79 dh_installdirs
80
81 $(MAKE) DESTDIR=$(CURDIR)/debian/smartmontools \
82 INSTALL_PROGRAM="${INSTALL_PROGRAM}" install-sbinPROGRAMS
83 $(MAKE) DESTDIR=$(CURDIR)/debian/smartmontools \
84 install-sysconfDATA
85 $(MAKE) DESTDIR=$(CURDIR)/debian/smartmontools \
86 install-man
87 $(MAKE) DESTDIR=$(CURDIR)/debian/smartmontools \
88 examplesdir='$$(docdir)/examples' \
89 -C examplescripts/ install-examplesSCRIPTS install-examplesDATA
90
91 install -D -m 755 debian/smartmontools-bug \
92 $(CURDIR)/debian/smartmontools/usr/share/bug/smartmontools
93 install -D -m 755 debian/smartd-runner \
94 $(CURDIR)/debian/smartmontools/usr/share/smartmontools/smartd-runner
95 install -D -m 755 debian/10mail \
96 $(CURDIR)/debian/smartmontools/etc/smartmontools/run.d/10mail
97
98 # Build architecture-independent files here.
99 binary-indep:
100 # We have nothing to do by default.
101
102 # Build architecture-dependent files here.
103 binary-arch: build install
104 dh_testdir
105 dh_testroot
106 # dh_installdebconf
107 dh_installdocs
108 dh_installexamples
109 dh_installmenu
110 dh_installlogrotate
111 # dh_installemacsen
112 # dh_installpam
113 # dh_installmime
114 dh_installinit -- start 20 2 3 4 5 . stop 20 1 .
115 dh_installcron
116 dh_installman
117 dh_installinfo
118 dh_lintian
119 # dh_installlogcheck
120 # dh_undocumented
121 dh_installchangelogs CHANGELOG
122 dh_link
123 dh_strip
124 dh_compress
125 dh_fixperms
126 # dh_makeshlibs
127 dh_installdeb
128 # dh_perl
129 dh_shlibdeps
130 dh_gencontrol
131 dh_md5sums
132 dh_builddeb
133
134 binary: binary-indep binary-arch
135 .PHONY: build clean binary-indep binary-arch binary install configure get-orig-source