2 # Sample debian/rules that uses debhelper.
3 # GNU copyright 1997 to 1999 by Joey Hess.
5 # Uncomment this to turn on verbose mode.
8 export DEB_BUILD_HARDENING
=1
10 DEB_BUILD_ARCH_OS ?
= $(shell dpkg-architecture
-qDEB_BUILD_ARCH_OS
)
11 DEB_BUILD_ARCH_CPU ?
= $(shell dpkg-architecture
-qDEB_BUILD_ARCH_CPU
)
13 ifeq ($(DEB_HOST_ARCH_OS
),linux
)
14 CONFIGURE_ARGS
+= --with-selinux
17 ifeq ($(DEB_HOST_ARCH_OS
),kfreebsd
)
18 CFLAGS
+= -I
/usr
/include/freebsd
21 CFLAGS
+= -fsigned-char
-Wall
22 ifneq (,$(findstring noopt
,$(DEB_BUILD_OPTIONS
)))
27 ifeq (,$(findstring nostrip
,$(DEB_BUILD_OPTIONS
)))
28 INSTALL_PROGRAM
= install -s
30 INSTALL_PROGRAM
= install
33 PACKAGE
= smartmontools
34 SRC_VERSION
:= $(shell dpkg-parsechangelog | sed
-ne
's/^Version: \(.*\)-.*/\1/p'| cut
-d
':' -f2
)
35 SVN_REVISION
:= $(shell echo
$(SRC_VERSION
) | awk
-F
"+" '{ print $$2 }' | sed
's/svn//' )
36 TARBALL
= $(PACKAGE
)_
$(SRC_VERSION
).orig.
tar.gz
39 rm -rf get-orig-source
$(TARBALL
)
41 svn
export -r
$(SVN_REVISION
) https
://smartmontools.svn.sourceforge.net
/svnroot
/smartmontools
/trunk
/smartmontools
/ \
42 get-orig-source
/$(PACKAGE
)-$(SRC_VERSION
).orig
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"
47 configure
: configure-stamp
51 CFLAGS
="${CFLAGS}" CXXFLAGS
="${CFLAGS}" .
/configure
--prefix=/usr \
53 --mandir=/usr
/share
/man \
54 --with-initscriptdir
=no \
55 --with-docdir
=/usr
/share
/doc
/smartmontools \
58 --enable-attributelog \
59 --with-savestates
=/var
/lib
/smartmontools
/smartd. \
60 --with-attributelog
=/var
/lib
/smartmontools
/attrlog. \
61 --with-exampledir
=/usr
/share
/doc
/smartmontools
/examples
/ \
62 --with-drivedbdir
=/var
/lib
/smartmontools
/drivedb \
63 --with-systemdsystemunitdir
=/lib
/systemd
/system \
64 --with-smartdscriptdir
=/usr
/share
/smartmontools \
65 --with-smartdplugindir
=/etc
/smartmontools
/smartd_warning.d
69 build
: build-arch build-indep
70 build-arch
: build-stamp
71 build-indep
: build-stamp
72 build-stamp
: configure-stamp
74 # Add here commands to compile the package.
81 # rm -f debian/logcheck.logcheck.ignore.*
82 # Add here commands to clean up after the build process.
83 [ ! -f Makefile
] ||
$(MAKE
) distclean
84 rm -f build-stamp configure-stamp \
85 Makefile.in examplescripts
/Makefile.in aclocal.m4 configure
93 $(MAKE
) DESTDIR
=$(CURDIR
)/debian
/smartmontools
install
95 # Build architecture-independent files here.
97 # We have nothing to do by default.
99 # Build architecture-dependent files here.
100 binary-arch
: build
install
110 dh_installinit
-- start
20 2 3 4 5 . stop
20 1 .
113 dh_installman debian
/update-smart-drivedb
.8
116 dh_installchangelogs ChangeLog
120 chmod
755 $(CURDIR
)/debian
/smartmontools
/etc
/smartmontools
/run.d
/10mail \
121 $(CURDIR
)/debian
/smartmontools
/etc
/smartmontools
/run.d
/10powersave-notify \
122 $(CURDIR
)/debian
/smartmontools
/usr
/share
/smartmontools
/smartd-runner
130 binary
: binary-indep binary-arch
131 .PHONY
: build
clean binary-indep binary-arch binary
install configure get-orig-source