2
0
mirror of https://github.com/xcat2/confluent.git synced 2024-11-24 18:41:55 +00:00
confluent/imgutil/builddeb

29 lines
1.3 KiB
Plaintext
Raw Permalink Normal View History

2024-07-22 17:46:27 +00:00
#!/bin/bash
VERSION=`git describe|cut -d- -f 1`
NUMCOMMITS=`git describe|cut -d- -f 2`
if [ "$NUMCOMMITS" != "$VERSION" ]; then
LASTNUM=$(echo $VERSION|rev|cut -d . -f 1|rev)
LASTNUM=$((LASTNUM+1))
FIRSTPART=$(echo $VERSION|rev|cut -d . -f 2- |rev)
VERSION=${FIRSTPART}.${LASTNUM}
VERSION=$VERSION~dev$NUMCOMMITS+`git describe|cut -d- -f 3`
2024-07-22 17:46:27 +00:00
fi
mkdir -p /tmp/confluent-imgutil
cp -a * /tmp/confluent-imgutil
cp ../LICENSE /tmp/confluent-imgutil
cd /tmp/confluent-imgutil
rm -rf deb/confluent_imgutil_$VERSION/
mkdir -p deb/confluent_imgutil_$VERSION/DEBIAN/
mkdir -p deb/confluent_imgutil_$VERSION/opt/confluent/lib/imgutil
mkdir -p deb/confluent_imgutil_$VERSION/opt/confluent/bin
mv imgutil deb/confluent_imgutil_$VERSION/opt/confluent/bin/
chmod a+x deb/confluent_imgutil_$VERSION/opt/confluent/bin/imgutil
mv ubuntu* suse15 el7 el9 el8 deb/confluent_imgutil_$VERSION/opt/confluent/lib/imgutil/
mkdir -p deb/confluent_imgutil_$VERSION/opt/confluent/share/licenses/confluent_imgutil
cp LICENSE deb/confluent_imgutil_$VERSION/opt/confluent/share/licenses/confluent_imgutil
sed -e 's/#VERSION#/'$VERSION/ control.tmpl > deb/confluent_imgutil_$VERSION/DEBIAN/control
2024-07-22 17:57:38 +00:00
dpkg-deb --build deb/confluent_imgutil_$VERSION
2024-07-22 17:46:27 +00:00
if [ ! -z "$1" ]; then
2024-07-22 17:57:38 +00:00
mv deb/confluent_imgutil_$VERSION.deb $1
2024-07-22 17:46:27 +00:00
fi