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_MAINT_OPTIONS
= hardening
=+all
9 DPKG_EXPORT_BUILDFLAGS
= 1
10 include /usr
/share
/dpkg
/buildflags.mk
12 DEB_BUILD_ARCH_OS ?
= $(shell dpkg-architecture
-qDEB_BUILD_ARCH_OS
)
13 DEB_BUILD_ARCH_CPU ?
= $(shell dpkg-architecture
-qDEB_BUILD_ARCH_CPU
)
15 ifeq ($(DEB_HOST_ARCH_OS
),linux
)
16 CONFIGURE_ARGS
+= --with-selinux
19 ifeq ($(DEB_HOST_ARCH_OS
),kfreebsd
)
20 CFLAGS
+= -I
/usr
/include/freebsd
23 CFLAGS
+= -fsigned-char
-Wall
24 ifneq (,$(findstring noopt
,$(DEB_BUILD_OPTIONS
)))
29 ifeq (,$(findstring nostrip
,$(DEB_BUILD_OPTIONS
)))
30 INSTALL_PROGRAM
= install -s
32 INSTALL_PROGRAM
= install
35 PACKAGE
= smartmontools
36 SRC_VERSION
:= $(shell dpkg-parsechangelog | sed
-ne
's/^Version: \(.*\)-.*/\1/p'| cut
-d
':' -f2
)
37 SVN_REVISION
:= $(shell echo
$(SRC_VERSION
) | awk
-F
"+" '{ print $$2 }' | sed
's/svn//' )
38 TARBALL
= $(PACKAGE
)_
$(SRC_VERSION
).orig.
tar.gz
41 rm -rf get-orig-source
$(TARBALL
)
43 svn
export -r
$(SVN_REVISION
) https
://smartmontools.svn.sourceforge.net
/svnroot
/smartmontools
/trunk
/smartmontools
/ \
44 get-orig-source
/$(PACKAGE
)-$(SRC_VERSION
).orig
45 rm -rf get-orig-source
/$(PACKAGE
)-$(SRC_VERSION
).orig
/os_solaris_ata.s
46 GZIP
=--best
tar czf
$(TARBALL
) -C get-orig-source
$(PACKAGE
)-$(SRC_VERSION
).orig
47 rm -rf get-orig-source
48 echo
" "$(TARBALL
)" created; move it to the right destination to build the package"
50 configure
: configure-stamp
54 CFLAGS
="${CFLAGS}" CXXFLAGS
="${CFLAGS}" .
/configure
--prefix=/usr \
56 --mandir=/usr
/share
/man \
57 --with-initscriptdir
=no \
58 --with-docdir
=/usr
/share
/doc
/smartmontools \
61 --enable-attributelog \
62 --with-savestates
=/var
/lib
/smartmontools
/smartd. \
63 --with-attributelog
=/var
/lib
/smartmontools
/attrlog. \
64 --with-exampledir
=/usr
/share
/doc
/smartmontools
/examples
/ \
65 --with-drivedbdir
=/var
/lib
/smartmontools
/drivedb \
66 --with-systemdsystemunitdir
=/lib
/systemd
/system \
67 --with-smartdscriptdir
=/usr
/share
/smartmontools \
68 --with-smartdplugindir
=/etc
/smartmontools
/smartd_warning.d \
69 --with-systemdenvfile
=/etc
/default
/smartmontools \
73 build
: build-arch build-indep
74 build-arch
: build-stamp
75 build-indep
: build-stamp
76 build-stamp
: configure-stamp
78 # Add here commands to compile the package.
85 # rm -f debian/logcheck.logcheck.ignore.*
86 # Add here commands to clean up after the build process.
87 [ ! -f Makefile
] ||
$(MAKE
) distclean
88 rm -f build-stamp configure-stamp \
89 Makefile.in examplescripts
/Makefile.in aclocal.m4 configure
97 $(MAKE
) DESTDIR
=$(CURDIR
)/debian
/smartmontools
install
99 # Build architecture-independent files here.
101 # We have nothing to do by default.
103 # Build architecture-dependent files here.
104 binary-arch
: build
install
114 dh_installinit
-- start
20 2 3 4 5 . stop
20 1 .
117 dh_installman debian
/update-smart-drivedb
.8
120 dh_installchangelogs ChangeLog
124 chmod
755 $(CURDIR
)/debian
/smartmontools
/etc
/smartmontools
/run.d
/10mail \
125 $(CURDIR
)/debian
/smartmontools
/etc
/smartmontools
/run.d
/10powersave-notify \
126 $(CURDIR
)/debian
/smartmontools
/usr
/share
/smartmontools
/smartd-runner
134 binary
: binary-indep binary-arch
135 .PHONY
: build
clean binary-indep binary-arch binary
install configure get-orig-source