* add darkhttpd

This commit is contained in:
Alexander Baldeck 2019-03-26 22:55:39 +00:00
parent 3020142f5f
commit ab72586540
3 changed files with 74 additions and 0 deletions

46
darkhttpd/PKGBUILD Normal file
View File

@ -0,0 +1,46 @@
# POWER Maintainer: Alexander Baldeck <alex.bldck@gmail.com>
# Maintainer: Sergej Pupykin <arch+pub@sergej.pp.ru>
pkgname=darkhttpd
pkgver=1.12
pkgrel=4
pkgdesc="A small and secure static webserver"
arch=(x86_64 powerpc64le)
url="https://unix4lyfe.org/darkhttpd/"
license=('BSD')
backup=('etc/conf.d/mimetypes')
source=("$url/$pkgname-$pkgver.tar.bz2"
'darkhttpd.service'
'darkhttpd@.service')
sha256sums=('a50417b622b32b5f421b3132cb94ebeff04f02c5fb87fba2e31147d23de50505'
'e53ae82993f6c996c0c54ccbbd9307811501cf01404c441b48b2c79f9384fa27'
'0bfbe13c93ba87d8ea08ab85745c92cebcbc6b627616e7c58d6099a234a59841')
prepare() {
cd "$srcdir/$pkgname-$pkgver"
sed -i 's/$(CFLAGS)/$(CFLAGS) $(LDFLAGS)/' Makefile
}
build() {
cd "$srcdir/$pkgname-$pkgver"
make
}
package() {
cd "$srcdir/$pkgname-$pkgver"
# install darkhttpd
install -Dm755 "$srcdir/$pkgname-$pkgver/darkhttpd" "$pkgdir/usr/bin/darkhttpd"
# install systemd files
install -Dm644 "$srcdir/darkhttpd.service" "$pkgdir/usr/lib/systemd/system/darkhttpd.service"
install -Dm644 "$srcdir/darkhttpd@.service" "$pkgdir/usr/lib/systemd/system/darkhttpd@.service"
install -dm0755 "$pkgdir"/etc/conf.d/
touch "$pkgdir"/etc/conf.d/mimetypes
# install license
install -d "$pkgdir/usr/share/licenses/$pkgname"
sed -n '1,/^$/p' darkhttpd.c > "$pkgdir/usr/share/licenses/$pkgname/LICENSE"
}

View File

@ -0,0 +1,14 @@
[Unit]
Description=Darkhttpd Webserver
After=network.target
[Service]
Type=simple
ExecStart=/usr/bin/darkhttpd /srv/http --uid http --gid http --chroot --no-listing --mimetypes /etc/conf.d/mimetypes
ProtectSystem=full
ProtectHome=on
PrivateDevices=on
NoNewPrivileges=on
[Install]
WantedBy=multi-user.target

View File

@ -0,0 +1,14 @@
[Unit]
Description=Darkhttpd Webserver
After=network.target
[Service]
Type=simple
ExecStart=/usr/bin/darkhttpd /srv/http --uid http --gid http --chroot --no-listing --mimetypes /etc/conf.d/mimetypes --addr %i
ProtectSystem=full
ProtectHome=on
PrivateDevices=on
NoNewPrivileges=on
[Install]
WantedBy=multi-user.target