From patchwork Tue Nov 10 21:32:15 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Anders Roxell X-Patchwork-Id: 56351 Delivered-To: patch@linaro.org Received: by 10.112.155.196 with SMTP id vy4csp1015767lbb; Tue, 10 Nov 2015 13:44:04 -0800 (PST) X-Received: by 10.50.79.229 with SMTP id m5mr28881738igx.6.1447191844189; Tue, 10 Nov 2015 13:44:04 -0800 (PST) Return-Path: Received: from lists.linaro.org (lists.linaro.org. [54.225.227.206]) by mx.google.com with ESMTP id p72si5748068iop.47.2015.11.10.13.44.03; Tue, 10 Nov 2015 13:44:04 -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; dkim=neutral (body hash did not verify) header.i=@linaro_org.20150623.gappssmtp.com Received: by lists.linaro.org (Postfix, from userid 109) id 4418961999; Tue, 10 Nov 2015 21:44:03 +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.5 required=5.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_LOW, RCVD_IN_MSPIKE_H3, RCVD_IN_MSPIKE_WL, T_DKIM_INVALID, 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 F014861D5A; Tue, 10 Nov 2015 21:38:18 +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 BCF9761B43; Tue, 10 Nov 2015 21:38:09 +0000 (UTC) Received: from mail-lf0-f52.google.com (mail-lf0-f52.google.com [209.85.215.52]) by lists.linaro.org (Postfix) with ESMTPS id 2C45461B63 for ; Tue, 10 Nov 2015 21:36:50 +0000 (UTC) Received: by lfdo63 with SMTP id o63so6047098lfd.2 for ; Tue, 10 Nov 2015 13:36:49 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro_org.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=Yf35YKKKFRE+xlhNWQFQzvsrOSylcxVifQuVY6r+c6I=; b=ZYJ4crgUDfUy1PIpGIm/UW2+cn3JMQ3NcOUuR3qBLfjsaOcKZPFBqW+me4lYVd5v7B MYoxoC09PNk6GXUh4u4mRsE6BfASQ8GQOhKOHszMIKXcqjFcG+5eiJG6SUcXLWTP19QV V+gl9WaOyjZidmSPneBKv15OxXnM+sHs5LDTySPqkwuWcfAhnGUXJx3zZMHBeJAu6Q9D mXNnkfGxni/mmiqvUkfv4OISElW96yxKyQcXBw8eLbs7R4gVgFDfM8K+XIAshxUCCBKC 7vUx/sB4qp1Uef/KYwdc3tYBMqosw6p6Fo0DL6jIASPd0RUsve/oMsMqAXA/cWNGkQ1e OoFQ== 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=Yf35YKKKFRE+xlhNWQFQzvsrOSylcxVifQuVY6r+c6I=; b=mHiKLln7ijooTJRmRMA4l+7qoBxdW1cDMZlC8tojkQNsjPFCYyT2E6G6FfRhMyy/Zx nmE4dy7zl/8+CG9zqPid7UsQ20hINEo2bzH6Gd8q8ZjauZkn7lHKFnJTtSoAU5nSRutj Lh1GOnqfkc188OLTmzbJGWnEutaIhvOZ6TyalkiIWFf1eYZe1lJQ/C7sHtPv17jNjiD4 EBEYs/ay5D8qb8x+GRE8U4cF+m4Q+cPqy1btFq2L316veQAT2rG7spfaGDVxMQDb3aSz 2ZMP9P/XG1QXB+OLdZY1BCPJ7zZN717p2SybF8wPVxR3zkS1mU9Q/GBPS3swYAdzBGEe GmVA== X-Gm-Message-State: ALoCoQkpv6nNWhatHn1o/Ukm3c4JauVOsxplPyLT3+/B2gqkIZjtXQ6rUVMfeF7x4EVFP4WOmlZC X-Received: by 10.25.139.68 with SMTP id n65mr2860957lfd.81.1447191409112; Tue, 10 Nov 2015 13:36:49 -0800 (PST) Received: from localhost (c-aa3470d5.07-21-73746f28.cust.bredbandsbolaget.se. [213.112.52.170]) by smtp.gmail.com with ESMTPSA id m80sm874639lfm.15.2015.11.10.13.36.48 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 10 Nov 2015 13:36:48 -0800 (PST) From: Anders Roxell To: lng-odp@lists.linaro.org Date: Tue, 10 Nov 2015 22:32:15 +0100 Message-Id: <1447191136-21213-9-git-send-email-anders.roxell@linaro.org> X-Mailer: git-send-email 2.1.4 In-Reply-To: <1447191136-21213-1-git-send-email-anders.roxell@linaro.org> References: <1447191136-21213-1-git-send-email-anders.roxell@linaro.org> X-Topics: patch Subject: [lng-odp] [PATCHv3 8/9] scripts: make rpm packages 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" Signed-off-by: Anders Roxell Reviewed-by: Fathi Boudra --- scripts/builddeb | 14 ++++---------- scripts/buildrpm | 30 ++++++++++++++++++++++++++++++ scripts/common_pkg_build.sh | 17 +++++++++++++++++ 3 files changed, 51 insertions(+), 10 deletions(-) create mode 100755 scripts/buildrpm create mode 100644 scripts/common_pkg_build.sh diff --git a/scripts/builddeb b/scripts/builddeb index 48c3183..829fd1d 100755 --- a/scripts/builddeb +++ b/scripts/builddeb @@ -2,19 +2,13 @@ set -e -ROOT_DIR=$(readlink -e $(dirname $0) | sed 's|/scripts||') +export ROOT_DIR=$(readlink -e $(dirname $0) | sed 's|/scripts||') -pushd ${ROOT_DIR} -./bootstrap -./configure -make dist +source ${ROOT_DIR}/scripts/common_pkg_build.sh -version=$(cat ${ROOT_DIR}/.scmversion) +prepare_tarball -cp opendataplane-${version}.tar.gz opendataplane_${version}.orig.tar.gz -tar xzf opendataplane_${version}.orig.tar.gz - -pushd ${ROOT_DIR}/opendataplane-${version} +pushd ${ROOT_DIR}/${package}-${version} cp -r ${ROOT_DIR}/pkg/debian . current=$(echo ${version} | awk -F . '{printf("%d\n", (($1 * 100) + $2))}') diff --git a/scripts/buildrpm b/scripts/buildrpm new file mode 100755 index 0000000..8568592 --- /dev/null +++ b/scripts/buildrpm @@ -0,0 +1,30 @@ +#!/bin/bash + +set -e + +export ROOT_DIR=$(readlink -e $(dirname $0) | sed 's|/scripts||') + +source ${ROOT_DIR}/scripts/common_pkg_build.sh + +prepare_tarball + +mkdir -p ${ROOT_DIR}/rpm/RPMS +mkdir -p ${ROOT_DIR}/rpm/SRPMS +mkdir -p ${ROOT_DIR}/rpm/BUILD +mkdir -p ${ROOT_DIR}/rpm/SOURCES +mkdir -p ${ROOT_DIR}/rpm/tmp +rm -rf ${ROOT_DIR}/rpm/BUILD/${package}-root +rm -rf ${ROOT_DIR}/rpm/RPMS/${package}* +rm -rf ${ROOT_DIR}/rpm/SRPMS/${package}* +rm -rf ${ROOT_DIR}/rpm/SOURCES/${package}* +cp ${ROOT_DIR}/${package}-${version}.tar.gz ${ROOT_DIR}/rpm/SOURCES/ +cp ${ROOT_DIR}/pkg/rpm/odp.spec ${ROOT_DIR}/rpm/odp.spec +if [ $(egrep "\.([a-z0-9]{8}\>|dirty)" .scmversion |wc -l) -gt 0 ]; then + creation_date=$(date '+%a %b %e %G') + RPMEMAIL="donald.duck (at) linaro.org" + sed -i -e "s/changelog/changelog\n* ${creation_date} - ${RPMEMAIL}\n- not a official release\!/g" ${ROOT_DIR}/rpm/odp.spec +fi +sed -i "s|^Version: .*$|Version: ${version}|g" ${ROOT_DIR}/rpm/odp.spec +rpmbuild --quiet --nodeps --define="_topdir ${ROOT_DIR}/rpm" -ba ${ROOT_DIR}/rpm/odp.spec +cp ${ROOT_DIR}/rpm/RPMS/*/* ${ROOT_DIR}/ +popd diff --git a/scripts/common_pkg_build.sh b/scripts/common_pkg_build.sh new file mode 100644 index 0000000..cf4f6e3 --- /dev/null +++ b/scripts/common_pkg_build.sh @@ -0,0 +1,17 @@ +#!/bin/bash + +set -e + +prepare_tarball() { + export package=opendataplane + + pushd ${ROOT_DIR} + ./bootstrap + ./configure + make dist + + version=$(cat ${ROOT_DIR}/.scmversion) + + cp ${package}-${version}.tar.gz ${package}_${version}.orig.tar.gz + tar xzf ${package}_${version}.orig.tar.gz +}