2013-10-15 10:42:00 +02:00
|
|
|
#
|
|
|
|
# spec file for package haproxy
|
|
|
|
#
|
2013-10-29 09:25:21 +01:00
|
|
|
# Copyright (c) 2013 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
|
|
|
|
Version: 1.4.24
|
|
|
|
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
|
2013-12-18 16:53:39 +01:00
|
|
|
Patch1: 0001-MEDIUM-add-systemd-service.patch
|
|
|
|
Patch2: 0002-MEDIUM-add-haproxy-systemd-wrapper.patch
|
|
|
|
Patch3: 0003-MEDIUM-New-cli-option-Ds-for-systemd-compatibility.patch
|
|
|
|
Patch4: 0004-BUG-MEDIUM-systemd-wrapper-don-t-leak-zombie-process.patch
|
|
|
|
Patch5: 0005-BUILD-stdbool-is-not-portable-again.patch
|
|
|
|
Patch6: 0006-haproxy-1.2.16_config_haproxy_user.patch
|
|
|
|
Patch7: 0007-haproxy-makefile_lib.patch
|
|
|
|
Patch8: 0008-MEDIUM-haproxy-systemd-wrapper-Revised-implementatio.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
|
|
|
|
%patch6 -p0
|
|
|
|
%patch7 -p0
|
|
|
|
%patch8 -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 ||:
|
|
|
|
|
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
|