Version 1.9.3 now with bindata
This commit is contained in:
		
							
								
								
									
										87
									
								
								gitea.spec
									
									
									
									
									
								
							
							
						
						
									
										87
									
								
								gitea.spec
									
									
									
									
									
								
							| @@ -1,7 +1,7 @@ | |||||||
| ExclusiveArch:  %{go_arches} | ExclusiveArch:  %{go_arches} | ||||||
|  |  | ||||||
| Name:           gitea | Name:           gitea | ||||||
| Version:        1.9.2 | Version:        1.9.3 | ||||||
| Release:        1%{?dist} | Release:        1%{?dist} | ||||||
| Summary:        Gitea: Git with a cup of tea | Summary:        Gitea: Git with a cup of tea | ||||||
|  |  | ||||||
| @@ -20,83 +20,48 @@ Requires:       git | |||||||
|  |  | ||||||
| %prep | %prep | ||||||
| %setup -q -c | %setup -q -c | ||||||
| %{__mkdir_p} src/code.gitea.io/ |  | ||||||
| mv %{name}-%{version} src/code.gitea.io/gitea |  | ||||||
|  |  | ||||||
| %build | %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 | sed -i \ | ||||||
|   i386) |   -e 's/-s -w //g' %{name}-%{version}/Makefile | ||||||
|     GOARCH=386 |  | ||||||
|     ;; |  | ||||||
|   x86_64) |  | ||||||
|     GOARCH=amd64 |  | ||||||
|     ;; |  | ||||||
|   *) |  | ||||||
|     echo UNKNOWN ${RPM_ARCH} |  | ||||||
|     exit 1 |  | ||||||
|     ;; |  | ||||||
| esac |  | ||||||
|  |  | ||||||
| case ${RPM_OS} in | make \ | ||||||
|   linux) |   -C src/code.gitea.io/gitea/ \ | ||||||
|     GOOS=linux |   TAGS="bindata pam sqlite sqlite_unlock_notify"\ | ||||||
|     ;; |   DRONE_TAG="%{version}-%{release}" \ | ||||||
|   *) |   GOFLAGS='-a' \ | ||||||
|     echo UNKNOWN ${RPM_OS} |   build | ||||||
|     exit 1 |  | ||||||
|     ;; |  | ||||||
| esac |  | ||||||
|  |  | ||||||
| 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 \ | sed -i \ | ||||||
| 	-e 's|^User=.*$|User=gitea|g' \ | 	-e 's|^User=.*$|User=gitea|g' \ | ||||||
| 	-e 's|^Group=.*$|Group=gitea|g' \ | 	-e 's|^Group=.*$|Group=gitea|g' \ | ||||||
| 	-e 's|^WorkingDirectory=.*$|WorkingDirectory=/var/lib/gitea|g' \ | 	-e 's|^WorkingDirectory=.*$|WorkingDirectory=/var/lib/gitea|g' \ | ||||||
| 	-e 's|^ExecStart=.*$|ExecStart=%{_bindir}/gitea web /etc/gitea/app.ini|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' \ | 	-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 | %install | ||||||
| rm -rf %{buildroot} | rm -rf %{buildroot} | ||||||
| cd src/code.gitea.io/gitea |  | ||||||
| %{__install} -d %{buildroot}%{_bindir} | %{__install} -d %{buildroot}%{_bindir} | ||||||
| %{__install} -d %{buildroot}%{_sysconfdir}/gitea | %{__install} -d %{buildroot}%{_sysconfdir}/gitea | ||||||
| %{__install} -d %{buildroot}/usr/lib/systemd/system | %{__install} -d %{buildroot}/usr/lib/systemd/system | ||||||
| %{__install} -d %{buildroot}/var/lib/gitea | %{__install} -d %{buildroot}/var/lib/gitea | ||||||
| %{__install} -d %{buildroot}/var/log/gitea | %{__install} -d %{buildroot}/var/log/gitea | ||||||
| %{__install} -p -m 0755 %{name} %{buildroot}%{_bindir}/%{name} | %{__install} -p -m 0755 %{name}-%{version}/%{name} %{buildroot}%{_bindir}/%{name} | ||||||
| %{__install} -p -m 0644 contrib/systemd/gitea.service %{buildroot}/usr/lib/systemd/system/gitea.service | %{__install} -p -m 0644 %{name}-%{version}/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/ |  | ||||||
|  |  | ||||||
|  |  | ||||||
| %pre | %pre | ||||||
| @@ -116,12 +81,14 @@ getent passwd gitea > /dev/null 2>&1 || useradd -r -d /var/lib/gitea -s /bin/bas | |||||||
| %{_bindir}/%{name} | %{_bindir}/%{name} | ||||||
| %attr(0644, root, root) /usr/lib/systemd/system/gitea.service | %attr(0644, root, root) /usr/lib/systemd/system/gitea.service | ||||||
| %attr(-, gitea, gitea) %config(noreplace) %{_sysconfdir}/gitea | %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 | %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 | * Mon Sep 16 2019 Jason Rothstein | ||||||
| - version bump 1.9.2 | - version bump 1.9.2 | ||||||
|  |  | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user