gitlab-shell.spec 1.62 KB
Name:		gitlab-shell
Version:	2.6.6
Release:	0
Summary:	Software Development Platform
Group:		Development/Tools
License:	Expat
URL:		https://gitlab.com/gitlab-org/gitlab-shell
Source0:	%{name}-%{version}.tar.gz
BuildArch:	noarch

# BuildRequires:
Requires:	ruby >= 1.9, redis

%global _log /var/log/gitlab-shell
%global _usrlib /usr/lib/gitlab-shell
%global _varlib /var/lib/gitlab-shell
%global _etc /etc/gitlab-shell

%description
Gitlab-shell

%prep
%setup -q

%build
cat > config.yml <<EOF
user: git
gitlab_url: "http://localhost:8080/"

http_settings:
#  user: someone
#  password: somepass
#  ca_file: /etc/ssl/cert.pem
#  ca_path: /etc/pki/tls/certs
  self_signed_cert: false

repos_path: "/var/lib/gitlab-shell/repositories/"
auth_file: "/var/lib/gitlab-shell/.ssh/authorized_keys"

redis:
  bin: /usr/bin/redis-cli
  host: 127.0.0.1
  port: 6379
  # pass: redispass # Allows you to specify the password for Redis
  #database: 0
  #socket: /var/run/redis/redis.sock # Comment out this line if you want to use TCP
  #namespace: resque:gitlab

log_file: "/var/log/gitlab-shell/gitlab-shell.log"
log_level: INFO
audit_usernames: false
EOF

%install
mkdir -p %{buildroot}%{_usrlib}
mkdir -p %{buildroot}%{_etc}

mv config.yml %{buildroot}%{_etc}
ln -s %{_etc}/config.yml %{buildroot}%{_usrlib}

cp -r .  %{buildroot}%{_usrlib}

%post
groupadd git || true
if ! id git; then
  adduser --system --home-dir %{_varlib} --gid git git
fi

mkdir -p %{_log}
mkdir -p %{_varlib}/.ssh
mkdir -p %{_varlib}/repositories

chown -R git:git %{_log}
chown -R git:git %{_varlib}

sudo -u git -H /usr/lib/gitlab-shell/bin/install

%files
%{_usrlib}
%{_etc}


%changelog