358feff
Summary:       A high-performance MySQL proxy
358feff
Name:          proxysql
6fa3a34
Version:       2.0.9
e9103b4
Release:       6%{?dist}
358feff
URL:           http://www.proxysql.com/
358feff
# The entire source code is GPLv3+ except deps/re2 and deps/jemalloc which is BSD
358feff
# and deps/mariadb-connector-c which is LGPLv2+
358feff
License:       GPLv3+ and LGPLv2+ and BSD
358feff
a633007
BuildRequires: openssl-devel, libev-devel, perl
a633007
BuildRequires: cmake, gcc-c++, libcurl-devel, pcre-devel
358feff
BuildRequires: systemd
a633007
BuildRequires: libconfig-devel, lz4-devel
358feff
BuildRequires: libdaemon-devel
358feff
BuildRequires: sqlite-devel
23dd3be
BuildRequires: zlib-devel
358feff
441e163
Suggests: mariadb, community-mysql
441e163
358feff
# Build in other architectures aside from x86 is not yet supported due to some
358feff
# use of assembly code, but is on the upstream roadmap to support them.
358feff
# https://github.com/sysown/proxysql/issues/977
358feff
ExcludeArch:   %{arm} %{power64} s390x aarch64
358feff
a633007
Provides:      bundled(jemalloc) = 5.2.0
a633007
Provides:      bundled(mariadb-connector-c) = 3.0.2
a633007
Provides:      bundled(re2) = 20180701
358feff
a633007
# Added bundled libraries from v2.0.7
a633007
Provides:      bundled(clickhouse-cpp)
a633007
Provides:      bundled(cityhash) = 1.1.1
a633007
Provides:      bundled(google-coredumper) = 1.2.1
a633007
Provides:      bundled(libmicrohttpd) = 0.9.55
a633007
a633007
# There is inconsistency between name and URL of file
a633007
Source0:       https://github.com/sysown/proxysql/archive/%{name}-%{version}.tar.gz
358feff
Source1:       proxysql.service
358feff
Source2:       proxysql.1
358feff
a633007
# The upstream code bundles 15 libraries: libconfig, libdaemon, sqlite3, re2,
a633007
# mariadb-connector-c, pcre, clickhouse-cpp, lz4, cityhash, microhttpd, curl
a633007
# ev, coredumper, libssl and jemalloc.
a633007
# This patch de-bundles 8 of these libraries: libconfig, libdaemon and sqlite3,
a633007
# libsl, pcre, curl, lz4, ev
358feff
# The remaining libraries are not de-bundled due to different reasons (mainly
358feff
# being patched, more info here: https://bugzilla.redhat.com/show_bug.cgi?id=1457929).
a633007
# Other remaining libraries are not maintained in Fedora (clickhouse-cpp,
a633007
# cityhash, google-coredumper)
358feff
a633007
# Patch provides debundling bundled libraries
a633007
Patch0: proxysql_debundle.patch
358feff
%description
358feff
ProxySQL is a high performance, high availability, protocol aware proxy for
358feff
MySQL and forks (like Percona Server and MariaDB).
358feff
358feff
%prep
358feff
%setup -q
358feff
%patch0 -p1
358feff
rm -rf deps/libconfig deps/libdaemon deps/sqlite3
358feff
a633007
# Remove sources of debundled libraries from v2.0.7
a633007
rm -rf deps/libssl deps/pcre deps/curl deps/lz4 deps/libev
a633007
358feff
%build
358feff
%global _configure :
a633007
%configure help
358feff
export CPPFLAGS=$CXXFLAGS
358feff
make %{?_smp_mflags}
358feff
358feff
%install
9a31274
install -p -D -m 0755 src/proxysql %{buildroot}%{_bindir}/proxysql
9a31274
install -p -D -m 0640 etc/proxysql.cnf %{buildroot}%{_sysconfdir}/proxysql.cnf
9a31274
install -p -D -m 0755 tools/proxysql_galera_checker.sh %{buildroot}%{_datadir}/%{name}/tools/proxysql_galera_checker.sh
9a31274
install -p -D -m 0755 tools/proxysql_galera_writer.pl %{buildroot}%{_datadir}/%{name}/tools/proxysql_galera_writer.pl
594eabc
install -p -D -m 0644 %{SOURCE1} %{buildroot}%{_unitdir}/%{name}.service
9a31274
install -p -D -m 0644 README.md %{buildroot}%{_docdir}/proxysql/README.md
9a31274
install -p -D -m 0644 RUNNING.md %{buildroot}%{_docdir}/proxysql/RUNNING.md
9a31274
install -p -D -m 0644 FAQ.md %{buildroot}%{_docdir}/proxysql/FAQ.md
a633007
install -p -D -m 0644 doc/release_notes/*.md -t %{buildroot}%{_docdir}/proxysql
a633007
install -p -D -m 0644 doc/internal/*.txt -t %{buildroot}%{_docdir}/proxysql
a633007
install -p -D -m 0644 %{SOURCE2} %{buildroot}/%{_mandir}/man1/%{name}.1
9a31274
install -d -m 0755 %{buildroot}%{_sharedstatedir}/proxysql
358feff
358feff
%pre
358feff
/usr/sbin/groupadd -r proxysql >/dev/null 2>&1 || :
358feff
/usr/sbin/useradd  -g proxysql -r -d /var/lib/proxysql -s /sbin/nologin \
358feff
    -c "ProxySQL" proxysql >/dev/null 2>&1 || :
358feff
358feff
%post
358feff
%systemd_post proxysql.service
358feff
358feff
%preun
358feff
%systemd_preun proxysql.service
358feff
358feff
%postun
358feff
%systemd_postun_with_restart proxysql.service
358feff
358feff
%files
358feff
%{_bindir}/*
358feff
%{_unitdir}/*
358feff
%{_datadir}/%{name}
358feff
%{_docdir}/%{name}
358feff
%{_mandir}/man1/*
358feff
%license LICENSE
358feff
%defattr(-,proxysql,proxysql,-)
358feff
%{_sharedstatedir}/%{name}
358feff
%defattr(-,proxysql,root,-)
358feff
%config(noreplace) %{_sysconfdir}/%{name}.cnf
358feff
358feff
%changelog
e9103b4
* Sat Aug 01 2020 Fedora Release Engineering <releng@fedoraproject.org> - 2.0.9-6
e9103b4
- Second attempt - Rebuilt for
e9103b4
  https://fedoraproject.org/wiki/Fedora_33_Mass_Rebuild
e9103b4
d1248af
* Tue Jul 28 2020 Fedora Release Engineering <releng@fedoraproject.org> - 2.0.9-5
d1248af
- Rebuilt for https://fedoraproject.org/wiki/Fedora_33_Mass_Rebuild
d1248af
441e163
* Mon Mar 02 2020 Lukas Javorsky <ljavorsk@redhat.com> - 2.0.9-4
441e163
- Add mariadb and mysql client to suggests
441e163
a9f6631
* Thu Jan 30 2020 Fedora Release Engineering <releng@fedoraproject.org> - 2.0.9-3
a9f6631
- Rebuilt for https://fedoraproject.org/wiki/Fedora_32_Mass_Rebuild
a9f6631
594eabc
* Thu Jan 16 2020 Filip Januš <fjanus@redhat.com> - 2.0.9-2
594eabc
- .service file path fix
594eabc
6fa3a34
* Tue Nov 19 2019 Filip Januš <fjanus@redhat.com> - 2.0.9-1
6fa3a34
- Upstream released ProxySQL 2.0.9
6fa3a34
- Patch0 was modified - lib/Makefile was modified
6fa3a34
62a5430
* Tue Oct 15 2019 Filip Januš <fjanus@redhat.com> - 2.0.8-1
62a5430
- Upstream released ProxySQL 2.0.8
62a5430
62a5430
* Mon Sep 23 2019 Filip Januš <fjanus@redhat.com> - 2.0.7-1
a633007
- Updated to ProxySQL 2.0.7
a633007
- De-bundled new libraries (Update patch)
a633007
- Fix path to doc
a633007
- Fix man page path (bug #1722350)
a633007
23dd3be
* Thu Sep 12 2019 Petr Pisar <ppisar@redhat.com> - 1.3.7-11
23dd3be
- Build-require zlib-devel (bug #1727136)
23dd3be
f7320c7
* Fri Jul 26 2019 Fedora Release Engineering <releng@fedoraproject.org> - 1.3.7-10
f7320c7
- Rebuilt for https://fedoraproject.org/wiki/Fedora_31_Mass_Rebuild
f7320c7
98dc380
* Sat Feb 02 2019 Fedora Release Engineering <releng@fedoraproject.org> - 1.3.7-9
98dc380
- Rebuilt for https://fedoraproject.org/wiki/Fedora_30_Mass_Rebuild
98dc380
7f072c4
* Tue Jul 24 2018 Adam Williamson <awilliam@redhat.com> - 1.3.7-8
7f072c4
- Rebuild for new libconfig
7f072c4
9c2e127
* Fri Jul 13 2018 Fedora Release Engineering <releng@fedoraproject.org> - 1.3.7-7
9c2e127
- Rebuilt for https://fedoraproject.org/wiki/Fedora_29_Mass_Rebuild
9c2e127
789c653
* Fri Feb 09 2018 Fedora Release Engineering <releng@fedoraproject.org> - 1.3.7-6
789c653
- Rebuilt for https://fedoraproject.org/wiki/Fedora_28_Mass_Rebuild
789c653
9a31274
* Tue Sep 26 2017 Augusto Caringi <acaringi@redhat.com> 1.3.7-5
9a31274
- Made install commands in install section compatible with epel7
9a31274
0fb6b50
* Thu Aug 03 2017 Fedora Release Engineering <releng@fedoraproject.org> - 1.3.7-4
0fb6b50
- Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Binutils_Mass_Rebuild
0fb6b50
b480f54
* Thu Jul 27 2017 Fedora Release Engineering <releng@fedoraproject.org> - 1.3.7-3
b480f54
- Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Mass_Rebuild
b480f54
358feff
* Thu Jun 15 2017  Augusto Caringi <acaringi@redhat.com> 1.3.7-2
358feff
- Fixed build flags through exporting CPPFLAGS variable
358feff
- Remove unused bundled libraries
358feff
- Fixed configuration file ownership
358feff
- Replaced default login shell of proxysql user from /bin/false to /sbin/nologin
358feff
358feff
* Wed Jun 14 2017  Augusto Caringi <acaringi@redhat.com> 1.3.7-1
358feff
- Updated to ProxySQL 1.3.7
358feff
- De-bundled some libraries
358feff
- Added man page
358feff
- Updated license field
358feff
- Adopted proxysql user/group
358feff
- Improvements in spec file
358feff
358feff
* Tue May 16 2017  Augusto Caringi <acaringi@redhat.com> 1.3.6-1
358feff
- Initial build