%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} # Temporary Fix for a probable transient issue. XXX: Still needed ? # Source0: %{gosource} Source0: https://github.com/nmasse-itix/wimip/archive/refs/tags/v0.0.2.tar.gz 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