79 lines
2.5 KiB
RPMSpec
79 lines
2.5 KiB
RPMSpec
|
%define gitlab_uid 65434
|
||
|
%define gitlab_gid 65434
|
||
|
%define homedir %{_localstatedir}/lib/gitlab
|
||
|
|
||
|
Name: gitlab-shell
|
||
|
Version: 1.9.5
|
||
|
Release: 1mamba
|
||
|
Summary: GitLab ssh access and repository management
|
||
|
Group: Applications/Development
|
||
|
Vendor: openmamba
|
||
|
Distribution: openmamba
|
||
|
Packager: Silvan Calarco <silvan.calarco@mambasoft.it>
|
||
|
URL: https://github.com/gitlabhq/gitlab-shell
|
||
|
## GITSOURCE https://github.com/gitlabhq/gitlab-shell.git v1.7.0
|
||
|
Source: https://github.com/gitlabhq/gitlab-shell.git/v%{version}/gitlab-shell-%{version}.tar.bz2
|
||
|
Patch0: gitlab-shell-1.9.5-config.yml.patch
|
||
|
License: MIT
|
||
|
## AUTOBUILDREQ-BEGIN
|
||
|
## AUTOBUILDREQ-END
|
||
|
Requires: ruby-bundler
|
||
|
Requires: redis
|
||
|
BuildRoot: %{_tmppath}/%{name}-%{version}-root
|
||
|
|
||
|
%description
|
||
|
GitLab Shell is an application that allows you to execute git commands and provide ssh access to git repositories. It is not a unix shell nor a replacement for Bash or Zsh.
|
||
|
|
||
|
%prep
|
||
|
%setup -q
|
||
|
%patch0 -p1
|
||
|
|
||
|
%build
|
||
|
mv config.yml.example config.yml
|
||
|
|
||
|
%install
|
||
|
[ "%{buildroot}" != / ] && rm -rf "%{buildroot}"
|
||
|
install -d -m0755 %{buildroot}%{_datadir}/gitlab-shell
|
||
|
cp -a * %{buildroot}%{_datadir}/gitlab-shell
|
||
|
|
||
|
install -d -m0700 %{buildroot}%{homedir}/.ssh
|
||
|
touch %{buildroot}%{homedir}/.ssh/authorized_keys
|
||
|
|
||
|
install -d -m0770 %{buildroot}%{homedir}/repositories
|
||
|
|
||
|
install -d -m0755 %{buildroot}%{_sysconfdir}/gitlab
|
||
|
mv %{buildroot}%{_datadir}/gitlab-shell/config.yml %{buildroot}%{_sysconfdir}/gitlab/gitlab-shell-config.yml
|
||
|
ln -sf %{_sysconfdir}/gitlab/gitlab-shell-config.yml %{buildroot}%{_datadir}/gitlab-shell/config.yml
|
||
|
|
||
|
%clean
|
||
|
[ "%{buildroot}" != / ] && rm -rf "%{buildroot}"
|
||
|
|
||
|
%pre
|
||
|
if [ $1 -ge 1 ]; then
|
||
|
/usr/sbin/groupadd gitlab -g %{gitlab_gid} 2>/dev/null
|
||
|
/usr/sbin/useradd -u %{gitlab_uid} -c 'Gitlab user' -d %{homedir} -g gitlab \
|
||
|
-s /bin/false gitlab 2>/dev/null
|
||
|
fi
|
||
|
:
|
||
|
|
||
|
%post
|
||
|
if [ $1 -eq 1 ]; then
|
||
|
echo "INFO: after installing gitlab run:"
|
||
|
echo " sudo -u gitlab -H bundle exec rake gitlab:shell:setup RAILS_ENV=production"
|
||
|
fi
|
||
|
:
|
||
|
|
||
|
%files
|
||
|
%defattr(-,root,root)
|
||
|
%dir %{_datadir}/gitlab-shell
|
||
|
%config(noreplace) %{_sysconfdir}/gitlab/gitlab-shell-config.yml
|
||
|
%{_datadir}/gitlab-shell/*
|
||
|
%dir %attr(0700,gitlab,gitlab) %{homedir}/.ssh
|
||
|
%config(noreplace) %attr(0600,gitlab,gitlab) %{homedir}/.ssh/authorized_keys
|
||
|
%dir %attr(2770,gitlab,gitlab) %{homedir}/repositories
|
||
|
%doc LICENSE
|
||
|
|
||
|
%changelog
|
||
|
* Mon Jun 02 2014 Silvan Calarco <silvan.calarco@mambasoft.it> 1.9.5-1mamba
|
||
|
- package created using the webbuild interface
|