Name: postfix-tlspol Version: 1.8.12 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.} %define _unpackaged_files_terminate_build 0 %global goipath github.com/Zuplu/postfix-tlspol %gometa -L -f URL: %{gourl} BuildRequires: git golang go-rpm-macros systemd-rpm-macros %description %{common_description} %prep cd %{_builddir} git clone %{URL} mv %{_builddir}/postfix-tlspol %{_builddir}/%{archivename} %build # Stay with the golang version loaded with mock (set GOTOOLCHAIN=auto to allow upgrades) export GOTOOLCHAIN=local # Use pure golang. Don't link 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 * Mon Jul 28 2025 Michael Webb - 1.8.12-1 - Initial build For EL 9