Sophie

Sophie

distrib > Fedora > 14 > x86_64 > by-pkgid > bef512c11fb2fa6e6405f3519ef6f35a > files > 3

mysql-proxy-0.8.0-1.fc13.src.rpm

Name:           mysql-proxy
Version:        0.8.0
Release:        1%{?dist}
Summary:        A proxy for the MySQL Client/Server protocol

Group:          Applications/Databases
License:        GPLv2
URL:            http://forge.mysql.com/wiki/MySQL_Proxy

# I haven't found a link to a direct download location, only to mirrors
Source0:        http://mysql.he.net/Downloads/MySQL-Proxy/%{name}-%{version}.tar.gz
Source1:        %{name}.init
Source2:        %{name}.sysconfig
BuildRoot:      %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)

BuildRequires:  lua-devel
BuildRequires:  libevent-devel
BuildRequires:  mysql-devel
BuildRequires:  glib2-devel
BuildRequires:  gawk
BuildRequires:  check-devel
BuildRequires:  flex

Requires(pre):  shadow-utils
Requires(post): chkconfig
Requires(preun): chkconfig
Requires(preun): initscripts
Requires(postun): initscripts

%description
MySQL Proxy is a simple program that sits between your client and MySQL
server(s) that can monitor, analyze or transform their communication.
Its flexibility allows for unlimited uses, common ones include: load balancing,
fail-over, query analysis, query filtering and modification and many more.

%package devel
Summary:    Development files for %{name}
Requires:   %{name} = %{version}-%{release}
Requires:   pkgconfig


%description devel
Development files for %{name}


%prep
%setup -q -n %{name}-%{version}
sed -i 's/g_build_filename(base_dir, "lib"/g_build_filename(base_dir, "%{_lib}"/g' src/chassis.c
sed -i 's/g_build_filename(srv->base_dir, "lib"/g_build_filename(srv->base_dir, "%{_lib}"/g' src/chassis.c


%build
%configure
# strip rpath
sed -i 's|^hardcode_libdir_flag_spec=.*|hardcode_libdir_flag_spec=""|g' libtool
sed -i 's|^runpath_var=LD_RUN_PATH|runpath_var=DIE_RPATH_DIE|g' libtool

make %{?_smp_mflags}


%install
rm -rf %{buildroot}
make install DESTDIR=%{buildroot}
find %{buildroot} -type f -name \*.la -exec rm -v {} \;
rm -v examples/Makefile* examples/CMakeLists.txt
install -Dp -m 0755 %{SOURCE1} %{buildroot}%{_initrddir}/%{name}
install -Dp -m 0644 %{SOURCE2} %{buildroot}%{_sysconfdir}/sysconfig/%{name}


%clean
rm -rf %{buildroot}


%pre
getent group %{name} &>/dev/null || groupadd -r %{name} &>/dev/null
getent passwd %{name} &>/dev/null || \
useradd -r -g %{name} -d / -s /sbin/nologin \
    -c "MySQL-Proxy user" %{name} &>/dev/null || :


%post
ldconfig
/sbin/chkconfig --add %{name} || :


%preun
if [ "$1" = 0 ] ; then
    /sbin/service %{name} stop > /dev/null 2>&1
    /sbin/chkconfig --del %{name} || :
fi


%postun
ldconfig
if [ "$1" -ge 1 ]; then
    /sbin/service %{name} condrestart >/dev/null 2>&1 || :
fi


%files
%defattr(-,root,root,-)
%doc AUTHORS COPYING README NEWS
%doc examples/
%{_bindir}/%{name}
%{_initrddir}/%{name}
%config(noreplace) %{_sysconfdir}/sysconfig/%{name}
%{_bindir}/mysql-binlog-dump
%{_bindir}/mysql-myisam-dump
%{_libdir}/libmysql-*.so.*
%{_libdir}/%{name}


%files devel
%defattr(-,root,root,-)
%{_includedir}/*.h
%{_libdir}/libmysql-*.so
%{_libdir}/pkgconfig/mysql-chassis.pc
%{_libdir}/pkgconfig/mysql-proxy.pc


%changelog
* Sun Jan 31 2010 Ruben Kerkhof <ruben@rubenkerkhof.com> 0.8.0-1
- Upstream released new version 

* Wed Aug 12 2009 Ruben Kerkhof <ruben@rubenkerkhof.com> 0.7.2-1
- Upstream released new version

* Sat Jul 25 2009 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.6.1-4
- Rebuilt for https://fedoraproject.org/wiki/Fedora_12_Mass_Rebuild

* Wed Feb 25 2009 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.6.1-3
- Rebuilt for https://fedoraproject.org/wiki/Fedora_11_Mass_Rebuild

* Mon Jun 30 2008 Ruben Kerkhof <ruben@rubenkerkhof.com> - 0.6.1-2
- Rebuild to pick up new libevent

* Sat Feb 09 2008 Ruben Kerkhof <ruben@rubenkerkhof.com> - 0.6.1-1
- Sync with upstream

* Thu Jan 24 2008 Ruben Kerkhof <ruben@rubenkerkhof.com> - 0.6.0-2
- Rebuild to pick up new libevent

* Sat Dec 08 2007 Ruben Kerkhof <ruben@rubenkerkhof.com> - 0.6.0-1
- Upstream released new version
- Fix license tag
- Add BR for check-devel and flex

* Wed Aug 29 2007 Fedora Release Engineering <rel-eng at fedoraproject dot org> - 0.5.1-3
- BR gawk.

* Wed Aug 29 2007 Fedora Release Engineering <rel-eng at fedoraproject dot org> - 0.5.1-2
- Rebuild for selinux ppc32 issue.

* Tue Jul 10 2007 Ruben Kerkhof <ruben@rubenkerkhof.com> 0.5.1-1
- Upstream released new version
- Included examples
* Sun Jul 01 2007 Ruben Kerkhof <ruben@rubenkerkhof.com> 0.5.0-1
- First version