akonadi-mysql subpkg

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Here's an initial attempt at creating a akonadi-mysql subpkg.

It's purpose includes:
* provide a way for users/admin's to more-easily control which akonadi backend gets used by default. when akonadi-mysql is present => mysql, if not => sqlite * allows mysql (and friends) to drop out of fedora's critical path (which the mysql maintainer isn't fond of)

Once built, we can add akonadi-mysql to comps to get installed by default (1)

I've tested upgrading from pristine akonadi setup/config as well as one with an existing customized /etc/xdg/akonadi/akonadiserverrc file.


Any comments, thoughts, feedback?

-- rex

(1) though I'd personally not want this, my fellow kde-sig'ers disagreed with me last time the topic was debated.
>From cccf0cb8063193fd902881dfb7a3294163a9add2 Mon Sep 17 00:00:00 2001
From: Rex Dieter <rdieter@xxxxxxxxxxxxxxxxx>
Date: Mon, 25 Jun 2012 14:57:30 -0500
Subject: [PATCH] mysql subpkg

---
 akonadi.spec          |   83 ++++++++++++++++++++++++++++++-------------------
 akonadiserverrc.mysql |    2 ++
 2 files changed, 53 insertions(+), 32 deletions(-)
 create mode 100644 akonadiserverrc.mysql

diff --git a/akonadi.spec b/akonadi.spec
index 7c988d4..5678214 100644
--- a/akonadi.spec
+++ b/akonadi.spec
@@ -1,17 +1,12 @@
 
-## Can be either MYSQL(uptsream default), SQLITE, or POSTGRES(untested)
-%ifarch %{arm}
+# base pkg default to SQLITE now, install -mysql if you want that instead
 %global database_backend SQLITE
-%else
-%global database_backend MYSQL
-%endif
 
 Summary: PIM Storage Service
 Name:    akonadi
 Version: 1.7.90
-Release: 1%{?dist}
+Release: 2%{?dist}
 
-Group:   System Environment/Libraries
 License: LGPLv2+
 URL:     http://community.kde.org/KDE_PIM/Akonadi 
 %if 0%{?snap}
@@ -22,7 +17,9 @@ Source0: akonadi-%{version}-%{snap}.tar.bz2
 # Official release
 Source0: http://download.kde.org/stable/akonadi/src/akonadi-%{version}.tar.bz2
 %endif
-BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
+
+## mysql config
+Source10: akonadiserverrc.mysql
 
 ## upstream patches
 
@@ -46,29 +43,35 @@ BuildRequires: postgresql-server
 
 %{?_qt4_version:Requires: qt4%{?_isa} >= %{_qt4_version}}
 
-%if "%{?database_backend}" == "MYSQL"
-Requires: qt4-mysql%{?_isa}
-# not *strictly* required, but we need a functional default configuration
-Requires: mysql-server
-%endif
 Requires(postun): /sbin/ldconfig
 
 %description
 %{summary}.
-%if "%{?database_backend}" == "MYSQL"
-Requires an available instance of mysql server at runtime.  
-Akonadi can spawn a per-user one automatically if the mysql-server 
-package is installed on the machine.
-See also: %{_sysconfdir}/akonadi/mysql-global.conf
-%endif
 
 %package devel
 Summary: Developer files for %{name}
-Group:   Development/Libraries
 Requires: %{name}%{?_isa} = %{version}-%{release}
 %description devel
 %{summary}.
 
+%package mysql
+Summary: Akonadi MySQL backend support
+# upgrade path
+Obsoletes: akonadi < 1.7.90-2
+Requires: %{name}%{?_isa} = %{version}-%{release}
+Requires: mysql-server
+Requires: qt4-mysql%{?_isa}
+Requires(post): %{_sbindir}/update-alternatives
+Requires(postun): %{_sbindir}/update-alternatives
+%description mysql
+Configures akonadi to use mysql backend by default.
+
+Requires an available instance of mysql server at runtime.
+Akonadi can spawn a per-user one automatically if the mysql-server
+package is installed on the machine.
+See also: %{_sysconfdir}/akonadi/mysql-global.conf
+
+
 
 %prep
 %setup -q -n akonadi-%{version}
@@ -90,6 +93,8 @@ make %{?_smp_mflags} -C %{_target_platform}
 rm -rf %{buildroot} 
 make install/fast DESTDIR=$RPM_BUILD_ROOT -C %{_target_platform}
 
+install -p -m644 -D %{SOURCE10} %{buildroot}%{_sysconfdir}/xdg/akonadi/akonadiserverrc.mysql
+
 mkdir -p %{buildroot}%{_datadir}/akonadi/agents
 
 # create "big" config (analog to -mobile.conf)
@@ -117,11 +122,7 @@ install -p -m644 -D akonadiserverrc %{buildroot}%{_sysconfdir}/xdg/akonadi/akona
 %check
 export PKG_CONFIG_PATH=%{buildroot}%{_datadir}/pkgconfig:%{buildroot}%{_libdir}/pkgconfig
 test "$(pkg-config --modversion akonadi)" = "%{version}"
-## in mock,
-#The following tests FAILED:
-#	 14 - akonadi-dbconfigtest (Failed)
-# tests succeed locally (?) -- rex
-xvfb-run -a dbus-launch --exit-with-session make test -C %{_target_platform} ||:
+xvfb-run -a dbus-launch --exit-with-session make test -C %{_target_platform} 
 
 
 %clean
@@ -140,16 +141,10 @@ if [ $1 -eq 0 ] ; then
 fi
 
 %files
-%defattr(-,root,root,-)
 %doc AUTHORS lgpl-license
 %dir %{_sysconfdir}/xdg/akonadi/
 %ghost %config(missingok,noreplace) %{_sysconfdir}/xdg/akonadi/akonadiserverrc
 %dir %{_sysconfdir}/akonadi/
-# example conf's
-%{_sysconfdir}/akonadi/mysql-global-big.conf
-%{_sysconfdir}/akonadi/mysql-global-mobile.conf
-%config(noreplace) %{_sysconfdir}/akonadi/mysql-global.conf
-%config(noreplace) %{_sysconfdir}/akonadi/mysql-local.conf
 %{_bindir}/akonadi_agent_launcher
 %{_bindir}/akonadi_agent_server
 %{_bindir}/akonadi_control
@@ -165,14 +160,38 @@ fi
 %{_qt4_plugindir}/sqldrivers/libqsqlite3.so
 
 %files devel
-%defattr(-,root,root,-)
 %{_includedir}/akonadi/
 %{_libdir}/pkgconfig/akonadi.pc
 %{_libdir}/libakonadiprotocolinternals.so
 %{_libdir}/cmake/Akonadi/
 
+%post mysql
+%{_sbindir}/update-alternatives \
+  --install %{_sysconfdir}/xdg/akonadi/akonadiserverrc \
+  akonadiserverrc \
+  %{_sysconfdir}/xdg/akonadi/akonadiserverrc.mysql \
+  10
+
+%postun mysql
+if [ $1 -eq 0 ]; then
+%{_sbindir}/update-alternatives \
+  --remove akonadiserverrc \
+  %{_sysconfdir}/xdg/akonadi/akonadiserverrc.mysql 
+fi
+
+%files mysql
+%config(noreplace) %{_sysconfdir}/xdg/akonadi/akonadiserverrc.mysql
+%config(noreplace) %{_sysconfdir}/akonadi/mysql-global.conf
+%config(noreplace) %{_sysconfdir}/akonadi/mysql-local.conf
+# example conf's
+%{_sysconfdir}/akonadi/mysql-global-big.conf
+%{_sysconfdir}/akonadi/mysql-global-mobile.conf
+
 
 %changelog
+* Mon Jun 25 2012 Rex Dieter <rdieter@xxxxxxxxxxxxxxxxx> 1.7.90-2
+- -mysql subpkg
+
 * Mon Jun 25 2012 Rex Dieter <rdieter@xxxxxxxxxxxxxxxxx> 1.7.90-1
 - 1.7.90
 
diff --git a/akonadiserverrc.mysql b/akonadiserverrc.mysql
new file mode 100644
index 0000000..f72ecdb
--- /dev/null
+++ b/akonadiserverrc.mysql
@@ -0,0 +1,2 @@
+[%General]
+Driver=QMYSQL
-- 
1.7.10.4

_______________________________________________
kde mailing list
kde@xxxxxxxxxxxxxxxxxxxxxxx
https://admin.fedoraproject.org/mailman/listinfo/kde
New to KDE4? - get help from http://userbase.kde.org

[Index of Archives]     [KDE Users]     [Fedora General Discussion]     [Older Fedora Users Mail]     [Fedora Advisory Board]     [Fedora Security]     [Fedora Maintainers]     [Fedora Devel Java]     [Fedora Legacy]     [Fedora Desktop]     [ATA RAID]     [Fedora Marketing]     [Fedora Mentors]     [Fedora Package Announce]     [Fedora Package Review]     [Fedora Music]     [Fedora Packaging]     [Centos]     [Fedora SELinux]     [Fedora Triage]     [Coolkey]     [Yum Users]     [Yosemite Forum]     [Fedora Art]     [Fedora Docs]     [Asterisk PBX]

  Powered by Linux