[darkhttpd/f18] Add systemd support

Christopher Meng cicku at fedoraproject.org
Thu May 23 08:08:15 UTC 2013


commit 7a79980d6016fd827f93a19ef7903bb77f7366a0
Author: Christopher Meng <rpm at cicku.me>
Date:   Thu May 23 16:07:05 2013 +0800

    Add systemd support

 darkhttpd.service   |   10 ++++++++++
 darkhttpd.spec      |   11 ++++++++++-
 darkhttpd.sysconfig |    2 ++
 3 files changed, 22 insertions(+), 1 deletions(-)
---
diff --git a/darkhttpd.service b/darkhttpd.service
new file mode 100644
index 0000000..d01f994
--- /dev/null
+++ b/darkhttpd.service
@@ -0,0 +1,10 @@
+[Unit]
+Description=Darkhttpd webserver daemon
+
+[Service]
+EnvironmentFile=-/etc/sysconfig/darkhttpd
+ExecStart=/usr/bin/darkhttpd $DARKHTTPD_ROOT --daemon $DARKHTTPD_FLAGS
+Type=forking
+
+[Install]
+WantedBy=multi-user.target
diff --git a/darkhttpd.spec b/darkhttpd.spec
index 7c89bf2..a54cd79 100644
--- a/darkhttpd.spec
+++ b/darkhttpd.spec
@@ -1,11 +1,13 @@
 Name:              darkhttpd
 Version:           1.9
-Release:           1%{?dist}
+Release:           2%{?dist}
 Summary:           A secure, lightweight, fast, single-threaded HTTP/1.1 server
 License:           BSD
 
 URL:               http://unix4lyfe.org/darkhttpd/
 Source0:           http://unix4lyfe.org/%{name}/%{name}-%{version}.tar.bz2
+Source1:           %{name}.service
+Source2:           %{name}.sysconfig
 
 %description
 darkhttpd is a secure, lightweight, fast, single-threaded HTTP/1.1 server.
@@ -34,11 +36,18 @@ make CFLAGS="%{optflags}" %{?_smp_mflags}
 
 %install
 install -p -D -m 755 %{name} %{buildroot}%{_bindir}/%{name}
+install -p -D -m 644 %{S:1} %{buildroot}%{_unitdir}/%{name}.service
+install -p -D -m 644 %{S:2} %{buildroot}%{_sysconfdir}/sysconfig/%{name}
 
 %files
 %doc README
+%config(noreplace) %{_sysconfdir}/sysconfig/%{name}
 %{_bindir}/%{name}
+%{_unitdir}/%{name}.service
 
 %changelog
+* Wed May 22 2013 Christopher Meng <rpm at cicku.me> - 1.9-2
+- Add systemd support.
+
 * Wed May 01 2013 Christopher Meng <rpm at cicku.me> - 1.9-1
 - Initial Package.
diff --git a/darkhttpd.sysconfig b/darkhttpd.sysconfig
new file mode 100644
index 0000000..10b7125
--- /dev/null
+++ b/darkhttpd.sysconfig
@@ -0,0 +1,2 @@
+DARKHTTPD_ROOT="/var/www"
+DARKHTTPD_FLAGS="--uid nobody --gid nobody --chroot"


More information about the scm-commits mailing list