]> git.proxmox.com Git - mirror_smartmontools-debian.git/blame - debian/rules
Re-add drivedbdir to configure
[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
20a5687a
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//' )
d2cd5c38 38TARBALL = $(PACKAGE)_$(SRC_VERSION).orig.tar.xz
63180956 39SVN_ROOT := 'https://svn.code.sf.net/p/smartmontools/code/trunk/smartmontools'
35bece35
GI
40
41get-orig-source:
42 rm -rf get-orig-source $(TARBALL)
43 mkdir get-orig-source
63180956 44 svn export -r $(SVN_REVISION) $(SVN_ROOT) \
35bece35 45 get-orig-source/$(PACKAGE)-$(SRC_VERSION).orig
a5a9d5b7 46 rm -rf get-orig-source/$(PACKAGE)-$(SRC_VERSION).orig/os_solaris_ata.s
d2cd5c38 47 tar cJf $(TARBALL) -C get-orig-source $(PACKAGE)-$(SRC_VERSION).orig
35bece35
GI
48 rm -rf get-orig-source
49 echo " "$(TARBALL)" created; move it to the right destination to build the package"
2040f049 50
20259a08 51configure: configure-stamp
d3fc9d11 52configure-stamp:
20259a08 53 dh_testdir
2040f049 54 ./autogen.sh
827d3b2c 55 CFLAGS="${CFLAGS}" CXXFLAGS="${CFLAGS}" ./configure --prefix=/usr \
20a5687a
TF
56 --build=$(DEB_BUILD_GNU_TYPE) \
57 --host=$(DEB_HOST_GNU_TYPE) \
20259a08
GG
58 --sysconfdir=/etc \
59 --mandir=/usr/share/man \
65c801fb 60 --with-initscriptdir=no \
398d58d6 61 --docdir=/usr/share/doc/smartmontools \
1e46e09b
GI
62 --with-savestates=/var/lib/smartmontools/smartd. \
63 --with-attributelog=/var/lib/smartmontools/attrlog. \
f8250f31 64 --with-exampledir=/usr/share/doc/smartmontools/examples/ \
ec0ca21f 65 --with-drivedbdir=/var/lib/smartmontools/drivedb \
9804b75c 66 --with-systemdsystemunitdir=/lib/systemd/system \
3478a98f 67 --with-smartdscriptdir=/usr/share/smartmontools \
03a62f0c
GI
68 --with-smartdplugindir=/etc/smartmontools/smartd_warning.d \
69 --with-systemdenvfile=/etc/default/smartmontools \
683ec72b 70 ${CONFIGURE_ARGS}
20259a08
GG
71 touch configure-stamp
72
8f14e44e
GI
73build: build-arch build-indep
74build-arch: build-stamp
75build-indep: build-stamp
2040f049 76build-stamp: configure-stamp
20259a08 77 dh_testdir
20259a08
GG
78 # Add here commands to compile the package.
79 $(MAKE)
20259a08
GG
80 touch build-stamp
81
d3fc9d11 82clean:
20259a08
GG
83 dh_testdir
84 dh_testroot
20259a08 85 # rm -f debian/logcheck.logcheck.ignore.*
20259a08 86 # Add here commands to clean up after the build process.
a52f90d4 87 [ ! -f Makefile ] || $(MAKE) distclean
4d98553f 88 rm -f build-stamp configure-stamp \
6c5eb127
JD
89 Makefile.in examplescripts/Makefile.in aclocal.m4 configure \
90 config.guess config.h.in config.sub depcomp install-sh \
91 m4/pkg.m4 missing
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
aa3fa587 100 rm -f debian/smartmontools/usr/sbin/update-smart-drivedb
20259a08
GG
101
102# Build architecture-independent files here.
a19d514d 103binary-indep:
20259a08
GG
104# We have nothing to do by default.
105
106# Build architecture-dependent files here.
107binary-arch: build install
108 dh_testdir
109 dh_testroot
055efcb0
JD
110 rm -f debian/smartmontools/usr/share/doc/smartmontools/INSTALL \
111 debian/smartmontools/usr/share/doc/smartmontools/COPYING \
112 debian/smartmontools/usr/share/doc/smartmontools/ChangeLog
20259a08
GG
113 dh_installdocs
114 dh_installexamples
115 dh_installmenu
486adbce 116 dh_installlogrotate
31e40f75 117 dh_install
9804b75c
GI
118 dh_link
119 dh_systemd_enable
bcade6c1 120 dh_installinit
7af93365 121 dh_systemd_start
20259a08 122 dh_installcron
20259a08 123 dh_installinfo
fd9c6756 124 dh_lintian
841c1a8e 125 dh_installchangelogs ChangeLog
20259a08
GG
126 dh_strip
127 dh_compress
128 dh_fixperms
31e40f75 129 chmod 755 $(CURDIR)/debian/smartmontools/etc/smartmontools/run.d/10mail \
52b4501b 130 $(CURDIR)/debian/smartmontools/etc/smartmontools/run.d/10powersave-notify \
31e40f75
GI
131 $(CURDIR)/debian/smartmontools/usr/share/smartmontools/smartd-runner
132 dh_makeshlibs
20259a08 133 dh_installdeb
20259a08
GG
134 dh_shlibdeps
135 dh_gencontrol
136 dh_md5sums
137 dh_builddeb
138
139binary: binary-indep binary-arch
35bece35 140.PHONY: build clean binary-indep binary-arch binary install configure get-orig-source