]> git.proxmox.com Git - mirror_smartmontools-debian.git/blame_incremental - debian/rules
Import d/changelog from last uploaded version (6.3+svn4002-2)
[mirror_smartmontools-debian.git] / debian / rules
... / ...
CommitLineData
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.
6#export DH_VERBOSE=1
7
8export DEB_BUILD_MAINT_OPTIONS = hardening=+all
9DPKG_EXPORT_BUILDFLAGS = 1
10include /usr/share/dpkg/buildflags.mk
11
12DEB_BUILD_ARCH_OS ?= $(shell dpkg-architecture -qDEB_BUILD_ARCH_OS)
13DEB_BUILD_ARCH_CPU ?= $(shell dpkg-architecture -qDEB_BUILD_ARCH_CPU)
14
15ifeq ($(DEB_HOST_ARCH_OS),linux)
16 CONFIGURE_ARGS += --with-selinux
17endif
18
19ifeq ($(DEB_HOST_ARCH_OS),kfreebsd)
20 CFLAGS += -I/usr/include/freebsd
21endif
22
23CFLAGS += -fsigned-char -Wall
24ifneq (,$(findstring noopt,$(DEB_BUILD_OPTIONS)))
25 CFLAGS += -O0
26else
27 CFLAGS += -O2
28endif
29ifeq (,$(findstring nostrip,$(DEB_BUILD_OPTIONS)))
30 INSTALL_PROGRAM = install -s
31else
32 INSTALL_PROGRAM = install
33endif
34
35PACKAGE = smartmontools
36SRC_VERSION := $(shell dpkg-parsechangelog | sed -ne 's/^Version: \(.*\)-.*/\1/p'| cut -d':' -f2)
37SVN_REVISION := $(shell echo $(SRC_VERSION) | awk -F"+" '{ print $$2 }' | sed 's/svn//' )
38TARBALL = $(PACKAGE)_$(SRC_VERSION).orig.tar.gz
39SVN_ROOT := 'https://svn.code.sf.net/p/smartmontools/code/trunk/smartmontools'
40
41get-orig-source:
42 rm -rf get-orig-source $(TARBALL)
43 mkdir get-orig-source
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 GZIP=--best tar czf $(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"
50
51configure: configure-stamp
52configure-stamp:
53 dh_testdir
54 ./autogen.sh
55 CFLAGS="${CFLAGS}" CXXFLAGS="${CFLAGS}" ./configure --prefix=/usr \
56 --sysconfdir=/etc \
57 --mandir=/usr/share/man \
58 --with-initscriptdir=no \
59 --with-docdir=/usr/share/doc/smartmontools \
60 --enable-drivedb \
61 --enable-savestates \
62 --enable-attributelog \
63 --with-savestates=/var/lib/smartmontools/smartd. \
64 --with-attributelog=/var/lib/smartmontools/attrlog. \
65 --with-exampledir=/usr/share/doc/smartmontools/examples/ \
66 --with-drivedbdir=/var/lib/smartmontools/drivedb \
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 \
71 ${CONFIGURE_ARGS}
72 touch configure-stamp
73
74build: build-arch build-indep
75build-arch: build-stamp
76build-indep: build-stamp
77build-stamp: configure-stamp
78 dh_testdir
79 # Add here commands to compile the package.
80 $(MAKE)
81 touch build-stamp
82
83clean:
84 dh_testdir
85 dh_testroot
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 dh_clean
92
93install: build
94 dh_testdir
95 dh_testroot
96 dh_prep
97 dh_installdirs
98 $(MAKE) DESTDIR=$(CURDIR)/debian/smartmontools install
99
100# Build architecture-independent files here.
101binary-indep:
102# We have nothing to do by default.
103
104# Build architecture-dependent files here.
105binary-arch: build install
106 dh_testdir
107 dh_testroot
108 dh_installdocs
109 dh_installexamples
110 dh_installmenu
111 dh_installlogrotate
112 dh_install
113 dh_link
114 dh_systemd_enable
115 dh_installinit -- start 20 2 3 4 5 . stop 20 1 .
116 dh_systemd_enable
117 dh_installcron
118 dh_installman debian/update-smart-drivedb.8
119 dh_installinfo
120 dh_lintian
121 dh_installchangelogs ChangeLog
122 dh_strip
123 dh_compress
124 dh_fixperms
125 chmod 755 $(CURDIR)/debian/smartmontools/etc/smartmontools/run.d/10mail \
126 $(CURDIR)/debian/smartmontools/etc/smartmontools/run.d/10powersave-notify \
127 $(CURDIR)/debian/smartmontools/usr/share/smartmontools/smartd-runner
128 dh_makeshlibs
129 dh_installdeb
130 dh_shlibdeps
131 dh_gencontrol
132 dh_md5sums
133 dh_builddeb
134
135binary: binary-indep binary-arch
136.PHONY: build clean binary-indep binary-arch binary install configure get-orig-source