[packages/gitlab-ce] FHS packaging, preserve homedir relative paths

glen glen at pld-linux.org
Mon Aug 29 23:17:31 CEST 2016


commit 34df841715c41fdc754cee22ec6e6ebfc8e32627
Author: Elan Ruusamäe <glen at delfi.ee>
Date:   Fri Aug 26 00:45:36 2016 +0300

    FHS packaging, preserve homedir relative paths

 apache.conf            |  2 +-
 gitlab-ce.spec         |  5 +++--
 gitlab-rake.sh         |  2 +-
 gitlab-sidekiq.init    |  2 +-
 gitlab-sidekiq.service |  8 ++++----
 gitlab-unicorn.init    |  2 +-
 gitlab-unicorn.service |  6 +++---
 gitlab.logrotate       | 14 +++++++-------
 nginx.conf             |  2 +-
 pld.patch              |  6 +++---
 10 files changed, 25 insertions(+), 24 deletions(-)
---
diff --git a/gitlab-ce.spec b/gitlab-ce.spec
index 99183c2..8fde8c7 100644
--- a/gitlab-ce.spec
+++ b/gitlab-ce.spec
@@ -17,7 +17,7 @@
 Summary:	A Web interface to create projects and repositories, manage access and do code reviews
 Name:		gitlab-ce
 Version:	8.11.2
-Release:	0.61
+Release:	0.62
 License:	MIT
 Group:		Applications/WWW
 # md5 deliberately omitted until this package is useful
@@ -68,7 +68,8 @@ BuildRoot:	%{tmpdir}/%{name}-%{version}-root-%(id -u -n)
 
 %define	uname git
 %define gname git
-%define homedir %{_localstatedir}/lib/gitlab
+%define homedir %{_prefix}/lib/gitlab
+%define vardir  %{_localstatedir}/lib/gitlab
 
 %description
 GitLab Community Edition (CE) is open source software to collaborate
diff --git a/apache.conf b/apache.conf
index 53825b6..bee5351 100644
--- a/apache.conf
+++ b/apache.conf
@@ -27,7 +27,7 @@
   RewriteRule .* http://127.0.0.1:8080%{REQUEST_URI} [P,QSA]
 
   # Needed for downloading attachments
-  DocumentRoot /var/lib/gitlab/public
+  DocumentRoot /usr/lib/gitlab/public
 
   # Set up apache error documents, if back end goes down (i.e. 503 error) then a maintenance/deploy page is thrown up.
   ErrorDocument 404 /404.html
diff --git a/gitlab-rake.sh b/gitlab-rake.sh
index db30222..6872762 100755
--- a/gitlab-rake.sh
+++ b/gitlab-rake.sh
@@ -21,5 +21,5 @@ done
 # so instead show defined tasks
 test $# = 0 && set -- -T
 
-cd /var/lib/gitlab
+cd /usr/lib/gitlab
 exec sudo -u git bundle exec rake RAILS_ENV=production "$@"
diff --git a/gitlab-sidekiq.init b/gitlab-sidekiq.init
index 68e2da4..8154674 100755
--- a/gitlab-sidekiq.init
+++ b/gitlab-sidekiq.init
@@ -31,7 +31,7 @@ RAILS_ENV="production"
 
 # The username and path to the gitlab source
 USER=git
-APP_PATH=/var/lib/gitlab
+APP_PATH=/usr/lib/gitlab
 
 # The PID and LOCK files used by unicorn and sidekiq
 pidfile=$APP_PATH/tmp/pids/sidekiq.pid
diff --git a/gitlab-sidekiq.service b/gitlab-sidekiq.service
index 8a3d227..b30e428 100644
--- a/gitlab-sidekiq.service
+++ b/gitlab-sidekiq.service
@@ -12,13 +12,13 @@ Description=GitLab Sidekiq Worker
 [Service]
 Type=forking
 User=gitlab
-WorkingDirectory=/var/lib/gitlab
+WorkingDirectory=/usr/lib/gitlab
 Environment=RAILS_ENV=production
 SyslogIdentifier=gitlab-sidekiq
-PIDFile=/var/lib/gitlab/pids/sidekiq.pid
+PIDFile=/var/run/gitlab/sidekiq.pid
 
-ExecStart=/var/lib/gitlab/bin/bundle exec "sidekiq -q post_receive,mailer,system_hook,project_web_hook,gitlab_shell,common,default -e production -P pids/sidekiq.pid -d -L log/sidekiq.log >> log/sidekiq.log 2>&1"
-ExecStop=/var/lib/gitlab/bin/bundle exec "sidekiqctl stop /var/lib/gitlab/pids/sidekiq.pid >> /var/lib/gitlab/log/sidekiq.log 2>&1"
+ExecStart=/usr/bin/bundle exec "sidekiq -q post_receive,mailer,system_hook,project_web_hook,gitlab_shell,common,default -e production -P pids/sidekiq.pid -d -L log/sidekiq.log >> log/sidekiq.log 2>&1"
+ExecStop=/usr/bin/bundle exec "sidekiqctl stop /var/run/gitlab/sidekiq.pid >> /var/lib/gitlab/sidekiq.log 2>&1"
 
 [Install]
 WantedBy=gitlab.target
diff --git a/gitlab-unicorn.init b/gitlab-unicorn.init
index 53dbca2..ebed4d8 100755
--- a/gitlab-unicorn.init
+++ b/gitlab-unicorn.init
@@ -31,7 +31,7 @@ RAILS_ENV="production"
 
 # The username and path to the gitlab source
 USER=git
-APP_PATH=/var/lib/gitlab
+APP_PATH=/usr/lib/gitlab
 
 # The PID and LOCK files used by unicorn and sidekiq
 pidfile=$APP_PATH/tmp/pids/unicorn.pid
diff --git a/gitlab-unicorn.service b/gitlab-unicorn.service
index a0f31fb..12f5aed 100644
--- a/gitlab-unicorn.service
+++ b/gitlab-unicorn.service
@@ -11,12 +11,12 @@ Description=GitLab Unicorn Server
 
 [Service]
 User=gitlab
-WorkingDirectory=/var/lib/gitlab
+WorkingDirectory=/usr/lib/gitlab
 Environment=RAILS_ENV=production
 SyslogIdentifier=gitlab-unicorn
-PIDFile=/var/lib/gitlab/pids/unicorn.pid
+PIDFile=/usr/lib/gitlab/pids/unicorn.pid
 
-ExecStart=/var/lib/gitlab/bin/bundle exec "unicorn_rails -c /var/lib/gitlab/config/unicorn.rb -E production"
+ExecStart=/usr/bin/bundle exec "unicorn_rails -c /etc/gitlab/unicorn.rb -E production"
 ExecStop=kill -QUIT $MAINPID
 ExecReload=kill -USR2 $MAINPID
 
diff --git a/gitlab.logrotate b/gitlab.logrotate
index 5d3b064..a1972dd 100644
--- a/gitlab.logrotate
+++ b/gitlab.logrotate
@@ -1,10 +1,10 @@
-/var/lib/gitlab/log/application.log
-/var/lib/gitlab/log/development.log
-/var/lib/gitlab/log/githost.log
-/var/lib/gitlab/log/production.log
-/var/lib/gitlab/log/sidekiq.log
-/var/lib/gitlab/log/unicorn.stderr.log
-/var/lib/gitlab/log/unicorn.stdout.log
+/var/log/gitlab/application.log
+/var/log/gitlab/development.log
+/var/log/gitlab/githost.log
+/var/log/gitlab/production.log
+/var/log/gitlab/sidekiq.log
+/var/log/gitlab/unicorn.stderr.log
+/var/log/gitlab/unicorn.stdout.log
 {
     rotate 7
     daily
diff --git a/nginx.conf b/nginx.conf
index f0af758..e6caa6a 100644
--- a/nginx.conf
+++ b/nginx.conf
@@ -53,7 +53,7 @@ server {
 	error_page 502 /502.html;
 
 	location ~ ^/(404|422|500|502)\.html$ {
-		root /var/lib/gitlab/public;
+		root /usr/lib/gitlab/public;
 		internal;
 	}
 }
diff --git a/pld.patch b/pld.patch
index 5b192dc..9fe561d 100644
--- a/pld.patch
+++ b/pld.patch
@@ -41,7 +41,7 @@
  # Help ensure your application will always spawn in the symlinked
  # "current" directory that Capistrano sets up.
 -working_directory "/home/git/gitlab" # available in 0.94.0+
-+working_directory "/var/lib/gitlab" # available in 0.94.0+
++working_directory "/usr/lib/gitlab" # available in 0.94.0+
  
  # Listen on both a Unix domain socket and a TCP port.
  # If you are load-balancing multiple Unicorn masters, lower the backlog
@@ -63,8 +63,8 @@
  # so prevent them from going to /dev/null when daemonized here:
 -stderr_path "/home/git/gitlab/log/unicorn.stderr.log"
 -stdout_path "/home/git/gitlab/log/unicorn.stdout.log"
-+stderr_path "/var/lib/gitlab/log/unicorn.stderr.log"
-+stdout_path "/var/lib/gitlab/log/unicorn.stdout.log"
++stderr_path "/var/log/gitlab/unicorn.stderr.log"
++stdout_path "/var/log/gitlab/unicorn.stdout.log"
  
  # combine Ruby 2.0.0dev or REE with "preload_app true" for memory savings
  # http://rubyenterpriseedition.com/faq.html#adapt_apps_for_cow
================================================================

---- gitweb:

http://git.pld-linux.org/gitweb.cgi/packages/gitlab-ce.git/commitdiff/5ce23bfad84ef429a91c4a8a1376f27f32d53e98



More information about the pld-cvs-commit mailing list