From 5b1dc77f7b7f7bb39a014070efd7ee615c043cd995929791b7697415e620fba5 Mon Sep 17 00:00:00 2001 From: Tim Serong Date: Fri, 16 Aug 2019 08:40:50 +0000 Subject: [PATCH] Accepting request 723936 from home:jfajerski:branches:server:monitoring document changes a bit better OBS-URL: https://build.opensuse.org/request/show/723936 OBS-URL: https://build.opensuse.org/package/show/server:monitoring/golang-github-prometheus-prometheus?expand=0&rev=19 --- 0004-prometheus-buildmode-pie.patch | 13 ----------- golang-github-prometheus-prometheus.changes | 8 +++++++ golang-github-prometheus-prometheus.spec | 24 +++++++++------------ 3 files changed, 18 insertions(+), 27 deletions(-) delete mode 100644 0004-prometheus-buildmode-pie.patch diff --git a/0004-prometheus-buildmode-pie.patch b/0004-prometheus-buildmode-pie.patch deleted file mode 100644 index 685b0ed..0000000 --- a/0004-prometheus-buildmode-pie.patch +++ /dev/null @@ -1,13 +0,0 @@ -Index: prometheus-2.11.1/.promu.yml -=================================================================== ---- prometheus-2.11.1.orig/.promu.yml 2019-07-31 12:44:46.190247145 +0200 -+++ prometheus-2.11.1/.promu.yml 2019-07-31 12:45:18.354547518 +0200 -@@ -10,7 +10,7 @@ build: - path: ./cmd/prometheus - - name: promtool - path: ./cmd/promtool -- flags: -mod=vendor -a -+ flags: -mod=vendor -buildmode=pie -a - ldflags: | - -X github.com/prometheus/common/version.Version={{.Version}} - -X github.com/prometheus/common/version.Revision={{.Revision}} diff --git a/golang-github-prometheus-prometheus.changes b/golang-github-prometheus-prometheus.changes index f093df5..2dc6e29 100644 --- a/golang-github-prometheus-prometheus.changes +++ b/golang-github-prometheus-prometheus.changes @@ -1,3 +1,11 @@ +------------------------------------------------------------------- +Fri Aug 16 06:46:24 UTC 2019 - Jan Fajerski + +- remove 0004-prometheus-buildmode-pie.patch + + this patch produces binaries that crash immediately +- add -v to promu build command for better build debugging +- reorder some %install tasks + ------------------------------------------------------------------- Fri Aug 2 11:22:25 UTC 2019 - Jan Fajerski diff --git a/golang-github-prometheus-prometheus.spec b/golang-github-prometheus-prometheus.spec index d746090..e55d02f 100644 --- a/golang-github-prometheus-prometheus.spec +++ b/golang-github-prometheus-prometheus.spec @@ -39,8 +39,6 @@ Patch1: 0001-Do-not-force-the-pure-Go-name-resolver.patch Patch2: 0002-Default-settings.patch # Uyuni service discovery support Patch3: 0003-Add-Uyuni-service-discovery.patch -# Add -buildmode=pie -Patch4: 0004-prometheus-buildmode-pie.patch BuildRequires: fdupes # Adding glibc-devel-static seems to be required for linking if building # with -buildmode=pie @@ -70,22 +68,20 @@ Prometheus's main features are: %build %goprep github.com/prometheus/prometheus -GOPATH=%{_builddir}/go promu build +GOPATH=%{_builddir}/go promu build -v %install install -D -m0755 %{_builddir}/prometheus-%{version}/prometheus %{buildroot}/%{_bindir}/prometheus install -D -m0755 %{_builddir}/prometheus-%{version}/promtool %{buildroot}/%{_bindir}/promtool -install -m 0755 -d %{buildroot}%{_datarootdir}/prometheus -cp -fr console_libraries/ consoles/ %{buildroot}%{_datarootdir}/prometheus +install -D -m 0644 %{SOURCE1} %{buildroot}%{_unitdir}/prometheus.service -install -m 0755 -d %{buildroot}%{_unitdir} -install -m 0644 %{SOURCE1} %{buildroot}%{_unitdir}/prometheus.service +install -D -m 0644 %{SOURCE2} %{buildroot}%{_sysconfdir}/prometheus/prometheus.yml install -d -m 0755 %{buildroot}%{_sbindir} ln -s /usr/sbin/service %{buildroot}%{_sbindir}/rcprometheus -install -d -m 0755 %{buildroot}%{_sysconfdir}/prometheus -install -m 0644 %{SOURCE2} %{buildroot}%{_sysconfdir}/prometheus/prometheus.yml +install -m 0755 -d %{buildroot}%{_datarootdir}/prometheus +cp -fr console_libraries/ consoles/ %{buildroot}%{_datarootdir}/prometheus install -m 0755 -d %{buildroot}%{_fillupdir} install -m 0644 %{SOURCE3} %{buildroot}%{_fillupdir}/sysconfig.prometheus @@ -93,11 +89,11 @@ install -m 0644 %{SOURCE3} %{buildroot}%{_fillupdir}/sysconfig.prometheus install -m 0755 -d %{buildroot}%{_libdir}/firewalld/services/ install -m 0644 %{SOURCE4} %{buildroot}%{_libdir}/firewalld/services/prometheus.xml -install -d -m 0755 %{buildroot}%{_sharedstatedir}/prometheus -install -d -m 0755 %{buildroot}%{_sharedstatedir}/prometheus/data -install -d -m 0755 %{buildroot}%{_sharedstatedir}/prometheus/metrics - -%fdupes %{buildroot}/%{_datarootdir} +install -Dd -m 0750 %{buildroot}%{_localstatedir}/lib/prometheus +install -Dd -m 0750 %{buildroot}%{_localstatedir}/lib/prometheus/data +install -Dd -m 0750 %{buildroot}%{_localstatedir}/lib/prometheus/metrics +%gofilelist +%fdupes %{buildroot}/%{_prefix} %pre getent group %{prometheus_group} >/dev/null || %{_sbindir}/groupadd -r %{prometheus_group}