]> git.proxmox.com Git - mirror_smartmontools-debian.git/blame - debian/rules
Merge commit 'upstream/5.39.1'
[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
a19d514d
GG
8# for quilt
9include /usr/share/quilt/quilt.make
20259a08 10
a117ede1 11DEB_BUILD_ARCH_OS ?= $(shell dpkg-architecture -qDEB_BUILD_ARCH_OS)
a7e19a33
GI
12DEB_BUILD_ARCH_CPU ?= $(shell dpkg-architecture -qDEB_BUILD_ARCH_CPU)
13
a117ede1
GI
14ifeq ($(DEB_HOST_ARCH_OS),linux)
15 CONFIGURE_ARGS += --with-selinux
16endif
20259a08 17
a7e19a33
GI
18ifeq ($(DEB_BUILD_ARCH_CPU),armel)
19 CONFIGURE_ARGS += --without-libcap-ng
20endif
21
35bece35 22CFLAGS += -fsigned-char -Wall
20259a08
GG
23ifneq (,$(findstring noopt,$(DEB_BUILD_OPTIONS)))
24 CFLAGS += -O0
25else
26 CFLAGS += -O2
27endif
28ifeq (,$(findstring nostrip,$(DEB_BUILD_OPTIONS)))
29 INSTALL_PROGRAM = install -s
30else
31 INSTALL_PROGRAM = install
32endif
33
35bece35
GI
34PACKAGE = smartmontools
35SRC_VERSION := $(shell dpkg-parsechangelog | sed -ne 's/^Version: \(.*\)-.*/\1/p'| cut -d':' -f2)
36SVN_REVISION := $(shell echo $(SRC_VERSION) | awk -F"+" '{ print $$2 }' | sed 's/svn//' )
37TARBALL = $(PACKAGE)_$(SRC_VERSION).orig.tar.gz
38
39get-orig-source:
40 rm -rf get-orig-source $(TARBALL)
41 mkdir get-orig-source
42 svn export -r $(SVN_REVISION) https://smartmontools.svn.sourceforge.net/svnroot/smartmontools/trunk/smartmontools/ \
43 get-orig-source/$(PACKAGE)-$(SRC_VERSION).orig
35bece35
GI
44 GZIP=--best tar czf $(TARBALL) -C get-orig-source $(PACKAGE)-$(SRC_VERSION).orig
45 rm -rf get-orig-source
46 echo " "$(TARBALL)" created; move it to the right destination to build the package"
2040f049 47
20259a08 48configure: configure-stamp
a19d514d 49configure-stamp: debian/stamp-patched
20259a08 50 dh_testdir
2040f049 51 ./autogen.sh
20259a08
GG
52 CFLAGS="${CFLAGS}" ./configure --prefix=/usr \
53 --sysconfdir=/etc \
54 --mandir=/usr/share/man \
55 --with-initscriptdir=/etc/init.d \
0197215a 56 --with-docdir=/usr/share/doc/smartmontools \
683ec72b 57 ${CONFIGURE_ARGS}
20259a08
GG
58 touch configure-stamp
59
60
61build: 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
2040f049 68clean: unpatch
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
20259a08
GG
83 $(MAKE) DESTDIR=$(CURDIR)/debian/smartmontools \
84 INSTALL_PROGRAM="${INSTALL_PROGRAM}" install-sbinPROGRAMS
85 $(MAKE) DESTDIR=$(CURDIR)/debian/smartmontools \
86 install-sysconfDATA
87 $(MAKE) DESTDIR=$(CURDIR)/debian/smartmontools \
88 install-man
89 $(MAKE) DESTDIR=$(CURDIR)/debian/smartmontools \
90 examplesdir='$$(docdir)/examples' \
91 -C examplescripts/ install-examplesSCRIPTS install-examplesDATA
20259a08
GG
92 install -D -m 755 debian/smartmontools-bug \
93 $(CURDIR)/debian/smartmontools/usr/share/bug/smartmontools
20259a08
GG
94
95# Build architecture-independent files here.
a19d514d 96binary-indep:
20259a08
GG
97# We have nothing to do by default.
98
99# Build architecture-dependent files here.
100binary-arch: build install
101 dh_testdir
102 dh_testroot
20259a08
GG
103 dh_installdocs
104 dh_installexamples
105 dh_installmenu
486adbce 106 dh_installlogrotate
31e40f75 107 dh_install
9afe5af0 108 dh_installinit -- start 20 2 3 4 5 . stop 20 1 .
20259a08
GG
109 dh_installcron
110 dh_installman
111 dh_installinfo
fd9c6756 112 dh_lintian
20259a08
GG
113 dh_installchangelogs CHANGELOG
114 dh_link
115 dh_strip
116 dh_compress
117 dh_fixperms
31e40f75 118 chmod 755 $(CURDIR)/debian/smartmontools/etc/smartmontools/run.d/10mail \
52b4501b 119 $(CURDIR)/debian/smartmontools/etc/smartmontools/run.d/10powersave-notify \
31e40f75
GI
120 $(CURDIR)/debian/smartmontools/usr/share/smartmontools/smartd-runner
121 dh_makeshlibs
20259a08 122 dh_installdeb
20259a08
GG
123 dh_shlibdeps
124 dh_gencontrol
125 dh_md5sums
126 dh_builddeb
127
128binary: binary-indep binary-arch
35bece35 129.PHONY: build clean binary-indep binary-arch binary install configure get-orig-source