Modernize debian/ and add multiarch support and hardening flags.
authorroubert@google.com <roubert@google.com@ee073f10-1060-11df-b6a4-87a95322a99c>
Tue, 3 Jun 2014 08:24:40 +0000 (08:24 +0000)
committerroubert@google.com <roubert@google.com@ee073f10-1060-11df-b6a4-87a95322a99c>
Tue, 3 Jun 2014 08:24:40 +0000 (08:24 +0000)
R=daniel@pocock.pro
BUG=

Review URL: https://codereview.appspot.com/103800043

git-svn-id: http://libphonenumber.googlecode.com/svn/trunk@668 ee073f10-1060-11df-b6a4-87a95322a99c

debian/compat
debian/control
debian/libphonenumber-dev.install
debian/libphonenumber6.install
debian/rules

index 7f8f011..ec63514 100644 (file)
@@ -1 +1 @@
-7
+9
index f6b0c7b..306b5b7 100644 (file)
@@ -2,10 +2,12 @@ Source: libphonenumber
 Priority: optional
 Maintainer: Fredrik Roubert <roubert@google.com>
 Build-Depends: ant,
+               ant-optional,
                cmake,
-               debhelper (>= 7.0.50~),
+               debhelper (>= 9),
                default-jdk | java-sdk,
                javahelper (>= 0.34),
+               junit,
                libboost-dev (>= 1.40),
                libboost-system-dev (>= 1.40),
                libboost-thread-dev (>= 1.40),
@@ -14,7 +16,7 @@ Build-Depends: ant,
                libprotobuf-dev (>= 2.4),
                libre2-dev,
                protobuf-compiler
-Standards-Version: 3.9.1
+Standards-Version: 3.9.5
 Section: libs
 Homepage: http://code.google.com/p/libphonenumber/
 Vcs-Browser: http://code.google.com/p/libphonenumber/source/browse/
@@ -24,21 +26,21 @@ Package: libphonenumber-dev
 Section: libdevel
 Architecture: any
 Depends: libphonenumber6 (=${binary:Version}), ${misc:Depends}
-Description: parsing/formatting/validating phone numbers - development
+Description: parsing/formatting/validating phone numbers - development files
  Google's common C++ and Java library for parsing, formatting, storing and
  validating international phone numbers.
  .
  This package contains the static libraries and include files.
 
 Package: libphonenumber6
-Section: libs
 Architecture: any
+Pre-Depends: ${misc:Pre-Depends}
 Depends: ${shlibs:Depends}, ${misc:Depends}
-Description: parsing/formatting/validating phone numbers - runtime
+Description: parsing/formatting/validating phone numbers
  Google's common C++ and Java library for parsing, formatting, storing and
  validating international phone numbers.
  .
- This package contains the runtime libraries.
+ This package contains the runtime libraries for C++ users.
 
 Package: libphonenumber-java
 Section: java
@@ -48,4 +50,4 @@ Description: parsing/formatting/validating phone numbers - java
  Google's common C++ and Java library for parsing, formatting, storing and
  validating international phone numbers.
  .
- This package contains the JAR files.
+ This package contains the runtime library JARs for Java users.
index d1bffed..a3c8f6c 100644 (file)
@@ -1,3 +1,3 @@
 usr/include/*
-usr/lib/lib*.a
-usr/lib/lib*.so
+usr/lib/*/lib*.a
+usr/lib/*/lib*.so
index d0dbfd1..3ddde58 100644 (file)
@@ -1 +1 @@
-usr/lib/lib*.so.*
+usr/lib/*/lib*.so.*
index b067e8e..8beed53 100755 (executable)
@@ -26,6 +26,12 @@ CMAKE_FLAGS := -DCMAKE_INSTALL_PREFIX=/usr
 CPP_BUILD := cpp/build
 JAVA_BUILD := java/build
 
+# CMake doesn't read CPPFLAGS and dh_auto commands are not used in this rules
+# file so we have to manually set the flags here to ensure that hardening flags
+# are used:
+CFLAGS += $(CPPFLAGS)
+CXXFLAGS += $(CPPFLAGS)
+
 ifneq (,$(filter noopt,$(DEB_BUILD_OPTIONS)))
   CFLAGS += -O0
 else
@@ -55,8 +61,14 @@ ifeq (,$(findstring nocheck,$(DEB_BUILD_OPTIONS)))
        $(ANT) -f $(JAVA_BUILD).xml junit
 endif
 
+# Hack for multiarch: CMake doesn't really support libdir so we just manually
+# move /usr/lib/* to a proper multiarch location.
 override_dh_auto_install:
        dh_auto_install --builddirectory=$(CPP_BUILD)
+       mkdir -p debian/tmp/usr/lib-$(DEB_HOST_MULTIARCH)
+       mv debian/tmp/usr/lib/* debian/tmp/usr/lib-$(DEB_HOST_MULTIARCH)
+       mv debian/tmp/usr/lib-$(DEB_HOST_MULTIARCH) \
+               debian/tmp/usr/lib/$(DEB_HOST_MULTIARCH)
 
 override_dh_auto_clean:
        -test -d $(CPP_BUILD) && $(MAKE) -C $(CPP_BUILD) clean