diff --git a/README.md b/README.md index 5746750..e2651ae 100644 --- a/README.md +++ b/README.md @@ -1,2 +1,4 @@ # gitlab-shell +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. + diff --git a/gitlab-shell-1.9.5-config.yml.patch b/gitlab-shell-1.9.5-config.yml.patch new file mode 100644 index 0000000..5a0a78b --- /dev/null +++ b/gitlab-shell-1.9.5-config.yml.patch @@ -0,0 +1,31 @@ +--- gitlab-shell-1.9.5/config.yml.example.orig 2014-06-02 04:45:01.891389227 +0200 ++++ gitlab-shell-1.9.5/config.yml.example 2014-06-02 04:44:18.214779888 +0200 +@@ -1,5 +1,5 @@ + # GitLab user. git by default +-user: git ++user: gitlab + + # Url to gitlab instance. Used for api calls. Should end with a slash. + gitlab_url: "http://localhost/" +@@ -15,10 +15,10 @@ + # Give the canonicalized absolute pathname, + # REPOS_PATH MUST NOT CONTAIN ANY SYMLINK!!! + # Check twice that none of the components is a symlink, including "/home". +-repos_path: "/home/git/repositories" ++repos_path: "/var/lib/gitlab/repositories" + + # File used as authorized_keys for gitlab user +-auth_file: "/home/git/.ssh/authorized_keys" ++auth_file: "/var/lib/gitlab/.ssh/authorized_keys" + + # Redis settings used for pushing commit notices to gitlab + redis: +@@ -30,7 +30,7 @@ + + # Log file. + # Default is gitlab-shell.log in the root directory. +-# log_file: "/home/git/gitlab-shell/gitlab-shell.log" ++log_file: "/var/lib/gitlab/log/gitlab-shell.log" + + # Log level. INFO by default + log_level: INFO diff --git a/gitlab-shell.spec b/gitlab-shell.spec new file mode 100644 index 0000000..788e614 --- /dev/null +++ b/gitlab-shell.spec @@ -0,0 +1,78 @@ +%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 +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 1.9.5-1mamba +- package created using the webbuild interface