commit 9463cff2ffa85d919ae37325bce8813707c8b266
Author: Elan Ruusamäe <[email protected]>
Date:   Mon Oct 29 01:04:05 2012 +0200

    up to 2.0.3, build innodb 5.5 target

 xtrabackup.spec | 108 ++++++++++++++++++++++++++++++++++++++++----------------
 1 file changed, 77 insertions(+), 31 deletions(-)
---
diff --git a/xtrabackup.spec b/xtrabackup.spec
index 38541c8..7609157 100644
--- a/xtrabackup.spec
+++ b/xtrabackup.spec
@@ -1,52 +1,96 @@
 # TODO
-# - which configure args should be set? same as mysql.spec?
-Summary:       Open source backup tool for InnoDB and XtraDB
+# - system zlib (seems unmodified)
+# - BR deps (for libarchive, mysql builds)
+Summary:       XtraBackup online backup for MySQL / InnoDB
 Name:          xtrabackup
-Version:       0.7
-Release:       0.2
+Version:       2.0.3
+Release:       0.1
 License:       GPL v2
 Group:         Applications/Databases
-URL:           http://www.percona.com/docs/wiki/percona-xtrabackup:start
-Source0:       
http://ftp.gwdg.de/pub/misc/mysql/Downloads/MySQL-5.0/mysql-5.0.83.tar.gz
-# Source0-md5: 051392064a1e32cca5c23a593908b10e
-Source1:       xtrabackup.tar.bz2
-# Source1-md5: 79ad151ec9055d30ee30d66993751f98
+URL:           http://www.percona.com/doc/percona-xtrabackup/
+Source0:       
http://www.percona.com/downloads/XtraBackup/XtraBackup-%{version}/source/percona-%{name}-%{version}.tar.gz
+# Source0-md5: f59e7d26b71bd105d11a8d9eb665faad
+Source1:       
http://s3.amazonaws.com/percona.com/downloads/community/mysql-5.5.17.tar.gz
+# Source1-md5: dcb6a06e68c5e8f30f57b15300730c9c
+BuildRequires: bash
+BuildRequires: cmake >= 2.6
+BuildRequires: libaio-devel
+#BuildRequires:        libarchive-devel
 BuildRequires: libstdc++-devel
+BuildRequires: ncurses-devel >= 4.2
+#BuildRequires:        zlib-devel
 BuildRoot:     %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
 
-# CFLAGS for innodb are altered
-%undefine      configure_cache
-
 %description
 Percona XtraBackup is OpenSource online (non-blockable) backup
-solution for InnoDB and XtraDB engines. It works with MySQL 5.0 and
-5.1 versions (InnoDB Plugin is not supported yet as for alpha-0.3) and
-also can handle MyISAM tables.
+solution for InnoDB and XtraDB engines.
 
 %prep
-%setup -qc -a1
-mv mysql-*/* .
-%{__patch} -p1 < xtrabackup/fix_innodb_for_backup.patch
-mv xtrabackup innobase
+%setup -q -n percona-%{name}-%{version} -a1
+
+mv mysql-5.5.* mysql-5.5
+cd mysql-5.5
+%{__patch} -p1 < ../patches/innodb55.patch
 
 %build
 # The compiler flags are as per mysql "official" spec ;)
-CXXFLAGS="%{rpmcflags} -felide-constructors -fno-rtti -fno-exceptions 
%{!?debug:-fomit-frame-pointer}"
-CFLAGS="%{rpmcflags} %{!?debug:-fomit-frame-pointer}"
+export CC="%{__cc}"
+export CXX="%{__cxx}"
+export CXXFLAGS="%{rpmcflags} -felide-constructors -fno-rtti -fno-exceptions 
%{!?debug:-fomit-frame-pointer}"
+export CFLAGS="%{rpmcflags} %{!?debug:-fomit-frame-pointer}"
+
+cd mysql-5.5
+# We need to build with partitioning due to MySQL bug #58632
+%cmake \
+       -DCMAKE_BUILD_TYPE=%{!?debug:RelWithDebInfo}%{?debug:Debug} \
+       -DCMAKE_C_FLAGS_RELEASE="%{rpmcflags} -DNDEBUG -fno-omit-frame-pointer 
-fno-strict-aliasing" \
+       -DCMAKE_CXX_FLAGS_RELEASE="%{rpmcxxflags} -DNDEBUG 
-fno-omit-frame-pointer -fno-strict-aliasing" \
+       -DWITH_ZLIB=bundled \
+       %{?with_system_zlib:-DWITH_ZLIB=system} \
+       -DENABLED_LOCAL_INFILE=ON \
+       -DWITH_INNOBASE_STORAGE_ENGINE=ON \
+       -DWITH_PARTITION_STORAGE_ENGINE=ON \
+       -DWITH_EXTRA_CHARSETS=all \
+       -DENABLE_DTRACE=OFF \
+       -DWITH_LIBEDIT=OFF \
+       -DWITH_READLINE=OFF \
+       -DCURSES_INCLUDE_PATH=/usr/include/ncurses \
+       .
+
+for dir in include strings mysys dbug extra storage/innobase; do
+       %{__make} -C $dir
+done
 
-%configure \
-       --with-extra-charsets=all
+# build_libarchive()
+cd ../src/libarchive
+%cmake \
+       -DENABLE_CPIO=OFF \
+       -DENABLE_OPENSSL=OFF \
+       -DENABLE_TAR=OFF \
+       -DENABLE_TEST=OFF \
+       .
 %{__make}
-%{__make} -C innobase/xtrabackup \
-       CC="%{__cc}" \
-       CXXFLAGS="$CFLAGS" \
-       CFLAGS="$CFLAGS"
+
+# build_xtrabackup
+cd ../..
+# Read XTRABACKUP_VERSION from the VERSION file
+. ./VERSION
+
+server_dir=$(pwd)/mysql-5.5
+xtrabackup_target=5.5
+cd src
+
+export LIBS="$LIBS -lrt"
+%{__make} MYSQL_ROOT_DIR=$server_dir clean
+%{__make} MYSQL_ROOT_DIR=$server_dir XTRABACKUP_VERSION=$XTRABACKUP_VERSION 
$xtrabackup_target
 
 %install
 rm -rf $RPM_BUILD_ROOT
-install -d $RPM_BUILD_ROOT%{_bindir}
-install innobase/xtrabackup/innobackupex-1.5.1 
$RPM_BUILD_ROOT%{_bindir}/innobackupex
-install innobase/xtrabackup/xtrabackup $RPM_BUILD_ROOT%{_bindir}
+install -d $RPM_BUILD_ROOT{%{_bindir},%{_mandir}/man1}
+install -p innobackupex $RPM_BUILD_ROOT%{_bindir}
+install -p src/xbstream $RPM_BUILD_ROOT%{_bindir}
+install -p src/xtrabackup_innodb55 $RPM_BUILD_ROOT%{_bindir}
+cp -p doc/xtrabackup.1 $RPM_BUILD_ROOT%{_mandir}/man1
 
 %clean
 rm -rf $RPM_BUILD_ROOT
@@ -54,4 +98,6 @@ rm -rf $RPM_BUILD_ROOT
 %files
 %defattr(644,root,root,755)
 %attr(755,root,root) %{_bindir}/innobackupex
-%attr(755,root,root) %{_bindir}/xtrabackup
+%attr(755,root,root) %{_bindir}/xbstream
+%attr(755,root,root) %{_bindir}/xtrabackup_innodb55
+%{_mandir}/man1/xtrabackup.1*
================================================================

---- gitweb:

http://git.pld-linux.org/gitweb.cgi/packages/xtrabackup.git/commitdiff/9463cff2ffa85d919ae37325bce8813707c8b266

_______________________________________________
pld-cvs-commit mailing list
[email protected]
http://lists.pld-linux.org/mailman/listinfo/pld-cvs-commit

Reply via email to