similarity index 100%
rename from debian/README.Debian
rename to pkg/debian/README.Debian
similarity index 100%
rename from debian/changelog
rename to pkg/debian/changelog
similarity index 100%
rename from debian/compat
rename to pkg/debian/compat
similarity index 100%
rename from debian/control
rename to pkg/debian/control
similarity index 100%
rename from debian/copyright
rename to pkg/debian/copyright
similarity index 100%
rename from debian/docs
rename to pkg/debian/docs
similarity index 100%
rename from debian/libodp-dev.dirs
rename to pkg/debian/libodp-dev.dirs
similarity index 100%
rename from debian/libodp-dev.install
rename to pkg/debian/libodp-dev.install
similarity index 100%
rename from debian/libodp.dirs
rename to pkg/debian/libodp.dirs
similarity index 100%
rename from debian/libodp.install
rename to pkg/debian/libodp.install
similarity index 100%
rename from debian/libodphelper-dev.dirs
rename to pkg/debian/libodphelper-dev.dirs
similarity index 100%
rename from debian/libodphelper-dev.install
rename to pkg/debian/libodphelper-dev.install
similarity index 100%
rename from debian/libodphelper.dirs
rename to pkg/debian/libodphelper.dirs
similarity index 100%
rename from debian/libodphelper.install
rename to pkg/debian/libodphelper.install
similarity index 100%
rename from debian/odp-bin.dirs
rename to pkg/debian/odp-bin.dirs
similarity index 100%
rename from debian/odp-bin.install
rename to pkg/debian/odp-bin.install
similarity index 100%
rename from debian/rules
rename to pkg/debian/rules
similarity index 100%
rename from debian/source/format
rename to pkg/debian/source/format
@@ -2,20 +2,14 @@
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}
-cp -r ${ROOT_DIR}/debian .
+pushd ${ROOT_DIR}/${package}-${version}
+cp -r ${ROOT_DIR}/pkg/debian .
current=$(echo ${version} | awk -F . '{printf("%d\n", (($1 * 100) + $2))}')
rename 's,([^-\.]*)(.*),${1}'"${current}"'${2},' debian/*odp*
new file mode 100755
@@ -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
new file mode 100644
@@ -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
+}