]> git.pld-linux.org Git - packages/gitlab-shell.git/blob - gitlab-shell.spec
ce4f690667264038bd171521bf0a33a86c0f6741
[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.10
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 BuildRequires:  sed >= 4.0
14 Requires:       ruby >= 1:2.0
15 Suggests:       redis
16 BuildArch:      noarch
17 BuildRoot:      %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
18
19 %define gitlab_uid 65434
20 %define gitlab_gid 65434
21 %define homedir %{_localstatedir}/lib/gitlab
22
23 %description
24 GitLab Shell is an application that allows you to execute git commands
25 and provide ssh access to git repositories. It is not a Unix shell nor
26 a replacement for Bash or Zsh.
27
28 %prep
29 %setup -q
30 cp -p config.yml.example config.yml
31 %patch0 -p1
32
33 %{__sed} -i -e '1 s,#!.*ruby,#!%{__ruby},' bin/* hooks/*
34
35 # deprecated
36 rm support/rewrite-hooks.sh
37 # stupid script, rather not package it at all
38 rm support/truncate_repositories.sh*
39
40 # cleanup backups after patching
41 find '(' -name '*~' -o -name '*.orig' ')' -print0 | xargs -0 -r -l512 rm -f
42
43 %install
44 rm -rf $RPM_BUILD_ROOT
45 install -d $RPM_BUILD_ROOT%{_datadir}/%{name}
46 cp -a *.yml bin lib hooks support $RPM_BUILD_ROOT%{_datadir}/%{name}
47
48 install -d $RPM_BUILD_ROOT%{homedir}/{.ssh,repositories}
49 touch $RPM_BUILD_ROOT%{homedir}/.ssh/authorized_keys
50
51 install -d $RPM_BUILD_ROOT%{_sysconfdir}/gitlab
52 mv $RPM_BUILD_ROOT%{_datadir}/gitlab-shell/config.yml $RPM_BUILD_ROOT%{_sysconfdir}/gitlab/gitlab-shell-config.yml
53 ln -sf %{_sysconfdir}/gitlab/gitlab-shell-config.yml $RPM_BUILD_ROOT%{_datadir}/gitlab-shell/config.yml
54
55 # it will attempt to symlink if it doesn't exist
56 # /var/lib/gitlab/config/initializers/gitlab_shell_secret_token.rb +18
57 touch $RPM_BUILD_ROOT%{_sysconfdir}/gitlab/.gitlab_shell_secret
58 ln -s %{_sysconfdir}/gitlab/.gitlab_shell_secret $RPM_BUILD_ROOT%{_datadir}/%{name}/.gitlab_shell_secret
59
60 %clean
61 rm -rf $RPM_BUILD_ROOT
62
63 %pre
64 if [ $1 -ge 1 ]; then
65         %groupadd gitlab -g %{gitlab_gid}
66         %useradd -u %{gitlab_uid} -c 'Gitlab user' -d %{homedir} -g gitlab -s /bin/false gitlab
67 fi
68
69 %post
70 if [ $1 -eq 1 ]; then
71         echo "INFO: after installing gitlab run:"
72         echo "      sudo -u gitlab -H bundle exec rake gitlab:shell:setup RAILS_ENV=production"
73 fi
74
75 %files
76 %defattr(644,root,root,755)
77 %doc README.md CHANGELOG LICENSE VERSION
78 %dir %{_sysconfdir}/gitlab
79 %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/gitlab/gitlab-shell-config.yml
80 %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/gitlab/.gitlab_shell_secret
81 %dir %{_datadir}/%{name}
82 %{_datadir}/%{name}/lib
83 %dir %{_datadir}/%{name}/bin
84 %attr(755,root,root) %{_datadir}/%{name}/bin/*
85 %{_datadir}/%{name}/.gitlab_shell_secret
86 %{_datadir}/%{name}/config.yml
87 %dir %{_datadir}/%{name}/hooks
88 %attr(755,root,root) %{_datadir}/%{name}/hooks/*
89
90 %dir %{homedir}
91 %dir %attr(700,gitlab,gitlab) %{homedir}/.ssh
92 %config(noreplace) %attr(600,gitlab,gitlab) %{homedir}/.ssh/authorized_keys
93 %dir %attr(2770,gitlab,gitlab) %{homedir}/repositories
This page took 0.081705 seconds and 2 git commands to generate.