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