haproxy/haproxy.spec

204 lines
6.1 KiB
RPMSpec
Raw Normal View History

2020-02-14 10:50:02 +08:00
%define haproxy_user haproxy
%define haproxy_group haproxy
%global _hardened_build 1
Name: haproxy
2024-01-03 18:15:00 +08:00
Version: 2.9.5
Release: 3
2020-02-14 10:50:02 +08:00
Summary: The Reliable, High Performance TCP/HTTP Load Balancer
License: GPLv2+
URL: https://www.haproxy.org/
2024-01-03 18:15:00 +08:00
Source0: https://www.haproxy.org/download/2.9/src/%{name}-%{version}.tar.gz
2020-02-14 10:50:02 +08:00
Source1: %{name}.service
Source2: %{name}.cfg
Source3: %{name}.logrotate
Source4: %{name}.sysconfig
Patch1: backport-BUG-MINOR-server-source-interface-ignored-from-defau.patch
2023-09-22 11:17:59 +08:00
2022-03-23 16:06:17 +08:00
BuildRequires: gcc lua-devel pcre2-devel openssl-devel systemd-devel systemd libatomic
2020-02-14 10:50:02 +08:00
Requires(pre): shadow-utils
2022-03-23 16:06:17 +08:00
%{?systemd_requires}
2020-02-14 10:50:02 +08:00
%package_help
%description
HAProxy is a free, very fast and reliable solution offering high availability, load balancing,
and proxying for TCP and HTTP-based applications. It is particularly suited for very high traffic
web sites and powers quite a number of the world's most visited ones.
%prep
2021-08-27 14:38:04 +08:00
%autosetup -n %{name}-%{version} -p1
2020-02-14 10:50:02 +08:00
%build
2024-03-29 15:04:26 +08:00
%if "%toolchain" == "clang"
%global make_opts CC=clang
%endif
2020-02-14 10:50:02 +08:00
2024-03-29 15:04:26 +08:00
%make_build %{?make_opts} CPU="generic" TARGET="linux-glibc" USE_OPENSSL=1 USE_PCRE2=1 USE_SLZ=1 \
2022-10-22 06:30:31 +00:00
USE_LUA=1 USE_CRYPT_H=1 USE_SYSTEMD=1 USE_LINUX_TPROXY=1 USE_GETADDRINFO=1 USE_PROMEX=1 DEFINE=-DMAX_SESS_STKCTR=12 \
2022-03-23 16:06:17 +08:00
ADDINC="%{build_cflags}" ADDLIB="%{build_ldflags}"
2020-02-14 10:50:02 +08:00
2024-03-29 15:04:26 +08:00
%make_build %{?make_opts} admin/halog/halog ADDINC="%{build_cflags}" ADDLIB="%{build_ldflags}"
2020-02-14 10:50:02 +08:00
2022-03-23 16:06:17 +08:00
pushd admin/iprange
2024-03-29 15:04:26 +08:00
%make_build %{?make_opts} OPTIMIZE="%{build_cflags}" LDFLAGS="%{build_ldflags}"
2020-02-14 10:50:02 +08:00
popd
%install
install -d %{buildroot}%{_sbindir}
install haproxy %{buildroot}%{_sbindir}
install -d %{buildroot}%{_mandir}/man1
install -m 644 doc/haproxy.1 %{buildroot}%{_mandir}/man1
pushd %{buildroot}
install -p -D -m 0644 %{SOURCE1} .%{_unitdir}/%{name}.service
install -p -D -m 0644 %{SOURCE2} .%{_sysconfdir}/haproxy/%{name}.cfg
install -p -D -m 0644 %{SOURCE3} .%{_sysconfdir}/logrotate.d/%{name}
install -p -D -m 0644 %{SOURCE4} .%{_sysconfdir}/sysconfig/%{name}
install -d -m 0755 .%{_bindir}
install -d -m 0755 .%{_localstatedir}/lib/haproxy
2022-10-22 06:30:31 +00:00
install -d -m 0755 .%{_sysconfdir}/haproxy/conf.d
2020-02-14 10:50:02 +08:00
install -d -m 0755 .%{_datadir}/haproxy
popd
2022-03-23 16:06:17 +08:00
install -p -m 0755 ./admin/halog/halog %{buildroot}%{_bindir}/halog
install -p -m 0755 ./admin/iprange/iprange %{buildroot}%{_bindir}/iprange
install -p -m 0755 ./admin/iprange/ip6range %{buildroot}%{_bindir}/ip6range
2020-02-14 10:50:02 +08:00
install -p -m 0644 ./examples/errorfiles/* %{buildroot}%{_datadir}/haproxy
for httpfile in $(find ./examples/errorfiles/ -type f)
do
install -p -m 0644 $httpfile %{buildroot}%{_datadir}/haproxy
done
%{__rm} -rf ./examples/errorfiles/
find ./examples/* -type f ! -name "*.cfg" -exec %{__rm} -f "{}" \;
textfiles=$(find ./ -type f -name '*.txt')
for textfile in ${textfiles}
do
%{__mv} ${textfile} ${textfile}.old
iconv --from-code ISO8859-1 --to-code UTF-8 --output ${textfile} ${textfile}.old
%{__rm} -f ${textfile}.old
done
%pre
getent group %{haproxy_group} >/dev/null || groupadd -r %{haproxy_group}
getent passwd %{haproxy_user} >/dev/null || useradd -r -g %{haproxy_user} -d \
%{_localstatedir}/lib/haproxy -s /sbin/nologin -c "haproxy" %{haproxy_user}
exit 0
%post
%systemd_post %{name}.service
%preun
%systemd_preun %{name}.service
%postun
%systemd_postun_with_restart %{name}.service
%files
%defattr(-,root,root)
%license LICENSE
%dir %{_sysconfdir}/haproxy
%config(noreplace) %{_sysconfdir}/haproxy/%{name}.cfg
%config(noreplace) %{_sysconfdir}/logrotate.d/%{name}
%config(noreplace) %{_sysconfdir}/sysconfig/%{name}
%{_bindir}/halog
%{_bindir}/iprange
2022-03-23 16:06:17 +08:00
%{_bindir}/ip6range
2020-02-14 10:50:02 +08:00
%{_sbindir}/%{name}
%{_unitdir}/%{name}.service
2022-10-22 06:30:31 +00:00
%dir %{_sysconfdir}/haproxy/conf.d
2020-02-14 10:50:02 +08:00
%dir %{_localstatedir}/lib/haproxy
%dir %{_datadir}/haproxy
%{_datadir}/haproxy/*
%files help
%defattr(-,root,root)
2022-10-22 06:30:31 +00:00
%doc doc/* examples/* CHANGELOG README VERSION
2020-02-14 10:50:02 +08:00
%{_mandir}/man1/*
%changelog
* Mon Jun 24 2024 xinghe <xinghe2@h-partners.com> - 2.9.5-3
- Type:bugfix
- CVE:NA
- SUG:NA
- DESC:server: 'source' interface ignored from 'default-server' directive
2024-03-29 15:04:26 +08:00
* Thu Feb 22 2024 luofng <luofeng13@huawei.com> - 2.9.5-2
- Type:enhencement
- CVE:NA
- SUG:NA
- DESC:support for building with clang
2024-01-03 18:15:00 +08:00
* Mon Feb 19 2024 liweigang <izmirvii@gmail.com> - 2.9.5-1
- update to version 2.9.5
2023-10-11 17:37:34 +08:00
* Wed Oct 11 2023 yaoxin <yao_xin001@hoperun.com> - 2.6.15-1
- Upgrade to 2.6.15
2023-09-27 11:28:52 +08:00
* Wed Sep 27 2023 xinghe <xinghe2@h-partners.com> - 2.6.6-6
- Type:bugfix
- CVE:NA
- SUG:restart
- DESC:backport to fix potential coredump:
errors: handle malloc failure in usermsgs_put
ssl_sock: add check for ha_meth
thread: add a check for pthread_creat
2023-09-22 11:17:59 +08:00
* Fri Sep 22 2023 leeffo <liweiganga@uniontech.com> - 2.6.6-5
- backport update stream
2023-08-21 14:35:21 +08:00
* Mon Aug 21 2023 wangkai <wang_kai001@hoperun.com> - 2.6.6-4
- Fix CVE-2023-40225
2023-04-20 09:08:25 +08:00
* Thu Apr 20 2023 yaoxin <yao_xin001@hoperun.com> - 2.6.6-3
- Fix CVE-2023-25950
* Sat Feb 25 2023 yaoxin <yaoxin30@h-partners.com> - 2.6.6-2
- Fix CVE-2023-25725 and CVE-2023-0056
2022-10-22 06:30:31 +00:00
* Sat Oct 22 2022 xinghe <xinghe2@h-partners.com> - 2.6.6-1
- Type:enhancement
- ID:NA
- SUG:NA
- DESC:upgrade to 2.6.6
2022-03-23 16:06:17 +08:00
* Wed Mar 23 2022 xihaochen <xihaochen@h-partners.com> - 2.4.8-1
- update haproxy to 2.4.8
2022-03-11 11:17:20 +08:00
* Fri Mar 11 2022 yaoxin <yaoxin30@huawei.com> - 2.2.16-3
- Fix CVE-2022-0711
* Sat Sep 18 2021 yaoxin <yaoxin30@huawei.com> - 2.2.16-2
2021-09-18 11:52:54 +08:00
- Fix CVE-2021-40346
2022-03-11 11:17:20 +08:00
* Mon Aug 30 2021 yaoxin <yaoxin30@huawei.com> - 2.2.16-1
2021-08-30 20:59:40 +08:00
- Upgrade 2.2.16 to fix CVE-2021-39240
2023-09-22 11:17:59 +08:00
* Thu Aug 26 2021 liwu <liwu13@huawei.com> - 2.2.1-2
2021-08-27 14:38:04 +08:00
- fix CVE-2021-39241,CVE-2021-39242
2023-09-22 11:17:59 +08:00
* Thu Jul 1 2021 huanghaitao <huanghaitao8@huawei.com> - 2.2.1-1
2021-07-01 11:42:57 +08:00
- update to 2.2.1
* Tue Sep 15 2020 Ge Wang <wangge20@huawei.com> - 2.0.17-1
- update to 2.0.17 and modify source0 url
2020-08-05 15:56:16 +08:00
* Wed Aug 05 2020 lingsheng <lingsheng@huawei.com> - 2.0.14-2
- Add support for the Lua 5.4
2020-07-22 13:50:48 +08:00
* Wed Jul 22 2020 hanzhijun <hanzhijun1@huawei.com> - 2.0.14-1
- update to 2.0.14
2020-05-13 12:50:37 +08:00
* Thu May 7 2020 cuibaobao <cuibaobao1@huawei.com> - 1.8.14-5
- Type:cves
- ID: CVE-2020-11100
- SUG:restart
- DESC: fix CVE-2020-11100
2020-02-14 10:50:02 +08:00
* Wed Dec 4 2019 openEuler Buildteam <buildteam@openeuler.org> - 1.8.14-4
- Package init