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