Version 1.9.3 now with bindata
This commit is contained in:
parent
3524592217
commit
1174804bf9
87
gitea.spec
87
gitea.spec
@ -1,7 +1,7 @@
|
||||
ExclusiveArch: %{go_arches}
|
||||
|
||||
Name: gitea
|
||||
Version: 1.9.2
|
||||
Version: 1.9.3
|
||||
Release: 1%{?dist}
|
||||
Summary: Gitea: Git with a cup of tea
|
||||
|
||||
@ -20,83 +20,48 @@ Requires: git
|
||||
|
||||
%prep
|
||||
%setup -q -c
|
||||
%{__mkdir_p} src/code.gitea.io/
|
||||
mv %{name}-%{version} src/code.gitea.io/gitea
|
||||
|
||||
%build
|
||||
export GOPATH=%{gopath}:$(pwd)
|
||||
%{__mkdir_p} src/code.gitea.io/
|
||||
%{__ln_s} ../../%{name}-%{version} src/code.gitea.io/gitea
|
||||
export GOPATH=$(pwd):%{gopath}
|
||||
|
||||
cd src/code.gitea.io/gitea
|
||||
for bindir_location in options public templates
|
||||
do
|
||||
(
|
||||
cd src/code.gitea.io/gitea/modules/${bindir_location}
|
||||
GO111MODULE=on go run -mod=vendor main.go
|
||||
)
|
||||
done
|
||||
|
||||
case ${RPM_ARCH} in
|
||||
i386)
|
||||
GOARCH=386
|
||||
;;
|
||||
x86_64)
|
||||
GOARCH=amd64
|
||||
;;
|
||||
*)
|
||||
echo UNKNOWN ${RPM_ARCH}
|
||||
exit 1
|
||||
;;
|
||||
esac
|
||||
sed -i \
|
||||
-e 's/-s -w //g' %{name}-%{version}/Makefile
|
||||
|
||||
case ${RPM_OS} in
|
||||
linux)
|
||||
GOOS=linux
|
||||
;;
|
||||
*)
|
||||
echo UNKNOWN ${RPM_OS}
|
||||
exit 1
|
||||
;;
|
||||
esac
|
||||
make \
|
||||
-C src/code.gitea.io/gitea/ \
|
||||
TAGS="bindata pam sqlite sqlite_unlock_notify"\
|
||||
DRONE_TAG="%{version}-%{release}" \
|
||||
GOFLAGS='-a' \
|
||||
build
|
||||
|
||||
export GOARCH
|
||||
export GOOS
|
||||
|
||||
|
||||
#
|
||||
# It is best practice to always use external packages, rather than bundled
|
||||
# content. As not all of these packages are yet available in Fedora, we will
|
||||
# save this for a future date.
|
||||
#
|
||||
# rm -fr vendor
|
||||
#
|
||||
|
||||
|
||||
#
|
||||
# Push our package version, release, and buidl tags into the code
|
||||
#
|
||||
sed -i -e 's/^var Version.*$/var Version = "%{version}-%{release}"/g' main.go
|
||||
|
||||
#
|
||||
# Using -a to force everything to compile
|
||||
#
|
||||
# Using -v to display what is happening
|
||||
#
|
||||
go build -a -v -tags 'pam sqlite sqlite_unlock_notify'
|
||||
sed -i \
|
||||
-e 's|^User=.*$|User=gitea|g' \
|
||||
-e 's|^Group=.*$|Group=gitea|g' \
|
||||
-e 's|^WorkingDirectory=.*$|WorkingDirectory=/var/lib/gitea|g' \
|
||||
-e 's|^ExecStart=.*$|ExecStart=%{_bindir}/gitea web /etc/gitea/app.ini|g' \
|
||||
-e 's|^Environment=.*$|Environment=USER=gitea HOME=/var/lib/gitea GITEA_WORK_DIR=/var/lib/gitea|g' \
|
||||
contrib/systemd/gitea.service
|
||||
%{name}-%{version}/contrib/systemd/gitea.service
|
||||
|
||||
|
||||
%install
|
||||
rm -rf %{buildroot}
|
||||
cd src/code.gitea.io/gitea
|
||||
%{__install} -d %{buildroot}%{_bindir}
|
||||
%{__install} -d %{buildroot}%{_sysconfdir}/gitea
|
||||
%{__install} -d %{buildroot}/usr/lib/systemd/system
|
||||
%{__install} -d %{buildroot}/var/lib/gitea
|
||||
%{__install} -d %{buildroot}/var/log/gitea
|
||||
%{__install} -p -m 0755 %{name} %{buildroot}%{_bindir}/%{name}
|
||||
%{__install} -p -m 0644 contrib/systemd/gitea.service %{buildroot}/usr/lib/systemd/system/gitea.service
|
||||
%{__cp} -rp options %{buildroot}/var/lib/gitea/
|
||||
%{__cp} -rp public %{buildroot}/var/lib/gitea/
|
||||
%{__cp} -rp templates %{buildroot}/var/lib/gitea/
|
||||
%{__install} -p -m 0755 %{name}-%{version}/%{name} %{buildroot}%{_bindir}/%{name}
|
||||
%{__install} -p -m 0644 %{name}-%{version}/contrib/systemd/gitea.service %{buildroot}/usr/lib/systemd/system/gitea.service
|
||||
|
||||
|
||||
%pre
|
||||
@ -116,12 +81,14 @@ getent passwd gitea > /dev/null 2>&1 || useradd -r -d /var/lib/gitea -s /bin/bas
|
||||
%{_bindir}/%{name}
|
||||
%attr(0644, root, root) /usr/lib/systemd/system/gitea.service
|
||||
%attr(-, gitea, gitea) %config(noreplace) %{_sysconfdir}/gitea
|
||||
%attr(-, gitea, gitea) %config(noreplace) /var/lib/gitea/options
|
||||
%attr(-, gitea, gitea) %config(noreplace) /var/lib/gitea/public
|
||||
%attr(-, gitea, gitea) %config(noreplace) /var/lib/gitea/templates
|
||||
|
||||
|
||||
%changelog
|
||||
* Mon Sep 16 2019 Jason Rothstein
|
||||
- version bump 1.9.3
|
||||
- enable bindata tag
|
||||
- use make with DRONE_TAG to include the rpm package version and release data
|
||||
|
||||
* Mon Sep 16 2019 Jason Rothstein
|
||||
- version bump 1.9.2
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user