@ -3,7 +3,6 @@
@@ -3,7 +3,6 @@
%define gitea_group git
%define gitea_home /var/lib/gitea/
%define gitea_logdir /var/log/gitea/
%define debug_package %{nil}
Name : gitea
Version : 1.9.3
@ -25,16 +24,17 @@ Gitea is a community managed fork of Gogs, lightweight code hosting solution wri
@@ -25,16 +24,17 @@ Gitea is a community managed fork of Gogs, lightweight code hosting solution wri
%prep
%setup -T -q -c %{name}-%{version}
export GOPATH=`pwd`
go get -u -v code.gitea.io/gitea
mkdir -p src/github.com/go-gitea/
cd src/github.com/go-gitea/
git clone https://github.com/go-gitea/gitea
%build
export GOPATH=`pwd`
cd src/code.gitea.io/gitea
rm -rf src/code.gitea.io/gitea
cd src/github.com/go-gitea/gitea
git checkout tags/v%{version}
sed -i 's|^var Version = "1.[0-9].[0-9]-dev"$|var Version = "'%{version}'"|g' main.go
GO111MODULE=on go build -v -ldflags '-extldflags -s -w -buildid '%{version}' -X "main.Version='%{version}'"'
GO111MODULE=on 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}"'"
sed -i 's|^STATIC_ROOT_PATH =$|STATIC_ROOT_PATH = /usr/share/gitea/templates/default/|g' custom/conf/app.ini.sample
sed -i 's|^ROOT =$|ROOT = /var/lib/gitea/repositories/|g' custom/conf/app.ini.sample
sed -i 's|^APP_DATA_PATH = data$|APP_DATA_PATH = /var/lib/gitea/data|g' custom/conf/app.ini.sample
@ -48,16 +48,16 @@ sed -i 's|^TEMP_PATH = data/tmp/uploads$|TEMP_PATH = /var/lib/gitea/data/tmp/upl
@@ -48,16 +48,16 @@ sed -i 's|^TEMP_PATH = data/tmp/uploads$|TEMP_PATH = /var/lib/gitea/data/tmp/upl
%install
install -p -D -m 0644 %{SOURCE0} %{buildroot}%{_unitdir}/gitea.service
mkdir -p %{buildroot}/%{gitea_home}/conf/
install -p -D -m 0644 src/code.gitea.io/gitea/custom/conf/app.ini.sample %{buildroot}%{gitea_home}/conf/app.ini
cp -r src/code.gitea.io/gitea/options/locale %{buildroot}%{gitea_home}/conf/
cp -r src/code.gitea.io/gitea/options/license %{buildroot}%{gitea_home}/conf/
cp -r src/code.gitea.io/gitea/options/label %{buildroot}%{gitea_home}/conf/
cp -r src/code.gitea.io/gitea/options/readme %{buildroot}%{gitea_home}/conf/
install -p -D -m 0644 src/github.com/go-gitea/gitea/custom/conf/app.ini.sample %{buildroot}%{gitea_home}/conf/app.ini
cp -r src/github.com/go-gitea/gitea/options/locale %{buildroot}%{gitea_home}/conf/
cp -r src/github.com/go-gitea/gitea/options/license %{buildroot}%{gitea_home}/conf/
cp -r src/github.com/go-gitea/gitea/options/label %{buildroot}%{gitea_home}/conf/
cp -r src/github.com/go-gitea/gitea/options/readme %{buildroot}%{gitea_home}/conf/
install -p -D -m 0644 %{SOURCE1} %{buildroot}%{_sysconfdir}/logrotate.d/gitea
mkdir -p %{buildroot}%{_datadir}/%{name}/templates/default/
cp -r src/code.gitea.io/gitea/templates %{buildroot}%{_datadir}/%{name}/templates/default/
cp -r src/code.gitea.io/gitea/public %{buildroot}%{_datadir}/%{name}/templates/default/
install -p -D -m 0555 src/code.gitea.io/gitea/gitea %{buildroot}%{_bindir}/gitea
cp -r src/github.com/go-gitea/gitea/templates %{buildroot}%{_datadir}/%{name}/templates/default/
cp -r src/github.com/go-gitea/gitea/public %{buildroot}%{_datadir}/%{name}/templates/default/
install -p -D -m 0555 src/github.com/go-gitea/gitea/gitea %{buildroot}%{_bindir}/gitea
install -p -d -m 0700 %{buildroot}%{gitea_home}
install -p -d -m 0700 %{buildroot}%{gitea_logdir}