# - trigger that prepares system from pre-cluster into cluster
# - trigger /etc/mysqld.conf into /etc/mysql/mysqld.conf. Solve possible
# conflict with /var/lib/mysql/mysqld.conf
+# - what's the libwrapper constistent bcond name? I see in specs 'libwrap', 'tcpd', 'tcp_wrappers'
#
# Conditional build:
%bcond_with bdb # Berkeley DB support
+%bcond_without innodb # Without InnoDB support
+%bcond_without isam # Without ISAM table format (used in mysql 3.22)
+%bcond_without raid # Without raid
+%bcond_without ssl # Without OpenSSL
+%bcond_without tcpd # Without libwrap (tcp_wrappers) support
#
%include /usr/lib/rpm/macros.perl
Summary: MySQL: a very fast and reliable SQL database engine
Name: mysql
Group: Applications/Databases
Version: 4.1.10
-Release: 0.1
+Release: 0.2
License: GPL + MySQL FLOSS Exception
Source0: http://mysql.mirror.anlx.net/Downloads/MySQL-4.1/%{name}-%{version}.tar.gz
# Source0-md5: 27b27b74f430aaeb77fb8d4e6f32ac4d
%{?with_bdb:BuildRequires: db3-devel}
BuildRequires: libstdc++-devel >= 5:3.0
BuildRequires: libtool
-BuildRequires: libwrap-devel
+%{?with_tcpd:BuildRequires: libwrap-devel}
BuildRequires: ncurses-devel >= 4.2
-BuildRequires: openssl-devel >= 0.9.7d
+%{?with_ssl:BuildRequires: openssl-devel >= 0.9.7d}
BuildRequires: perl-DBI
BuildRequires: perl-devel >= 1:5.6.1
BuildRequires: readline-devel >= 4.2
Summary(uk): MySQL - ÈÅÄÅÒÉ ÔÁ ¦Â̦ÏÔÅËÉ ÐÒÏÇÒÁͦÓÔÁ
Group: Development/Libraries
Requires: %{name}-libs = %{version}-%{release}
-Requires: openssl-devel
+%{?with_ssl:Requires: openssl-devel}
Requires: zlib-devel
Obsoletes: MySQL-devel
Obsoletes: libmysql10-devel
%prep
%setup -q
%patch0 -p1
-%patch1 -p1
+%{?with_tcpd:%patch1 -p1}
%patch2 -p1
%patch3 -p1
%ifarch alpha
%{__aclocal}
%{__automake}
%{__autoconf}
-CXXFLAGS="%{rpmcflags} -fno-rtti -fno-exceptions %{!?debug:-fomit-frame-pointer}"
+# The compiler flags are as per their "official" spec ;)
+CXXFLAGS="%{rpmcflags} -felide-constructors -fno-rtti -fno-exceptions %{!?debug:-fomit-frame-pointer}"
CFLAGS="%{rpmcflags} %{!?debug:-fomit-frame-pointer}"
%configure \
PS='/bin/ps' \
--enable-shared \
--enable-static \
--enable-thread-safe-client \
- %{?with_bdb:--with-berkeley-db} \
+ --with%{!?with_bdb:out}-berkeley-db \
+ --with%{!?with_innodb:out}-innodb \
+ --with%{!?with_isam:out}-isam \
+ --with%{!?with_raid:out}-raid \
+ --with%{!?with_ssl:out}-openssl \
+ --with%{!?with_tcpd:out}-libwrap \
--with-comment="PLD Linux Distribution MySQL RPM" \
--with%{!?debug:out}-debug \
--with-embedded-server \
--with-extra-charsets=all \
- --with-libwrap \
--with-low-memory \
--with-mysqld-user=mysql \
--with-named-curses-libs="-lncurses" \
- --with-openssl \
--with-pthread \
- --with-raid \
--with-unix-socket-path=/var/lib/mysql/mysql.sock \
--with-vio \
--with-ndbcluster \
install %{SOURCE2} $RPM_BUILD_ROOT/etc/sysconfig/mysql
install %{SOURCE3} $RPM_BUILD_ROOT/etc/logrotate.d/mysql
# This is template for configuration file which is created after 'service mysql init'
-install %{SOURCE4} $RPM_BUILD_ROOT%{_datadir}/mysql/mysqld.conf
+install %{SOURCE4} mysqld.conf
install %{SOURCE5} $RPM_BUILD_ROOT/etc/mysql/clusters.conf
install %{SOURCE6} $RPM_BUILD_ROOT/etc/monit
touch $RPM_BUILD_ROOT/var/log/mysql/{err,log,update,isamlog.log}
+# remove innodb directives from mysqld.conf if mysqld is configured without
+%if %{without innodb}
+ cp mysqld.conf mysqld.tmp
+ awk 'BEGIN { RS="\n\n" } !/innodb/ { printf("%s\n\n", $0) }' < mysqld.tmp > mysqld.conf
+%endif
+
+# remove berkeley-db directives from mysqld.conf if mysqld is configured without
+%if %{without bdb}
+ cp mysqld.conf mysqld.tmp
+ awk 'BEGIN { RS="\n\n" } !/bdb/ { printf("%s\n\n", $0) }' < mysqld.tmp > mysqld.conf
+%endif
+
+install mysqld.conf $RPM_BUILD_ROOT%{_datadir}/mysql/mysqld.conf
+
# NDB
install %{SOURCE7} $RPM_BUILD_ROOT/etc/rc.d/init.d/mysql-ndb
install %{SOURCE8} $RPM_BUILD_ROOT/etc/sysconfig/mysql-ndb