From cd736d3e9464062c303ec444eb1a845ea0404c36 Mon Sep 17 00:00:00 2001 From: Roger Shimizu Date: Tue, 17 May 2016 21:11:05 +0900 Subject: [PATCH] A few commit recommend for Debian uploading (#636) * Add Security Hardening ref: https://wiki.debian.org/Hardening * Add debian/source/format * Remove -dbg package Debug Package is already generated automatically, as -dbgsym package ref: https://wiki.debian.org/DebugPackage * Do not include a duplicated changelog into deb package * Upgrade to policy version 3.9.8 No change is required, based on: https://www.debian.org/doc/debian-policy/upgrading-checklist.html * Update configure not to use local libs at all when choosing so --- configure | 12 ++++++++++-- configure.ac | 10 +++++++--- debian/.gitignore | 1 - debian/control | 14 +------------- debian/rules | 11 ++++++++++- debian/source/format | 1 + 6 files changed, 29 insertions(+), 20 deletions(-) create mode 100644 debian/source/format diff --git a/configure b/configure index 30409bf7..d4e2daa1 100755 --- a/configure +++ b/configure @@ -12669,6 +12669,8 @@ fi +if test -z "$USE_SYSTEM_SHARED_LIB_TRUE"; then : + else for ac_header in sys/inotify.h sys/epoll.h sys/event.h port.h poll.h sys/select.h sys/eventfd.h sys/signalfd.h do : @@ -12938,6 +12940,7 @@ fi +fi case $host in *-mingw*) @@ -15573,8 +15576,13 @@ if test -z "$USE_SYSTEM_SHARED_LIB_TRUE"; then : fi -ac_config_files="$ac_config_files shadowsocks-libev.pc Makefile libcork/Makefile libipset/Makefile libudns/Makefile libev/Makefile src/Makefile" +ac_config_files="$ac_config_files shadowsocks-libev.pc Makefile libcork/Makefile libipset/Makefile src/Makefile" +if test -z "$USE_SYSTEM_SHARED_LIB_TRUE"; then : + else + ac_config_files="$ac_config_files libudns/Makefile libev/Makefile" + +fi cat >confcache <<\_ACEOF # This file is a shell script that caches the results of configure # tests run on this system so they can be shared between configure @@ -16605,9 +16613,9 @@ do "Makefile") CONFIG_FILES="$CONFIG_FILES Makefile" ;; "libcork/Makefile") CONFIG_FILES="$CONFIG_FILES libcork/Makefile" ;; "libipset/Makefile") CONFIG_FILES="$CONFIG_FILES libipset/Makefile" ;; + "src/Makefile") CONFIG_FILES="$CONFIG_FILES src/Makefile" ;; "libudns/Makefile") CONFIG_FILES="$CONFIG_FILES libudns/Makefile" ;; "libev/Makefile") CONFIG_FILES="$CONFIG_FILES libev/Makefile" ;; - "src/Makefile") CONFIG_FILES="$CONFIG_FILES src/Makefile" ;; *) as_fn_error $? "invalid argument: \`$ac_config_target'" "$LINENO" 5;; esac diff --git a/configure.ac b/configure.ac index 736d00b7..86a43c10 100755 --- a/configure.ac +++ b/configure.ac @@ -55,7 +55,9 @@ AC_PROG_MAKE_SET AC_LANG_SOURCE dnl Checks for libev -m4_include([libev/libev.m4]) +AM_COND_IF([USE_SYSTEM_SHARED_LIB], + [], + [m4_include([libev/libev.m4])]) dnl Add library for mingw case $host in @@ -285,7 +287,9 @@ AC_CONFIG_FILES([ shadowsocks-libev.pc Makefile libcork/Makefile libipset/Makefile - libudns/Makefile - libev/Makefile src/Makefile]) +AM_COND_IF([USE_SYSTEM_SHARED_LIB], + [], + [AC_CONFIG_FILES([libudns/Makefile + libev/Makefile])]) AC_OUTPUT diff --git a/debian/.gitignore b/debian/.gitignore index 1f1d1576..5c178bac 100644 --- a/debian/.gitignore +++ b/debian/.gitignore @@ -1,5 +1,4 @@ *.substvars libshadowsocks1/ -libshadowsocks-dbg/ libshadowsocks-dev/ tmp/ diff --git a/debian/control b/debian/control index 20bd3dd2..35a221d0 100644 --- a/debian/control +++ b/debian/control @@ -3,7 +3,7 @@ Section: net Priority: extra Maintainer: Max Lv Build-Depends: debhelper (>= 9), dh-systemd (>= 1.5), pkg-config, libssl-dev (>= 0.9.8), autotools-dev, mime-support, gawk -Standards-Version: 3.9.6 +Standards-Version: 3.9.8 Homepage: http://www.shadowsocks.org Vcs-Git: https://github.com/shadowsocks/shadowsocks-libev.git Vcs-Browser: https://github.com/shadowsocks/shadowsocks-libev @@ -42,15 +42,3 @@ Description: lightweight and secure socks5 proxy (development files) embedded devices and low end boxes. . This package provides C header files for the libraries. - -Package: libshadowsocks-dbg -Architecture: any -Section: debug -Priority: extra -Breaks: shadowsocks-libev (<< 2.4.0) -Depends: libshadowsocks1 (= ${binary:Version}), ${misc:Depends} -Description: debugging symbols for the libshadowsocks1 library - Shadowsocks-libev is a lightweight and secure socks5 proxy for - embedded devices and low end boxes. - . - This package contains the debugging symbols for libshadowsocks1. diff --git a/debian/rules b/debian/rules index 02c6a432..8987d8d4 100755 --- a/debian/rules +++ b/debian/rules @@ -10,6 +10,12 @@ # Modified to make a template file for a multi-binary package with separated # build-arch and build-indep targets by Bill Allombert 2001 +# Security Hardening +export DEB_BUILD_MAINT_OPTIONS = hardening=+all + +DPKG_EXPORT_BUILDFLAGS = 1 +include /usr/share/dpkg/buildflags.mk + # Uncomment this to turn on verbose mode. #export DH_VERBOSE=1 @@ -20,7 +26,7 @@ export DH_OPTIONS DEB_HOST_MULTIARCH ?= $(shell dpkg-architecture -qDEB_HOST_MULTIARCH) override_dh_strip: - dh_strip --dbg-package=libshadowsocks-dbg + dh_strip sed -i "/dependency_libs/ s/'.*'/''/" `find . -name '*.la'` override_dh_auto_configure: @@ -34,5 +40,8 @@ override_dh_installinit: dh_installinit --no-start --name=shadowsocks-libev-redir@ dh_installinit --no-start --name=shadowsocks-libev-local@ +override_dh_installchangelogs: + dh_installchangelogs -XChanges + %: dh $@ --with systemd diff --git a/debian/source/format b/debian/source/format new file mode 100644 index 00000000..163aaf8d --- /dev/null +++ b/debian/source/format @@ -0,0 +1 @@ +3.0 (quilt)