3 changed files with 72 additions and 0 deletions
@ -0,0 +1 @@ |
|||||
|
WIMIP_LISTENADDR=:8585 |
||||
@ -0,0 +1,13 @@ |
|||||
|
[Unit] |
||||
|
Description=What is my IP address? |
||||
|
Wants=network.target |
||||
|
After=network-online.target |
||||
|
|
||||
|
[Service] |
||||
|
Restart=always |
||||
|
Type=simple |
||||
|
EnvironmentFile=/opt/wimip/etc/wimip.env |
||||
|
ExecStart=/opt/wimip/bin/wimip |
||||
|
|
||||
|
[Install] |
||||
|
WantedBy=multi-user.target default.target |
||||
@ -0,0 +1,58 @@ |
|||||
|
%global goipath github.com/nmasse-itix/wimip |
||||
|
Version: 0.0.2 |
||||
|
|
||||
|
%gometa |
||||
|
|
||||
|
%global common_description %{expand: What is my IP address?} |
||||
|
|
||||
|
Name: wimip |
||||
|
Release: itix1 |
||||
|
Summary: What is my IP address? |
||||
|
License: MIT |
||||
|
ExclusiveArch: x86_64 |
||||
|
URL: %{gourl} |
||||
|
Source0: %{gosource} |
||||
|
Source1: wimip.service |
||||
|
Source2: wimip.env |
||||
|
BuildRequires: systemd |
||||
|
|
||||
|
# Not (yet ?) in CentOS Stream 8... |
||||
|
#BuildRequires: go-rpm-macros |
||||
|
|
||||
|
%description |
||||
|
%{common_description} |
||||
|
|
||||
|
%global _missing_build_ids_terminate_build 0 |
||||
|
%global _build_id_links none |
||||
|
%global debug_package %{nil} |
||||
|
|
||||
|
%prep |
||||
|
%setup # CentOS Stream 8 does not (yet ?) have the %goprep macro |
||||
|
cp %{S:1} %{name}.service |
||||
|
cp %{S:2} %{name}.env |
||||
|
|
||||
|
%build |
||||
|
CGO_ENABLED=0 GO111MODULE=on go build -o %{gobuilddir}/wimip %{goipath} |
||||
|
|
||||
|
%install |
||||
|
|
||||
|
install -D %{gobuilddir}/wimip %{buildroot}/opt/wimip/bin/wimip |
||||
|
install -D -m 0644 %{name}.service %{buildroot}%{_unitdir}/%{name}.service |
||||
|
install -D -m 0644 %{name}.env %{buildroot}/opt/wimip/etc/%{name}.env |
||||
|
|
||||
|
%files |
||||
|
%attr(0755, root, root) /opt/wimip/bin/wimip |
||||
|
%defattr(0644, root, root, 0755) |
||||
|
%{_unitdir}/%{name}.service |
||||
|
%config(noreplace) /opt/wimip/etc/%{name}.env |
||||
|
|
||||
|
%post |
||||
|
%systemd_post %{name}.service |
||||
|
|
||||
|
%preun |
||||
|
%systemd_preun %{name}.service |
||||
|
|
||||
|
%postun |
||||
|
%systemd_postun_with_restart %{name}.service |
||||
|
|
||||
|
%changelog |
||||
Loading…
Reference in new issue