# Generated by go2rpm 1.5.0 %bcond_without check # https://github.com/foxcpp/maddy %global goipath github.com/foxcpp/maddy Version: 0.7.1 %gometa %global common_description %{expand: ✉️ Composable all-in-one mail server.} %global golicenses COPYING framework/config/lexer/LICENSE.APACHE %global godocs docs HACKING.md README.md cmd/README.md contrib/README.md \\\ dist/README.md framework/config/lexer/README.md Name: %{goname} Release: 1%{?dist} Summary: ✉️ Composable all-in-one mail server Provides: maddy = %{version} # Upstream license specification: Apache-2.0 and GPL-3.0-only License: ASL 2.0 and GPLv3 # FIXME: Upstream uses unknown SPDX tag GPL-3.0-only! URL: %{gourl} Source0: %{gosource} Source1: maddy.sysusers Patch0: 0001-Systemd-Unit.patch %if %{with check} # Tests #BuildRequires: golang(github.com/johannesboyne/gofakes3) #BuildRequires: golang(github.com/johannesboyne/gofakes3/backend/s3mem) %endif BuildRequires: systemd-rpm-macros BuildRequires: scdoc BuildRequires: git %global debug_package %{nil} %description %{common_description} %gopkg %prep %goprep %patch -P 0 -p1 %build export GOPROXY="https://proxy.golang.org" export GOSUMDB="sum.golang.org" go build -trimpath -ldflags="-X \"github.com/foxcpp/maddy.Version=%{version}\"" -o %{gobuilddir}/bin/maddy ./cmd/maddy mkdir -p %{gobuilddir}/man/man1 for f in ./docs/man/*.1.scd; do scdoc < "$f" > "%{gobuilddir}/man/man1/$(basename "$f" .scd)" done ln -sf %{gobuilddir}/bin/maddy %{gobuilddir}/bin/maddyctl %install %gopkginstall 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 %{SOURCE1} %{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 %{SOURCE1} # Create home folder install -m 0770 -o maddy -g maddy -vd %{_sharedstatedir}/maddy %files %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.* %gopkgfiles