]> git.proxmox.com Git - ceph.git/blame - ceph/make-debs.sh
bump version to 12.2.10-pve1
[ceph.git] / ceph / make-debs.sh
CommitLineData
7c673cae
FG
1#!/bin/bash
2#
3# Copyright (C) 2015 Red Hat <contact@redhat.com>
4#
5# Author: Loic Dachary <loic@dachary.org>
6#
7# This program is free software; you can redistribute it and/or modify
8# it under the terms of the GNU Library Public License as published by
9# the Free Software Foundation; either version 2, or (at your option)
10# any later version.
11#
12# This program is distributed in the hope that it will be useful,
13# but WITHOUT ANY WARRANTY; without even the implied warranty of
14# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15# GNU Library Public License for more details.
16#
17set -xe
18
19base=${1:-/tmp/release}
20codename=$(lsb_release -sc)
21releasedir=$base/$(lsb_release -si)/WORKDIR
22rm -fr $releasedir
23mkdir -p $releasedir
24#
25# remove all files not under git so they are not
26# included in the distribution.
27#
28git clean -dxf
29#
30# git describe provides a version that is
31# a) human readable
32# b) is unique for each commit
33# c) compares higher than any previous commit
34# d) contains the short hash of the commit
35#
36vers=$(git describe --match "v*" | sed s/^v//)
37./make-dist $vers
38#
39# rename the tarbal to match debian conventions and extract it
40#
41mv ceph-$vers.tar.bz2 $releasedir/ceph_$vers.orig.tar.bz2
42tar -C $releasedir -jxf $releasedir/ceph_$vers.orig.tar.bz2
43#
44# copy the debian directory over and remove -dbg packages
45# because they are large and take time to build
46#
47cp -a debian $releasedir/ceph-$vers/debian
48cd $releasedir
49perl -ni -e 'print if(!(/^Package: .*-dbg$/../^$/))' ceph-$vers/debian/control
50perl -pi -e 's/--dbg-package.*//' ceph-$vers/debian/rules
51#
52# always set the debian version to 1 which is ok because the debian
53# directory is included in the sources and the upstream version will
54# change each time it is modified.
55#
56dvers="$vers-1"
57#
58# update the changelog to match the desired version
59#
60cd ceph-$vers
61chvers=$(head -1 debian/changelog | perl -ne 's/.*\(//; s/\).*//; print')
62if [ "$chvers" != "$dvers" ]; then
63 DEBEMAIL="contact@ceph.com" dch -D $codename --force-distribution -b -v "$dvers" "new version"
64fi
65#
66# create the packages
67# a) with ccache to speed things up when building repeatedly
68# b) do not sign the packages
69# c) use half of the available processors
70#
71: ${NPROC:=$(($(nproc) / 2))}
72if test $NPROC -gt 1 ; then
73 j=-j${NPROC}
74fi
75PATH=/usr/lib/ccache:$PATH dpkg-buildpackage $j -uc -us
76cd ../..
77mkdir -p $codename/conf
78cat > $codename/conf/distributions <<EOF
79Codename: $codename
80Suite: stable
81Components: main
82Architectures: i386 amd64 source
83EOF
84if [ ! -e conf ]; then
85 ln -s $codename/conf conf
86fi
87reprepro --basedir $(pwd) include $codename WORKDIR/*.changes
88#
89# teuthology needs the version in the version file
90#
91echo $dvers > $codename/version