Name: postfix-tlspol Version: 1.8.13 Release: 1%{?dist} Summary: Lightweight MTA-STS + DANE/TLSA resolver and TLS policy server for Postfix, prioritizing DANE License: MIT and GPLv3+ %global common_description %{expand: Lightweight MTA-STS + DANE/TLSA resolver and TLS policy server for Postfix, prioritizing DANE.} %global debug_package %{nil} %define _unpackaged_files_terminate_build 0 %global goipath github.com/Zuplu/postfix-tlspol %if 0%{?rhel} == 8 %gometa %else %gometa -L -f %endif URL: %{gourl} # Comment to build directly from git source along with lines in %prep section Source0: %{archivename}.tar.gz BuildRequires: git golang go-srpm-macros systemd-rpm-macros %if 0%{?rhel} >= 9 BuildRequires: go-rpm-macros %endif %description %{common_description} %prep # Uncomment the following to build directly from git source #cd %{_builddir} #git clone %{URL} #mv %{_builddir}/postfix-tlspol %{_builddir}/%{archivename} # # Comment out the line below and Source0 above to build directly from git source %setup a0 %build # To include CPU detection and optimization and other features, paste script from the ./scripts/build.sh example here. # Allow golang upgrade to match toolchain version specified in ./go.mod (set GOTOOLCHAIN=local to disable). export GOTOOLCHAIN=local # Use pure golang. Don't use any gcc libraries. export CGO_ENABLED=0 printf "Version: %version\n" cd %{_builddir}/%{archivename} mkdir -p build if go build -buildmode=exe -trimpath -tags netgo -ldflags="-d -extldflags='-static' -s -X 'main.Version=%version'" -o build/postfix-tlspol .; then printf "Build succeeded!\n" else printf "Build failed!\n" exit 1 fi %install install -m 0755 -vd %{buildroot}%{_bindir} %__install -Dm 755 "%{_builddir}/%{archivename}/build/postfix-tlspol" "%{buildroot}%{_bindir}/" %__install -Dm 644 "%{_builddir}/%{archivename}/configs/config.default.yaml" "%{buildroot}%{_sysconfdir}/postfix-tlspol/config.yaml" %__install -Dm 644 "%{_builddir}/%{archivename}/README.md" "%{buildroot}%{_pkgdocdir}/README.md" %__install -Dm 644 "%{_builddir}/%{archivename}/SECURITY.md" "%{buildroot}%{_pkgdocdir}/SECURITY.md" %__install -Dm 755 "%{_builddir}/%{archivename}/scripts/query.sh" "%{buildroot}/usr/local/bin/postfix-tlspol/query.sh" %__install -Dm 755 "%{_builddir}/%{archivename}/scripts/test.sh" "%{buildroot}/usr/local/bin/postfix-tlspol/test.sh" %__install -Dm 644 "%{_builddir}/%{archivename}/init/postfix-tlspol.service" "%{buildroot}%{_unitdir}/postfix-tlspol.service" %__install -Dm 644 "%{_builddir}/%{archivename}/LICENSE" "%{buildroot}/usr/share/licenses/postfix-tlspol/LICENSE" # Change default DNS Server IP Address to 127.0.0.1:53 sed -i 's/53\:53/1\:53/g' %{buildroot}%{_sysconfdir}/postfix-tlspol/config.yaml %post %systemd_post postfix-tlspol.service exit 0 %preun %systemd_preun postfix-tlspol.service exit 0 %postun %systemd_postun_with_restart postfix-tlspol.service exit 0 %files %{_bindir}/postfix-tlspol /usr/share/licenses/postfix-tlspol/LICENSE %config(noreplace) %{_sysconfdir}/postfix-tlspol/config.yaml %{_pkgdocdir}/*.md /usr/local/bin/postfix-tlspol/*.sh %{_unitdir}/postfix-tlspol.service %changelog * Wed Aug 20 2025 Michael Webb - 1.8.13-1 - Upstream release update * Wed Jul 30 2025 Peter Ajamian - 1.8.12-3 - Remove version from the spec file name. - Force local go toochain. - Don't use the -L or -f flags for EL8 * Tue Jul 29 2025 Michael Webb - 1.8.12-2 - Preference to reuse same source tarball for rebuild consistency instead of git refresh - Preference to match toolchain specified in go.mod * Mon Jul 28 2025 Michael Webb - 1.8.12-1 - Initial build For EL 9