2013-10-15 10:42:00 +02:00
|
|
|
#
|
|
|
|
# spec file for package haproxy
|
|
|
|
#
|
2014-05-06 17:38:15 +02:00
|
|
|
# Copyright (c) 2014 SUSE LINUX Products GmbH, Nuernberg, Germany.
|
2013-10-15 10:42:00 +02:00
|
|
|
#
|
|
|
|
# All modifications and additions to the file contributed by third parties
|
|
|
|
# remain the property of their copyright owners, unless otherwise agreed
|
|
|
|
# upon. The license for this file, and modifications and additions to the
|
|
|
|
# file, is the same license as for the pristine package itself (unless the
|
|
|
|
# license for the pristine package is not an Open Source License, in which
|
|
|
|
# case the license is the MIT License). An "Open Source License" is a
|
|
|
|
# license that conforms to the Open Source Definition (Version 1.9)
|
|
|
|
# published by the Open Source Initiative.
|
|
|
|
|
|
|
|
# Please submit bugfixes or comments via http://bugs.opensuse.org/
|
2013-12-18 16:53:39 +01:00
|
|
|
#
|
|
|
|
|
2013-10-15 10:42:00 +02:00
|
|
|
|
|
|
|
Name: haproxy
|
2014-05-06 17:38:15 +02:00
|
|
|
Version: 1.4.25
|
2013-10-15 10:42:00 +02:00
|
|
|
Release: 0
|
|
|
|
#
|
|
|
|
#
|
2013-12-18 16:53:39 +01:00
|
|
|
%if 0%{?suse_version} >= 1230
|
|
|
|
BuildRequires: pkgconfig(systemd)
|
|
|
|
%endif
|
|
|
|
BuildRoot: %{_tmppath}/%{name}-%{version}-build
|
2013-10-29 09:25:21 +01:00
|
|
|
BuildRequires: libgcrypt-devel
|
2013-12-18 16:53:39 +01:00
|
|
|
BuildRequires: pcre-devel
|
2013-10-15 10:42:00 +02:00
|
|
|
BuildRequires: udev
|
|
|
|
%define pkg_name haproxy
|
|
|
|
%define pkg_home /var/lib/%{pkg_name}
|
|
|
|
#
|
|
|
|
Url: http://haproxy.1wt.eu/
|
|
|
|
Source: http://haproxy.1wt.eu/download/1.4/src/haproxy-%{version}.tar.gz
|
2013-12-18 16:53:39 +01:00
|
|
|
Source1: %{pkg_name}.init
|
2013-10-15 10:42:00 +02:00
|
|
|
Source2: http://haproxy.1wt.eu/download/contrib/haproxy.vim
|
2014-05-06 17:38:15 +02:00
|
|
|
# PATCH-FEATURE-UPSTREAM
|
2013-12-18 16:53:39 +01:00
|
|
|
Patch1: 0001-MEDIUM-add-systemd-service.patch
|
2014-05-06 17:38:15 +02:00
|
|
|
# PATCH-FEATURE-UPSTREAM
|
2013-12-18 16:53:39 +01:00
|
|
|
Patch2: 0002-MEDIUM-add-haproxy-systemd-wrapper.patch
|
2014-05-06 17:38:15 +02:00
|
|
|
# PATCH-FIX-UPSTREAM
|
2013-12-18 16:53:39 +01:00
|
|
|
Patch3: 0003-MEDIUM-New-cli-option-Ds-for-systemd-compatibility.patch
|
2014-05-06 17:38:15 +02:00
|
|
|
# PATCH-FIX-UPSTREAM
|
2013-12-18 16:53:39 +01:00
|
|
|
Patch4: 0004-BUG-MEDIUM-systemd-wrapper-don-t-leak-zombie-process.patch
|
2014-05-06 17:38:15 +02:00
|
|
|
# PATCH-FIX-UPSTREAM
|
2013-12-18 16:53:39 +01:00
|
|
|
Patch5: 0005-BUILD-stdbool-is-not-portable-again.patch
|
2014-05-06 17:38:15 +02:00
|
|
|
# PATCH-FIX-UPSTREAM
|
|
|
|
Patch6: 0006-MEDIUM-haproxy-systemd-wrapper-Use-haproxy-in-same-d.patch
|
|
|
|
# PATCH-FIX-UPSTREAM
|
|
|
|
Patch7: 0007-MEDIUM-systemd-wrapper-Kill-child-processes-when-int.patch
|
|
|
|
# PATCH-FIX-UPSTREAM
|
|
|
|
Patch8: 0008-LOW-systemd-wrapper-Write-debug-information-to-stdou.patch
|
|
|
|
# PATCH-FIX-OPENSUSE
|
|
|
|
Patch9: 0009-openSUSE-Configure-haproxy-user.patch
|
|
|
|
# PATCH-FIX-OPENSUSE
|
|
|
|
Patch10: 0010-openSUSE-Fix-path-to-PCRE-library.patch
|
|
|
|
# PATCH-FIX-UPSTREAM
|
|
|
|
Patch11: 0011-BUILD-MINOR-systemd-fix-compiler-warning-about-unuse.patch
|
|
|
|
# PATCH-FIX-UPSTREAM
|
|
|
|
Patch12: 0012-BUG-MEDIUM-systemd-wrapper-fix-locating-of-haproxy-b.patch
|
|
|
|
# PATCH-FIX-UPSTREAM
|
|
|
|
Patch13: 0013-MINOR-systemd-wrapper-re-execute-on-SIGUSR2.patch
|
|
|
|
# PATCH-FIX-UPSTREAM
|
|
|
|
Patch14: 0014-MINOR-systemd-wrapper-improve-logging.patch
|
|
|
|
# PATCH-FIX-UPSTREAM
|
|
|
|
Patch15: 0015-MINOR-systemd-wrapper-propagate-exit-status.patch
|
|
|
|
|
2013-10-15 10:42:00 +02:00
|
|
|
Source99: haproxy-rpmlintrc
|
|
|
|
#
|
|
|
|
Summary: The Reliable, High Performance TCP/HTTP Load Balancer
|
2013-12-18 16:53:39 +01:00
|
|
|
License: GPL-2.0+ and LGPL-2.1+
|
|
|
|
Group: Productivity/Networking/Web/Proxy
|
2013-10-15 10:42:00 +02:00
|
|
|
Provides: %{name}-doc = %{version}
|
|
|
|
Obsoletes: %{name}-doc < %{version}
|
2013-12-18 16:53:39 +01:00
|
|
|
|
|
|
|
%if 0%{?suse_version} >= 1230
|
2013-10-29 09:25:21 +01:00
|
|
|
%{?systemd_requires}
|
2013-12-18 16:53:39 +01:00
|
|
|
%endif
|
2013-10-15 10:42:00 +02:00
|
|
|
|
|
|
|
%description
|
|
|
|
HAProxy implements an event-driven, mono-process model which enables support
|
|
|
|
for very high number of simultaneous connections at very high speeds.
|
|
|
|
Multi-process or multi-threaded models can rarely cope with thousands of
|
|
|
|
connections because of memory limits, system scheduler limits, and lock
|
|
|
|
contention everywhere. Event-driven models do not have these problems because
|
|
|
|
implementing all the tasks in user-space allows a finer resource and time
|
|
|
|
management. The down side is that those programs generally don't scale well on
|
|
|
|
multi-processor systems. That's the reason why they must be optimized to get
|
|
|
|
the most work done from every CPU cycle.
|
|
|
|
|
|
|
|
%prep
|
|
|
|
%setup -q
|
2013-12-18 16:53:39 +01:00
|
|
|
%patch1 -p1
|
|
|
|
%patch2 -p1
|
|
|
|
%patch3 -p1
|
|
|
|
%patch4 -p1
|
|
|
|
%patch5 -p1
|
2014-05-06 17:38:15 +02:00
|
|
|
%patch6 -p1
|
|
|
|
%patch7 -p1
|
2013-12-18 16:53:39 +01:00
|
|
|
%patch8 -p1
|
2014-05-06 17:38:15 +02:00
|
|
|
%patch9 -p1
|
|
|
|
%patch10 -p1
|
|
|
|
%patch11 -p1
|
|
|
|
%patch12 -p1
|
|
|
|
%patch13 -p1
|
|
|
|
%patch14 -p1
|
|
|
|
%patch15 -p1
|
2013-10-15 10:42:00 +02:00
|
|
|
|
|
|
|
%build
|
|
|
|
%{__make} \
|
|
|
|
TARGET=linux26 \
|
|
|
|
CPU="%{_target_cpu}" \
|
|
|
|
USE_PCRE=1 \
|
|
|
|
USE_LIBCRYPT=1 \
|
|
|
|
LIB="%{_lib}" \
|
|
|
|
DEBUG="%{optflags} -fno-strict-aliasing"
|
|
|
|
|
2013-12-18 16:53:39 +01:00
|
|
|
%{__make} PREFIX="%{_prefix}" -C contrib/systemd
|
|
|
|
|
2013-10-15 10:42:00 +02:00
|
|
|
%install
|
|
|
|
%{__install} -D -m 0755 %{pkg_name} %{buildroot}%{_sbindir}/%{pkg_name}
|
|
|
|
%{__install} -D -m 0644 examples/%{pkg_name}.cfg %{buildroot}%{_sysconfdir}/%{pkg_name}/%{pkg_name}.cfg
|
2013-12-18 16:53:39 +01:00
|
|
|
|
|
|
|
%if 0%{?suse_version} >= 1230
|
|
|
|
%{__install} -D -m 0755 haproxy-systemd-wrapper %{buildroot}%{_sbindir}/haproxy-systemd-wrapper
|
|
|
|
%{__install} -D -m 0755 contrib/systemd/%{pkg_name}.service %{buildroot}%{_unitdir}/%{pkg_name}.service
|
2013-10-29 09:25:21 +01:00
|
|
|
ln -sf /sbin/service %{buildroot}%{_sbindir}/rc%{pkg_name}
|
2013-12-18 16:53:39 +01:00
|
|
|
%else
|
|
|
|
%{__install} -D -m 0755 %{S:1} %{buildroot}%{_sysconfdir}/init.d/%{pkg_name}
|
|
|
|
%{__ln_s} -f %{_sysconfdir}/init.d/%{pkg_name} %{buildroot}%{_sbindir}/rc%{pkg_name}
|
|
|
|
%endif
|
|
|
|
|
2013-10-15 10:42:00 +02:00
|
|
|
%{__install} -d -m 0755 %{buildroot}%{pkg_home}
|
|
|
|
%{__install} -D -m 0644 %{S:2} %{buildroot}%{_datadir}/%{pkg_name}/%{pkg_name}.vim
|
|
|
|
%{__install} -D -m 0644 doc/%{pkg_name}.1 %{buildroot}%{_mandir}/man1/%{pkg_name}.1
|
|
|
|
gzip %{buildroot}%{_mandir}/man1/%{pkg_name}.1
|
|
|
|
|
2013-12-18 16:53:39 +01:00
|
|
|
%if 0%{?suse_version} < 1230
|
|
|
|
%clean
|
|
|
|
%{?buildroot:%{__rm} -rf %{buildroot}}
|
|
|
|
%endif
|
|
|
|
|
2013-10-15 10:42:00 +02:00
|
|
|
%pre
|
|
|
|
/usr/sbin/groupadd -r %{pkg_name} &>/dev/null ||:
|
|
|
|
/usr/sbin/useradd -g %{pkg_name} -s /bin/false -r -c "user for %{pkg_name}" -d %{pkg_home} %{pkg_name} &>/dev/null ||:
|
2014-05-23 07:27:51 +02:00
|
|
|
%if 0%{?suse_version} >= 1230
|
|
|
|
%service_add_pre %{pkg_name}.service
|
|
|
|
%endif
|
2013-10-15 10:42:00 +02:00
|
|
|
|
2013-12-18 16:53:39 +01:00
|
|
|
%if 0%{?suse_version} >= 1230
|
|
|
|
|
2013-10-15 10:42:00 +02:00
|
|
|
%post
|
2013-10-29 09:25:21 +01:00
|
|
|
%service_add_post %{pkg_name}.service
|
2013-10-15 10:42:00 +02:00
|
|
|
|
|
|
|
%preun
|
2013-10-29 09:25:21 +01:00
|
|
|
%service_del_preun %{pkg_name}.service
|
2013-10-15 10:42:00 +02:00
|
|
|
|
|
|
|
%postun
|
2013-10-29 09:25:21 +01:00
|
|
|
%service_del_postun %{pkg_name}.service
|
2013-10-15 10:42:00 +02:00
|
|
|
|
2013-12-18 16:53:39 +01:00
|
|
|
%else
|
|
|
|
|
|
|
|
%post
|
|
|
|
%fillup_and_insserv %{pkg_name}
|
|
|
|
|
|
|
|
%preun
|
|
|
|
%stop_on_removal %{pkg_name}
|
|
|
|
|
|
|
|
%postun
|
|
|
|
%restart_on_update %{pkg_name}
|
|
|
|
%{insserv_cleanup}
|
|
|
|
|
|
|
|
%endif
|
|
|
|
|
2013-10-15 10:42:00 +02:00
|
|
|
%files
|
|
|
|
%defattr(-,root,root,-)
|
|
|
|
%doc CHANGELOG README LICENSE
|
|
|
|
%doc ROADMAP TODO doc/* examples
|
|
|
|
%dir %{_sysconfdir}/%{pkg_name}
|
|
|
|
%config(noreplace) %{_sysconfdir}/%{pkg_name}/%{pkg_name}.cfg
|
2013-12-18 16:53:39 +01:00
|
|
|
|
|
|
|
%if 0%{?suse_version} >= 1230
|
|
|
|
|
2013-10-29 09:25:21 +01:00
|
|
|
%{_unitdir}/%{pkg_name}.service
|
2013-12-18 16:53:39 +01:00
|
|
|
%{_sbindir}/haproxy-systemd-wrapper
|
|
|
|
|
|
|
|
%else
|
|
|
|
|
|
|
|
%config(noreplace) %{_sysconfdir}/init.d/%{pkg_name}
|
|
|
|
|
|
|
|
%endif
|
|
|
|
|
2013-10-15 10:42:00 +02:00
|
|
|
%{_sbindir}/haproxy
|
|
|
|
%{_sbindir}/rchaproxy
|
|
|
|
%{pkg_home}
|
|
|
|
%doc %{_mandir}/man1/%{pkg_name}.1.gz
|
|
|
|
%{_datadir}/%{pkg_name}
|
|
|
|
|
|
|
|
%changelog
|