# Generated by go2rpm 1.19.0 %bcond check 1 # https://github.com/foxcpp/maddy %global goipath github.com/foxcpp/maddy Version: 0.9.2 %gometa -L -f Name: maddy Release: %autorelease Summary: ✉️ Composable all-in-one mail server Provides: golang-github-foxcpp-maddy # Generated by go-vendor-tools License: Apache-2.0 AND BSD-2-Clause AND BSD-3-Clause AND CC0-1.0 AND GPL-3.0-only AND ISC AND MIT AND MIT-0 AND MPL-2.0 URL: %{gourl} Source0: %{gosource} # Generated by go-vendor-tools Source1: %{archivename}-vendor.tar.bz2 Source2: go-vendor-tools.toml Source3: maddy.sysusers BuildRequires: go-vendor-tools BuildRequires: systemd-rpm-macros BuildRequires: scdoc BuildRequires: git Patch0: 0001-systemd-unit-exec-path-update.patch %description Maddy Mail Server implements all functionality required to run a e-mail server. It can send messages via SMTP (works as MTA), accept messages via SMTP (works as MX) and store messages while providing access to them via IMAP. In addition to that it implements auxiliary protocols that are mandatory to keep email reasonably secure (DKIM, SPF, DMARC, DANE, MTA-STS). %prep %goprep -p1 tar -xf %{S:1} %generate_buildrequires %go_vendor_license_buildrequires -c %{S:2} %build %global gomodulesmode GO111MODULE=on %gobuild -o %{gobuilddir}/bin/maddy %{goipath}/cmd/maddy %install %go_vendor_license_install -c %{S:2} install -m 0755 -vd %{buildroot}%{_bindir} install -m 0755 -vp %{gobuilddir}/bin/* %{buildroot}%{_bindir}/ # Install configuration install -m 0755 -vd %{buildroot}%{_sysconfdir}/maddy/ install -m 0644 -vp maddy.conf %{buildroot}%{_sysconfdir}/maddy/ # Install systemd service unit install -m 0755 -vd %{buildroot}%{_unitdir} install -m 0644 -vp dist/systemd/* %{buildroot}%{_unitdir}/ # Install logrotate configuration install -m 0755 -vd %{buildroot}%{_sysconfdir}/logrotate.d install -m 0644 -vp dist/logrotate.d/maddy %{buildroot}%{_sysconfdir}/logrotate.d/ # Install user&group spec install -m 0755 -vd %{buildroot}%{_sysusersdir} install -p -D -m 0644 %{SOURCE3} %{buildroot}%{_sysusersdir}/maddy.conf # Install man page # install -p -D -m 0644 %{gobuilddir}/maddy.1 %{buildroot}%{_mandir}/man1/maddy.1 %pre %sysusers_create_compat %{SOURCE3} # Create home folder install -m 0770 -o maddy -g maddy -vd %{_sharedstatedir}/maddy %check %go_vendor_license_check -c %{S:2} %if %{with check} %gotest ./cmd/maddy %endif %files -f %{go_vendor_license_filelist} %doc docs AGENTS.md HACKING.md cmd/README.md %doc cmd/maddy-pam-helper/README.md cmd/maddy-shadow-helper/README.md %doc contrib/README.md contrib/kubernetes/chart/README.md %doc contrib/kubernetes/chart/templates/NOTES.txt dist/README.md %doc framework/config/lexer/README.md %config(noreplace) %{_sysconfdir}/maddy/maddy.conf %{_bindir}/maddy %{_unitdir}/maddy.service %{_unitdir}/maddy@.service %{_sysusersdir}/maddy.conf %{_sysconfdir}/logrotate.d/maddy %changelog %autochangelog