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