Build proper packages

This commit is contained in:
Tyler
2017-09-11 00:00:18 -04:00
parent a35d776c32
commit fbe0d430bb
15 changed files with 82 additions and 228 deletions

View File

@ -0,0 +1,11 @@
fpm -s dir -t deb -p build/amd64/deb-simple_$VERSION.deb \
-n astra -v $VERSION \
--config-files /etc/deb-simple.conf \
--deb-priority optional --force \
--deb-compression bzip2 \
--description "Dead Simple Package Manager" \
-m "Tyler Stuyfzand <admin@meow.tf>" --vendor "Meow.tf"
--before-install packaging/scripts/preinst.deb \
-a $ARCH build/$ARCH/deb-simple=/usr/bin/deb-simple \
packaging/deb-simple.service=/lib/systemd/system/deb-simple.service \
sample_conf.ini=/etc/deb-simple.conf

View File

@ -0,0 +1,11 @@
[Unit]
Description=Dead Simple Repository Server
[Service]
User=deb-simple
Group=deb-simple
Restart=on-failure
ExecStart=/usr/bin/deb-simple -c /etc/deb-simple.conf
[Install]
WantedBy=multi-user.target

View File

@ -0,0 +1,37 @@
#! /bin/sh
# preinst script for deb-simple
set -e
addsimpleuser() {
if ! getent passwd deb-simple > /dev/null; then
adduser --quiet --system --group \
--disabled-login \
--home /var/lib/deb-simple \
--no-create-home \
--shell /bin/false \
deb-simple
fi
}
createdirectories() {
mkdir -p /opt/deb-simple /var/lib/deb-simple/repo || true
chown -R deb-simple:deb-simple /var/lib/deb-simple
}
case "$1" in
install)
addsimpleuser
createdirectories
;;
upgrade)
addsimpleuser
createdirectories
;;
abort-upgrade)
;;
*)
echo "preinst called with unknown argument \`$1'" >&2
exit 0
;;
esac
exit 0