43 lines
972 B
Bash
Executable File
43 lines
972 B
Bash
Executable File
#!/bin/bash
|
|
|
|
set -e
|
|
|
|
NAME=shperm
|
|
VERSION=1.0
|
|
REVISION=1
|
|
ARCH=amd64
|
|
|
|
if ! git tag -l |fgrep $VERSION; then
|
|
git tag $VERSION
|
|
git push origin $VERSION
|
|
fi
|
|
|
|
curdir=`dirname $0`
|
|
workdir="$curdir/${NAME}_${VERSION}-${REVISION}_${ARCH}"
|
|
mkdir -p "$workdir"
|
|
|
|
mkdir -p "$workdir/usr/bin"
|
|
gcc -o "$workdir/usr/bin/shperm" ../../shperm.c
|
|
chmod 0777 "$workdir/usr/bin/shperm"
|
|
|
|
mkdir "$workdir/DEBIAN"
|
|
cat << EOT > "$workdir/DEBIAN/control"
|
|
Package: $NAME
|
|
Version: $VERSION
|
|
Architecture: $ARCH
|
|
Maintainer: Daniel Buschke <damage@devloop.de>
|
|
Description: Shows permissions from given path
|
|
up to the root folder
|
|
Homepage: https://source.devloop.de/damage/shperm
|
|
EOT
|
|
|
|
dpkg-deb --build --root-owner-group "$workdir"
|
|
if [[ $? -eq 0 ]]; then
|
|
source "$curdir/../credentials"
|
|
curl --user "$GITEA_USER:$GITEA_PASS" \
|
|
--upload-file "${NAME}_${VERSION}-${REVISION}_${ARCH}.deb" \
|
|
https://source.devloop.de/api/packages/damage/debian/pool/stable/main/upload
|
|
|
|
rm -rf "$workdir"
|
|
fi
|