build deb package
This commit is contained in:
parent
1231b16151
commit
f1c57a0ae6
4
.gitignore
vendored
4
.gitignore
vendored
@ -1,2 +1,4 @@
|
|||||||
.vscode
|
.vscode
|
||||||
shperm
|
shperm
|
||||||
|
build/credentials
|
||||||
|
build/deb/*.deb
|
||||||
|
2
build/credentials.example
Normal file
2
build/credentials.example
Normal file
@ -0,0 +1,2 @@
|
|||||||
|
GITEA_USER=user
|
||||||
|
GITEA_PASS=pass or token
|
42
build/deb/build_stable.sh
Executable file
42
build/deb/build_stable.sh
Executable file
@ -0,0 +1,42 @@
|
|||||||
|
#!/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
|
Loading…
x
Reference in New Issue
Block a user