From b9c7b0d613478bd0826df0a7d63edaca3eba61b0 Mon Sep 17 00:00:00 2001 From: Rex Dieter Date: Mar 30 2010 16:26:07 +0000 Subject: - backport mysql_update patch (kde#232702) - add (versioned) Requires: qt4 ... --- diff --git a/akonadi-1.3.1-mysql_update_backport.patch b/akonadi-1.3.1-mysql_update_backport.patch new file mode 100644 index 0000000..f7ad50b --- /dev/null +++ b/akonadi-1.3.1-mysql_update_backport.patch @@ -0,0 +1,69 @@ +Index: server/src/akonadi.cpp +=================================================================== +--- server/src/akonadi.cpp ++++ server/src/akonadi.cpp 2010-03-22 10:15:12.000000000 +0100 +@@ -368,11 +368,15 @@ + void AkonadiServer::startMysqlDatabaseProcess() + { + const QString mysqldPath = DbConfig::serverPath(); ++ const QStringList mysqldSearchPath = DbConfig::mysqldSearchPath(); + + const QString dataDir = XdgBaseDirs::saveDir( "data", QLatin1String( "akonadi/db_data" ) ); + const QString akDir = XdgBaseDirs::saveDir( "data", QLatin1String( "akonadi/" ) ); + const QString miscDir = XdgBaseDirs::saveDir( "data", QLatin1String( "akonadi/db_misc" ) ); + const QString fileDataDir = XdgBaseDirs::saveDir( "data", QLatin1String( "akonadi/file_db_data" ) ); ++ const QString mMysqlInstallDbPath = XdgBaseDirs::findExecutableFile( QLatin1String( "mysql_install_db" ), mysqldSearchPath ); ++ akDebug() << "Found mysql_install_db: " << mMysqlInstallDbPath; ++ + + // generate config file + const QString globalConfig = XdgBaseDirs::findResourceFile( "config", QLatin1String( "akonadi/mysql-global.conf" ) ); +@@ -443,6 +447,12 @@ + } + } + ++ // first run, some MySQL versions need a mysql_install_db run for that ++ if ( QDir( dataDir ).entryList( QDir::NoDotAndDotDot | QDir::AllEntries ).isEmpty() && !mMysqlInstallDbPath.isEmpty() ) { ++ const QStringList arguments = QStringList() << QString::fromLatin1( "--datadir=%1/" ).arg( dataDir ); ++ QProcess::execute( mMysqlInstallDbPath, arguments ); ++ } ++ + // clear mysql ib_logfile's in case innodb_log_file_size option changed in last confUpdate + if ( confUpdate ) { + QFile(dataDir + QDir::separator() + QString::fromLatin1( "ib_logfile0" )).remove(); +Index: server/src/storage/dbconfig.cpp +=================================================================== +--- server/src/storage/dbconfig.cpp ++++ server/src/storage/dbconfig.cpp 2010-03-22 10:13:08.000000000 +0100 +@@ -299,3 +299,15 @@ + return sInstance()->mCleanServerShutdownCommand; + } + ++QStringList DbConfig::mysqldSearchPath() ++{ ++const QStringList mysqldSearchPath = QStringList() ++ << QLatin1String("/usr/sbin") ++ << QLatin1String("/usr/local/sbin") ++ << QLatin1String("/usr/local/libexec") ++ << QLatin1String("/usr/libexec") ++ << QLatin1String("/opt/mysql/libexec") ++ << QLatin1String("/opt/local/lib/mysql5/bin"); ++ ++ return mysqldSearchPath ; ++} +Index: server/src/storage/dbconfig.h +=================================================================== +--- server/src/storage/dbconfig.h ++++ server/src/storage/dbconfig.h 2010-03-22 10:14:28.000000000 +0100 +@@ -76,6 +76,11 @@ + * exists. + */ + QString cleanServerShutdownCommand(); ++ ++ /** ++ * Returns the path where mysql binaries are searched ++ */ ++ QStringList mysqldSearchPath() ; + } + + #endif diff --git a/akonadi.spec b/akonadi.spec index f98615e..45507e0 100644 --- a/akonadi.spec +++ b/akonadi.spec @@ -2,7 +2,7 @@ Summary: PIM Storage Service Name: akonadi Version: 1.3.1 -Release: 2%{?dist} +Release: 3%{?dist} Group: System Environment/Libraries License: LGPLv2+ @@ -16,6 +16,9 @@ BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n) Patch1: akonadi-1.1.1-mysql_conf.patch ## upstream patches +# backport from trunk/ +# +Patch100: akonadi-1.3.1-mysql_update_backport.patch BuildRequires: cmake >= 2.6.0 BuildRequires: qt4-devel >= 4.4 @@ -28,6 +31,7 @@ BuildRequires: shared-mime-info BuildRequires: boost-devel BuildRequires: soprano-devel +%{?_qt4_version:Requires: qt4%{_?isa} >= %{_qt4_version}} # when/if akonadi grows support for other backends, consider splitting # these similar to how phonon is done currently. Requires: qt4-mysql @@ -58,6 +62,8 @@ Requires: pkgconfig %patch1 -p1 -b .mysql_conf touch -d %{mysql_conf_timestamp} server/src/storage/mysql-global.conf +%patch100 -p0 -b .mysql_update_backport + %build @@ -120,6 +126,10 @@ fi %changelog +* Tue Mar 30 2010 Rex Dieter 1.3.1-3 +- backport mysql_update patch (kde#232702) +- add (versioned) Requires: qt4 ... + * Wed Feb 10 2010 Rex Dieter 1.3.1-2 - mysql_conf_timestamp 20100209 (ie, force a config resync)