gitlab.spec
1.25 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
Name: gitlab
Version: 7.5.2
Release: 1%{?dist}
Summary: Software Development Platform
Group: Development/Tools
License: Expat
URL: https://beta.softwarepublico.gov.br/gitlab/softwarepublico/gitlab
Source0: %{name}-%{version}.tar.gz
BuildRequires: gitlab-deps,postgresql-server, postgresql-devel
Requires: gitlab-deps, postgresql-server, git
%description
GitLab
%prep
%autosetup
%pre
adduser git
service postgresql initdb
service postgresql start
sudo -u postgres psql -d template1 << EOF
CREATE USER git CREATEDB;
CREATE DATABASE gitlabhq_production OWNER git;
\q
EOF
%build
# make %{?_smp_mflags}
%install
cp config/gitlab.yml.example config/gitlab.yml
cp config/unicorn.rb.example config/unicorn.rb
cp config/initializers/rack_attack.rb.example config/initializers/rack_attack.rb
cp config/database.yml.postgresql config/database.yml
mkdir -p %{buildroot}/usr/lib/gitlab
cp -r app bin config config.ru db doc GITLAB_SHELL_VERSION lib Procfile public Rakefile vendor VERSION %{buildroot}/usr/lib/gitlab/
%post
cd /usr/lib/gitlab/
cp vendor/Gemfile* .
bundle exec rake gitlab:setup RAILS_ENV=production
%postun
userdel git
sudo -u postgres psql -d template1 << EOF
DROP DATABASE gitlabhq_production;
DROP USER git;
\q
EOF
%files
/usr/lib/gitlab
%doc