-
Notifications
You must be signed in to change notification settings - Fork 1
/
tarball.sh
executable file
·52 lines (40 loc) · 1.45 KB
/
tarball.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
#!/bin/bash -ex
set -o pipefail
function download() {
url=$1
name=$2
mkdir -p "$DOWNLOADS"
if [ ! -e "$DOWNLOADS/$name" ]; then
curl -L -f "$url" -o "$DOWNLOADS/$name"
fi
cp "$DOWNLOADS/$name" "$name"
}
rm -vf *.dsc *.build *.buildinfo *.changes *.upload *.tar.gz *.tar.xz *.tar.bz2
source settings.sh
BASEDIR=$(basename "$PWD")
PACKAGE_NAME=${PACKAGE_NAME:-$BASEDIR}
DOWNLOADS="../downloads"
# Change -rc1 to ~rc1
PACKAGE_VERSION=$(echo $RELEASE_VERSION | tr -- -rc \~rc)
download "${URL}/${PACKAGE_NAME}-${RELEASE_VERSION}.tar.$COMPR" \
"${PACKAGE_NAME}_${PACKAGE_VERSION}.orig.tar.$COMPR"
if ! download "${URL}/${PACKAGE_NAME}-${RELEASE_VERSION}.tar.$COMPR.sig" \
"${PACKAGE_NAME}_${PACKAGE_VERSION}.orig.tar.$COMPR.sig" ; then
download "${URL}/${PACKAGE_NAME}-${RELEASE_VERSION}.tar.$COMPR.asc" \
"${PACKAGE_NAME}_${PACKAGE_VERSION}.orig.tar.$COMPR.sig"
fi
gpg --verify "${PACKAGE_NAME}_${PACKAGE_VERSION}.orig.tar.$COMPR.sig" \
"${PACKAGE_NAME}_${PACKAGE_VERSION}.orig.tar.$COMPR"
WDIR="$PACKAGE_NAME-$PACKAGE_VERSION"
rm -rf "$WDIR" "${PACKAGE_NAME}-${RELEASE_VERSION}"
tar xf "${PACKAGE_NAME}_${PACKAGE_VERSION}.orig.tar.$COMPR"
if [ "${PACKAGE_NAME}-${RELEASE_VERSION}" != "$WDIR" ]; then
mv "${PACKAGE_NAME}-${RELEASE_VERSION}" "$WDIR"
fi
cd "$WDIR"
cp -r ../debian .
for dist in $DISTROS; do
DEBIAN_VERSION=${PACKAGE_VERSION}-1ubuntu1~${dist:0:1}~mesarc${INC}
dch --distribution ${dist} -v ${DEBIAN_VERSION} "New snapshot"
debuild -S -d
done