]> git.proxmox.com Git - mirror_smartmontools-debian.git/blobdiff - debian/rules
Merge commit 'upstream/5.39.1'
[mirror_smartmontools-debian.git] / debian / rules
index a54e4bb52a71333aefb57d06249f579e64cf2848..603ca2e03404cc70b31833f651d5a4158ca80e61 100755 (executable)
@@ -8,8 +8,18 @@
 # for quilt
 include /usr/share/quilt/quilt.make
 
+DEB_BUILD_ARCH_OS  ?= $(shell dpkg-architecture -qDEB_BUILD_ARCH_OS)
+DEB_BUILD_ARCH_CPU ?= $(shell dpkg-architecture -qDEB_BUILD_ARCH_CPU)
 
-CFLAGS = -fsigned-char -Wall
+ifeq ($(DEB_HOST_ARCH_OS),linux)
+       CONFIGURE_ARGS += --with-selinux
+endif
+
+ifeq ($(DEB_BUILD_ARCH_CPU),armel)
+       CONFIGURE_ARGS += --without-libcap-ng 
+endif
+
+CFLAGS += -fsigned-char -Wall
 ifneq (,$(findstring noopt,$(DEB_BUILD_OPTIONS)))
         CFLAGS += -O0
 else
@@ -21,6 +31,19 @@ else
         INSTALL_PROGRAM = install
 endif
 
+PACKAGE = smartmontools
+SRC_VERSION := $(shell dpkg-parsechangelog | sed -ne 's/^Version: \(.*\)-.*/\1/p'| cut -d':' -f2)
+SVN_REVISION := $(shell echo $(SRC_VERSION) | awk -F"+" '{ print $$2 }' | sed 's/svn//' )
+TARBALL = $(PACKAGE)_$(SRC_VERSION).orig.tar.gz
+
+get-orig-source:
+               rm -rf get-orig-source $(TARBALL)
+               mkdir get-orig-source
+               svn export -r $(SVN_REVISION) https://smartmontools.svn.sourceforge.net/svnroot/smartmontools/trunk/smartmontools/ \
+                       get-orig-source/$(PACKAGE)-$(SRC_VERSION).orig
+               GZIP=--best tar czf $(TARBALL) -C get-orig-source $(PACKAGE)-$(SRC_VERSION).orig
+               rm -rf get-orig-source
+               echo "  "$(TARBALL)" created; move it to the right destination to build the package"
 
 configure: configure-stamp
 configure-stamp: debian/stamp-patched
@@ -30,29 +53,24 @@ configure-stamp: debian/stamp-patched
                                --sysconfdir=/etc                \
                                --mandir=/usr/share/man          \
                                --with-initscriptdir=/etc/init.d \
-                               --with-docdir=/usr/share/doc/smartmontools
-
+                               --with-docdir=/usr/share/doc/smartmontools \
+                               ${CONFIGURE_ARGS}
        touch configure-stamp
 
 
 build: build-stamp
 build-stamp: configure-stamp
        dh_testdir
-
        # Add here commands to compile the package.
        $(MAKE)
-
-       #/usr/bin/docbook-to-man debian/smartmontools.sgml > smartmontools.1
-
        touch build-stamp
 
 clean: unpatch
        dh_testdir
        dh_testroot
        # rm -f debian/logcheck.logcheck.ignore.*
-
        # Add here commands to clean up after the build process.
-       -$(MAKE) distclean
+       [ ! -f Makefile ] || $(MAKE) distclean
        rm -f build-stamp configure-stamp \
              Makefile.in examplescripts/Makefile.in aclocal.m4 configure
        dh_clean
@@ -60,9 +78,8 @@ clean: unpatch
 install: build
        dh_testdir
        dh_testroot
-       dh_clean -k
+       dh_prep
        dh_installdirs
-
        $(MAKE) DESTDIR=$(CURDIR)/debian/smartmontools \
                INSTALL_PROGRAM="${INSTALL_PROGRAM}" install-sbinPROGRAMS
        $(MAKE) DESTDIR=$(CURDIR)/debian/smartmontools \
@@ -72,13 +89,8 @@ install: build
        $(MAKE) DESTDIR=$(CURDIR)/debian/smartmontools \
                examplesdir='$$(docdir)/examples'      \
                -C examplescripts/ install-examplesSCRIPTS install-examplesDATA
-
        install -D -m 755 debian/smartmontools-bug \
                $(CURDIR)/debian/smartmontools/usr/share/bug/smartmontools
-       install -D -m 755 debian/smartd-runner \
-               $(CURDIR)/debian/smartmontools/usr/share/smartmontools/smartd-runner
-       install -D -m 755 debian/10mail \
-               $(CURDIR)/debian/smartmontools/etc/smartmontools/run.d/10mail
 
 # Build architecture-independent files here.
 binary-indep:
@@ -88,32 +100,30 @@ binary-indep:
 binary-arch: build install
        dh_testdir
        dh_testroot
-#      dh_installdebconf       
        dh_installdocs
        dh_installexamples
        dh_installmenu
        dh_installlogrotate
-#      dh_installemacsen
-#      dh_installpam
-#      dh_installmime
-       dh_installinit
+       dh_install
+       dh_installinit -- start 20 2 3 4 5 . stop 20 1 .
        dh_installcron
        dh_installman
        dh_installinfo
-#      dh_installlogcheck
-#      dh_undocumented
+       dh_lintian
        dh_installchangelogs CHANGELOG
        dh_link
        dh_strip
        dh_compress
        dh_fixperms
-#      dh_makeshlibs
+       chmod 755 $(CURDIR)/debian/smartmontools/etc/smartmontools/run.d/10mail \
+               $(CURDIR)/debian/smartmontools/etc/smartmontools/run.d/10powersave-notify \
+               $(CURDIR)/debian/smartmontools/usr/share/smartmontools/smartd-runner
+       dh_makeshlibs
        dh_installdeb
-#      dh_perl
        dh_shlibdeps
        dh_gencontrol
        dh_md5sums
        dh_builddeb
 
 binary: binary-indep binary-arch
-.PHONY: build clean binary-indep binary-arch binary install configure
+.PHONY: build clean binary-indep binary-arch binary install configure get-orig-source