1 Summary: An HTTP daemon that serves Git clients
6 Group: Development/Building
7 Source0: https://gitlab.com/gitlab-org/gitlab-workhorse/repository/archive.tar.bz2?ref=v%{version}&/%{name}-%{version}.tar.bz2
8 # Source0-md5: b850a73be788189ea184c2b98c84aea8
9 Source1: %{name}.service
11 Source3: %{name}.sysconfig
12 URL: https://gitlab.com/gitlab-org/gitlab-workhorse
13 BuildRequires: git-core
14 BuildRequires: golang >= 1.5
15 BuildRequires: rpmbuild(macros) >= 1.647
16 Requires(post,preun): /sbin/chkconfig
17 Requires: rc-scripts >= 0.4.16
18 Requires: systemd-units >= 0.38
19 Obsoletes: gitlab-git-http-server <= 0.3.0
20 BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
23 gitlab-git-http-server was designed to unload Git HTTP traffic from
24 the GitLab Rails app (Unicorn) to a separate daemon. All
25 authentication and authorization logic is still handled by the GitLab
30 mv %{name}-v%{version}-*/* .
33 # make version similar when built from git:
34 # Starting gitlab-workhorse v0.7.1-20160404.102052
35 version=v%{version}-$(date -u +%%Y%%m%%d.%%H%%M%%S)
41 ./gitlab-workhorse --version > v
45 rm -rf $RPM_BUILD_ROOT
46 install -d $RPM_BUILD_ROOT{%{_sbindir},%{systemdunitdir},/etc/{rc.d/init.d,sysconfig}}
48 install -p %{name} $RPM_BUILD_ROOT%{_sbindir}/%{name}
49 cp -p %{SOURCE1} $RPM_BUILD_ROOT%{systemdunitdir}/%{name}.service
50 install -p %{SOURCE2} $RPM_BUILD_ROOT/etc/rc.d/init.d/%{name}
51 cp -p %{SOURCE3} $RPM_BUILD_ROOT/etc/sysconfig/%{name}
54 rm -rf $RPM_BUILD_ROOT
57 /sbin/chkconfig --add %{name}
58 %service %{name} restart
59 %systemd_post %{name}.service
62 if [ "$1" = "0" ]; then
63 %service -q %{name} stop
64 /sbin/chkconfig --del %{name}
66 %systemd_preun %{name}.service
72 %defattr(644,root,root,755)
73 %doc CHANGELOG README.md LICENSE
74 %config(noreplace) %verify(not md5 mtime size) /etc/sysconfig/%{name}
75 %attr(754,root,root) /etc/rc.d/init.d/%{name}
76 %attr(755,root,root) %{_sbindir}/%{name}
77 %{systemdunitdir}/%{name}.service