diff --git a/darkhttpd/PKGBUILD b/darkhttpd/PKGBUILD new file mode 100644 index 0000000000..d471f18387 --- /dev/null +++ b/darkhttpd/PKGBUILD @@ -0,0 +1,46 @@ +# POWER Maintainer: Alexander Baldeck +# Maintainer: Sergej Pupykin + +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" +} diff --git a/darkhttpd/darkhttpd.service b/darkhttpd/darkhttpd.service new file mode 100644 index 0000000000..65f9bf3642 --- /dev/null +++ b/darkhttpd/darkhttpd.service @@ -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 diff --git a/darkhttpd/darkhttpd@.service b/darkhttpd/darkhttpd@.service new file mode 100644 index 0000000000..c05fe91316 --- /dev/null +++ b/darkhttpd/darkhttpd@.service @@ -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