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.gz?ref=v%{version}&/%{name}-%{version}.tar.gz
8 # Source0-md5: 983d07b5c6f277dac7bc652d002f938b
9 Source1: %{name}.service
11 URL: https://gitlab.com/gitlab-org/gitlab-workhorse
12 BuildRequires: git-core
13 BuildRequires: golang >= 1.5
14 BuildRequires: rpmbuild(macros) >= 1.647
15 Requires(post,preun): /sbin/chkconfig
16 Requires: rc-scripts >= 0.4.16
17 Requires: systemd-units >= 0.38
18 Obsoletes: gitlab-git-http-server <= 0.3.0
19 BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
22 gitlab-git-http-server was designed to unload Git HTTP traffic from
23 the GitLab Rails app (Unicorn) to a separate daemon. All
24 authentication and authorization logic is still handled by the GitLab
29 mv %{name}-v%{version}-*/* .
32 # make version similar when built from git:
33 # Starting gitlab-workhorse v0.7.1-20160404.102052
34 version=v%{version}-$(date -u +%%Y%%m%%d.%%H%%M%%S)
40 ./gitlab-workhorse --version > v
44 rm -rf $RPM_BUILD_ROOT
45 install -d $RPM_BUILD_ROOT{%{_sbindir},%{systemdunitdir},/etc/rc.d/init.d}
47 install -p %{name} $RPM_BUILD_ROOT%{_sbindir}/%{name}
48 cp -p %{SOURCE1} $RPM_BUILD_ROOT%{systemdunitdir}/%{name}.service
49 cp -p %{SOURCE2} $RPM_BUILD_ROOT/etc/rc.d/init.d/%{name}
52 rm -rf $RPM_BUILD_ROOT
55 /sbin/chkconfig --add %{name}
56 %service %{name} restart
57 %systemd_post %{name}.service
60 if [ "$1" = "0" ]; then
61 %service -q %{name} stop
62 /sbin/chkconfig --del %{name}
64 %systemd_preun %{name}.service
70 %defattr(644,root,root,755)
71 %doc CHANGELOG README.md LICENSE
72 %attr(754,root,root) /etc/rc.d/init.d/%{name}
73 %attr(755,root,root) %{_sbindir}/%{name}
74 %{systemdunitdir}/%{name}.service