%global debug_package %{nil} # Generated by go2rpm 1.19.0 %bcond check 1 # https://github.com/restic/rest-server %global goipath github.com/restic/rest-server Version: 0.14.0 %gometa -L -f Name: rest-server Release: %autorelease Summary: A high performance HTTP server that implements the Restic REST backend API # Generated by go-vendor-tools License: Apache-2.0 AND BSD-2-Clause AND BSD-3-Clause AND MIT URL: %{gourl} Source0: %{gosource} # Generated by go-vendor-tools Source1: %{archivename}-vendor.tar.bz2 Source2: go-vendor-tools.toml Source3: rest-server.service Source4: rest-server.sysconfig Source5: rest-server.sysusers BuildRequires: go-vendor-tools BuildRequires: systemd-rpm-macros %description A high performance HTTP server that implements the Restic REST backend API. %prep %goprep -p1 tar -xf %{S:1} %generate_buildrequires %go_vendor_license_buildrequires -c %{S:2} %build %global gomodulesmode GO111MODULE=on for cmd in cmd/* ; do %gobuild -o %{gobuilddir}/bin/$(basename $cmd) %{goipath}/$cmd done %install install -Dpm 0644 %{SOURCE3} %{buildroot}%{_unitdir}/rest-server.service install -Dpm 0644 %{SOURCE4} %{buildroot}%{_sysconfdir}/sysconfig/rest-server install -Dpm 0644 %{SOURCE5} %{buildroot}%{_sysusersdir}/rest-server.conf install -dm 0755 %{buildroot}%{_sharedstatedir}/rest-server %go_vendor_license_install -c %{S:2} install -m 0755 -vd %{buildroot}%{_bindir} install -m 0755 -vp %{gobuilddir}/bin/* %{buildroot}%{_bindir}/ %check %go_vendor_license_check -c %{S:2} %if %{with check} %gotest ./... %endif %files -f %{go_vendor_license_filelist} %{_unitdir}/rest-server.service %config(noreplace) %{_sysconfdir}/sysconfig/rest-server %{_sysusersdir}/rest-server.conf %attr(0755, rest-server, rest-server) %{_sharedstatedir}/rest-server %doc examples AUTHORS CHANGELOG.md README.md Release.md %doc changelog/CHANGELOG-GitHub.tmpl changelog/CHANGELOG.tmpl %{_bindir}/rest-server %changelog %autochangelog %post %systemd_post rest-server.service %preun %systemd_preun rest-server.service %postun %systemd_postun_with_restart rest-server.service