]> git.pld-linux.org Git - packages/gitlab-ce.git/blame - gitlab-ce.spec
restore fixtures. emojis are used
[packages/gitlab-ce.git] / gitlab-ce.spec
CommitLineData
1bfc7ca0
ER
1# NOTE:
2# This package uses Bundler to download and install all gems in deployment
3# mode (i.e. into isolated directory inside application). That's not PLD Linux
4# way how it should be done, but GitLab has too many dependencies that it will
5# be too difficult to maintain them via distro packages.
8f15c340 6#
a92c651e 7# install notes: https://gitlab.com/gitlab-org/gitlab-ce/blob/v8.6.6/doc/install/installation.md
8f15c340 8#
1bfc7ca0
ER
9# TODO
10# - [timfel-krb5-auth] doesn't build with heimdal (https://github.com/timfel/krb5-auth/issues/8)
11#
12#
13# Conditional build:
14%bcond_with krb5 # build with kerberos support
dc27d1e6 15%bcond_without gem_cache # use local to speedup gem installation
1bfc7ca0 16
edff9e13
ER
17Summary: A Web interface to create projects and repositories, manage access and do code reviews
18Name: gitlab-ce
e2d7a1f0 19Version: 8.8.1
d6fb12dc 20Release: 0.25
edff9e13
ER
21License: MIT
22Group: Applications/WWW
3af24041 23# md5 deliberately omitted until this package is useful
1bfc7ca0 24Source0: https://github.com/gitlabhq/gitlabhq/archive/v%{version}/%{name}-%{version}.tar.gz
79bdc113 25Patch0: https://gitlab.com/gitlab-org/gitlab-ce/merge_requests/3774.patch
c06de8c3 26Patch1: pld.patch
edff9e13
ER
27Source1: gitlab.target
28Source2: gitlab-sidekiq.service
7db376f0
ER
29Source3: gitlab-sidekiq.init
30Source4: gitlab-unicorn.service
31Source5: gitlab-unicorn.init
32Source6: gitlab.logrotate
33Source7: gitlab.tmpfiles.d
34Source8: gitlab-apache-conf
6ba051e8 35Source9: gitlab-rake.sh
e29cce1b 36Source10: gitconfig
c06de8c3 37URL: https://www.gitlab.com/gitlab-ce/
99acef11 38BuildRequires: cmake
b70ed759 39BuildRequires: gmp-devel
8b1af143 40BuildRequires: libgit2-devel
99acef11
ER
41BuildRequires: libicu-devel
42BuildRequires: libstdc++-devel
43BuildRequires: libxml2-devel
99acef11
ER
44BuildRequires: mysql-devel
45BuildRequires: postgresql-devel
8b1af143 46BuildRequires: rpm-rubyprov
edff9e13 47BuildRequires: ruby-bundler
b70ed759 48BuildRequires: ruby-devel >= 1:2.1.0
99acef11 49BuildRequires: zlib-devel
edff9e13 50Requires: apache-base
6f80237a 51Requires: git-core >= 2.7.4
63c66c76 52Requires: gitlab-shell >= 2.7.2
0f5b396e 53Requires: nodejs
edff9e13 54Requires: ruby-bundler
1bfc7ca0
ER
55Suggests: mysql
56Suggests: redis-server
63c66c76 57Obsoletes: gitlab <= 8.1.4
edff9e13
ER
58BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
59
a92c651e
ER
60%define _noautoreqfiles redcloth_scan.jar primitives.jar
61
e2b24ef1
G
62%define uname git
63%define gname git
64%define homedir %{_localstatedir}/lib/gitlab
edff9e13
ER
65
66%description
67GitLab Community Edition (CE) is open source software to collaborate
68on code. Create projects and repositories, manage access and do code
69reviews. GitLab CE is on-premises software that you can install and
70use on your server(s).
71
72%prep
1bfc7ca0 73%setup -qn gitlabhq-%{version}
c06de8c3
ER
74mv config/gitlab.yml.example config/gitlab.yml
75mv config/unicorn.rb.example config/unicorn.rb
79bdc113 76%patch0 -p1
c06de8c3 77%patch1 -p1
b262a96c 78
e3e185ca
ER
79# use mysql for now
80mv config/database.yml.mysql config/database.yml
81
d6fb12dc
ER
82find -name .gitkeep | xargs rm
83rm -r docker
84rm -r features
d6fb12dc
ER
85rm -r lib/support/{deploy,init.d}
86rm -r scripts
87rm -r spec
6f80237a 88rm .csscomb.json
d6fb12dc
ER
89rm .flayignore
90rm .foreman
cd662819 91rm .gitattributes
d6fb12dc
ER
92rm .gitignore
93rm .gitlab-ci.yml
94rm .hound.yml
95rm .pkgr.yml
96rm .rspec
97rm .rubocop.yml
98rm .scss-lint.yml
99rm .simplecov
100rm .teatro.yml
101rm Procfile
102rm bin/pkgr_before_precompile.sh
298ba786 103rm docker-compose.yml
99acef11 104
edff9e13 105%build
dc27d1e6
ER
106%if %{with gem_cache}
107cachedir="%{_specdir}/cache/%{version}.%{_arch}"
108install -d vendor/bundle
109test -d "$cachedir" && cp -aul "$cachedir"/* vendor/bundle
110%endif
111
edff9e13 112bundle install %{_smp_mflags} \
7470b5a8 113 --verbose \
dc27d1e6
ER
114 --deployment \
115 --without development test aws %{!?with_krb5:kerberos}
edff9e13 116
ea8d688f
ER
117cp -p config/gitlab.yml{,.production}
118sed -i -e '/secret_file:/d' config/gitlab.yml
a5202e18 119bundle exec rake RAILS_ENV=production assets:clean assets:precompile USE_DB=false
ea8d688f 120mv -f config/gitlab.yml{.production,}
a3c02bfc 121
a92c651e
ER
122# avoid bogus ruby dep
123chmod a-x vendor/bundle/ruby/gems/unicorn-*/bin/unicorn*
124
a3c02bfc
ER
125# remove secrets, log and cache that assets compile initialized
126rm .gitlab_shell_secret
127rm .secret
128rm config/secrets.yml
129rm log/production.log
130rm -r tmp/cache/*
131
dc27d1e6
ER
132%if %{with gem_cache}
133install -d "$cachedir"
134cp -aul vendor/bundle/* "$cachedir"
135%endif
136
edff9e13
ER
137%install
138rm -rf $RPM_BUILD_ROOT
139install -d \
6eb5e245
ER
140 $RPM_BUILD_ROOT%{homedir}/www \
141 $RPM_BUILD_ROOT%{homedir}/public/{assets,uploads} \
142 $RPM_BUILD_ROOT%{homedir}/satellites \
143 $RPM_BUILD_ROOT%{homedir}/tmp/{cache/assets,sessions} \
edff9e13 144 $RPM_BUILD_ROOT%{_sysconfdir}/gitlab \
6eb5e245 145 $RPM_BUILD_ROOT%{_docdir}/gitlab \
edff9e13 146
b262a96c
ER
147# test if we can hardlink -- %{_builddir} and $RPM_BUILD_ROOT on same partition
148if cp -al VERSION $RPM_BUILD_ROOT/VERSION 2>/dev/null; then
149 l=l
150 rm -f $RPM_BUILD_ROOT/VERSION
151fi
152
153cp -a$l . $RPM_BUILD_ROOT%{homedir}
edff9e13 154
fb518a6f
ER
155# rpm cruft from repackaging
156rm -f $RPM_BUILD_ROOT%{homedir}/debug*.list
157
321d2ad5
ER
158# nuke tests
159chmod -R u+w $RPM_BUILD_ROOT%{homedir}/vendor/bundle/ruby/gems/*/test
160rm -r $RPM_BUILD_ROOT%{homedir}/vendor/bundle/ruby/gems/*/test
161
edff9e13
ER
162# Creating links
163ln -fs /run/gitlab $RPM_BUILD_ROOT%{homedir}/pids
164ln -fs /run/gitlab $RPM_BUILD_ROOT%{homedir}/sockets
e4edb538 165rmdir $RPM_BUILD_ROOT%{homedir}/log
edff9e13 166ln -fs %{_localstatedir}/log/gitlab $RPM_BUILD_ROOT%{homedir}/log
1bfc7ca0 167install -d $RPM_BUILD_ROOT%{_localstatedir}/log/gitlab
edff9e13 168
fb518a6f
ER
169move_config() {
170 local source=$1 target=$2
171 mv $RPM_BUILD_ROOT$source $RPM_BUILD_ROOT$target
172 ln -s $target $RPM_BUILD_ROOT$source
173}
174
edff9e13
ER
175# Install config files
176for f in gitlab.yml unicorn.rb database.yml; do
fb518a6f 177 move_config %{homedir}/config/$f %{_sysconfdir}/gitlab/$f
edff9e13
ER
178done
179
6ba051e8 180install -d $RPM_BUILD_ROOT{%{_sbindir},%{systemdunitdir},%{systemdtmpfilesdir}} \
7db376f0 181 $RPM_BUILD_ROOT/etc/{logrotate.d,rc.d/init.d,httpd/webapps.d}
c7ba61b6 182
c7ba61b6 183cp -p %{SOURCE2} $RPM_BUILD_ROOT%{systemdunitdir}/gitlab-sidekiq.service
7db376f0
ER
184install -p %{SOURCE3} $RPM_BUILD_ROOT/etc/rc.d/init.d/gitlab-sidekiq
185cp -p %{SOURCE4} $RPM_BUILD_ROOT%{systemdunitdir}/gitlab-unicorn.service
186install -p %{SOURCE5} $RPM_BUILD_ROOT/etc/rc.d/init.d/gitlab-unicorn
187
188cp -p %{SOURCE1} $RPM_BUILD_ROOT%{systemdunitdir}/gitlab.target
189cp -p %{SOURCE7} $RPM_BUILD_ROOT%{systemdtmpfilesdir}/gitlab.conf
190cp -p %{SOURCE6} $RPM_BUILD_ROOT/etc/logrotate.d/gitlab.logrotate
191cp -p %{SOURCE8} $RPM_BUILD_ROOT/etc/httpd/webapps.d/gitlab.conf
e29cce1b 192cp -p %{SOURCE10} $RPM_BUILD_ROOT%{homedir}/.gitconfig
6ba051e8 193install -p %{SOURCE9} $RPM_BUILD_ROOT%{_sbindir}/gitlab-rake
edff9e13
ER
194
195%clean
196rm -rf "$RPM_BUILD_ROOT"
197
edff9e13
ER
198%post
199if [ $1 -ge 1 ]; then
200 systemctl -q daemon-reload
201 systemd-tmpfiles --create %{systemdtmpfilesdir}/gitlab.conf
202 [ -e %{_localstatedir}/lock/subsys/httpd ] && service httpd reload || :
203fi
204if [ $1 -eq 1 ]; then
205 systemctl -q enable gitlab-unicorn
206 systemctl -q enable gitlab-sidekiq
207 systemctl -q enable gitlab.target
208 systemctl -q start gitlab-unicorn
209 systemctl -q start gitlab-sidekiq
210 systemctl -q start gitlab.target
edff9e13
ER
211 echo "Create and configure database in /etc/gitlab/database.yml"
212 echo "Then run 'sudo -u gitlab bundle exec rake gitlab:setup RAILS_ENV=production'"
213 echo
214else
037664ba
ER
215 systemctl -q try-restart gitlab-unicorn || :
216 systemctl -q try-start gitlab-sidekiq || :
edff9e13
ER
217fi
218
219%postun
220if [ $1 -eq 0 ]; then
221 %userremove gitlab
222 %groupremove gitlab
223fi
224
225%files
226%defattr(644,root,root,755)
227%doc LICENSE
edff9e13
ER
228%config(noreplace) %{_sysconfdir}/gitlab/database.yml
229%config(noreplace) %{_sysconfdir}/gitlab/gitlab.yml
230%config(noreplace) %{_sysconfdir}/gitlab/unicorn.rb
c7ba61b6 231%config(noreplace) %{_sysconfdir}/httpd/webapps.d/gitlab.conf
edff9e13 232/etc/logrotate.d/gitlab.logrotate
7db376f0
ER
233%attr(754,root,root) /etc/rc.d/init.d/gitlab-sidekiq
234%attr(754,root,root) /etc/rc.d/init.d/gitlab-unicorn
6ba051e8 235%attr(755,root,root) %{_sbindir}/gitlab-rake
edff9e13
ER
236%{systemdunitdir}/gitlab-sidekiq.service
237%{systemdunitdir}/gitlab-unicorn.service
238%{systemdunitdir}/gitlab.target
239%{systemdtmpfilesdir}/gitlab.conf
e2b24ef1 240%dir %attr(755,%{uname},%{gname}) %{homedir}
e29cce1b 241%dir %attr(640,%{uname},%{gname}) %{homedir}/.gitconfig
e2b24ef1
G
242%dir %attr(755,%{uname},%{gname}) %{homedir}/app
243%attr(-,%{uname},%{gname}) %{homedir}/app/*
244%dir %attr(755,%{uname},%{gname}) %{homedir}/bin
245%attr(-,%{uname},%{gname}) %{homedir}/bin/*
246%dir %attr(755,%{uname},%{gname}) %{homedir}/builds
247%dir %attr(755,%{uname},%{gname}) %{homedir}/config
248%attr(-,%{uname},%{gname}) %{homedir}/config/*
249%dir %attr(755,%{uname},%{gname}) %{homedir}/db
250%attr(-,%{uname},%{gname}) %{homedir}/db/*
251%dir %attr(755,%{uname},%{gname}) %{homedir}/doc
252%attr(-,%{uname},%{gname}) %{homedir}/doc/*
e2b24ef1
G
253%dir %attr(755,%{uname},%{gname}) %{homedir}/lib
254%attr(-,%{uname},%{gname}) %{homedir}/lib/*
255%dir %attr(755,%{uname},%{gname}) %{homedir}/pids
e2d7a1f0 256
c76cceba 257%{homedir}/fixtures
e2d7a1f0
ER
258%{homedir}/generator_templates
259
4c1de6fa 260%dir %{homedir}/public
a14207d0 261%{homedir}/public/ci
4c1de6fa
ER
262%{homedir}/public/*.*
263%attr(-,%{uname},%{gname}) %{homedir}/public/uploads
264%attr(-,%{uname},%{gname}) %{homedir}/public/assets
e2b24ef1 265%dir %attr(755,%{uname},%{gname}) %{homedir}/satellites
e2b24ef1 266%dir %attr(755,%{uname},%{gname}) %{homedir}/sockets
e2b24ef1
G
267%dir %attr(755,%{uname},%{gname}) %{homedir}/tmp
268%attr(-,%{uname},%{gname}) %{homedir}/tmp/*
269%dir %attr(755,%{uname},%{gname}) %{homedir}/www
edff9e13 270
cd662819
ER
271%dir %attr(750,%{uname},%{gname}) %{homedir}/shared
272%dir %attr(750,%{uname},%{gname}) %{homedir}/shared/artifacts
273%dir %attr(750,%{uname},%{gname}) %{homedir}/shared/artifacts/tmp
274%dir %attr(750,%{uname},%{gname}) %{homedir}/shared/artifacts/tmp/cache
275%dir %attr(750,%{uname},%{gname}) %{homedir}/shared/artifacts/tmp/uploads
276%dir %attr(750,%{uname},%{gname}) %{homedir}/shared/lfs-objects
a329122f 277%dir %attr(750,%{uname},%{gname}) %{homedir}/shared/registry
cd662819 278
e2b24ef1
G
279%dir %attr(755,%{uname},%{gname}) %{homedir}/.bundle
280%attr(-,%{uname},%{gname}) %{homedir}/.bundle/config
e2b24ef1 281%attr(-,%{uname},%{gname}) %{homedir}/.ruby-version
e2b24ef1
G
282%attr(-,%{uname},%{gname}) %{homedir}/CHANGELOG
283%attr(-,%{uname},%{gname}) %{homedir}/GITLAB_WORKHORSE_VERSION
284%attr(-,%{uname},%{gname}) %{homedir}/GITLAB_SHELL_VERSION
285%attr(-,%{uname},%{gname}) %{homedir}/Gemfile*
286%attr(-,%{uname},%{gname}) %{homedir}/LICENSE
287%attr(-,%{uname},%{gname}) %{homedir}/*.md
e2b24ef1
G
288%attr(-,%{uname},%{gname}) %{homedir}/Rakefile
289%attr(-,%{uname},%{gname}) %{homedir}/VERSION
290%attr(-,%{uname},%{gname}) %{homedir}/config.ru
580f84c4 291
e4edb538 292%{homedir}/log
e2b24ef1 293%dir %attr(771,root,%{gname}) /var/log/gitlab
e4edb538 294
580f84c4
ER
295%defattr(-,root,root,-)
296%dir %{homedir}/vendor
297%{homedir}/vendor/*
This page took 0.113531 seconds and 4 git commands to generate.