Systemd config changed for more flexibility

This commit is contained in:
2019-01-20 13:45:54 +01:00
parent 7d300c4c70
commit df3bf274bb

View File

@@ -10,7 +10,7 @@
Name: echoip Name: echoip
Version: 1.0 Version: 1.0
Release: 1.%{gitv}%{?dist} Release: 3.%{gitv}%{?dist}
Summary: A simple service for looking up your IP address. Summary: A simple service for looking up your IP address.
%define debug_package %{nil} %define debug_package %{nil}
@@ -19,19 +19,18 @@ License: BSD 3-Clause license
URL: https://github.com/mpolden/%{name} URL: https://github.com/mpolden/%{name}
Source0: %name-%{version}.%{gitv}.tgz Source0: %name-%{version}.%{gitv}.tgz
Source1: %name.service Source1: %name.service
Source2: echoip-index.html Source2: %name-index.html
Source3: %name.cfg
BuildRequires: golang BuildRequires: golang
BuildRequires: go-compilers-golang-compiler BuildRequires: go-compilers-golang-compiler
BuildRequires: go-srpm-macros BuildRequires: go-srpm-macros
BuildRequires: httpd-filesystem
Requires: httpd >= 2.4.0
Requires: httpd-filesystem Requires: httpd-filesystem
Requires: geoipupdate-cron Requires: geoipupdate-cron
Requires: GeoIP Requires: GeoIP
%description %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 %prep
%setup -q -n %{name}-%{version}.%{gitv} %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|.. .Host ..|%{protocol}://%{domain}|g' %{buildroot}%{webd}/%{name}/index.html
sed -i -e 's/8080/%{port}/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 %{SOURCE1} %{buildroot}%{_unitdir}/%{name}.service
install -D -m 0644 %{SOURCE3} %{buildroot}%{_sysconfdir}/sysconfig/%{name}
%clean %clean
[ "%{buildroot}" != "/" ] && [ -d "%{buildroot}" ] && rm -rf %{buildroot} [ "%{buildroot}" != "/" ] && [ -d "%{buildroot}" ] && rm -rf %{buildroot}
@@ -108,6 +108,7 @@ fi
%doc README.md %doc README.md
%license LICENSE %license LICENSE
%{_bindir}/%{name} %{_bindir}/%{name}
%config(noreplace) %{_sysconfdir}/sysconfig/%{name}
%dir %attr(-,%{name},%{name}) %{webd}/%{name} %dir %attr(-,%{name},%{name}) %{webd}/%{name}
%attr(-,%{name},%{name}) %{webd}/%{name}/index.html %attr(-,%{name},%{name}) %{webd}/%{name}/index.html
%attr(-,%{name},%{name}) %{webd}/%{name}/orig-index.html %attr(-,%{name},%{name}) %{webd}/%{name}/orig-index.html
@@ -115,5 +116,12 @@ fi
%dir %attr(-,%{name},%{name}) %{_rundir}/%{name} %dir %attr(-,%{name},%{name}) %{_rundir}/%{name}
%changelog %changelog
* Sun Jan 20 2019 Daniel Steiner <daniel.steiner@greenmail.ch>
- All options are now in sysconfig file.
* Sun Jan 20 2019 Daniel Steiner <daniel.steiner@greenmail.ch>
- More flexible systemd config added.
* Sat Jan 19 2019 Daniel Steiner <daniel.steiner@greenmail.ch> * Sat Jan 19 2019 Daniel Steiner <daniel.steiner@greenmail.ch>
- First build for Fedora 29 using git master commit 58fd8a6. - First build for Fedora 29 using git master commit 58fd8a6.