From patchwork Mon Feb 22 13:17:36 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ricardo Salveti X-Patchwork-Id: 62568 Delivered-To: patch@linaro.org Received: by 10.112.43.199 with SMTP id y7csp1230407lbl; Mon, 22 Feb 2016 05:18:45 -0800 (PST) X-Received: by 10.55.74.86 with SMTP id x83mr33956786qka.89.1456147125624; Mon, 22 Feb 2016 05:18:45 -0800 (PST) Return-Path: Received: from lists.linaro.org (lists.linaro.org. [54.225.227.206]) by mx.google.com with ESMTP id p199si24905663qhb.90.2016.02.22.05.18.45; Mon, 22 Feb 2016 05:18:45 -0800 (PST) Received-SPF: pass (google.com: domain of lng-odp-bounces@lists.linaro.org designates 54.225.227.206 as permitted sender) client-ip=54.225.227.206; Authentication-Results: mx.google.com; spf=pass (google.com: domain of lng-odp-bounces@lists.linaro.org designates 54.225.227.206 as permitted sender) smtp.mailfrom=lng-odp-bounces@lists.linaro.org Received: by lists.linaro.org (Postfix, from userid 109) id 44267617BE; Mon, 22 Feb 2016 13:18:45 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on ip-10-142-244-252 X-Spam-Level: X-Spam-Status: No, score=-2.6 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_LOW, RCVD_IN_MSPIKE_H2, URIBL_BLOCKED autolearn=disabled version=3.4.0 Received: from [127.0.0.1] (localhost [127.0.0.1]) by lists.linaro.org (Postfix) with ESMTP id 58D79617C9; Mon, 22 Feb 2016 13:18:15 +0000 (UTC) X-Original-To: lng-odp@lists.linaro.org Delivered-To: lng-odp@lists.linaro.org Received: by lists.linaro.org (Postfix, from userid 109) id 30686617BE; Mon, 22 Feb 2016 13:18:08 +0000 (UTC) Received: from mail-qg0-f51.google.com (mail-qg0-f51.google.com [209.85.192.51]) by lists.linaro.org (Postfix) with ESMTPS id 56AC6617BE for ; Mon, 22 Feb 2016 13:17:48 +0000 (UTC) Received: by mail-qg0-f51.google.com with SMTP id y9so111598690qgd.3 for ; Mon, 22 Feb 2016 05:17:48 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=C4agl8N+cWWEVfNtCcWSHWaPnI9Z/nx/JUTe1NSJm1I=; b=ifjFWRQkW7726zUw5kZOADUOQNnmMEAl87cvfKFfRBr3kIhs4crUHr4mbBrFVmhhl8 VoOJBxtWRJAmfRrO+pi40NDZ3GXUT3PGWSHJmtUpJo9zsK85VdfiEmA/2TtJX3cmbUXO 277y2DcJnMxL7LNkSPmN66nMoRqwDnKIq2U89zF/PHvwCIz5xVxiXNX95OofiehdINhG RvXfbMv1WJvHF33O1xzltU87cRzHnVhIa6gXgTs9gWKLsTKSWvb5C9vew42urkh/OHob op/JD1Y/gWlfccd8ki67iv/15k3hXfSWBIkW7Zb0wos1Sq0N69RqrMRR+2e5UKe0kOn4 Y3/Q== X-Gm-Message-State: AG10YORchutPADJ0nBSxXclNwIE/jNu6C8KquSy8uBMBWIlf0VgleGPWcQ9Stvssf03Xl1bAUNc= X-Received: by 10.140.91.225 with SMTP id z88mr16688965qgd.99.1456147068050; Mon, 22 Feb 2016 05:17:48 -0800 (PST) Received: from localhost.localdomain ([179.223.143.138]) by smtp.gmail.com with ESMTPSA id w66sm6261146qgd.26.2016.02.22.05.17.46 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Mon, 22 Feb 2016 05:17:47 -0800 (PST) From: Ricardo Salveti To: lng-odp@lists.linaro.org Date: Mon, 22 Feb 2016 10:17:36 -0300 Message-Id: <1456147056-767-3-git-send-email-ricardo.salveti@linaro.org> X-Mailer: git-send-email 2.5.0 In-Reply-To: <1456147056-767-1-git-send-email-ricardo.salveti@linaro.org> References: <1456147056-767-1-git-send-email-ricardo.salveti@linaro.org> X-Topics: Architecture patch Subject: [lng-odp] [PATCH 3/3] builddeb: support creating source-only package with git archive X-BeenThere: lng-odp@lists.linaro.org X-Mailman-Version: 2.1.16 Precedence: list List-Id: "The OpenDataPlane \(ODP\) List" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: lng-odp-bounces@lists.linaro.org Sender: "lng-odp" With git archive the bootstrap steps are not required when creating the orig tarball, allowing the user to create a source package without having the build-deps available at the host machine. As debian/rules is also calling autoreconf now, it's not required to have the cached autoconf/automake files in order to produce the build. To create the source package simply call 'scripts/builddeb source'. Signed-off-by: Ricardo Salveti --- scripts/builddeb | 13 +++++++++++-- scripts/common_pkg_build.sh | 22 +++++++++++++++++++--- 2 files changed, 30 insertions(+), 5 deletions(-) diff --git a/scripts/builddeb b/scripts/builddeb index 829fd1d..bce74cb 100755 --- a/scripts/builddeb +++ b/scripts/builddeb @@ -6,7 +6,16 @@ export ROOT_DIR=$(readlink -e $(dirname $0) | sed 's|/scripts||') source ${ROOT_DIR}/scripts/common_pkg_build.sh -prepare_tarball +# debuild default options +DEB_OPTS="-us -uc" + +# Also allow the user to create just the source package (skip build process) +if [ "$1" == source ]; then + prepare_tarball archive + DEB_OPTS="-S $DEB_OPTS" +else + prepare_tarball +fi pushd ${ROOT_DIR}/${package}-${version} cp -r ${ROOT_DIR}/pkg/debian . @@ -23,6 +32,6 @@ if [ $(egrep "\.([a-z0-9]{8}\>|dirty)" .scmversion |wc -l) -gt 0 ]; then dch --newversion ${version}-1 --urgency low "not a official release!" fi -debuild -us -uc +debuild $DEB_OPTS popd popd diff --git a/scripts/common_pkg_build.sh b/scripts/common_pkg_build.sh index eefc07d..fbb2511 100644 --- a/scripts/common_pkg_build.sh +++ b/scripts/common_pkg_build.sh @@ -6,11 +6,9 @@ prepare_tarball() { export package=opendataplane pushd ${ROOT_DIR} - ./bootstrap - ./configure - make dist if [[ -d ${ROOT_DIR}/.git ]]; then + . scripts/git_hash.sh ${ROOT_DIR} version=$(cat ${ROOT_DIR}/.scmversion) else echo "This script isn't expected to be used without" @@ -18,6 +16,24 @@ prepare_tarball() { exit 1 fi + if [ "$1" == archive ]; then + git archive --format=tar --prefix=${package}-${version}/ HEAD > ${package}-${version}.tar + + # append .scmversion, otherwise bootstrap fails + SCMTMP=`mktemp -d` + pushd $SCMTMP + mkdir ${package}-${version} + cp ${ROOT_DIR}/.scmversion ${package}-${version} + tar --update -v -f ${ROOT_DIR}/${package}-${version}.tar ${package}-${version} + popd + rm -rf $SCMTMP + gzip ${package}-${version}.tar + else + ./bootstrap + ./configure + make dist + fi + cp ${package}-${version}.tar.gz ${package}_${version}.orig.tar.gz tar xzf ${package}_${version}.orig.tar.gz }