Dominique Leuenberger 2019-08-23 09:03:01 +00:00 committed by Git OBS Bridge
commit 31237338a0
3 changed files with 18 additions and 27 deletions

View File

@ -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}}

View File

@ -1,3 +1,11 @@
-------------------------------------------------------------------
Fri Aug 16 06:46:24 UTC 2019 - Jan Fajerski <jan.fajerski@suse.com>
- 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 <jan.fajerski@suse.com>

View File

@ -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}