You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

71 lines
1.5 KiB

%global _hardened_build 1
%define _user git
%define _group git
%define _home /var/lib/staletea/
%define _logdir /var/log/staletea/
Name : staletea
Version : 1.0.0
Release : 1%{dist}
License : MIT
URL : https://gitea.com/jonasfranz/staletea
Summary : StaleTea is a simple stalebot for Gitea
Source0 : %{name}.service
Source1 : %{name}.env
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
%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} -o staletea main.go
%install
install -p -D -m 0644 %{SOURCE0} %{buildroot}%{_unitdir}/%{name}.service
install -p -D -m 0644 %{SOURCE1} %{buildroot}/%{_home}/env
install -p -D -m 0555 go/src/gitea.com/jonasfranz/staletea/staletea %{buildroot}%{_home}/%{name}
%pre
getent group %{_group} > /dev/null || groupadd -r %{_group}
getent passwd %{_user} > /dev/null || \
useradd -r -d %{_home} -g %{_group} \
-s /bin/bash -c "git user" %{_user}
exit 0
%post
%systemd_post %{name}.service
%preun
%systemd_preun %{name}.service
%postun
%systemd_postun %{name}.service
%files
%config(noreplace) %{_home}/env
%{_home}/%{name}
%{_unitdir}/%{name}.service
%changelog