]> git.proxmox.com Git - mirror_smartmontools-debian.git/blame - debian/rules
Fixed postinst script: Version is only valid when configuring.
[mirror_smartmontools-debian.git] / debian / rules
CommitLineData
20259a08
GG
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.
8b3c2089 6#export DH_VERBOSE=1
2040f049 7
1aabc0aa
GI
8export DEB_BUILD_MAINT_OPTIONS = hardening=+all
9DPKG_EXPORT_BUILDFLAGS = 1
10include /usr/share/dpkg/buildflags.mk
0f1c16c6 11
0b361a55
TF
12DEB_BUILD_GNU_TYPE ?= $(shell dpkg-architecture -qDEB_BUILD_GNU_TYPE)
13DEB_HOST_GNU_TYPE ?= $(shell dpkg-architecture -qDEB_HOST_GNU_TYPE)
a7e19a33 14
a117ede1
GI
15ifeq ($(DEB_HOST_ARCH_OS),linux)
16 CONFIGURE_ARGS += --with-selinux
17endif
20259a08 18
827d3b2c
ED
19ifeq ($(DEB_HOST_ARCH_OS),kfreebsd)
20 CFLAGS += -I/usr/include/freebsd
21endif
22
35bece35 23CFLAGS += -fsigned-char -Wall
20259a08
GG
24ifneq (,$(findstring noopt,$(DEB_BUILD_OPTIONS)))
25 CFLAGS += -O0
26else
27 CFLAGS += -O2
28endif
29ifeq (,$(findstring nostrip,$(DEB_BUILD_OPTIONS)))
30 INSTALL_PROGRAM = install -s
31else
32 INSTALL_PROGRAM = install
33endif
34
35bece35
GI
35PACKAGE = smartmontools
36SRC_VERSION := $(shell dpkg-parsechangelog | sed -ne 's/^Version: \(.*\)-.*/\1/p'| cut -d':' -f2)
37SVN_REVISION := $(shell echo $(SRC_VERSION) | awk -F"+" '{ print $$2 }' | sed 's/svn//' )
38TARBALL = $(PACKAGE)_$(SRC_VERSION).orig.tar.gz
39
40get-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
a5a9d5b7 45 rm -rf get-orig-source/$(PACKAGE)-$(SRC_VERSION).orig/os_solaris_ata.s
35bece35
GI
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"
2040f049 49
20259a08 50configure: configure-stamp
d3fc9d11 51configure-stamp:
20259a08 52 dh_testdir
2040f049 53 ./autogen.sh
827d3b2c 54 CFLAGS="${CFLAGS}" CXXFLAGS="${CFLAGS}" ./configure --prefix=/usr \
0b361a55
TF
55 --build=$(DEB_BUILD_GNU_TYPE) \
56 --host=$(DEB_HOST_GNU_TYPE) \
20259a08
GG
57 --sysconfdir=/etc \
58 --mandir=/usr/share/man \
65c801fb 59 --with-initscriptdir=no \
0197215a 60 --with-docdir=/usr/share/doc/smartmontools \
b1b3452c
GI
61 --enable-drivedb \
62 --enable-savestates \
63 --enable-attributelog \
1e46e09b
GI
64 --with-savestates=/var/lib/smartmontools/smartd. \
65 --with-attributelog=/var/lib/smartmontools/attrlog. \
f8250f31 66 --with-exampledir=/usr/share/doc/smartmontools/examples/ \
5ae3fa9e 67 --with-drivedbdir=/var/lib/smartmontools/drivedb \
9804b75c 68 --with-systemdsystemunitdir=/lib/systemd/system \
3478a98f 69 --with-smartdscriptdir=/usr/share/smartmontools \
03a62f0c
GI
70 --with-smartdplugindir=/etc/smartmontools/smartd_warning.d \
71 --with-systemdenvfile=/etc/default/smartmontools \
683ec72b 72 ${CONFIGURE_ARGS}
20259a08
GG
73 touch configure-stamp
74
8f14e44e
GI
75build: build-arch build-indep
76build-arch: build-stamp
77build-indep: build-stamp
2040f049 78build-stamp: configure-stamp
20259a08 79 dh_testdir
20259a08
GG
80 # Add here commands to compile the package.
81 $(MAKE)
20259a08
GG
82 touch build-stamp
83
d3fc9d11 84clean:
20259a08
GG
85 dh_testdir
86 dh_testroot
20259a08 87 # rm -f debian/logcheck.logcheck.ignore.*
20259a08 88 # Add here commands to clean up after the build process.
a52f90d4 89 [ ! -f Makefile ] || $(MAKE) distclean
4d98553f 90 rm -f build-stamp configure-stamp \
1b4c984c 91 Makefile.in examplescripts/Makefile.in aclocal.m4 configure
20259a08
GG
92 dh_clean
93
94install: build
95 dh_testdir
96 dh_testroot
608687b1 97 dh_prep
20259a08 98 dh_installdirs
0711e68a 99 $(MAKE) DESTDIR=$(CURDIR)/debian/smartmontools install
20259a08
GG
100
101# Build architecture-independent files here.
a19d514d 102binary-indep:
20259a08
GG
103# We have nothing to do by default.
104
105# Build architecture-dependent files here.
106binary-arch: build install
107 dh_testdir
108 dh_testroot
20259a08
GG
109 dh_installdocs
110 dh_installexamples
111 dh_installmenu
486adbce 112 dh_installlogrotate
31e40f75 113 dh_install
9804b75c
GI
114 dh_link
115 dh_systemd_enable
9afe5af0 116 dh_installinit -- start 20 2 3 4 5 . stop 20 1 .
9804b75c 117 dh_systemd_enable
20259a08 118 dh_installcron
a26a490b 119 dh_installman debian/update-smart-drivedb.8
20259a08 120 dh_installinfo
fd9c6756 121 dh_lintian
841c1a8e 122 dh_installchangelogs ChangeLog
20259a08
GG
123 dh_strip
124 dh_compress
125 dh_fixperms
31e40f75 126 chmod 755 $(CURDIR)/debian/smartmontools/etc/smartmontools/run.d/10mail \
52b4501b 127 $(CURDIR)/debian/smartmontools/etc/smartmontools/run.d/10powersave-notify \
31e40f75
GI
128 $(CURDIR)/debian/smartmontools/usr/share/smartmontools/smartd-runner
129 dh_makeshlibs
20259a08 130 dh_installdeb
20259a08
GG
131 dh_shlibdeps
132 dh_gencontrol
133 dh_md5sums
134 dh_builddeb
135
136binary: binary-indep binary-arch
35bece35 137.PHONY: build clean binary-indep binary-arch binary install configure get-orig-source