]> git.pld-linux.org Git - packages/gitlab-shell.git/blob - gitlab-shell.spec
6d7d93e728b430913c1f4732452187706c3b00d5
[packages/gitlab-shell.git] / gitlab-shell.spec
1 Summary:        GitLab ssh access and repository management
2 Name:           gitlab-shell
3 Version:        2.6.12
4 Release:        0.8
5 License:        MIT
6 Group:          Applications/Shells
7 Source0:        https://github.com/gitlabhq/gitlab-shell/archive/v%{version}/%{name}-%{version}.tar.gz
8 # Source0-md5:  730c60e3d3d14d0f0ce0e82ff3a88a23
9 Patch0:         config.yml.patch
10 URL:            https://github.com/gitlabhq/gitlab-shell
11 BuildRequires:  rpm-rubyprov
12 BuildRequires:  rpmbuild(macros) >= 1.665
13 Requires:       ruby >= 1:2.0
14 Suggests:       redis
15 BuildArch:      noarch
16 BuildRoot:      %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
17
18 %define gitlab_uid 65434
19 %define gitlab_gid 65434
20 %define homedir %{_localstatedir}/lib/gitlab
21
22 %description
23 GitLab Shell is an application that allows you to execute git commands
24 and provide ssh access to git repositories. It is not a Unix shell nor
25 a replacement for Bash or Zsh.
26
27 %prep
28 %setup -q
29 %patch0 -p1
30
31 mv config.yml.example config.yml
32
33 # cleanup backups after patching
34 find '(' -name '*~' -o -name '*.orig' ')' -print0 | xargs -0 -r -l512 rm -f
35
36 %install
37 rm -rf $RPM_BUILD_ROOT
38 install -d $RPM_BUILD_ROOT%{_datadir}/%{name}
39 cp -a * $RPM_BUILD_ROOT%{_datadir}/%{name}
40
41 # exclude tests and other unwanted files
42 rm -r $RPM_BUILD_ROOT%{_datadir}/%{name}/spec
43 rm $RPM_BUILD_ROOT%{_datadir}/%{name}/G*
44 rm -f $RPM_BUILD_ROOT%{_datadir}/%{name}/debug*
45 # deprecated
46 rm $RPM_BUILD_ROOT%{_datadir}/%{name}/support/rewrite-hooks.sh
47 # stupid script, rather not package it at all
48 rm $RPM_BUILD_ROOT%{_datadir}/%{name}/support/truncate_repositories.sh*
49
50 install -d $RPM_BUILD_ROOT%{homedir}/.ssh
51 touch $RPM_BUILD_ROOT%{homedir}/.ssh/authorized_keys
52
53 install -d $RPM_BUILD_ROOT%{homedir}/repositories
54
55 install -d $RPM_BUILD_ROOT%{_sysconfdir}/gitlab
56 mv $RPM_BUILD_ROOT%{_datadir}/gitlab-shell/config.yml $RPM_BUILD_ROOT%{_sysconfdir}/gitlab/gitlab-shell-config.yml
57 ln -sf %{_sysconfdir}/gitlab/gitlab-shell-config.yml $RPM_BUILD_ROOT%{_datadir}/gitlab-shell/config.yml
58
59 # it will attempt to symlink if it doesn't exist
60 # /var/lib/gitlab/config/initializers/gitlab_shell_secret_token.rb +18
61 touch $RPM_BUILD_ROOT%{_sysconfdir}/gitlab/.gitlab_shell_secret
62 ln -s %{_sysconfdir}/gitlab/.gitlab_shell_secret $RPM_BUILD_ROOT%{_datadir}/%{name}/.gitlab_shell_secret
63
64 %clean
65 rm -rf $RPM_BUILD_ROOT
66
67 %pre
68 if [ $1 -ge 1 ]; then
69         %groupadd gitlab -g %{gitlab_gid}
70         %useradd -u %{gitlab_uid} -c 'Gitlab user' -d %{homedir} -g gitlab -s /bin/false gitlab
71 fi
72
73 %post
74 if [ $1 -eq 1 ]; then
75         echo "INFO: after installing gitlab run:"
76         echo "      sudo -u gitlab -H bundle exec rake gitlab:shell:setup RAILS_ENV=production"
77 fi
78
79 %files
80 %defattr(644,root,root,755)
81 %doc LICENSE
82 %dir %{_sysconfdir}/gitlab
83 %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/gitlab/gitlab-shell-config.yml
84 %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/gitlab/.gitlab_shell_secret
85 %dir %{_datadir}/%{name}
86 %{_datadir}/%{name}/lib
87 %dir %{_datadir}/%{name}/bin
88 %attr(755,root,root) %{_datadir}/%{name}/bin/*
89 %{_datadir}/%{name}/.gitlab_shell_secret
90 %{_datadir}/%{name}/[A-Z]*
91 %{_datadir}/%{name}/config.yml
92 %dir %{_datadir}/%{name}/hooks
93 %attr(755,root,root) %{_datadir}/%{name}/hooks/*
94
95 %dir %{homedir}
96 %dir %attr(700,gitlab,gitlab) %{homedir}/.ssh
97 %config(noreplace) %attr(600,gitlab,gitlab) %{homedir}/.ssh/authorized_keys
98 %dir %attr(2770,gitlab,gitlab) %{homedir}/repositories
This page took 0.070173 seconds and 2 git commands to generate.