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_GNU_TYPE ?
= $(shell dpkg-architecture
-qDEB_BUILD_GNU_TYPE
)
13 DEB_HOST_GNU_TYPE ?
= $(shell dpkg-architecture
-qDEB_HOST_GNU_TYPE
)
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.xz
39 SVN_ROOT
:= 'https://svn.code.sf.net/p/smartmontools/code/trunk/smartmontools'
42 rm -rf get-orig-source
$(TARBALL
)
44 svn
export -r
$(SVN_REVISION
) $(SVN_ROOT
) \
45 get-orig-source
/$(PACKAGE
)-$(SRC_VERSION
).orig
46 rm -rf get-orig-source
/$(PACKAGE
)-$(SRC_VERSION
).orig
/os_solaris_ata.s
47 tar cJf
$(TARBALL
) -C get-orig-source
$(PACKAGE
)-$(SRC_VERSION
).orig
48 rm -rf get-orig-source
49 echo
" "$(TARBALL
)" created; move it to the right destination to build the package"
51 configure
: configure-stamp
55 CFLAGS
="${CFLAGS}" CXXFLAGS
="${CFLAGS}" .
/configure
--prefix=/usr \
56 --build
=$(DEB_BUILD_GNU_TYPE
) \
57 --host
=$(DEB_HOST_GNU_TYPE
) \
59 --mandir=/usr
/share
/man \
60 --with-initscriptdir
=no \
61 --with-docdir
=/usr
/share
/doc
/smartmontools \
63 --enable-attributelog \
64 --with-savestates
=/var
/lib
/smartmontools
/smartd. \
65 --with-attributelog
=/var
/lib
/smartmontools
/attrlog. \
66 --with-exampledir
=/usr
/share
/doc
/smartmontools
/examples
/ \
67 --with-systemdsystemunitdir
=/lib
/systemd
/system \
68 --with-smartdscriptdir
=/usr
/share
/smartmontools \
69 --with-smartdplugindir
=/etc
/smartmontools
/smartd_warning.d \
70 --with-systemdenvfile
=/etc
/default
/smartmontools \
74 build
: build-arch build-indep
75 build-arch
: build-stamp
76 build-indep
: build-stamp
77 build-stamp
: configure-stamp
79 # Add here commands to compile the package.
86 # rm -f debian/logcheck.logcheck.ignore.*
87 # Add here commands to clean up after the build process.
88 [ ! -f Makefile
] ||
$(MAKE
) distclean
89 rm -f build-stamp configure-stamp \
90 Makefile.in examplescripts
/Makefile.in aclocal.m4 configure \
91 config.guess config.h.in config.sub depcomp install-sh \
100 $(MAKE
) DESTDIR
=$(CURDIR
)/debian
/smartmontools
install
101 rm -f debian
/smartmontools
/usr
/sbin
/update-smart-drivedb
103 # Build architecture-independent files here.
105 # We have nothing to do by default.
107 # Build architecture-dependent files here.
108 binary-arch
: build
install
111 rm -f debian
/smartmontools
/usr
/share
/doc
/smartmontools
/INSTALL \
112 debian
/smartmontools
/usr
/share
/doc
/smartmontools
/COPYING \
113 debian
/smartmontools
/usr
/share
/doc
/smartmontools
/ChangeLog
121 dh_installinit
-- start
20 2 3 4 5 . stop
20 1 .
126 dh_installchangelogs ChangeLog
130 chmod
755 $(CURDIR
)/debian
/smartmontools
/etc
/smartmontools
/run.d
/10mail \
131 $(CURDIR
)/debian
/smartmontools
/etc
/smartmontools
/run.d
/10powersave-notify \
132 $(CURDIR
)/debian
/smartmontools
/usr
/share
/smartmontools
/smartd-runner
140 binary
: binary-indep binary-arch
141 .PHONY
: build
clean binary-indep binary-arch binary
install configure get-orig-source