Fix systemd integration in debian package
This commit is contained in:
parent
783c482e9e
commit
496db34e45
7 changed files with 61 additions and 13 deletions
5
contrib/debian/changelog
Normal file
5
contrib/debian/changelog
Normal file
|
@ -0,0 +1,5 @@
|
|||
mitra (0.0.0) UNRELEASED; urgency=medium
|
||||
|
||||
* Release.
|
||||
|
||||
-- silverpill <silverpill> Thu, 05 May 2022 17:30:49 +0000
|
1
contrib/debian/compat
Normal file
1
contrib/debian/compat
Normal file
|
@ -0,0 +1 @@
|
|||
11
|
|
@ -1,3 +1,9 @@
|
|||
Package: mitra
|
||||
Source: mitra
|
||||
Section: admin
|
||||
Priority: optional
|
||||
Maintainer: silverpill
|
||||
Build-Depends: debhelper (>= 11)
|
||||
|
||||
Package: mitra
|
||||
Description: ActivityPub server written in Rust
|
||||
Depends: ${shlibs:Depends}, ${misc:Depends}
|
||||
|
|
2
contrib/debian/install
Normal file
2
contrib/debian/install
Normal file
|
@ -0,0 +1,2 @@
|
|||
etc .
|
||||
usr .
|
24
contrib/debian/postinst.ex
Normal file
24
contrib/debian/postinst.ex
Normal file
|
@ -0,0 +1,24 @@
|
|||
#!/bin/sh
|
||||
|
||||
set -e
|
||||
|
||||
case "$1" in
|
||||
configure)
|
||||
adduser --system --group --home /var/lib/mitra mitra
|
||||
;;
|
||||
|
||||
abort-upgrade|abort-remove|abort-deconfigure)
|
||||
;;
|
||||
|
||||
*)
|
||||
echo "postinst called with unknown argument \`$1'" >&2
|
||||
exit 1
|
||||
;;
|
||||
esac
|
||||
|
||||
# dh_installdeb will replace this with shell code automatically
|
||||
# generated by other debhelper scripts.
|
||||
|
||||
#DEBHELPER#
|
||||
|
||||
exit 0
|
9
contrib/debian/rules
Executable file
9
contrib/debian/rules
Executable file
|
@ -0,0 +1,9 @@
|
|||
#!/usr/bin/make -f
|
||||
|
||||
export DEB_BUILD_OPTIONS=noautodbgsym
|
||||
|
||||
%:
|
||||
dh $@
|
||||
|
||||
override_dh_installsystemd:
|
||||
dh_installsystemd --no-start --no-enable
|
|
@ -11,15 +11,13 @@ WEB_DIR="$1"
|
|||
|
||||
# Package info
|
||||
rm -rf $PACKAGE_DIR
|
||||
mkdir -p $PACKAGE_DIR/DEBIAN
|
||||
cp contrib/debian/* $PACKAGE_DIR/DEBIAN/
|
||||
echo "Version: $VERSION" >> $PACKAGE_DIR/DEBIAN/control
|
||||
echo "Architecture: $ARCH" >> $PACKAGE_DIR/DEBIAN/control
|
||||
mkdir -p $PACKAGE_DIR/debian
|
||||
cp contrib/debian/* $PACKAGE_DIR/debian/
|
||||
sed -i "s/0.0.0/${VERSION}/" $PACKAGE_DIR/debian/changelog
|
||||
echo "Architecture: $ARCH" >> $PACKAGE_DIR/debian/control
|
||||
|
||||
# Binaries
|
||||
mkdir -p $PACKAGE_DIR/usr/bin
|
||||
cp target/release/mitra $PACKAGE_DIR/usr/bin/mitra
|
||||
cp target/release/mitractl $PACKAGE_DIR/usr/bin/mitractl
|
||||
# Service
|
||||
cp contrib/mitra.service $PACKAGE_DIR/debian/mitra.service
|
||||
|
||||
# Config directory
|
||||
mkdir -p $PACKAGE_DIR/etc/mitra
|
||||
|
@ -28,13 +26,16 @@ mkdir -p $PACKAGE_DIR/etc/mitra
|
|||
mkdir -p $PACKAGE_DIR/usr/share/mitra/examples
|
||||
cp config.yaml.example $PACKAGE_DIR/usr/share/mitra/examples/config.yaml
|
||||
|
||||
# Service
|
||||
mkdir -p $PACKAGE_DIR/lib/systemd/system
|
||||
cp contrib/mitra.service $PACKAGE_DIR/lib/systemd/system/mitra.service
|
||||
# Binaries
|
||||
mkdir -p $PACKAGE_DIR/usr/bin
|
||||
cp target/release/mitra $PACKAGE_DIR/usr/bin/mitra
|
||||
cp target/release/mitractl $PACKAGE_DIR/usr/bin/mitractl
|
||||
|
||||
# Webapp
|
||||
mkdir -p $PACKAGE_DIR/usr/share/mitra
|
||||
# https://people.debian.org/~neilm/webapps-policy/ch-issues.html#s-issues-fhs
|
||||
cp -r $WEB_DIR $PACKAGE_DIR/usr/share/mitra/www
|
||||
|
||||
dpkg-deb --build target/debian/tmp target/debian/mitra_${VERSION}_${ARCH}.deb
|
||||
# Build
|
||||
cd $PACKAGE_DIR
|
||||
dpkg-buildpackage --build=binary --unsigned-changes
|
||||
|
|
Loading…
Reference in a new issue