diff --git a/debian/conf/gitlab-debian.conf.example b/debian/conf/gitlab-debian.conf.example index 1ef2d433b4..ebf2701131 100644 --- a/debian/conf/gitlab-debian.conf.example +++ b/debian/conf/gitlab-debian.conf.example @@ -2,6 +2,9 @@ # Variables with all caps are passed to gitlab app RAILS_ENV=production DB=postgres +# This will be replaced by debian/rules at the time of build. +GITLAB_DEBIAN_VERSION="__NEW_VERSION__" +SALSA_TAG_URL="https://salsa.debian.org/ruby-team/gitlab/tags/debian/" gitlab_app_root=/usr/share/gitlab gitlab_data_dir=/var/lib/gitlab gitlab_pid_path=/run/gitlab diff --git a/debian/gitlab.postinst b/debian/gitlab.postinst index 26dd923f36..eacd940c02 100755 --- a/debian/gitlab.postinst +++ b/debian/gitlab.postinst @@ -41,7 +41,9 @@ test -f ${gitlab_common_defaults} && . ${gitlab_common_defaults} # Read debian specific configuration ####################################################################### -test -f ${gitlab_debian_conf_private} || cp ${gitlab_debian_conf_example} ${gitlab_debian_conf_private} +# Always copy the example configuration file in case there are newer entries +# added by maintainer +cp ${gitlab_debian_conf_example} ${gitlab_debian_conf_private} . ${gitlab_debian_conf_private} # If /etc/gitlab/gitlab-debian.conf is already present, use it diff --git a/debian/patches/0700-add-salsa-link-to-help.patch b/debian/patches/0700-add-salsa-link-to-help.patch new file mode 100644 index 0000000000..68e49a4763 --- /dev/null +++ b/debian/patches/0700-add-salsa-link-to-help.patch @@ -0,0 +1,19 @@ +Description: Use link to gitlab project on Salsa in help page +Author: Balasankar C +Last-Update: 2018-12-16 +--- +This patch header follows DEP-3: http://dep.debian.net/deps/dep3/ +--- a/app/helpers/version_check_helper.rb ++++ b/app/helpers/version_check_helper.rb +@@ -11,7 +11,10 @@ + end + + def link_to_version +- if Gitlab.pre_release? ++ if ENV['GITLAB_DEBIAN_VERSION'] && ENV['SALSA_TAG_URL'] ++ debian_tag = ENV['GITLAB_DEBIAN_VERSION'].gsub('~', '_') ++ link_to ENV['GITLAB_DEBIAN_VERSION'], ENV['SALSA_TAG_URL'] + debian_tag ++ elsif Gitlab.pre_release? + commit_link = link_to(Gitlab.revision, Gitlab::COM_URL + namespace_project_commits_path('gitlab-org', source_code_project, Gitlab.revision)) + [Gitlab::VERSION, content_tag(:small, commit_link)].join(' ').html_safe + else diff --git a/debian/patches/series b/debian/patches/series index c6ead516f4..1ddf141170 100644 --- a/debian/patches/series +++ b/debian/patches/series @@ -25,3 +25,4 @@ 0670-allow-doorkeepr-4_3.patch 0680-rails-5_2.patch 0690-debian-usage-ping.patch +0700-add-salsa-link-to-help.patch diff --git a/debian/rules b/debian/rules index 0cc07d592d..00ea826afe 100755 --- a/debian/rules +++ b/debian/rules @@ -1,5 +1,7 @@ #!/usr/bin/make -f +include /usr/share/dpkg/pkg-info.mk + %: dh $@ --with=systemd @@ -13,6 +15,7 @@ override_dh_install: mv debian/gitlab/usr/share/gitlab/app/assets/javascripts/locale \ debian/gitlab/usr/share/gitlab/app/assets/javascripts/locale.static mv debian/gitlab/var/lib/gitlab/db/schema.rb debian/gitlab/var/lib/gitlab/db/schema.rb.template + sed -i 's/__NEW_VERSION__/${DEB_VERSION}/g' debian/gitlab/usr/lib/gitlab/templates/gitlab-debian.conf.example override_dh_installinit: dh_installinit --no-start -p gitlab --name=gitlab-sidekiq