%global _hardened_build 1 %define gitea_user git %define gitea_group git %define gitea_home /var/lib/gitea/ %define gitea_logdir /var/log/gitea/ Name : staletea Version : 0.0.1 Release : 1%{dist} License : MIT URL : https://gitea.com/jonasfranz/staletea Summary : StaleTea is a simple stalebot for Gitea. Source0 : staletea.service Source1 : staletea.timer BuildRequires: golang BuildRequires: git Requires : git %description StaleTea is a simple stalebot for Gitea. %prep %setup -T -q -c %{name}-%{version} export GOPATH=`pwd` mkdir -p go/src/gitea.com/jonasfranz/ cd go/src/gitea.com/jonasfranz/ git clone https://gitea.com/jonasfranz/staletea cd staletea %build export GOPATH=`pwd` export GO111MODULE=on cd go/src/gitea.com/jonasfranz/staletea go build -v -ldflags "-extldflags -s -w -B 0x$(head -c20 /dev/urandom|od -An -tx1|tr -d ' \n') -buildid "%{version}" -X 'main.Version="%{version}"' -X 'main.MakeVersion="%{release}"'" %install install -p -D -m 0644 %{SOURCE0} %{buildroot}%{_unitdir}/staletea.service install -p -D -m 0644 %{SOURCE1} %{buildroot}%{_unitdir}/statetea.timer #mkdir -p %{buildroot}/%{_sysconfdir}/%{name}/ #install -p -D -m 0644 go/src/github.com/gitea-group-sync/gitea-group-sync/config.yaml %{buildroot}%{_sysconfdir}/%{name}/config.yaml #install -p -D -m 0555 go/src/github.com/gitea-group-sync/gitea-group-sync/gitea-group-sync %{buildroot}%{_bindir}/gitea-group-sync %pre #getent group %{gitea_group} > /dev/null || groupadd -r %{gitea_group} #getent passwd %{gitea_user} > /dev/null || \ # useradd -r -d %{gitea_home} -g %{gitea_group} \ # -s /bin/bash -c "git user" %{gitea_user} #exit 0 %post %systemd_post staletea.service %preun %systemd_preun staletea.service %postun %systemd_postun staletea.service %files %config(noreplace) %{_sysconfdir}/%{name}/config.yaml #%{_bindir}/gitea-group-sync #%{_unitdir}/gitea-group-sync.service #%{_unitdir}/gitea-group-sync.timer %changelog