From df3bf274bb8e06d94deaf5dfc8336e466bba01db Mon Sep 17 00:00:00 2001 From: Daniel Steiner Date: Sun, 20 Jan 2019 13:45:54 +0100 Subject: [PATCH] Systemd config changed for more flexibility --- fedora/SPECS/echoip.spec | 18 +++++++++++++----- 1 file changed, 13 insertions(+), 5 deletions(-) diff --git a/fedora/SPECS/echoip.spec b/fedora/SPECS/echoip.spec index a88127f..8b6d691 100644 --- a/fedora/SPECS/echoip.spec +++ b/fedora/SPECS/echoip.spec @@ -10,7 +10,7 @@ Name: echoip Version: 1.0 -Release: 1.%{gitv}%{?dist} +Release: 3.%{gitv}%{?dist} Summary: A simple service for looking up your IP address. %define debug_package %{nil} @@ -19,19 +19,18 @@ License: BSD 3-Clause license URL: https://github.com/mpolden/%{name} Source0: %name-%{version}.%{gitv}.tgz Source1: %name.service -Source2: echoip-index.html +Source2: %name-index.html +Source3: %name.cfg BuildRequires: golang BuildRequires: go-compilers-golang-compiler BuildRequires: go-srpm-macros -BuildRequires: httpd-filesystem -Requires: httpd >= 2.4.0 Requires: httpd-filesystem Requires: geoipupdate-cron Requires: GeoIP %description -A simple service for looking up your IP address. This is the code that powers https://ifconfig.co. +A simple service for looking up your IP address. This is the code that powers https://echoip.daniel-steiner.org. %prep %setup -q -n %{name}-%{version}.%{gitv} @@ -63,6 +62,7 @@ install -D -m 0644 %{SOURCE2} %{buildroot}%{webd}/%{name}/index.html sed -i -e 's|.. .Host ..|%{protocol}://%{domain}|g' %{buildroot}%{webd}/%{name}/index.html sed -i -e 's/8080/%{port}/g' %{buildroot}%{webd}/%{name}/index.html install -D -m 0644 %{SOURCE1} %{buildroot}%{_unitdir}/%{name}.service +install -D -m 0644 %{SOURCE3} %{buildroot}%{_sysconfdir}/sysconfig/%{name} %clean [ "%{buildroot}" != "/" ] && [ -d "%{buildroot}" ] && rm -rf %{buildroot} @@ -108,6 +108,7 @@ fi %doc README.md %license LICENSE %{_bindir}/%{name} +%config(noreplace) %{_sysconfdir}/sysconfig/%{name} %dir %attr(-,%{name},%{name}) %{webd}/%{name} %attr(-,%{name},%{name}) %{webd}/%{name}/index.html %attr(-,%{name},%{name}) %{webd}/%{name}/orig-index.html @@ -115,5 +116,12 @@ fi %dir %attr(-,%{name},%{name}) %{_rundir}/%{name} %changelog +* Sun Jan 20 2019 Daniel Steiner +- All options are now in sysconfig file. + +* Sun Jan 20 2019 Daniel Steiner +- More flexible systemd config added. + * Sat Jan 19 2019 Daniel Steiner - First build for Fedora 29 using git master commit 58fd8a6. +