Package: service-wrapper
Severity: wishlist
Tags: patch

It would be nice to have Jessie released with a newer service-wrapper
package. Please consider updating to the latest stable release (3.5.25).

Attached is a patch against the 3.5.22 service-wrapper packaging.

Due to hardening-wrapper's obsolescence, I have patched the Makefiles*
to add the LDFLAGS variable so that the proper hardening build flags can
be set. Once upstream fixes this problem this patch can be dropped.

In case it would be easier to deal with this request, I created a
repository on github for this package. My changes can be found at
https://github.com/kytvi2p/service-wrapper-java.git in the
master-3.5.25 branch.


From 64c11ee6995a9e916ce47f8d40a6fd2dcf341d59 Mon Sep 17 00:00:00 2001
From: Kill Your TV <killyou...@i2pmail.org>
Date: Thu, 28 Aug 2014 14:31:04 +0000
Subject: [PATCH] Update packaging for 3.5.25

---
 debian/changelog                               |  18 ++++
 debian/control                                 |   5 +-
 debian/patches/0002-kfreebsd-support.patch     |  39 ++++---
 debian/patches/0003-additional-makefiles.patch |  34 +++---
 debian/patches/0004-ldflags.patch              | 143 +++++++++++++++++++++++++
 debian/patches/bashisms_690722.patch           |   6 +-
 debian/patches/series                          |   1 +
 debian/rules                                   |   3 +-
 8 files changed, 213 insertions(+), 36 deletions(-)
 create mode 100644 debian/patches/0004-ldflags.patch

diff --git a/debian/changelog b/debian/changelog
index 4822949..c6f649a 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,3 +1,21 @@
+service-wrapper-java (3.5.25-1) UNRELEASED; urgency=medium
+
+  * New upstream release
+  * debian/control
+    - add java7-runtime-headless as an alternate to satisfy the java
+      dependencies
+    - drop build dependency on hardening-wrapper as this package is now
+      obsolete.
+    - build depend on  libcunit1-ncurses-dev, libncurses5-dev
+  * hardening
+    - Add ldflags.patch to insert a LDFLAGS variable into the upstream
+      makefiles so that hardening LDFLAGS can be used in the build. As noted
+      above, hardening-wrapper is no longer used as it's obsolete.
+    - Update additional-makefiles.patch and kfreebsd-support.patch to add the
+      LDFLAGS variable
+
+ -- Kill Your TV <killyou...@i2pmail.org>  Thu, 28 Aug 2014 13:24:16 +0000
+
 service-wrapper-java (3.5.22-3) unstable; urgency=low
 
   * Correct bug number typo in previous upload.
diff --git a/debian/control b/debian/control
index 9ba5061..ad9917b 100644
--- a/debian/control
+++ b/debian/control
@@ -11,7 +11,8 @@ Build-Depends: debhelper (>= 9),
  ant-optional,
  junit,
  junit4,
- hardening-wrapper
+ libcunit1-ncurses-dev,
+ libncurses5-dev
 Standards-Version: 3.9.5
 Vcs-Git: git://git.debian.org/git/pkg-java/service-wrapper-java.git
 Vcs-Browser: http://git.debian.org/?p=pkg-java/service-wrapper-java.git
@@ -48,7 +49,7 @@ Description:Jar daemon wrapper java libraries
 Package: libservice-wrapper-jni
 Architecture: amd64 armel armhf i386 ia64 kfreebsd-amd64 kfreebsd-i386 powerpc mips mipsel
 Depends: ${shlibs:Depends}, ${misc:Depends},
- default-jre-headless | java5-runtime-headless | java6-runtime-headless
+ default-jre-headless | java5-runtime-headless | java6-runtime-headless | java7-runtime-headless
 Suggests: libservice-wrapper-doc
 Description:Jar daemon wrapper JNI libraries
  This Package contains the JNI libraries used by the Java Service Wrapper.
diff --git a/debian/patches/0002-kfreebsd-support.patch b/debian/patches/0002-kfreebsd-support.patch
index 45079f9..a1dc9ad 100644
--- a/debian/patches/0002-kfreebsd-support.patch
+++ b/debian/patches/0002-kfreebsd-support.patch
@@ -6,12 +6,14 @@ Subject: kfreebsd support
  build.xml                           |  5 ++++-
  src/c/Makefile-kfreebsd-x86-32.make | 42 +++++++++++++++++++++++++++++++++++++
  src/c/Makefile-kfreebsd-x86-64.make | 42 +++++++++++++++++++++++++++++++++++++
- src/c/logger.c                      |  2 +-
+ src/c/logger.c                      |  3 ++-
  src/c/wrapper.c                     |  6 ++++--
- 5 files changed, 93 insertions(+), 4 deletions(-)
+ 5 files changed, 94 insertions(+), 4 deletions(-)
  create mode 100644 src/c/Makefile-kfreebsd-x86-32.make
  create mode 100644 src/c/Makefile-kfreebsd-x86-64.make
 
+diff --git a/build.xml b/build.xml
+index fa2c6d5..5206ccf 100644
 --- a/build.xml
 +++ b/build.xml
 @@ -87,6 +87,9 @@
@@ -33,6 +35,9 @@ Subject: kfreebsd support
              <not>
                  <equals arg1="${sun.arch.data.model}" arg2="${bits}"/>
              </not>
+diff --git a/src/c/Makefile-kfreebsd-x86-32.make b/src/c/Makefile-kfreebsd-x86-32.make
+new file mode 100644
+index 0000000..a70e660
 --- /dev/null
 +++ b/src/c/Makefile-kfreebsd-x86-32.make
 @@ -0,0 +1,42 @@
@@ -53,7 +58,7 @@ Subject: kfreebsd support
 +
 +wrapper_SOURCE = wrapper.c wrapperinfo.c wrappereventloop.c wrapper_unix.c property.c logger.c wrapper_file.c wrapper_i18n.c wrapper_hashmap.c
 +
-+libwrapper_so_OBJECTS = wrapper_i18n.o wrapperjni_unix.o wrapperinfo.o wrapperjni.o
++libwrapper_so_OBJECTS = wrapper_i18n.o wrapperjni_unix.o wrapperinfo.o wrapperjni.o loggerjni.o
 +
 +BIN = ../../bin
 +LIB = ../../lib
@@ -71,13 +76,16 @@ Subject: kfreebsd support
 +	if test ! -d .deps; then mkdir .deps; fi
 +
 +wrapper: $(wrapper_SOURCE)
-+	$(CC) $(wrapper_SOURCE) -lm -pthread -o $(BIN)/wrapper
++	$(CC) $(wrapper_SOURCE) -lm -pthread $(LDFLAGS)-o $(BIN)/wrapper
 +
 +libwrapper.so: $(libwrapper_so_OBJECTS)
-+	$(CC) -shared $(libwrapper_so_OBJECTS) -o $(LIB)/libwrapper.so
++	$(CC) -shared $(libwrapper_so_OBJECTS) $(LDFLAGS) -o $(LIB)/libwrapper.so
 +
 +#%.o: %.c
 +#	$(COMPILE) -c $(DEFS) $<
+diff --git a/src/c/Makefile-kfreebsd-x86-64.make b/src/c/Makefile-kfreebsd-x86-64.make
+new file mode 100644
+index 0000000..a2822f5
 --- /dev/null
 +++ b/src/c/Makefile-kfreebsd-x86-64.make
 @@ -0,0 +1,42 @@
@@ -98,7 +106,7 @@ Subject: kfreebsd support
 +
 +wrapper_SOURCE = wrapper.c wrapperinfo.c wrappereventloop.c wrapper_unix.c property.c logger.c wrapper_file.c wrapper_i18n.c wrapper_hashmap.c
 +
-+libwrapper_so_OBJECTS = wrapper_i18n.o wrapperjni_unix.o wrapperinfo.o wrapperjni.o
++libwrapper_so_OBJECTS = wrapper_i18n.o wrapperjni_unix.o wrapperinfo.o wrapperjni.o loggerjni.o
 +
 +BIN = ../../bin
 +LIB = ../../lib
@@ -116,27 +124,32 @@ Subject: kfreebsd support
 +	if test ! -d .deps; then mkdir .deps; fi
 +
 +wrapper: $(wrapper_SOURCE)
-+	$(CC) $(wrapper_SOURCE) -lm -pthread -o $(BIN)/wrapper
++	$(CC) $(wrapper_SOURCE) -lm -pthread $(LDFLAGS) -o $(BIN)/wrapper
 +
 +libwrapper.so: $(libwrapper_so_OBJECTS)
-+	$(CC) -shared $(libwrapper_so_OBJECTS) -o $(LIB)/libwrapper.so
++	$(CC) -shared $(libwrapper_so_OBJECTS) $(LDFLAGS) -o $(LIB)/libwrapper.so
 +
 +#%.o: %.c
 +#	$(COMPILE) -c $(DEFS) $<
+diff --git a/src/c/logger.c b/src/c/logger.c
+index 15e5bc8..3c873bc 100644
 --- a/src/c/logger.c
 +++ b/src/c/logger.c
-@@ -76,7 +76,7 @@
+@@ -74,7 +74,8 @@ typedef long intptr_t;
+   #include <sys/fcntl.h>
   #elif defined(AIX) || defined(HPUX) || defined(MACOSX) || defined(OSF1)
   #elif defined(IRIX)
-   #define PATH_MAX FILENAME_MAX
 - #elif defined(FREEBSD)
++  #define PATH_MAX FILENAME_MAX
 + #elif defined(FREEBSD) || defined(KFREEBSD)
    #include <sys/param.h>
    #include <errno.h>
   #else /* LINUX */
+diff --git a/src/c/wrapper.c b/src/c/wrapper.c
+index deed088..4807571 100644
 --- a/src/c/wrapper.c
 +++ b/src/c/wrapper.c
-@@ -98,7 +98,7 @@
+@@ -93,7 +93,7 @@
   #elif defined(AIX) || defined(HPUX) || defined(MACOSX) || defined(OSF1)
   #elif defined(IRIX)
    #define PATH_MAX FILENAME_MAX
@@ -145,7 +158,7 @@ Subject: kfreebsd support
    #include <sys/param.h>
    #include <errno.h>
   #else /* LINUX */
-@@ -4619,7 +4619,7 @@
+@@ -4701,7 +4701,7 @@ int checkIfBinary(const TCHAR *filename) {
              log_printf(WRAPPER_SOURCE_WRAPPER, LEVEL_DEBUG, TEXT("Magic number for file %s: 0x%02x%02x%02x%02x"), filename, head[0], head[1], head[2], head[3]);
          }
  
@@ -154,7 +167,7 @@ Subject: kfreebsd support
          if (head[1] == 'E' && head[2] == 'L' && head[3] == 'F') {
              return 1; /*ELF */
  #elif defined(AIX)
-@@ -5913,6 +5913,8 @@
+@@ -6022,6 +6022,8 @@ int wrapperBuildJavaCommandArrayInner(TCHAR **strings, int addQuotes, const TCHA
                                TEXT("wrapper.java.additional.auto_bits.solaris"),
  #elif defined(FREEBSD)
                                TEXT("wrapper.java.additional.auto_bits.freebsd"),
diff --git a/debian/patches/0003-additional-makefiles.patch b/debian/patches/0003-additional-makefiles.patch
index cc447e3..77fe765 100644
--- a/debian/patches/0003-additional-makefiles.patch
+++ b/debian/patches/0003-additional-makefiles.patch
@@ -19,9 +19,9 @@ Description: linux makefiles for other architectures
 +
 +DEFS = -I$(INCLUDE) -I$(INCLUDE)/linux
 +
-+wrapper_SOURCE = wrapper.c wrapperinfo.c wrappereventloop.c wrapper_unix.c property.c logger.c wrapper_file.c wrapper_i18n.c test.c wrapper_hashmap.c
++wrapper_SOURCE = wrapper.c wrapperinfo.c wrappereventloop.c wrapper_unix.c property.c logger.c wrapper_file.c wrapper_i18n.c wrapper_hashmap.c
 +
-+libwrapper_so_OBJECTS = wrapper_i18n.o wrapperjni_unix.o wrapperinfo.o wrapperjni.o
++libwrapper_so_OBJECTS = wrapper_i18n.o wrapperjni_unix.o wrapperinfo.o wrapperjni.o loggerjni.o
 +
 +BIN = ../../bin
 +LIB = ../../lib
@@ -39,10 +39,10 @@ Description: linux makefiles for other architectures
 +	if test ! -d .deps; then mkdir .deps; fi
 +
 +wrapper: $(wrapper_SOURCE)
-+	$(COMPILE) -pthread $(wrapper_SOURCE) -lm -o $(BIN)/wrapper
++	$(COMPILE) -pthread $(wrapper_SOURCE) -lm $(LDFLAGS) -o $(BIN)/wrapper
 +
 +libwrapper.so: $(libwrapper_so_OBJECTS)
-+	${COMPILE} -shared $(libwrapper_so_OBJECTS) -o $(LIB)/libwrapper.so
++	${COMPILE} -shared $(libwrapper_so_OBJECTS) $(LDFLAGS) -o $(LIB)/libwrapper.so
 +
 +%.o: %.c
 +	@echo '$(COMPILE) -c $<'; \
@@ -71,9 +71,9 @@ Description: linux makefiles for other architectures
 +
 +DEFS = -I$(INCLUDE) -I$(INCLUDE)/linux
 +
-+wrapper_SOURCE = wrapper.c wrapperinfo.c wrappereventloop.c wrapper_unix.c property.c logger.c wrapper_file.c wrapper_i18n.c test.c wrapper_hashmap.c
++wrapper_SOURCE = wrapper.c wrapperinfo.c wrappereventloop.c wrapper_unix.c property.c logger.c wrapper_file.c wrapper_i18n.c wrapper_hashmap.c
 +
-+libwrapper_so_OBJECTS = wrapper_i18n.o wrapperjni_unix.o wrapperinfo.o wrapperjni.o
++libwrapper_so_OBJECTS = wrapper_i18n.o wrapperjni_unix.o wrapperinfo.o wrapperjni.o loggerjni.o
 +
 +BIN = ../../bin
 +LIB = ../../lib
@@ -91,10 +91,10 @@ Description: linux makefiles for other architectures
 +	if test ! -d .deps; then mkdir .deps; fi
 +
 +wrapper: $(wrapper_SOURCE)
-+	$(COMPILE) -pthread $(wrapper_SOURCE) -lm -o $(BIN)/wrapper
++	$(COMPILE) -pthread $(wrapper_SOURCE) -lm $(LDFLAGS) -o $(BIN)/wrapper
 +
 +libwrapper.so: $(libwrapper_so_OBJECTS)
-+	${COMPILE} -shared $(libwrapper_so_OBJECTS) -o $(LIB)/libwrapper.so
++	${COMPILE} -shared $(libwrapper_so_OBJECTS) $(LDFLAGS) -o $(LIB)/libwrapper.so
 +
 +%.o: %.c
 +	@echo '$(COMPILE) -c $<'; \
@@ -125,7 +125,7 @@ Description: linux makefiles for other architectures
 +
 +wrapper_SOURCE = wrapper.c wrapperinfo.c wrappereventloop.c wrapper_unix.c property.c logger.c wrapper_file.c wrapper_i18n.c wrapper_hashmap.c
 +
-+libwrapper_so_OBJECTS = wrapper_i18n.o wrapperjni_unix.o wrapperinfo.o wrapperjni.o
++libwrapper_so_OBJECTS = wrapper_i18n.o wrapperjni_unix.o wrapperinfo.o wrapperjni.o loggerjni.o
 +
 +BIN = ../../bin
 +LIB = ../../lib
@@ -143,10 +143,10 @@ Description: linux makefiles for other architectures
 +	if test ! -d .deps; then mkdir .deps; fi
 +
 +wrapper: $(wrapper_SOURCE)
-+	$(COMPILE) -lm -pthread $(wrapper_SOURCE) -o $(BIN)/wrapper
++	$(COMPILE) -lm -pthread $(wrapper_SOURCE) $(LDFLAGS) -o $(BIN)/wrapper
 +
 +libwrapper.so: $(libwrapper_so_OBJECTS)
-+	${COMPILE} -shared $(libwrapper_so_OBJECTS) -o $(LIB)/libwrapper.so
++	${COMPILE} -shared $(libwrapper_so_OBJECTS) $(LDFLAGS) -o $(LIB)/libwrapper.so
 +
 +%.o: %.c
 +	@echo '$(COMPILE) -c $<'; \
@@ -177,7 +177,7 @@ Description: linux makefiles for other architectures
 +
 +wrapper_SOURCE = wrapper.c wrapperinfo.c wrappereventloop.c wrapper_unix.c property.c logger.c wrapper_file.c wrapper_i18n.c wrapper_hashmap.c
 +
-+libwrapper_so_OBJECTS = wrapper_i18n.o wrapperjni_unix.o wrapperinfo.o wrapperjni.o
++libwrapper_so_OBJECTS = wrapper_i18n.o wrapperjni_unix.o wrapperinfo.o wrapperjni.o loggerjni.o
 +
 +BIN = ../../bin
 +LIB = ../../lib
@@ -195,10 +195,10 @@ Description: linux makefiles for other architectures
 +	if test ! -d .deps; then mkdir .deps; fi
 +
 +wrapper: $(wrapper_SOURCE)
-+	$(COMPILE) -lm -pthread $(wrapper_SOURCE) -o $(BIN)/wrapper
++	$(COMPILE) -lm -pthread $(LDFLAGS) $(wrapper_SOURCE) -o $(BIN)/wrapper
 +
 +libwrapper.so: $(libwrapper_so_OBJECTS)
-+	${COMPILE} -shared $(libwrapper_so_OBJECTS) -o $(LIB)/libwrapper.so
++	${COMPILE} -shared $(LDFLAGS) $(libwrapper_so_OBJECTS) -o $(LIB)/libwrapper.so
 +
 +%.o: %.c
 +	@echo '$(COMPILE) -c $<'; \
@@ -229,7 +229,7 @@ Description: linux makefiles for other architectures
 +
 +wrapper_SOURCE = wrapper.c wrapperinfo.c wrappereventloop.c wrapper_unix.c property.c logger.c wrapper_file.c wrapper_i18n.c wrapper_hashmap.c
 +
-+libwrapper_so_OBJECTS = wrapper_i18n.o wrapperjni_unix.o wrapperinfo.o wrapperjni.o
++libwrapper_so_OBJECTS = wrapper_i18n.o wrapperjni_unix.o wrapperinfo.o wrapperjni.o loggerjni.o
 +
 +BIN = ../../bin
 +LIB = ../../lib
@@ -247,10 +247,10 @@ Description: linux makefiles for other architectures
 +	if test ! -d .deps; then mkdir .deps; fi
 +
 +wrapper: $(wrapper_SOURCE)
-+	$(COMPILE) -lm -pthread $(wrapper_SOURCE) -o $(BIN)/wrapper
++	$(COMPILE) -lm -pthread $(LDFLAGS) $(wrapper_SOURCE) -o $(BIN)/wrapper
 +
 +libwrapper.so: $(libwrapper_so_OBJECTS)
-+	${COMPILE} -shared $(libwrapper_so_OBJECTS) -o $(LIB)/libwrapper.so
++	${COMPILE} -shared $(LDFLAGS) $(libwrapper_so_OBJECTS) -o $(LIB)/libwrapper.so
 +
 +%.o: %.c
 +	@echo '$(COMPILE) -c $<'; \
diff --git a/debian/patches/0004-ldflags.patch b/debian/patches/0004-ldflags.patch
new file mode 100644
index 0000000..efe9e8f
--- /dev/null
+++ b/debian/patches/0004-ldflags.patch
@@ -0,0 +1,143 @@
+From: Kill Your TV <killyou...@i2pmail.org>
+Date: Thu, 28 Aug 2014 09:26:00 +0000
+Subject: ldflags
+
+Add the LDFLAGS variable to the makefiles so packages can be hardened without
+the obsolete hardening-wrapper package.
+---
+ src/c/Makefile-linux-armel-32.make | 4 ++--
+ src/c/Makefile-linux-armhf-32.make | 4 ++--
+ src/c/Makefile-linux-ia-64.make    | 4 ++--
+ src/c/Makefile-linux-ppc-32.make   | 4 ++--
+ src/c/Makefile-linux-ppc-64.make   | 4 ++--
+ src/c/Makefile-linux-x86-32.make   | 6 +++---
+ src/c/Makefile-linux-x86-64.make   | 6 +++---
+ 7 files changed, 16 insertions(+), 16 deletions(-)
+
+diff --git a/src/c/Makefile-linux-armel-32.make b/src/c/Makefile-linux-armel-32.make
+index c257910..fd99ec7 100644
+--- a/src/c/Makefile-linux-armel-32.make
++++ b/src/c/Makefile-linux-armel-32.make
+@@ -33,10 +33,10 @@ init:
+ 	if test ! -d .deps; then mkdir .deps; fi
+ 
+ wrapper: $(wrapper_SOURCE)
+-	$(COMPILE) -pthread $(wrapper_SOURCE) -lm -o $(BIN)/wrapper
++	$(COMPILE) -pthread $(wrapper_SOURCE) -lm $(LDFLAGS) -o $(BIN)/wrapper
+ 
+ libwrapper.so: $(libwrapper_so_OBJECTS)
+-	${COMPILE} -shared $(libwrapper_so_OBJECTS) -o $(LIB)/libwrapper.so
++	${COMPILE} -shared $(libwrapper_so_OBJECTS) $(LDFLAGS) -o $(LIB)/libwrapper.so
+ 
+ %.o: %.c
+ 	@echo '$(COMPILE) -c $<'; \
+diff --git a/src/c/Makefile-linux-armhf-32.make b/src/c/Makefile-linux-armhf-32.make
+index c257910..fd99ec7 100644
+--- a/src/c/Makefile-linux-armhf-32.make
++++ b/src/c/Makefile-linux-armhf-32.make
+@@ -33,10 +33,10 @@ init:
+ 	if test ! -d .deps; then mkdir .deps; fi
+ 
+ wrapper: $(wrapper_SOURCE)
+-	$(COMPILE) -pthread $(wrapper_SOURCE) -lm -o $(BIN)/wrapper
++	$(COMPILE) -pthread $(wrapper_SOURCE) -lm $(LDFLAGS) -o $(BIN)/wrapper
+ 
+ libwrapper.so: $(libwrapper_so_OBJECTS)
+-	${COMPILE} -shared $(libwrapper_so_OBJECTS) -o $(LIB)/libwrapper.so
++	${COMPILE} -shared $(libwrapper_so_OBJECTS) $(LDFLAGS) -o $(LIB)/libwrapper.so
+ 
+ %.o: %.c
+ 	@echo '$(COMPILE) -c $<'; \
+diff --git a/src/c/Makefile-linux-ia-64.make b/src/c/Makefile-linux-ia-64.make
+index d4be3f1..4ec89ff 100644
+--- a/src/c/Makefile-linux-ia-64.make
++++ b/src/c/Makefile-linux-ia-64.make
+@@ -33,10 +33,10 @@ init:
+ 	if test ! -d .deps; then mkdir .deps; fi
+ 
+ wrapper: $(wrapper_SOURCE)
+-	$(COMPILE) -lm -pthread $(wrapper_SOURCE) -o $(BIN)/wrapper
++	$(COMPILE) -lm -pthread $(LDFLAGS) $(wrapper_SOURCE) -o $(BIN)/wrapper
+ 
+ libwrapper.so: $(libwrapper_so_OBJECTS)
+-	${COMPILE} -lm -shared $(libwrapper_so_OBJECTS) -o $(LIB)/libwrapper.so
++	${COMPILE} -lm -shared $(LDFLAGS) $(libwrapper_so_OBJECTS) -o $(LIB)/libwrapper.so
+ 
+ %.o: %.c
+ 	@echo '$(COMPILE) -c $<'; \
+diff --git a/src/c/Makefile-linux-ppc-32.make b/src/c/Makefile-linux-ppc-32.make
+index fbc2424..8dd57c4 100644
+--- a/src/c/Makefile-linux-ppc-32.make
++++ b/src/c/Makefile-linux-ppc-32.make
+@@ -33,10 +33,10 @@ init:
+ 	if test ! -d .deps; then mkdir .deps; fi
+ 
+ wrapper: $(wrapper_SOURCE)
+-	$(COMPILE) -lm -pthread $(wrapper_SOURCE) -o $(BIN)/wrapper
++	$(COMPILE) -lm -pthread $(LDFLAGS) $(wrapper_SOURCE) -o $(BIN)/wrapper
+ 
+ libwrapper.so: $(libwrapper_so_OBJECTS)
+-	${COMPILE} -shared $(libwrapper_so_OBJECTS) -o $(LIB)/libwrapper.so
++	${COMPILE} -shared $(LDFLAGS) $(libwrapper_so_OBJECTS) -o $(LIB)/libwrapper.so
+ 
+ %.o: %.c
+ 	@echo '$(COMPILE) -c $<'; \
+diff --git a/src/c/Makefile-linux-ppc-64.make b/src/c/Makefile-linux-ppc-64.make
+index 78db926..f32b2a3 100644
+--- a/src/c/Makefile-linux-ppc-64.make
++++ b/src/c/Makefile-linux-ppc-64.make
+@@ -33,10 +33,10 @@ init:
+ 	if test ! -d .deps; then mkdir .deps; fi
+ 
+ wrapper: $(wrapper_SOURCE)
+-	$(COMPILE) -lm -pthread $(wrapper_SOURCE) -o $(BIN)/wrapper
++	$(COMPILE) -lm -pthread $(LDFLAGS) $(wrapper_SOURCE) -o $(BIN)/wrapper
+ 
+ libwrapper.so: $(libwrapper_so_OBJECTS)
+-	${COMPILE} -shared $(libwrapper_so_OBJECTS) -o $(LIB)/libwrapper.so
++	${COMPILE} -shared $(LDFLAGS) $(libwrapper_so_OBJECTS) -o $(LIB)/libwrapper.so
+ 
+ %.o: %.c
+ 	@echo '$(COMPILE) -c $<'; \
+diff --git a/src/c/Makefile-linux-x86-32.make b/src/c/Makefile-linux-x86-32.make
+index 5cad095..f5697c2 100644
+--- a/src/c/Makefile-linux-x86-32.make
++++ b/src/c/Makefile-linux-x86-32.make
+@@ -36,13 +36,13 @@ init:
+ 	if test ! -d .deps; then mkdir .deps; fi
+ 
+ wrapper: $(wrapper_SOURCE)
+-	$(COMPILE) -pthread $(wrapper_SOURCE) -lm -o $(BIN)/wrapper
++	$(COMPILE) -pthread $(wrapper_SOURCE) -lm $(LDFLAGS) -o $(BIN)/wrapper
+ 
+ testsuite: $(testsuite_SOURCE)
+-	$(COMPILE) -DCUNIT $(testsuite_SOURCE) -lm -pthread -L/usr/local/lib -lncurses -lcunit -o $(TEST)/testsuite
++	$(COMPILE) -DCUNIT $(testsuite_SOURCE) -lm $(LDFLAGS) -pthread -L/usr/local/lib -lncurses -lcunit -o $(TEST)/testsuite
+ 
+ libwrapper.so: $(libwrapper_so_OBJECTS)
+-	${COMPILE} -shared $(libwrapper_so_OBJECTS) -o $(LIB)/libwrapper.so
++	${COMPILE} -shared $(libwrapper_so_OBJECTS) $(LDFLAGS) -o $(LIB)/libwrapper.so
+ 
+ %.o: %.c
+ 	@echo '$(COMPILE) -c $<'; \
+diff --git a/src/c/Makefile-linux-x86-64.make b/src/c/Makefile-linux-x86-64.make
+index d6af907..cab1d9f 100644
+--- a/src/c/Makefile-linux-x86-64.make
++++ b/src/c/Makefile-linux-x86-64.make
+@@ -36,13 +36,13 @@ init:
+ 	if test ! -d .deps; then mkdir .deps; fi
+ 
+ wrapper: $(wrapper_SOURCE)
+-	$(COMPILE) -pthread $(wrapper_SOURCE) -lm -o $(BIN)/wrapper
++	$(COMPILE) -pthread $(wrapper_SOURCE) -lm $(LDFLAGS) -o $(BIN)/wrapper
+ 
+ testsuite: $(testsuite_SOURCE)
+-	$(COMPILE) -DCUNIT $(testsuite_SOURCE) -lm -pthread -L/usr/local/lib -lncurses -lcunit -o $(TEST)/testsuite
++	$(COMPILE) -DCUNIT $(testsuite_SOURCE) -lm $(LDFLAGS) -pthread -L/usr/local/lib -lncurses -lcunit -o $(TEST)/testsuite
+ 
+ libwrapper.so: $(libwrapper_so_OBJECTS)
+-	${COMPILE} -shared $(libwrapper_so_OBJECTS) -o $(LIB)/libwrapper.so
++	${COMPILE} -shared $(libwrapper_so_OBJECTS) $(LDFLAGS) -o $(LIB)/libwrapper.so
+ 
+ %.o: %.c 
+ 	@echo '$(COMPILE) -c $<'; \
diff --git a/debian/patches/bashisms_690722.patch b/debian/patches/bashisms_690722.patch
index f62955f..6b72137 100644
--- a/debian/patches/bashisms_690722.patch
+++ b/debian/patches/bashisms_690722.patch
@@ -3,9 +3,9 @@ Author: tony mancill <tmanc...@debian.org>
 
 --- a/src/bin/sh.script.in
 +++ b/src/bin/sh.script.in
-@@ -283,11 +283,11 @@
+@@ -294,11 +294,11 @@ if [ "$DIST_OS" = "macosx" ]
  then
-     OS_VER=`sw_vers | grep 'ProductVersion:' | grep -o '[0-9]*\.[0-9]*\.[0-9]*'`
+     OS_VER=`sw_vers | grep 'ProductVersion:' | grep -o '[0-9]*\.[0-9]*\.[0-9]*\|[0-9]*\.[0-9]*'`
      DIST_ARCH="universal"
 -    if [[ "$OS_VER" < "10.5.0" ]]
 +    if [ "$OS_VER" \< "10.5.0" ]
@@ -17,7 +17,7 @@ Author: tony mancill <tmanc...@debian.org>
          then
              DIST_BITS="64"
          else
-@@ -966,7 +966,7 @@
+@@ -981,7 +981,7 @@ macosxstart() {
      fi
      # If launchd is set to run the daemon already at Load, we don't need to call start
      getpid
diff --git a/debian/patches/series b/debian/patches/series
index f3140a7..9df836a 100644
--- a/debian/patches/series
+++ b/debian/patches/series
@@ -1,3 +1,4 @@
 bashisms_690722.patch
 0002-kfreebsd-support.patch
 0003-additional-makefiles.patch
+0004-ldflags.patch
diff --git a/debian/rules b/debian/rules
index b7600e8..8ad9562 100755
--- a/debian/rules
+++ b/debian/rules
@@ -14,7 +14,8 @@ export DEB_HOST_ARCH := $(shell dpkg-architecture -qDEB_HOST_ARCH)
 export DEB_HOST_ARCH_CPU := $(shell dpkg-architecture -qDEB_HOST_ARCH_CPU)
 
 export JAVA_HOME=/usr/lib/jvm/default-java
-export DEB_BUILD_HARDENING=1
+CFLAGS:=$(shell dpkg-buildflags --get CFLAGS)
+LDFLAGS:=$(shell dpkg-buildflags --get LDFLAGS)
 
 %:
 	dh $@  --with javahelper
-- 
2.1.0

Attachment: signature.asc
Description: PGP signature

__
This is the maintainer address of Debian's Java team
<http://lists.alioth.debian.org/cgi-bin/mailman/listinfo/pkg-java-maintainers>. 
Please use
debian-j...@lists.debian.org for discussions and questions.

Reply via email to