]> git.proxmox.com Git - mirror_smartmontools-debian.git/blob - debian/rules
425b774d5200f8d28c2d084f92f04ceb9002e6ea
[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 DEB_BUILD_ARCH_OS ?= $(shell dpkg-architecture -qDEB_BUILD_ARCH_OS)
9 DEB_BUILD_ARCH_CPU ?= $(shell dpkg-architecture -qDEB_BUILD_ARCH_CPU)
10
11 ifeq ($(DEB_HOST_ARCH_OS),linux)
12 CONFIGURE_ARGS += --with-selinux
13 endif
14
15 CFLAGS += -fsigned-char -Wall
16 ifneq (,$(findstring noopt,$(DEB_BUILD_OPTIONS)))
17 CFLAGS += -O0
18 else
19 CFLAGS += -O2
20 endif
21 ifeq (,$(findstring nostrip,$(DEB_BUILD_OPTIONS)))
22 INSTALL_PROGRAM = install -s
23 else
24 INSTALL_PROGRAM = install
25 endif
26
27 PACKAGE = smartmontools
28 SRC_VERSION := $(shell dpkg-parsechangelog | sed -ne 's/^Version: \(.*\)-.*/\1/p'| cut -d':' -f2)
29 SVN_REVISION := $(shell echo $(SRC_VERSION) | awk -F"+" '{ print $$2 }' | sed 's/svn//' )
30 TARBALL = $(PACKAGE)_$(SRC_VERSION).orig.tar.gz
31
32 get-orig-source:
33 rm -rf get-orig-source $(TARBALL)
34 mkdir get-orig-source
35 svn export -r $(SVN_REVISION) https://smartmontools.svn.sourceforge.net/svnroot/smartmontools/trunk/smartmontools/ \
36 get-orig-source/$(PACKAGE)-$(SRC_VERSION).orig
37 GZIP=--best tar czf $(TARBALL) -C get-orig-source $(PACKAGE)-$(SRC_VERSION).orig
38 rm -rf get-orig-source
39 echo " "$(TARBALL)" created; move it to the right destination to build the package"
40
41 configure: configure-stamp
42 configure-stamp:
43 dh_testdir
44 ./autogen.sh
45 CFLAGS="${CFLAGS}" ./configure --prefix=/usr \
46 --sysconfdir=/etc \
47 --mandir=/usr/share/man \
48 --with-initscriptdir=no \
49 --with-docdir=/usr/share/doc/smartmontools \
50 --enable-drivedb \
51 --enable-savestates \
52 --enable-attributelog \
53 --with-savestates=/var/lib/smartmontools/smartd. \
54 --with-attributelog=/var/lib/smartmontools/attrlog. \
55 --with-exampledir=/usr/share/doc/smartmontools/examples/ \
56 ${CONFIGURE_ARGS}
57 touch configure-stamp
58
59
60 build: build-stamp
61 build-stamp: configure-stamp
62 dh_testdir
63 # Add here commands to compile the package.
64 $(MAKE)
65 touch build-stamp
66
67 clean:
68 dh_testdir
69 dh_testroot
70 # rm -f debian/logcheck.logcheck.ignore.*
71 # Add here commands to clean up after the build process.
72 [ ! -f Makefile ] || $(MAKE) distclean
73 rm -f build-stamp configure-stamp \
74 Makefile.in examplescripts/Makefile.in aclocal.m4 configure
75 dh_clean
76
77 install: build
78 dh_testdir
79 dh_testroot
80 dh_prep
81 dh_installdirs
82 $(MAKE) DESTDIR=$(CURDIR)/debian/smartmontools install
83 install -D -m 755 debian/smartmontools-bug \
84 $(CURDIR)/debian/smartmontools/usr/share/bug/smartmontools
85
86 # Build architecture-independent files here.
87 binary-indep:
88 # We have nothing to do by default.
89
90 # Build architecture-dependent files here.
91 binary-arch: build install
92 dh_testdir
93 dh_testroot
94 dh_installdocs
95 dh_installexamples
96 dh_installmenu
97 dh_installlogrotate
98 dh_install
99 dh_installinit -- start 20 2 3 4 5 . stop 20 1 .
100 dh_installcron
101 dh_installman
102 dh_installinfo
103 dh_lintian
104 dh_installchangelogs CHANGELOG
105 dh_link
106 dh_strip
107 dh_compress
108 dh_fixperms
109 chmod 755 $(CURDIR)/debian/smartmontools/etc/smartmontools/run.d/10mail \
110 $(CURDIR)/debian/smartmontools/etc/smartmontools/run.d/10powersave-notify \
111 $(CURDIR)/debian/smartmontools/usr/share/smartmontools/smartd-runner
112 dh_makeshlibs
113 dh_installdeb
114 dh_shlibdeps
115 dh_gencontrol
116 dh_md5sums
117 dh_builddeb
118
119 binary: binary-indep binary-arch
120 .PHONY: build clean binary-indep binary-arch binary install configure get-orig-source