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