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