Code

changelog: Updated to 4.10.1-1.
[pkg-collectd.git] / debian / rules
index 35251583f3864f619af888b07d0a16f6aeb7386e..068edecd573446b6efa86572e323a5ea74fe83d6 100755 (executable)
@@ -26,14 +26,14 @@ CPPFLAGS += -DLT_LAZY_OR_NOW='RTLD_LAZY|RTLD_GLOBAL'
 CPPFLAGS += -UCONFIGFILE
 CPPFLAGS += -DCONFIGFILE='\"/etc/collectd/collectd.conf\"'
 
-ifneq (,$(findstring noopt,$(DEB_BUILD_OPTIONS)))
+ifneq (,$(filter noopt,$(DEB_BUILD_OPTIONS)))
        CFLAGS += -O0
 else
        CFLAGS += -O2
 endif
 
 # The archdir map has been copied from openjdk-6's debian/rules.
-JAVA_ARCHDIR_MAP = armel=arm hppa=parisc lpia=i386 powerpc=ppc
+JAVA_ARCHDIR_MAP = armel=arm hppa=parisc lpia=i386 powerpc=ppc sh4=sh
 JAVA_ARCHDIR = $(strip $(patsubst $(DEB_BUILD_ARCH)=%, %, \
                        $(filter $(DEB_BUILD_ARCH)=%, $(JAVA_ARCHDIR_MAP))))
 ifeq (,$(JAVA_ARCHDIR))
@@ -43,6 +43,7 @@ JAVA_HOME = /usr/lib/jvm/java-6-openjdk
 JAVA_LIBDIR = $(JAVA_HOME)/jre/lib/$(JAVA_ARCHDIR)/server
 
 JAVAC = $(JAVA_HOME)/bin/javac
+JAR = $(JAVA_HOME)/bin/jar
 JAVA_CPPFLAGS = -I$(JAVA_HOME)/include
 JAVA_LDFLAGS = -L$(JAVA_LIBDIR) -Wl,-rpath -Wl,$(JAVA_LIBDIR)
 
@@ -61,6 +62,9 @@ confflags = --host=$(DEB_HOST_GNU_TYPE) \
 # These plugins do not provide any functionality under Linux.
 confflags += --disable-apple_sensors --disable-tape
 
+# libmodbus is required for the modbus plugin.
+confflags += --disable-modbus
+
 # libnetapp is required for the netapp plugin.
 confflags += --disable-netapp
 
@@ -81,12 +85,12 @@ confflags += --disable-zfs-arc
 
 # The static library netstat cannot be linked into shared objects on some
 # architectures (see bugs #358637, #419684 and #524593 for more details).
-ifneq (,$(findstring $(DEB_BUILD_ARCH),alpha amd64 hppa ia64 ppc64 mips mipsel))
+ifneq (,$(filter alpha amd64 hppa ia64 ppc64 mips mipsel, $(DEB_BUILD_ARCH)))
        confflags += --disable-netlink
 endif
 
 # These plugins are Linux-specific.
-ifneq (,$(findstring $(DEB_BUILD_ARCH),kfreebsd-i386 kfreebsd-amd64))
+ifneq (,$(filter kfreebsd-i386 kfreebsd-amd64, $(DEB_BUILD_ARCH)))
        confflags += \
                --disable-iptables \
                --disable-ipvs \
@@ -97,7 +101,7 @@ ifneq (,$(findstring $(DEB_BUILD_ARCH),kfreebsd-i386 kfreebsd-amd64))
 endif
 
 # These plugins have not been ported to FreeBSD yet.
-ifneq (,$(findstring $(DEB_BUILD_ARCH),kfreebsd-i386 kfreebsd-amd64))
+ifneq (,$(filter kfreebsd-i386 kfreebsd-amd64, $(DEB_BUILD_ARCH)))
        confflags += \
                --disable-battery \
                --disable-conntrack \
@@ -116,7 +120,7 @@ ifneq (,$(findstring $(DEB_BUILD_ARCH),kfreebsd-i386 kfreebsd-amd64))
 endif
 
 # Build-dependencies of these plugins are (not yet) available for kfreebsd.
-ifneq (,$(findstring $(DEB_BUILD_ARCH),kfreebsd-i386 kfreebsd-amd64))
+ifneq (,$(filter kfreebsd-i386 kfreebsd-amd64, $(DEB_BUILD_ARCH)))
        confflags += \
                --disable-gmond \
                --disable-libvirt \
@@ -126,7 +130,7 @@ endif
 
 # The hppa buildds currently do not keep up with Java related stuff, thus
 # prevending testing transitions.
-ifneq (,$(findstring $(DEB_BUILD_ARCH),hppa))
+ifneq (,$(filter hppa, $(DEB_BUILD_ARCH)))
        confflags += --disable-java
 endif
 
@@ -147,7 +151,7 @@ config.status: configure $(DPATCH_STAMPFN)
        
        PKG_CONFIG_PATH="$(CURDIR)/debian/pkgconfig:$$PKG_CONFIG_PATH" \
        ./configure $(confflags) CPPFLAGS="$(CPPFLAGS)" CFLAGS="$(CFLAGS)" \
-               JAVAC="$(JAVAC)" JAVA_CPPFLAGS="$(JAVA_CPPFLAGS)" \
+               JAVAC="$(JAVAC)" JAR="$(JAR)" JAVA_CPPFLAGS="$(JAVA_CPPFLAGS)" \
                JAVA_LDFLAGS="$(JAVA_LDFLAGS)" \
                || ( status=$$?; cat config.log; exit $$status )