From 0296ce420027e7ad438380f95f48660649d1390a Mon Sep 17 00:00:00 2001 From: Peter Palfrader Date: Thu, 5 Jul 2012 08:21:32 +0000 Subject: Improve apparmor support git-svn-id: svn+ssh://asteria.noreply.org/svn/weaselutils/trunk@536 bc3d92e2-beff-0310-a7cd-cc87d7ac0ede --- build-tor-sources | 35 +++++++++++++++++++++++------------ 1 file changed, 23 insertions(+), 12 deletions(-) (limited to 'build-tor-sources') diff --git a/build-tor-sources b/build-tor-sources index fc89c09..3e0f850 100755 --- a/build-tor-sources +++ b/build-tor-sources @@ -96,10 +96,17 @@ hardening_backport() { } remove_apparmor() { + local builddep_only="${1:-}" + if grep -q dh-apparmor debian/control; then sed -i -e '/^Build-Depends/ s/, *dh-apparmor//' debian/control - sed -i -e 's/dh_apparmor/# &/' debian/rules - dch "Remove apparmor support for backport." + if [ "$builddep_only" = 1 ]; then + dch "Remove dh-apparmor build dependency for backport." + else + sed -i -e 's/dh_apparmor/# &/' debian/rules + sed -i -e 's;install.*etc/apparmor.d;# &;' debian/rules + dch "Remove apparmor support for backport." + fi fi } @@ -179,7 +186,7 @@ backport_all() { # ONEIRIC (EOL: April 2013) ################################################# bp1 $pkg $dir $sid_debian_version oneiric - (cd $dir; remove_apparmor) + (cd $dir; remove_apparmor 1) # dh_apparmor is in their patched debhelper bp2 $pkg $dir $origtar # PRECISE (EOL: April 2017) @@ -192,17 +199,20 @@ backport_all() { ## BPO ################################################# - # SQUEEZE-BPO - ################################################# - bp1 $pkg $dir $sid_debian_version squeeze-bpo - bp2 $pkg $dir $origtar + if [ "${DO_BPO:-}" = 1 ]; then + # SQUEEZE-BPO + ################################################# + bp1 $pkg $dir $sid_debian_version squeeze-bpo + bp2 $pkg $dir $origtar - mkdir bpo - mv *'~bpo'* bpo/ + mkdir bpo + mv *'~bpo'* bpo/ + fi } main() { local origtar="$1"; shift + local deb_revision="$1"; shift local gitdir="$1"; shift local pkg="$1"; shift @@ -212,7 +222,6 @@ main() { echo "Usage: $0 [version]" >&2 exit 1; fi - local deb_revision="${2:-1}" if [ ! -e "$origtar" ] ; then @@ -290,12 +299,14 @@ case "$(basename $0)" in set -x GITDIR="$HOME/projects/debian/debian/obfsproxy/obfsproxy" PKG="obfsproxy" - main "${1:-}" $GITDIR $PKG + SKIP_HARDY=1 + main "${1:-}" ${2:-1} $GITDIR $PKG ;; build-tor-sources) set -x GITDIR="$HOME/projects/tor/tor" PKG="tor" - main "${1:-}" $GITDIR $PKG + DO_BPO=1 + main "${1:-}" ${2:-1} $GITDIR $PKG ;; esac -- cgit v1.2.3