Browse Source

staletea package creation

Signed-off-by: webbuilder_pel7ppc64lebuilder0 <webbuilder@powerel.org>
master
webbuilder_pel7ppc64lebuilder0 8 months ago
parent
commit
a6d1f3293e
  1. 1
      SOURCES/staletea.env
  2. 18
      SOURCES/staletea.service
  3. 71
      SPECS/staletea.spec

1
SOURCES/staletea.env

@ -0,0 +1 @@ @@ -0,0 +1 @@
ADDRESS=":3030"

18
SOURCES/staletea.service

@ -0,0 +1,18 @@ @@ -0,0 +1,18 @@
[Unit]
Description=LGTM
After=syslog.target
After=network.target
After=gitea.service

[Service]
###
#LimitMEMLOCK=infinity
#LimitNOFILE=65535
Type=simple
User=git
Group=git
EnvironmentFile=/var/lib/staletea/env
ExecStart=/var/lib/staletea/staletea run --address $ADDRESS

[Install]
WantedBy=multi-user.target

71
SPECS/staletea.spec

@ -0,0 +1,71 @@ @@ -0,0 +1,71 @@
%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
Loading…
Cancel
Save