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