Browse Source

added gogs package files

Signed-off-by: webbuilder_pel7ppc64bebuilder0 <webbuilder@powerel.org>
master
webbuilder_pel7ppc64bebuilder0 7 years ago
parent
commit
663bdc9480
  1. 10
      SOURCES/gogs.logrotate
  2. 23
      SOURCES/gogs.service
  3. 97
      SPECS/gogs.spec

10
SOURCES/gogs.logrotate

@ -0,0 +1,10 @@ @@ -0,0 +1,10 @@
# gogs logs:
/var/log/gogs/*.log {
daily
missingok
rotate 14
compress
delaycompress
notifempty
copytruncate
}

23
SOURCES/gogs.service

@ -0,0 +1,23 @@ @@ -0,0 +1,23 @@
[Unit]
Description=Gogs
After=syslog.target
After=network.target
After=mariadb.service mysqld.service postgresql.service memcached.service redis.service

[Service]
# Modify these two values and uncomment them if you have
# repos with lots of files and get an HTTP error 500 because
# of that
###
#LimitMEMLOCK=infinity
#LimitNOFILE=65535
Type=simple
User=git
Group=git
WorkingDirectory=/var/lib/gogs/
ExecStart=/usr/bin/gogs web --config /etc/gogs/app.ini
Restart=always
Environment=USER=git HOME=/var/lib/gogs/

[Install]
WantedBy=multi-user.target

97
SPECS/gogs.spec

@ -0,0 +1,97 @@ @@ -0,0 +1,97 @@
%global _hardened_build 1
%define gogs_user git
%define gogs_group git
%define gogs_home /var/lib/gogs/
%define gogs_logdir /var/log/gogs/

Name : gogs
Version : 0.11.34
Release : 1%{dist}
License : MIT
URL : http://gogs.io
Summary : Gogs(Go Git Service) is a painless self-hosted Git Service written in Go.
Source0 : gogs.service
Source1 : gogs.logrotate
BuildRequires: golang
BuildRequires: git
Requires : git


%description
Gogs(Go Git Service) is a painless self-hosted Git Service written in Go.


%prep
%setup -T -q -c %{name}-%{version}
export GOPATH=`pwd`
go get -u github.com/gogits/gogs


%build
export GOPATH=`pwd`
cd src/github.com/gogits/gogs
git checkout -b v%{version}
go build
sed -i 's|^STATIC_ROOT_PATH =$|STATIC_ROOT_PATH = /usr/share/gogs/templates/default/|g' conf/app.ini
sed -i 's|^ROOT =$|ROOT = /var/lib/gogs/|g' conf/app.ini
sed -i 's|^APP_DATA_PATH = data$|APP_DATA_PATH = /var/lib/gogs/data|g' conf/app.ini
sed -i 's|^PROVIDER_CONFIG = data/sessions$|PROVIDER_CONFIG = /var/lib/gogs/data/sessions|g' conf/app.ini
sed -i 's|^AVATAR_UPLOAD_PATH = data/avatars$|AVATAR_UPLOAD_PATH = /var/lib/gogs/data/avatars|g' conf/app.ini
sed -i 's|^PATH = data/attachments$|PATH = /var/lib/gogs/data/attachments|g' conf/app.ini
sed -i 's|^ROOT_PATH =$|ROOT_PATH = /var/log/gogs|g' conf/app.ini
sed -i 's|^TEMP_PATH = data/tmp/uploads$|TEMP_PATH = /var/lib/gogs/data/tmp/uploads|g' conf/app.ini


%install
install -p -D -m 0644 %{SOURCE0} %{buildroot}%{_unitdir}/gogs.service
install -p -D -m 0644 src/github.com/gogits/gogs/conf/app.ini %{buildroot}%{_sysconfdir}/gogs/app.ini
cp -r src/github.com/gogits/gogs/conf/locale %{buildroot}%{_sysconfdir}/gogs/
cp -r src/github.com/gogits/gogs/conf/license %{buildroot}%{_sysconfdir}/gogs/
cp -r src/github.com/gogits/gogs/conf/label %{buildroot}%{_sysconfdir}/gogs/
cp -r src/github.com/gogits/gogs/conf/readme %{buildroot}%{_sysconfdir}/gogs/
install -p -D -m 0644 %{SOURCE1} %{buildroot}%{_sysconfdir}/logrotate.d/gogs
mkdir -p %{buildroot}%{_datadir}/%{name}/templates/default/
cp -r src/github.com/gogits/gogs/templates %{buildroot}%{_datadir}/%{name}/templates/default/
cp -r src/github.com/gogits/gogs/public %{buildroot}%{_datadir}/%{name}/templates/default/
install -p -D -m 0555 src/github.com/gogits/gogs/gogs %{buildroot}%{_bindir}/gogs
install -p -d -m 0700 %{buildroot}%{gogs_home}
install -p -d -m 0700 %{buildroot}%{gogs_logdir}


%pre
getent group %{gogs_group} > /dev/null || groupadd -r %{gogs_group}
getent passwd %{gogs_user} > /dev/null || \
useradd -r -d %{gogs_home} -g %{gogs_group} \
-s /bin/bash -c "Gogs user" %{gogs_user}
exit 0


%post
%systemd_post gogs.service


%preun
%systemd_preun gogs.service


%postun
%systemd_postun gogs.service


%files
%attr(775,%{gogs_user},%{gogs_group}) %dir %{_sysconfdir}/%{name}
%config(noreplace) %{_sysconfdir}/%{name}/app.ini
%{_sysconfdir}/%{name}/locale/*
%{_sysconfdir}/%{name}/license/*
%{_sysconfdir}/%{name}/label/*
%{_sysconfdir}/%{name}/readme/*
%{_sysconfdir}/logrotate.d/%{name}
%{_bindir}/gogs
%{_unitdir}/gogs.service
%{_datadir}/%{name}/templates/
%attr(700,%{gogs_user},%{gogs_group}) %dir %{gogs_home}
%attr(700,%{gogs_user},%{gogs_group}) %dir %{gogs_logdir}


%changelog

Loading…
Cancel
Save