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