]> git.pld-linux.org Git - packages/gitlab-workhorse.git/blob - gitlab-workhorse.spec
dae10fcf822614f34c8145caa5be6913796ce195
[packages/gitlab-workhorse.git] / gitlab-workhorse.spec
1 Summary:        An HTTP daemon that serves Git clients
2 Name:           gitlab-workhorse
3 Version:        0.8.5
4 Release:        1
5 License:        MIT
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
10 Source2:        %{name}.init
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)
20
21 %description
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
25 Rails app.
26
27 %prep
28 %setup -qc
29 mv %{name}-v%{version}-*/* .
30
31 %build
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)
35
36 %{__make} \
37         VERSION=$version
38
39 # verify
40 ./gitlab-workhorse --version > v
41 grep "$version" v
42
43 %install
44 rm -rf $RPM_BUILD_ROOT
45 install -d $RPM_BUILD_ROOT{%{_sbindir},%{systemdunitdir},/etc/rc.d/init.d}
46
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}
50
51 %clean
52 rm -rf $RPM_BUILD_ROOT
53
54 %post
55 /sbin/chkconfig --add %{name}
56 %service %{name} restart
57 %systemd_post %{name}.service
58
59 %preun
60 if [ "$1" = "0" ]; then
61         %service -q %{name} stop
62         /sbin/chkconfig --del %{name}
63 fi
64 %systemd_preun %{name}.service
65
66 %postun
67 %systemd_reload
68
69 %files
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
This page took 0.069691 seconds and 2 git commands to generate.