# Generated by go2rpm 1.18.0 %bcond check 1 # https://github.com/foxcpp/maddy %global goipath github.com/foxcpp/maddy Version: 0.8.1 %gometa -L -f Name: golang-github-foxcpp-maddy Release: %autorelease Summary: ✉️ Composable all-in-one mail server # 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 LicenseRef-Fedora-Public-Domain AND LicenseRef-scancode-musl-exception AND LicenseRef-scancode-other-permissive AND MIT AND MPL-2.0 AND (LicenseRef-Fedora-Public-Domain OR LicenseRef-scancode-other-permissive) 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: pam-devel BuildRequires: systemd-rpm-macros BuildRequires: scdoc BuildRequires: git Patch0: 0001-Systemd-Unit.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 -A %setup -q -T -D -a1 %{forgesetupargs} %autopatch -p1 %generate_buildrequires %go_vendor_license_buildrequires -c %{S:2} %build %global gomodulesmode GO111MODULE=on for cmd in "maddy" ; do %gobuild -o %{gobuilddir}/bin/$(basename $cmd) %{goipath}/cmd/$cmd done mkdir -p %{gobuilddir}/man/man1 for f in ./docs/man/*.1.scd; do scdoc < "$f" > "%{gobuilddir}/man/man1/$(basename "$f" .scd)" done %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 manpage install -m 0755 -vd %{buildroot}%{_mandir}/man1 install -m 0644 -vp %{gobuilddir}/man/man1/* %{buildroot}%{_mandir}/man1/ # Install docs install -m 0755 -vd %{buildroot}%{_docdir}/maddy cp -r docs/* %{buildroot}%{_docdir}/maddy/ %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 ./... %endif %files -f %{go_vendor_license_filelist} %license vendor/modules.txt %license COPYING framework/config/lexer/LICENSE.APACHE %doc %{_docdir}/maddy/* %config(noreplace) %{_sysconfdir}/maddy/maddy.conf %{_bindir}/* %{_unitdir}/maddy.service %{_unitdir}/maddy@.service %{_sysusersdir}/maddy.conf %{_sysconfdir}/logrotate.d/maddy %{_mandir}/man1/maddy.* %changelog %autochangelog