overcomplicate it
This commit is contained in:
parent
e2db47ec4b
commit
5f9946d79d
13
lexiserver.service
Normal file
13
lexiserver.service
Normal file
@ -0,0 +1,13 @@
|
||||
[Unit]
|
||||
Description=Lexiserver
|
||||
After=network.target
|
||||
|
||||
[Service]
|
||||
ExecStart=/usr/bin/lexiserver
|
||||
WorkingDirectory=/opt/lexiserver
|
||||
Restart=always
|
||||
User=lexiserver
|
||||
Group=lexiserver
|
||||
|
||||
[Install]
|
||||
WantedBy=multi-user.target
|
@ -1,3 +1,7 @@
|
||||
%global commit 8acdf9773c022b84b02bfee9f70c486b5572411d
|
||||
%global gittag GIT-TAG
|
||||
%global shortcommit %(c=%{commit}; echo ${c:0:7})
|
||||
|
||||
Name: lexiserver
|
||||
Version: 1.1.0
|
||||
Release: 1%{dist}
|
||||
@ -6,24 +10,43 @@ Summary: A webserver written in C that tries to keep it simple
|
||||
License: GPL-3.0-only
|
||||
|
||||
URL: https://github.com/alexiarstein/simple-webserver
|
||||
Source: lexiserver-%{version}.tar.gz
|
||||
Source: https://github.com/alexiarstein/simple-webserver/archive/%{commit}/%{name}-%{shortcommit}.tar.gz
|
||||
Source: lexiserver.service
|
||||
Source: lexiserver.sysusers
|
||||
|
||||
BuildRequires: annobin-plugin-gcc
|
||||
BuildRequires: cmake
|
||||
BuildRequires: gcc
|
||||
BuildRequires: file
|
||||
BuildRequires: openssl-devel
|
||||
BuildRequires: systemd-rpm-macros
|
||||
|
||||
%description
|
||||
LexiServer is a webserver written in C that tries to keep it simple. It supports TLS and executing CGI scripts.
|
||||
|
||||
%pre
|
||||
%sysusers_create_compat %{SOURCE2}
|
||||
|
||||
%post
|
||||
%systemd_post lexiserver.service
|
||||
|
||||
%preun
|
||||
%systemd_preun lexiserver.service
|
||||
|
||||
%postun
|
||||
%systemd_postun lexiserver.service
|
||||
|
||||
%package devel
|
||||
Summary: Development files for lexiserver
|
||||
|
||||
%description devel
|
||||
The development files for compiling against lexiserver
|
||||
|
||||
%prep
|
||||
%autosetup
|
||||
%autosetup -n simple-webserver-%{commit}
|
||||
|
||||
#remove precompiled binaries
|
||||
rm lexiserver-arm64{,-ssl}
|
||||
|
||||
%build
|
||||
%cmake
|
||||
@ -32,6 +55,9 @@ The development files for compiling against lexiserver
|
||||
%install
|
||||
%cmake_install
|
||||
|
||||
install -p -D -m 0644 %{SOURCE1} %{buildroot}%{_unitdir}/lexiserver.service
|
||||
install -p -D -m 0644 %{SOURCE2} %{buildroot}%{_sysusersdir}/lexiserver.conf
|
||||
|
||||
pushd redhat-linux-build
|
||||
install -p -D -m 0755 lexiserver %{buildroot}%{_bindir}/lexiserver
|
||||
popd
|
||||
@ -56,6 +82,8 @@ popd
|
||||
/opt/lexiserver/404.html
|
||||
%config(noreplace) /opt/lexiserver/lexiserver.conf
|
||||
%{_bindir}/lexiserver
|
||||
%{_sysusersdir}/lexiserver.conf
|
||||
%{_unitdir}/lexiserver.service
|
||||
|
||||
%files devel
|
||||
%{_includedir}/lexiserver*.c
|
||||
|
3
lexiserver.sysusers
Normal file
3
lexiserver.sysusers
Normal file
@ -0,0 +1,3 @@
|
||||
g lexiserver 96
|
||||
u lexiserver 96 "LexiServer" /opt/lexiserver /sbin/nologin
|
||||
|
Loading…
Reference in New Issue
Block a user