]> git.pld-linux.org Git - packages/gitlab-workhorse.git/blob - gitlab-workhorse.spec
up to 1.0.1
[packages/gitlab-workhorse.git] / gitlab-workhorse.spec
1 Summary:        Handles slow HTTP requests for GitLab
2 Name:           gitlab-workhorse
3 Version:        1.0.1
4 Release:        1
5 License:        MIT
6 Group:          Networking/Daemons/HTTP
7 Source0:        https://gitlab.com/gitlab-org/gitlab-workhorse/repository/archive.tar.bz2?ref=v%{version}&/%{name}-%{version}.tar.bz2
8 # Source0-md5:  23f922264b28f0eaf20404c41451e494
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-workhorse is a smart reverse proxy for GitLab. It handles
24 "large" HTTP requests such as file downloads, file uploads, Git
25 push/pull and Git archive downloads.
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,sysconfig}}
46
47 install -p %{name} $RPM_BUILD_ROOT%{_sbindir}/%{name}
48 cp -p %{SOURCE1} $RPM_BUILD_ROOT%{systemdunitdir}/%{name}.service
49 install -p %{SOURCE2} $RPM_BUILD_ROOT/etc/rc.d/init.d/%{name}
50 cp -p %{SOURCE3} $RPM_BUILD_ROOT/etc/sysconfig/%{name}
51
52 %clean
53 rm -rf $RPM_BUILD_ROOT
54
55 %post
56 /sbin/chkconfig --add %{name}
57 %service %{name} restart
58 %systemd_post %{name}.service
59
60 %preun
61 if [ "$1" = "0" ]; then
62         %service -q %{name} stop
63         /sbin/chkconfig --del %{name}
64 fi
65 %systemd_preun %{name}.service
66
67 %postun
68 %systemd_reload
69
70 %files
71 %defattr(644,root,root,755)
72 %doc CHANGELOG README.md LICENSE
73 %config(noreplace) %verify(not md5 mtime size) /etc/sysconfig/%{name}
74 %attr(754,root,root) /etc/rc.d/init.d/%{name}
75 %attr(755,root,root) %{_sbindir}/%{name}
76 %{systemdunitdir}/%{name}.service
This page took 0.079156 seconds and 3 git commands to generate.