Code

remove systemd and nondeterminism bits
[pkg-collectd.git] / debian / rules
index c5ca9dd83e9b2a1aa7dcf01d814db9dca9371d6c..e22b2a86311bdd23845ba9495975c0022aa26748 100755 (executable)
@@ -51,8 +51,6 @@ JAR = $(JAVA_HOME)/bin/jar
 JAVA_CPPFLAGS = -I$(JAVA_HOME)/include
 JAVA_LDFLAGS = -L$(JAVA_LIBDIR) -Wl,-rpath -Wl,$(JAVA_LIBDIR)
 
-include /usr/share/dpatch/dpatch.make
-
 confflags = --host=$(DEB_HOST_GNU_TYPE) \
                        --build=$(DEB_BUILD_GNU_TYPE) --prefix=/usr \
                        --mandir=\$${prefix}/share/man \
@@ -61,6 +59,7 @@ confflags = --host=$(DEB_HOST_GNU_TYPE) \
                        --without-libstatgrab \
                        --without-included-ltdl \
                        --disable-static \
+                       --disable-silent-rules \
                        --enable-all-plugins
 
 # These plugins do not provide any functionality under Linux.
@@ -141,11 +140,22 @@ endif
 ifneq (,$(filter kfreebsd-i386 kfreebsd-amd64, $(DEB_BUILD_ARCH)))
        confflags += \
                --disable-gmond \
-               --disable-libvirt \
+               --disable-virt \
                --disable-tokyotyrant \
                --disable-java
 endif
 
+# This plugin is Intel-hardware specific.
+ifeq (,$(filter amd64 i386, $(DEB_BUILD_ARCH)))
+       confflags += \
+               --disable-turbostat
+endif
+
+# libatasmart isn't available on these platforms.
+ifneq (,$(filter hurd-i386 kfreebsd-i386 kfreebsd-amd64, $(DEB_BUILD_ARCH)))
+       confflags += --disable-smart
+endif
+
 # The hppa buildds currently do not keep up with Java related stuff, thus
 # prevending testing transitions. sparc is also having trouble building the
 # java plugin.
@@ -153,15 +163,9 @@ ifneq (,$(filter hppa sparc, $(DEB_BUILD_ARCH)))
        confflags += --disable-java
 endif
 
-config.status: configure $(DPATCH_STAMPFN)
+config.status: configure
        dh_testdir
        
-       ( cd debian/patches/; for patch in *; do \
-               if test "$$patch" != "00list"; then \
-                       grep "$$patch" 00list > /dev/null \
-                               || ( echo "$$patch not enabled\!"; exit 1 ); \
-               fi; done )
-       
        # This is a work-around for #474087 (broken openipmi .pc files).
        mkdir debian/pkgconfig
        sed -re 's/^(Requires:.*) pthread(.*)$$/\1\2/' \
@@ -186,7 +190,7 @@ build-stamp: config.status
        
        touch build-stamp
 
-clean: unpatch
+clean:
        dh_testdir
        dh_testroot
        rm -f build-stamp
@@ -204,20 +208,25 @@ clean: unpatch
 install-indep:
        dh_testdir
        dh_testroot
-       dh_clean -k
+       dh_prep
        dh_installdirs -i
        dh_install -i
        
        # update include path for collectd header files
-       sed -r -i -e 's/include "(.*)"/include "collectd\/core\/\1"/' \
-               $(CURDIR)/debian/collectd-dev/usr/include/collectd/core/*
-       sed -r -i -e 's/"collectd\/core\/(liboconfig\/.*)"/"collectd\/\1"/' \
-               $(CURDIR)/debian/collectd-dev/usr/include/collectd/core/*
+       (       set -e; \
+               cd $(CURDIR)/debian/collectd-dev/usr/include/collectd/; \
+               for lib in $$(find . -type f -name '*.h'); do \
+                       libname=$$(basename $$lib); \
+                       fullpath=$$(echo $$lib | sed -r -e 's,^\./,collectd/,'); \
+                       for dir in $$(find . -mindepth 1 -type d); do \
+                               sed -r -i -e "s,(include\s+)\".*$$libname\",\1\"$$fullpath\"," $$dir/*.h; \
+                       done; \
+               done )
 
 install-arch: build
        dh_testdir
        dh_testroot
-       dh_clean -k
+       dh_prep
        dh_installdirs -a
        
        $(MAKE) install DESTDIR=$(CURDIR)/debian/tmp