]> git.pld-linux.org Git - packages/gitlab-shell.git/blob - gitlab-shell.spec
really unvendor redis
[packages/gitlab-shell.git] / gitlab-shell.spec
1 %define uid 264
2 %define gid 264
3 %define uname git
4 %define gname git
5 Summary:        GitLab ssh access and repository management
6 Name:           gitlab-shell
7 Version:        3.6.0
8 Release:        1
9 License:        MIT
10 Group:          Applications/Shells
11 Source0:        https://gitlab.com/gitlab-org/gitlab-shell/repository/archive.tar.gz?ref=v%{version}&/%{name}-%{version}.tar.gz
12 # Source0-md5:  e863a2b6e978b5da886842822861e327
13 Patch0:         config.yml.patch
14 Patch1:         unvendor-redis.patch
15 URL:            https://gitlab.com/gitlab-org/gitlab-shell
16 BuildRequires:  rpm-rubyprov
17 BuildRequires:  rpmbuild(macros) >= 1.665
18 BuildRequires:  sed >= 4.0
19 Provides:       group(%{gname})
20 Provides:       user(%{uname})
21 Conflicts:      gitlab-ce < 8.7.5-0.17
22 Requires(postun):       /usr/sbin/groupdel
23 Requires(postun):       /usr/sbin/userdel
24 Requires(pre):  /bin/id
25 Requires(pre):  /usr/bin/getgid
26 Requires(pre):  /usr/sbin/groupadd
27 Requires(pre):  /usr/sbin/useradd
28 Requires:       git-core >= 2.7.3
29 Requires:       ruby >= 1:2.0
30 Requires:       ruby-redis >= 3.3.0
31 Suggests:       redis-server
32 BuildArch:      noarch
33 BuildRoot:      %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
34
35 %define homedir %{_localstatedir}/lib/gitlab
36
37 %description
38 GitLab Shell is an application that allows you to execute git commands
39 and provide ssh access to git repositories. It is not a Unix shell nor
40 a replacement for Bash or Zsh.
41
42 %prep
43 %setup -qc
44 mv %{name}-*/* .
45 cp -p config.yml.example config.yml
46 %patch0 -p1
47 %patch1 -p1
48
49 %{__sed} -i -e '1 s,#!.*ruby,#!%{__ruby},' bin/* hooks/*
50
51 mv lib/vendor .
52
53 # deprecated
54 rm support/rewrite-hooks.sh
55 # stupid script, rather not package it at all
56 rm support/truncate_repositories.sh*
57
58 # cleanup backups after patching
59 find '(' -name '*~' -o -name '*.orig' ')' -print0 | xargs -0 -r -l512 rm -f
60
61 %install
62 rm -rf $RPM_BUILD_ROOT
63 install -d $RPM_BUILD_ROOT%{_datadir}/%{name}
64 cp -a VERSION *.yml bin lib hooks support $RPM_BUILD_ROOT%{_datadir}/%{name}
65
66 install -d $RPM_BUILD_ROOT%{homedir}/{.ssh,repositories}
67 touch $RPM_BUILD_ROOT%{homedir}/.ssh/authorized_keys
68
69 install -d $RPM_BUILD_ROOT%{_sysconfdir}/gitlab
70 mv $RPM_BUILD_ROOT%{_datadir}/gitlab-shell/config.yml $RPM_BUILD_ROOT%{_sysconfdir}/gitlab/gitlab-shell-config.yml
71 ln -sf %{_sysconfdir}/gitlab/gitlab-shell-config.yml $RPM_BUILD_ROOT%{_datadir}/gitlab-shell/config.yml
72
73 # it will attempt to symlink if it doesn't exist
74 # /var/lib/gitlab/config/initializers/gitlab_shell_secret_token.rb +18
75 touch $RPM_BUILD_ROOT%{_sysconfdir}/gitlab/.gitlab_shell_secret
76 ln -s %{_sysconfdir}/gitlab/.gitlab_shell_secret $RPM_BUILD_ROOT%{_datadir}/%{name}/.gitlab_shell_secret
77
78 %clean
79 rm -rf $RPM_BUILD_ROOT
80
81 %pre
82 %groupadd -g %{gid} %{gname}
83 %useradd -u %{uid} -c 'Git user' -d %{homedir} -g git -s /bin/false %{uname}
84
85 %post
86 %banner -o -e %{name} <<EOF
87
88 To rebuild authorized_keys file, run:
89
90   # gitlab-rake gitlab:shell:setup
91
92 http://docs.gitlab.com/ce/raketasks/maintenance.html#rebuild-authorized_keys-file
93
94 EOF
95
96 %postun
97 if [ "$1" = "0" ]; then
98         %userremove git
99         %groupremove git
100 fi
101
102 %files
103 %defattr(644,root,root,755)
104 %doc README.md CHANGELOG LICENSE
105 %dir %{_sysconfdir}/gitlab
106 %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/gitlab/gitlab-shell-config.yml
107 %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/gitlab/.gitlab_shell_secret
108 %dir %{_datadir}/%{name}
109 %{_datadir}/%{name}/lib
110 %dir %{_datadir}/%{name}/bin
111 %attr(755,root,root) %{_datadir}/%{name}/bin/*
112 %{_datadir}/%{name}/.gitlab_shell_secret
113 %{_datadir}/%{name}/config.yml
114 %{_datadir}/%{name}/VERSION
115 %dir %{_datadir}/%{name}/hooks
116 %attr(755,root,root) %{_datadir}/%{name}/hooks/*
117
118 %dir %{homedir}
119 %dir %attr(700,%{uname},%{gname}) %{homedir}/.ssh
120 %config(noreplace) %attr(600,%{uname},%{gname}) %{homedir}/.ssh/authorized_keys
121 %dir %attr(2770,%{uname},%{gname}) %{homedir}/repositories
This page took 0.066531 seconds and 3 git commands to generate.