2017-07-20 22:26:42 +00:00
|
|
|
#!/usr/bin/env bash
|
2015-01-01 19:52:18 +00:00
|
|
|
#
|
|
|
|
# Copyright (C) 2015 Red Hat <contact@redhat.com>
|
|
|
|
#
|
|
|
|
# Author: Loic Dachary <loic@dachary.org>
|
|
|
|
#
|
|
|
|
# This program is free software; you can redistribute it and/or modify
|
|
|
|
# it under the terms of the GNU Library Public License as published by
|
|
|
|
# the Free Software Foundation; either version 2, or (at your option)
|
|
|
|
# any later version.
|
|
|
|
#
|
|
|
|
# This program is distributed in the hope that it will be useful,
|
|
|
|
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
# GNU Library Public License for more details.
|
|
|
|
#
|
|
|
|
set -xe
|
|
|
|
|
2021-08-12 14:47:42 +00:00
|
|
|
. /etc/os-release
|
2015-01-01 19:52:18 +00:00
|
|
|
base=${1:-/tmp/release}
|
2021-08-12 14:47:42 +00:00
|
|
|
releasedir=$base/$NAME/WORKDIR
|
2018-11-21 12:14:16 +00:00
|
|
|
rm -fr $(dirname $releasedir)
|
2015-01-01 19:52:18 +00:00
|
|
|
mkdir -p $releasedir
|
|
|
|
#
|
|
|
|
# remove all files not under git so they are not
|
|
|
|
# included in the distribution.
|
|
|
|
#
|
|
|
|
git clean -dxf
|
|
|
|
#
|
|
|
|
# git describe provides a version that is
|
|
|
|
# a) human readable
|
|
|
|
# b) is unique for each commit
|
|
|
|
# c) compares higher than any previous commit
|
|
|
|
# d) contains the short hash of the commit
|
|
|
|
#
|
|
|
|
vers=$(git describe --match "v*" | sed s/^v//)
|
2016-09-08 15:04:13 +00:00
|
|
|
./make-dist $vers
|
2015-01-01 19:52:18 +00:00
|
|
|
#
|
|
|
|
# rename the tarbal to match debian conventions and extract it
|
|
|
|
#
|
2016-09-08 15:04:13 +00:00
|
|
|
mv ceph-$vers.tar.bz2 $releasedir/ceph_$vers.orig.tar.bz2
|
|
|
|
tar -C $releasedir -jxf $releasedir/ceph_$vers.orig.tar.bz2
|
2015-01-01 19:52:18 +00:00
|
|
|
#
|
|
|
|
# copy the debian directory over and remove -dbg packages
|
|
|
|
# because they are large and take time to build
|
|
|
|
#
|
|
|
|
cp -a debian $releasedir/ceph-$vers/debian
|
|
|
|
cd $releasedir
|
|
|
|
perl -ni -e 'print if(!(/^Package: .*-dbg$/../^$/))' ceph-$vers/debian/control
|
|
|
|
perl -pi -e 's/--dbg-package.*//' ceph-$vers/debian/rules
|
|
|
|
#
|
|
|
|
# always set the debian version to 1 which is ok because the debian
|
|
|
|
# directory is included in the sources and the upstream version will
|
|
|
|
# change each time it is modified.
|
|
|
|
#
|
|
|
|
dvers="$vers-1"
|
|
|
|
#
|
|
|
|
# update the changelog to match the desired version
|
|
|
|
#
|
|
|
|
cd ceph-$vers
|
|
|
|
chvers=$(head -1 debian/changelog | perl -ne 's/.*\(//; s/\).*//; print')
|
|
|
|
if [ "$chvers" != "$dvers" ]; then
|
2021-08-12 14:47:42 +00:00
|
|
|
DEBEMAIL="contact@ceph.com" dch -D $VERSION_CODENAME --force-distribution -b -v "$dvers" "new version"
|
2015-01-01 19:52:18 +00:00
|
|
|
fi
|
|
|
|
#
|
|
|
|
# create the packages
|
|
|
|
# a) with ccache to speed things up when building repeatedly
|
|
|
|
# b) do not sign the packages
|
|
|
|
# c) use half of the available processors
|
|
|
|
#
|
2015-05-02 14:11:51 +00:00
|
|
|
: ${NPROC:=$(($(nproc) / 2))}
|
|
|
|
if test $NPROC -gt 1 ; then
|
|
|
|
j=-j${NPROC}
|
|
|
|
fi
|
|
|
|
PATH=/usr/lib/ccache:$PATH dpkg-buildpackage $j -uc -us
|
2015-01-01 19:52:18 +00:00
|
|
|
cd ../..
|
2021-08-12 14:47:42 +00:00
|
|
|
mkdir -p $VERSION_CODENAME/conf
|
|
|
|
cat > $VERSION_CODENAME/conf/distributions <<EOF
|
|
|
|
Codename: $VERSION_CODENAME
|
2015-01-01 19:52:18 +00:00
|
|
|
Suite: stable
|
|
|
|
Components: main
|
2018-03-24 17:39:32 +00:00
|
|
|
Architectures: $(dpkg --print-architecture) source
|
2015-01-01 19:52:18 +00:00
|
|
|
EOF
|
2016-05-10 07:13:53 +00:00
|
|
|
if [ ! -e conf ]; then
|
2021-08-12 14:47:42 +00:00
|
|
|
ln -s $VERSION_CODENAME/conf conf
|
2016-05-10 07:13:53 +00:00
|
|
|
fi
|
2021-08-12 14:47:42 +00:00
|
|
|
reprepro --basedir $(pwd) include $VERSION_CODENAME WORKDIR/*.changes
|
2015-01-01 19:52:18 +00:00
|
|
|
#
|
|
|
|
# teuthology needs the version in the version file
|
|
|
|
#
|
2021-08-12 14:47:42 +00:00
|
|
|
echo $dvers > $VERSION_CODENAME/version
|