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