From 14a79b5500af0dfad94aebc9276e81bec9d45ae5 Mon Sep 17 00:00:00 2001 From: Roger Shimizu Date: Mon, 13 Feb 2017 20:29:07 +0900 Subject: [PATCH] Add deb build script for ubuntu trusty 14.04 --- scripts/deb4trusty.sh | 72 +++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 72 insertions(+) create mode 100755 scripts/deb4trusty.sh diff --git a/scripts/deb4trusty.sh b/scripts/deb4trusty.sh new file mode 100755 index 00000000..c8c15830 --- /dev/null +++ b/scripts/deb4trusty.sh @@ -0,0 +1,72 @@ +#!/bin/sh +# Copyright 2017 Roger Shimizu +# +# This is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 3 of the License, or +# (at your option) any later version. + +DEPS="git-buildpackage equivs dh-autoreconf" +sudo apt-get install -y $DEPS + +gbp_build() { + REPO=$1 + BRANCH=$2 + PROJECT_NAME=$(basename $1|sed s/\.git$//) + gbp clone --pristine-tar $REPO + cd $PROJECT_NAME + git checkout $BRANCH + mk-build-deps --root-cmd sudo --install --tool "apt-get -o Debug::pkgProblemResolver=yes --no-install-recommends -y" + rm ${PROJECT_NAME}-build-deps_*.deb + gbp buildpackage -us -uc --git-ignore-branch --git-pristine-tar + cd - +} + +dsc_build() { + DSC=$1 + DSC_FILE=$(basename $1) + dget -ux $DSC + PROJECT_NAME=$(grep ^Source: $DSC_FILE|cut -d" " -f2) + echo cd ${PROJECT_NAME}-* + cd ${PROJECT_NAME}-* + mk-build-deps --root-cmd sudo --install --tool "apt-get -o Debug::pkgProblemResolver=yes --no-install-recommends -y" + rm ${PROJECT_NAME}-build-deps_*.deb + dpkg-buildpackage -us -uc + cd - +} + +# Build libcork deb if you don't have +gbp_build https://github.com/rogers0/libcork trusty +sudo dpkg -i libcork-dev_*.deb libcork16_*.deb + +# Build libcorkipset deb if you don't have +gbp_build https://github.com/rogers0/libcorkipset trusty +sudo dpkg -i libcorkipset-dev_*.deb libcorkipset1_*.deb + +# Build libmbedtls deb if you don't have +gbp_build https://anonscm.debian.org/cgit/collab-maint/mbedtls.git debian/jessie-backports +sudo dpkg -i libmbed*.deb + +# Build libsodium deb if you don't have +dsc_build http://httpredir.debian.org/debian/pool/main/libs/libsodium/libsodium_1.0.11-1~bpo8+1.dsc +sudo dpkg -i libsodium*.deb + +# Build shadowsocks-libev +gbp_build https://anonscm.debian.org/git/collab-maint/shadowsocks-libev.git master +# Add patch to work with ubuntu trusty (14.04) +cd - +git clean -fdx +git reset --hard +sed -i s/--with\ systemd/--with\ systemd\ --with\ autoreconf/ debian/rules +sed -i s/debhelper\ \(\>=\ 10\)/debhelper\ \(\>=\ 9\)/ debian/control +git add -u +git commit -m "Patch to work with ubuntu trusty (14.04)" +gbp buildpackage -us -uc --git-ignore-branch --git-pristine-tar +cd - +sudo dpkg -i shadowsocks-libev_*.deb +sudo apt-get install -fy + +# Cleanup +sudo apt-get purge -y libcork-build-deps libcorkipset-build-deps shadowsocks-libev-build-deps \ + $DEPS $DEPS_BPO libcork-dev libcorkipset-dev +sudo apt-get autoremove -y