# Fedora 29 rpm build file

**URL:** <https://forum.gitea.com/t/fedora-29-rpm-build-file/1143>\
**Category:** General\
**Created:** [May 7, 2019, 11:09am UTC](https://forum.gitea.com/t/fedora-29-rpm-build-file/1143 "2019-05-07T11:09:34Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![lolizeppelin](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.gitea.com/lolizeppelin/32/522_2.png) [@lolizeppelin](https://forum.gitea.com/u/lolizeppelin)\
**Post date:** [May 7, 2019, 11:09am UTC](https://forum.gitea.com/t/fedora-29-rpm-build-file/1143/1 "2019-05-07T11:09:34Z")

</div>

patch Makifile

| grep -v /vendor/  
| sed s!\_${PWD}! [code.gitea.io/gitea!g](http://code.gitea.io/gitea!g) | grep -v /vendor/

---------------------------rpm spec------------------------------

%global \_missing\_build\_ids\_terminate\_build 0  
#%global debug\_package %{nil}

Name: gitea  
Version: 1.8.0  
Release: 1%{?dist}  
Summary: A painless self-hosted Git service.

License: MIT  
URL: [https://github.com/go-gitea/%{name}](https://github.com/go-gitea/%25%7Bname%7D)  
Source0: %{name}-%{version}.tar.gz  
Source1: %{name}.service  
Patch1: %{name}-%{version}-Makefile.patch

BuildRequires: autoconf  
BuildRequires: automake  
BuildRequires: golang \>= 1.6  
BuildRequires: go-bindata

Requires: glib2 \>= 2.5  
Requires: git \>= 1.7

%description  
Gitea is a community managed fork of Gogs, lightweight  
code hosting solution written in Go and published  
under the MIT license.

%prep  
%setup -qn %{name}-%{version}  
%patch1

%build  
mkdir -p ./\_build/src/  
mv vendor/\* ./\_build/src/  
ln -s $(pwd) ./\_build/src/code.gitea.io/%{name}  
rm -rf vendor

export GOPATH=$(pwd)/\_build:%{gopath}

%{\_\_make} %{?\_smp\_mflags} TAGS=“bindata” generate  
make build

%install  
%{\_\_install} -D -m 0644 -p %{SOURCE1} %{buildroot}%{\_unitdir}/%{name}.service  
%{\_\_install} -D -m 0755 %{name} -t %{buildroot}%{\_bindir}

mkdir -p %{buildroot}%{\_sharedstatedir}/%{name}  
mkdir -p %{buildroot}%{\_sysconfdir}/%{name}  
mkdir -p %{buildroot}%{\_localstatedir}/log/%{name}

%pre  
if [“$1” = “1”] ; then  
getent group git \>/dev/null || groupadd -f -g 874 -r git  
if ! getent passwd git \>/dev/null ; then  
if ! getent passwd 874 \>/dev/null ; then  
useradd -r -u 874 -g git -M -s /usr/bin/git-shell -c “gitea server” git  
else  
useradd -r -g git -M -s /usr/bin/git-shell -c “gitea server” git  
fi  
fi  
fi

%preun  
systemctl stop gitea.service \> /dev/null 2\>&1

%files  
%doc docs  
%doc custom/conf/app.ini.sample  
%doc contrib/mysql.sql  
%{\_bindir}/%{name}  
%{\_unitdir}/%{name}.service  
%dir %{\_sysconfdir}/%{name}  
%defattr(-,git,git,-)  
%dir %{\_sharedstatedir}/%{name}  
%dir %{\_localstatedir}/log/%{name}

%changelog  
XXXXXXXXXXXXXXXXXXXX

---

<div class="post-metadata">

**Author:** ![lolizeppelin](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.gitea.com/lolizeppelin/32/522_2.png) [@lolizeppelin](https://forum.gitea.com/u/lolizeppelin)\
**Post date:** [May 8, 2019, 4:47pm UTC](https://forum.gitea.com/t/fedora-29-rpm-build-file/1143/2 "2019-05-08T16:47:30Z")

</div>

patch file

— Makefile 2019-04-21 01:23:24.000000000 +0800  
+++ Makefile.new 2019-05-07 17:32:49.551327260 +0800  
@@ -38,7 +38,7 @@

LDFLAGS := -X “main.Version=(GITEA\_VERSION)" -X "main.Tags=(TAGS)”

-PACKAGES ?= (filter-out code.gitea.io/gitea/integrations/migration-test,(filter-out [code.gitea.io/gitea/integrations](http://code.gitea.io/gitea/integrations),(shell (GO) list ./… | grep -v /vendor/)))  
+PACKAGES ?= (filter-out code.gitea.io/gitea/integrations/migration-test,(filter-out [code.gitea.io/gitea/integrations](http://code.gitea.io/gitea/integrations),(shell (GO) list ./…| sed s!\_{PWD}!code.gitea.io/gitea!g | grep -v /vendor/ ))) SOURCES ?= (shell find . -name “\*.go” -type f)
