%bcond check 0 %bcond bootstrap 0 %if %{with bootstrap} %global debug_package %{nil} %endif %if %{with bootstrap} %global __requires_exclude %{?__requires_exclude:%{__requires_exclude}|}^golang\\(.*\\)$ %endif # https://github.com/matrix-org/dendrite %global goipath github.com/matrix-org/dendrite Version: 0.13.7 %gometa -f -L BuildRequires: sqlite-devel BuildRequires: pam-devel BuildRequires: systemd %if %{with check} BuildRequires: postgresql-server %else Recommends: postgresql-server %endif %global common_description %{expand: Dendrite is a second-generation Matrix homeserver written in Go!} %global golicenses LICENSE %global godocs docs CHANGES.md README.md build/docker/README.md\\\ build/scripts/README.md clientapi/README.md\\\ cmd/dendrite-demo-pinecone/README.md cmd/dendrite-\\\ demo-yggdrasil/README.md helm/dendrite/README.md\\\ helm/dendrite/README.md.gotmpl mediaapi/README.md\\\ relayapi/ARCHITECTURE.md roomserver/README.md\\\ syncapi/README.md Name: dendrite Release: %autorelease Summary: Dendrite is a second-generation Matrix homeserver written in Go License: Apache-2.0 URL: %{gourl} Source0: %{gosource} Source1: dendrite-monolith-server.service %description %{common_description} %global common_description %{expand: Dendrite is a second-generation Matrix homeserver written in Go!} %gopkg # Yes, we are vendoring it all %prep %goprep -A go mod vendor %autopatch -p1 # %%if %%{without bootstrap} # %%generate_buildrequires # %%go_generate_buildrequires # %%endif %if %{without bootstrap} %build for cmd in cmd/* ; do GOPATH=$(pwd)/vendor %gobuild -o %{gobuilddir}/bin/$(basename $cmd) %{goipath}/$cmd done for cmd in build/dendritejs-pinecone; do GOPATH=$(pwd)/vendor %gobuild -o %{gobuilddir}/bin/$(basename $cmd) %{goipath}/$cmd done %endif %install %gopkginstall %if %{without bootstrap} install -m 0755 -vd %{buildroot}%{_bindir}/%{name} install -m 0755 -vp %{gobuilddir}/bin/* %{buildroot}%{_bindir}/%{name}/ install -d -m 0755 %{buildroot}/%{_unitdir} install -m 644 %{SOURCE1} %{buildroot}%{_unitdir}/%{name}-monolith-server.service install -d -m 0755 %{buildroot}%{_sysconfdir}/%{name} install -m 660 dendrite-sample.yaml %{buildroot}%{_sysconfdir}/%{name}/dendrite.yaml install -d %{buildroot}%{_datadir}/%{name}/vendor install -d -m 0755 %{buildroot}%{_sharedstatedir}/%{name} install -d -m 0755 %{buildroot}%{_localstatedir}/log/%{name} cp -a vendor/* %{buildroot}%{_datadir}/%{name}/vendor/ %endif %if %{without bootstrap} %if %{with check} %check %gocheck %endif %endif %pre getent group %{name} > /dev/null || groupadd -r %{name} getent passwd %{name} > /dev/null || \ useradd -r -g %{name} -s /bin/bash \ -d %{_sharedstatedir}/%{name} \ -c "Dendrite account" %{name} %post %systemd_post %{name}-monolith-server.service %preun %systemd_preun %{name}-monolith-server.service %postun %systemd_postun %{name}-monolith-server.service %if %{without bootstrap} %files %defattr(-,root,root,-) %license LICENSE %doc docs CHANGES.md README.md build/docker/README.md build/scripts/README.md %doc clientapi/README.md cmd/dendrite-demo-pinecone/README.md %doc cmd/dendrite-demo-yggdrasil/README.md helm/dendrite/README.md %doc helm/dendrite/README.md.gotmpl mediaapi/README.md relayapi/ARCHITECTURE.md %doc roomserver/README.md syncapi/README.md %{_unitdir}/%{name}-monolith-server.service %{_bindir}/%{name}/create-account %{_bindir}/%{name}/dendrite-demo-pinecone %{_bindir}/%{name}/dendrite-demo-yggdrasil %{_bindir}/%{name}/dendrite %{_bindir}/%{name}/dendritejs-pinecone %{_bindir}/%{name}/dendrite-upgrade-tests %{_bindir}/%{name}/furl %{_bindir}/%{name}/generate-config %{_bindir}/%{name}/generate-keys %{_bindir}/%{name}/resolve-state %attr(0664,%{name},%{name}) %config(noreplace) %{_sysconfdir}/%{name}/dendrite.yaml %attr(0755,%{name},%{name}) %dir %{_sharedstatedir}/%{name} %attr(0755,%{name},%{name}) %dir %{_localstatedir}/log/%{name} %{_datadir}/%{name}/vendor %endif %gopkgfiles %changelog %autochangelog