[squash] split common data

instead of building the packaged binaries with the `bindata` tag, this
introduces a new forgejo-common package which contains common assets and
architecture independent files.

This is the first of a handful of PRs that will ultimately enable
building packages for multiple architectures.
This commit is contained in:
crystal 2024-04-29 04:30:06 -06:00
parent 7fcc7721f8
commit b5914277d3
No known key found for this signature in database
GPG key ID: 1122054731F7CC43
11 changed files with 54 additions and 25 deletions

View file

@ -1,34 +0,0 @@
#!/usr/bin/env bash
case "$1" in
install|upgrade)
[ -f "/etc/default/forgejo" ] && . /etc/default/forgejo
[ -z "$FORGEJO_HOME" ] && FORGEJO_HOME=/var/lib/forgejo
[ -z "$FORGEJO_USER" ] && FORGEJO_USER=forgejo
[ -z "$FORGEJO_NAME" ] && FORGEJO_NAME="Forgejo (Beyond coding. We forge.)"
[ -z "$FORGEJO_GROUP" ] && FORGEJO_GROUP=forgejo
if ! getent group | grep -q "^$FORGEJO_GROUP:" ; then
echo -n "Adding group $FORGEJO_GROUP.."
addgroup --quiet --system $FORGEJO_GROUP 2>/dev/null ||true
echo "..done"
fi
test -d $FORGEJO_HOME || mkdir $FORGEJO_HOME
if ! getent passwd | grep -q "^$FORGEJO_USER:"; then
echo -n "Adding system user $FORGEJO_USER.."
adduser --quiet \
--system \
--ingroup $FORGEJO_GROUP \
--no-create-home \
--disabled-password \
$FORGEJO_USER 2>/dev/null || true
echo "..done"
fi
usermod -c "$FORGEJO_NAME" \
-d $FORGEJO_HOME \
-g $FORGEJO_GROUP \
-s "/bin/bash" \
$FORGEJO_USER
if ! dpkg-statoverride --list $FORGEJO_HOME >/dev/null ; then
chown -R $FORGEJO_USER:$FORGEJO_GROUP $FORGEJO_HOME
chmod u=rwx,g=rx,o= $FORGEJO_HOME
fi
esac