]>
Commit | Line | Data |
---|---|---|
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 | |
0f1c16c6 GI |
8 | export DEB_BUILD_HARDENING=1 |
9 | ||
a117ede1 | 10 | DEB_BUILD_ARCH_OS ?= $(shell dpkg-architecture -qDEB_BUILD_ARCH_OS) |
a7e19a33 GI |
11 | DEB_BUILD_ARCH_CPU ?= $(shell dpkg-architecture -qDEB_BUILD_ARCH_CPU) |
12 | ||
a117ede1 GI |
13 | ifeq ($(DEB_HOST_ARCH_OS),linux) |
14 | CONFIGURE_ARGS += --with-selinux | |
15 | endif | |
20259a08 | 16 | |
827d3b2c ED |
17 | ifeq ($(DEB_HOST_ARCH_OS),kfreebsd) |
18 | CFLAGS += -I/usr/include/freebsd | |
19 | endif | |
20 | ||
35bece35 | 21 | CFLAGS += -fsigned-char -Wall |
20259a08 GG |
22 | ifneq (,$(findstring noopt,$(DEB_BUILD_OPTIONS))) |
23 | CFLAGS += -O0 | |
24 | else | |
25 | CFLAGS += -O2 | |
26 | endif | |
27 | ifeq (,$(findstring nostrip,$(DEB_BUILD_OPTIONS))) | |
28 | INSTALL_PROGRAM = install -s | |
29 | else | |
30 | INSTALL_PROGRAM = install | |
31 | endif | |
32 | ||
35bece35 GI |
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 | |
37 | ||
38 | get-orig-source: | |
39 | rm -rf get-orig-source $(TARBALL) | |
40 | mkdir get-orig-source | |
41 | svn export -r $(SVN_REVISION) https://smartmontools.svn.sourceforge.net/svnroot/smartmontools/trunk/smartmontools/ \ | |
42 | get-orig-source/$(PACKAGE)-$(SRC_VERSION).orig | |
a5a9d5b7 | 43 | rm -rf get-orig-source/$(PACKAGE)-$(SRC_VERSION).orig/os_solaris_ata.s |
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 | 48 | configure: configure-stamp |
d3fc9d11 | 49 | configure-stamp: |
20259a08 | 50 | dh_testdir |
2040f049 | 51 | ./autogen.sh |
827d3b2c | 52 | CFLAGS="${CFLAGS}" CXXFLAGS="${CFLAGS}" ./configure --prefix=/usr \ |
20259a08 GG |
53 | --sysconfdir=/etc \ |
54 | --mandir=/usr/share/man \ | |
65c801fb | 55 | --with-initscriptdir=no \ |
0197215a | 56 | --with-docdir=/usr/share/doc/smartmontools \ |
b1b3452c GI |
57 | --enable-drivedb \ |
58 | --enable-savestates \ | |
59 | --enable-attributelog \ | |
1e46e09b GI |
60 | --with-savestates=/var/lib/smartmontools/smartd. \ |
61 | --with-attributelog=/var/lib/smartmontools/attrlog. \ | |
f8250f31 | 62 | --with-exampledir=/usr/share/doc/smartmontools/examples/ \ |
5ae3fa9e | 63 | --with-drivedbdir=/var/lib/smartmontools/drivedb \ |
9804b75c | 64 | --with-systemdsystemunitdir=/lib/systemd/system \ |
3478a98f GI |
65 | --with-smartdscriptdir=/usr/share/smartmontools \ |
66 | --with-smartdplugindir=/etc/smartmontools/smartd_warning.d | |
683ec72b | 67 | ${CONFIGURE_ARGS} |
20259a08 GG |
68 | touch configure-stamp |
69 | ||
8f14e44e GI |
70 | build: build-arch build-indep |
71 | build-arch: build-stamp | |
72 | build-indep: build-stamp | |
2040f049 | 73 | build-stamp: configure-stamp |
20259a08 | 74 | dh_testdir |
20259a08 GG |
75 | # Add here commands to compile the package. |
76 | $(MAKE) | |
20259a08 GG |
77 | touch build-stamp |
78 | ||
d3fc9d11 | 79 | clean: |
20259a08 GG |
80 | dh_testdir |
81 | dh_testroot | |
20259a08 | 82 | # rm -f debian/logcheck.logcheck.ignore.* |
20259a08 | 83 | # Add here commands to clean up after the build process. |
a52f90d4 | 84 | [ ! -f Makefile ] || $(MAKE) distclean |
4d98553f | 85 | rm -f build-stamp configure-stamp \ |
1b4c984c | 86 | Makefile.in examplescripts/Makefile.in aclocal.m4 configure |
20259a08 GG |
87 | dh_clean |
88 | ||
89 | install: build | |
90 | dh_testdir | |
91 | dh_testroot | |
608687b1 | 92 | dh_prep |
20259a08 | 93 | dh_installdirs |
0711e68a | 94 | $(MAKE) DESTDIR=$(CURDIR)/debian/smartmontools install |
20259a08 GG |
95 | |
96 | # Build architecture-independent files here. | |
a19d514d | 97 | binary-indep: |
20259a08 GG |
98 | # We have nothing to do by default. |
99 | ||
100 | # Build architecture-dependent files here. | |
101 | binary-arch: build install | |
102 | dh_testdir | |
103 | dh_testroot | |
20259a08 GG |
104 | dh_installdocs |
105 | dh_installexamples | |
106 | dh_installmenu | |
486adbce | 107 | dh_installlogrotate |
31e40f75 | 108 | dh_install |
9804b75c GI |
109 | dh_link |
110 | dh_systemd_enable | |
9afe5af0 | 111 | dh_installinit -- start 20 2 3 4 5 . stop 20 1 . |
9804b75c | 112 | dh_systemd_enable |
20259a08 | 113 | dh_installcron |
a26a490b | 114 | dh_installman debian/update-smart-drivedb.8 |
20259a08 | 115 | dh_installinfo |
fd9c6756 | 116 | dh_lintian |
841c1a8e | 117 | dh_installchangelogs ChangeLog |
20259a08 GG |
118 | dh_strip |
119 | dh_compress | |
120 | dh_fixperms | |
31e40f75 | 121 | chmod 755 $(CURDIR)/debian/smartmontools/etc/smartmontools/run.d/10mail \ |
52b4501b | 122 | $(CURDIR)/debian/smartmontools/etc/smartmontools/run.d/10powersave-notify \ |
31e40f75 GI |
123 | $(CURDIR)/debian/smartmontools/usr/share/smartmontools/smartd-runner |
124 | dh_makeshlibs | |
20259a08 | 125 | dh_installdeb |
20259a08 GG |
126 | dh_shlibdeps |
127 | dh_gencontrol | |
128 | dh_md5sums | |
129 | dh_builddeb | |
130 | ||
131 | binary: binary-indep binary-arch | |
35bece35 | 132 | .PHONY: build clean binary-indep binary-arch binary install configure get-orig-source |