summaryrefslogtreecommitdiff
path: root/make-deb.sh
blob: 2b460dc3a64483da085a63eaf55a1913ebd56d58 (plain)
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
53
54
55
56
57
58
59
60
61
62
63
64
#!/usr/bin/env bash

set -x
set -e


base="$(realpath -e "$(dirname "$0")")"
deb_dir="${1:-$(realpath "${base}/../deb")}"

rm -rf "${deb_dir}"
mkdir "${deb_dir}"

version="1"
target="minecproxy-${version}"
otarget="$(echo "${target}" | tr '-' '_')"
build_dir="${deb_dir}/${target}"

cp -arf "${base}" "${build_dir}"
cd "${build_dir}"
git clean -dxf

cd ..
tar cvzf "${otarget}.orig.tar.gz" "${target}"

cd -
debuild -us -uc

exit 0



base=${1:-/tmp/release}
codename=$(lsb_release -sc)
releasedir=$base/$(lsb_release -si)/liburing
rm -rf $releasedir
mkdir -p $releasedir

src_dir=$(readlink -e `basename $0`)
liburing_dir=$(dirname $src_dir)
basename=$(basename $liburing_dir)
dirname=$(dirname $liburing_dir)
version=$(git describe --match "lib*" | cut -d '-' -f 2)
outfile="liburing-$version"
orgfile=$(echo $outfile | tr '-' '_')

# Prepare source code
cp -arf ${dirname}/${basename} ${releasedir}/${outfile}
cd ${releasedir}/${outfile}
git clean -dxf

# Change changelog if it's needed
cur_ver=`head -l debian/changelog | sed -n -e 's/.* (\(.*\)) .*/\1/p'`
if [ "$cur_ver" != "$version-1" ]; then
	dch -D $codename --force-distribution -b -v "$version-1" "new version"
fi

# Create tar archieve
cd ../
tar cvzf ${outfile}.tar.gz ${outfile}
ln -s ${outfile}.tar.gz ${orgfile}.orig.tar.gz

# Build debian package
cd -
debuild