aboutsummaryrefslogtreecommitdiff
path: root/scripts
diff options
context:
space:
mode:
authorRicardo Salveti <ricardo.salveti@linaro.org>2016-02-22 10:17:36 -0300
committerMaxim Uvarov <maxim.uvarov@linaro.org>2016-02-25 15:41:29 +0300
commit188a76d2f84a943ad59de6e5dc1d5c9f25dd2ac2 (patch)
tree714351ae65e90293e6b881075a9cb635941c0ca4 /scripts
parentfd9e7f78c98e1580af4b3bf37c9c9b62f7215ea3 (diff)
builddeb: support creating source-only package with git archive
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 <ricardo.salveti@linaro.org> Reviewed-by: Anders Roxell <anders.roxell@linaro.org> Signed-off-by: Maxim Uvarov <maxim.uvarov@linaro.org>
Diffstat (limited to 'scripts')
-rwxr-xr-xscripts/builddeb13
-rw-r--r--scripts/common_pkg_build.sh22
2 files changed, 30 insertions, 5 deletions
diff --git a/scripts/builddeb b/scripts/builddeb
index 829fd1d68..bce74cbe8 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 eefc07dec..fbb2511ef 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
}