Commit e07e1d76450c6ee62b9af41652b9faeb9a36fc12

Authored by Antonio Terceiro
0 parents

initial spec

Showing 1 changed file with 107 additions and 0 deletions   Show diff stats
gitlab.spec 0 → 100644
  1 +++ a/gitlab.spec
... ... @@ -0,0 +1,107 @@
  1 +%define pid_dir %{_localstatedir}/run/redis
  2 +%define pid_file %{pid_dir}/redis.pid
  3 +
  4 +Summary: gitlab
  5 +Name: gitlab
  6 +Version: 7.4
  7 +Release: 1
  8 +License: BSD
  9 +#Group: Applications/Multimedia
  10 +#URL: http://redis.io/
  11 +Source0: gitlab-%{version}.tar.gz
  12 +Source1: gitlab-ce-%{version}.tar.gz
  13 +BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root
  14 +Requires: nginx, postgresql-server, gitlab-deps
  15 +
  16 +BuildRequires: curl, zlib-devel, libyaml-devel, openssl-devel, libffi-devel, openssh-server, logrotate, libxml2-devel, libxslt-devel, readline-devel, ncurses-devel, libcurl-devel, python-docutils, gdbm-devel, gitlab-deps
  17 +
  18 +#Requires(post): /sbin/chkconfig /usr/sbin/useradd
  19 +#Requires(preun): /sbin/chkconfig, /sbin/service
  20 +#Requires(postun): /sbin/service
  21 +Provides: gitlab
  22 +%if 0%{?suse_version} >= 1210
  23 +BuildRequires: systemd
  24 +%endif
  25 +
  26 +
  27 +%description
  28 +
  29 +
  30 +%prep
  31 +echo "Fase de preparacao"
  32 +%setup
  33 +
  34 +%pre
  35 +adduser git
  36 +echo "Fase de pre"
  37 +service postgresql initdb
  38 +service postgresql start
  39 +sudo -u postgres psql -d template1 << EOF
  40 +CREATE USER git CREATEDB;
  41 +CREATE DATABASE gitlabhq_production OWNER git;
  42 +\q
  43 +EOF
  44 +
  45 +export PATH=$PATH:/usr/lib/gitlab/vendor/bundle/ruby/bin
  46 +
  47 +%build
  48 +
  49 +cp config/gitlab.yml.example config/gitlab.yml
  50 +cp config/unicorn.rb.example config/unicorn.rb
  51 +cp config/initializers/rack_attack.rb.example config/initializers/rack_attack.rb
  52 +cp config/database.yml.postgresql config/database.yml
  53 +
  54 +#bundle install --deployment --without development test mysql aws
  55 +
  56 +# Run the installation task for gitlab-shell (replace `REDIS_URL` if needed):
  57 +#bundle exec rake gitlab:shell:install REDIS_URL="redis://localhost:6379" RAILS_ENV=production
  58 +
  59 +# By default, the gitlab-shell config is generated from your main GitLab config.
  60 +# You can review (and modify) the gitlab-shell config as follows:
  61 +### vim /home/git/gitlab-shell/config.yml
  62 +
  63 +bundle exec rake gitlab:setup RAILS_ENV=production
  64 +bundle exec rake assets:precompile RAILS_ENV=production
  65 +
  66 +echo "\t\t\tFim da fase de build"
  67 +pwd
  68 +
  69 +%install
  70 +echo "#########Criando diretorio %{buildroot}%{_libdir}/gitlab"
  71 +mkdir -p %{buildroot}/usr/lib/gitlab/
  72 +cp -r . %{buildroot}/usr/lib/gitlab/
  73 +
  74 +
  75 +%post
  76 +
  77 +%preun
  78 +
  79 +%postun
  80 +
  81 +userdel git
  82 +
  83 +sudo -u postgres psql -d template1 << EOF
  84 +DROP DATABASE [ IF EXISTS ] gitlabhq_production;
  85 +DROP USER [ IF EXISTS ] git;
  86 +\q
  87 +EOF
  88 +
  89 +%clean
  90 +%{__rm} -rf %{buildroot}
  91 +
  92 +%files
  93 +/usr/lib/gitlab/
  94 +
  95 +#%defattr(-, root, root, 0755)
  96 +#%doc deps/lua/doc/*.html
  97 +#%{_sbindir}/redis-server
  98 +#%{_bindir}/redis-benchmark
  99 +#%{_bindir}/redis-cli
  100 +#%{_unitdir}/redis.service
  101 +#%config(noreplace) %{_sysconfdir}/redis.conf
  102 +#%{_sysconfdir}/logrotate.d/redis
  103 +#%dir %attr(0770,redis,redis) %{_localstatedir}/lib/redis
  104 +#%dir %attr(0755,redis,redis) %{_localstatedir}/log/redis
  105 +#%dir %attr(0755,redis,redis) %{_localstatedir}/run/redis
  106 +
  107 +%changelog
... ...