- updated to latest upstream alpha

- split ldap and gssapi plugins to subpackages
This commit is contained in:
Tomas Janousek 2007-08-10 12:13:40 +00:00
parent 4a688f1335
commit a520dff18f
4 changed files with 69 additions and 334 deletions

View File

@ -1,3 +1,3 @@
dovecot-1.1.alpha1.tar.gz
dovecot-1.1.alpha1.tar.gz.sig
dovecot-1.1.alpha2.tar.gz
dovecot-1.1.alpha2.tar.gz.sig
dovecot-sieve-1.1-131e25f6862b.tar.gz

View File

@ -1,314 +0,0 @@
--- dovecot-1.1.alpha1/src/dict/main.c.split 2007-07-12 03:42:49.000000000 +0200
+++ dovecot-1.1.alpha1/src/dict/main.c 2007-07-19 11:03:11.000000000 +0200
@@ -22,6 +22,7 @@
static struct io *log_io;
static struct module *modules;
+static struct module *sql_modules;
static struct dict_server *dict_server;
static void sig_die(int signo, void *context __attr_unused__)
@@ -50,6 +51,8 @@
/* Load built-in SQL drivers (if any) */
sql_drivers_init();
sql_drivers_register_all();
+ sql_modules = sql_drivers_modules_load();
+ module_dir_init(sql_modules);
restrict_access_by_env(FALSE);
}
@@ -98,6 +101,7 @@
dict_drivers_unregister_all();
+ module_dir_unload(&sql_modules);
sql_drivers_deinit();
random_deinit();
lib_signals_deinit();
--- dovecot-1.1.alpha1/src/lib-sql/Makefile.am.split 2007-07-12 03:42:50.000000000 +0200
+++ dovecot-1.1.alpha1/src/lib-sql/Makefile.am 2007-07-19 11:03:11.000000000 +0200
@@ -1,21 +1,66 @@
noinst_LIBRARIES = libsql.a
+if DYNAMIC_SQL
+if BUILD_MYSQL
+MYSQL_LIB=libdriver_mysql.la
+endif
+if BUILD_PGSQL
+PGSQL_LIB=libdriver_pgsql.la
+endif
+if BUILD_SQLITE
+SQLITE_LIB=libdriver_sqlite.la
+endif
+
+sql_module_LTLIBRARIES = \
+ $(MYSQL_LIB) \
+ $(PGSQL_LIB) \
+ $(SQLITE_LIB)
+
+sql_moduledir = $(moduledir)/sql
+endif
+
sql_drivers = @sql_drivers@
AM_CPPFLAGS = \
-I$(top_srcdir)/src/lib \
+ -DMODULEDIR=\""$(moduledir)"\" \
$(SQL_CFLAGS)
dist_sources = \
+ sql-api.c
+
+if ! DYNAMIC_SQL
+driver_sources = \
driver-mysql.c \
driver-pgsql.c \
- driver-sqlite.c \
- sql-api.c
+ driver-sqlite.c
+endif
libsql_a_SOURCES = \
$(dist_sources) \
+ $(driver_sources) \
sql-drivers-register.c
+if DYNAMIC_SQL
+libdriver_mysql_la_LDFLAGS = -module -avoid-version
+libdriver_mysql_la_LIBADD = $(MYSQL_LIBS)
+libdriver_mysql_la_CPPFLAGS = -I$(top_srcdir)/src/lib $(MYSQL_CFLAGS)
+libdriver_mysql_la_SOURCES = \
+ driver-mysql.c
+
+libdriver_pgsql_la_LDFLAGS = -module -avoid-version
+libdriver_pgsql_la_LIBADD = $(PGSQL_LIBS)
+libdriver_pgsql_la_CPPFLAGS = -I$(top_srcdir)/src/lib $(PGSQL_CFLAGS)
+libdriver_pgsql_la_SOURCES = \
+ driver-pgsql.c
+
+libdriver_sqlite_la_LDFLAGS = -module -avoid-version
+libdriver_sqlite_la_LIBADD = $(SQLITE_LIBS)
+libdriver_sqlite_la_CPPFLAGS = -I$(top_srcdir)/src/lib $(SQLITE_CFLAGS)
+libdriver_sqlite_la_SOURCES = \
+ driver-sqlite.c
+endif
+
headers = \
sql-api.h \
sql-api-private.h
@@ -32,17 +77,21 @@
echo '/* this file automatically generated by Makefile */' >$@
echo '#include "lib.h"' >>$@
echo '#include "sql-api.h"' >>$@
+if ! DYNAMIC_SQL
for i in $(sql_drivers) null; do \
if [ "$${i}" != "null" ]; then \
echo "extern struct sql_db driver_$${i}_db;" >>$@ ; \
fi \
done
+endif
echo 'void sql_drivers_register_all(void) {' >>$@
+if ! DYNAMIC_SQL
for i in $(sql_drivers) null; do \
if [ "$${i}" != "null" ]; then \
echo "sql_driver_register(&driver_$${i}_db);" >>$@ ; \
fi \
done
+endif
echo '}' >>$@
DISTFILES = $(DIST_COMMON) $(dist_sources) $(HEADERS) $(TEXINFOS) $(EXTRA_DIST)
--- dovecot-1.1.alpha1/src/lib-sql/sql-api.h.split 2007-07-12 03:42:50.000000000 +0200
+++ dovecot-1.1.alpha1/src/lib-sql/sql-api.h 2007-07-19 11:03:11.000000000 +0200
@@ -47,6 +47,8 @@
/* register all built-in SQL drivers */
void sql_drivers_register_all(void);
+struct module;
+struct module *sql_drivers_modules_load(void);
void sql_driver_register(const struct sql_db *driver);
void sql_driver_unregister(const struct sql_db *driver);
--- dovecot-1.1.alpha1/src/lib-sql/sql-api.c.split 2007-07-12 03:42:50.000000000 +0200
+++ dovecot-1.1.alpha1/src/lib-sql/sql-api.c 2007-07-19 11:03:11.000000000 +0200
@@ -2,6 +2,7 @@
#include "lib.h"
#include "array.h"
+#include "module-dir.h"
#include "sql-api-private.h"
#include <stdlib.h>
@@ -18,6 +19,12 @@
array_free(&sql_drivers);
}
+struct module *sql_drivers_modules_load(void)
+{
+ return module_dir_load(MODULEDIR"/sql",
+ NULL, TRUE, PACKAGE_VERSION);
+}
+
void sql_driver_register(const struct sql_db *driver)
{
array_append(&sql_drivers, &driver, 1);
--- dovecot-1.1.alpha1/src/auth/main.c.split 2007-07-12 03:42:49.000000000 +0200
+++ dovecot-1.1.alpha1/src/auth/main.c 2007-07-19 11:03:11.000000000 +0200
@@ -10,6 +10,7 @@
#include "sql-api.h"
#include "randgen.h"
#include "password-scheme.h"
+#include "module-dir.h"
#include "mech.h"
#include "auth.h"
#include "auth-request-handler.h"
@@ -35,6 +36,8 @@
static struct auth *auth;
static struct auth_worker_client *worker_client;
+static struct module *sql_modules;
+
static void sig_die(int signo, void *context __attr_unused__)
{
/* warn about being killed because of some signal, except SIGINT (^C)
@@ -189,6 +192,8 @@
/* Load built-in SQL drivers (if any) */
sql_drivers_init();
sql_drivers_register_all();
+ sql_modules = sql_drivers_modules_load();
+ module_dir_init(sql_modules);
/* Initialize databases so their configuration files can be readable
only by root. Also load all modules here. */
@@ -287,6 +292,7 @@
mech_deinit();
password_schemes_deinit();
+ module_dir_unload(&sql_modules);
sql_drivers_deinit();
random_deinit();
--- dovecot-1.1.alpha1/configure.in.split 2007-07-19 05:08:39.000000000 +0200
+++ dovecot-1.1.alpha1/configure.in 2007-07-19 11:05:18.000000000 +0200
@@ -254,6 +254,15 @@
want_lucene=no)
AM_CONDITIONAL(BUILD_LUCENE, test "$want_lucene" = "yes")
+AC_ARG_WITH(dynamic-sql,
+[ --with-dynamic-sql Build SQL modules as shared libs],
+ if test x$withval = xno; then
+ want_dynamic_sql=no
+ else
+ want_dynamic_sql=yes
+ fi,
+ want_dynamic_sql=no)
+
AC_ARG_WITH(ssl,
[ --with-ssl=[gnutls|openssl] Build with GNUTLS or OpenSSL (default)],
if test x$withval = xno; then
@@ -1660,12 +1669,12 @@
fi
AC_CHECK_HEADER(libpq-fe.h, [
if test "$PGSQL_INCLUDE" != ""; then
- SQL_CFLAGS="$SQL_CFLAGS -I$PGSQL_INCLUDE"
+ PGSQL_CFLAGS="$PGSQL_CFLAGS -I$PGSQL_INCLUDE"
fi
if test "$PGSQL_LIBDIR" != ""; then
- SQL_LIBS="$SQL_LIBS -L$PGSQL_LIBDIR"
+ PGSQL_LIBS="$PGSQL_LIBS -L$PGSQL_LIBDIR"
fi
- SQL_LIBS="$SQL_LIBS -lpq"
+ PGSQL_LIBS="$PGSQL_LIBS -lpq"
AC_DEFINE(HAVE_PGSQL,, Build with PostgreSQL support)
found_sql_drivers="$found_sql_drivers pgsql"
@@ -1711,12 +1720,12 @@
fi
AC_CHECK_HEADER(mysql.h, [
if test "$MYSQL_INCLUDE" != ""; then
- SQL_CFLAGS="$SQL_CFLAGS -I$MYSQL_INCLUDE"
+ MYSQL_CFLAGS="$MYSQL_CFLAGS -I$MYSQL_INCLUDE"
fi
if test "$MYSQL_LIBDIR" != ""; then
- SQL_LIBS="$SQL_LIBS -L$MYSQL_LIBDIR"
+ MYSQL_LIBS="$MYSQL_LIBS -L$MYSQL_LIBDIR"
fi
- SQL_LIBS="$SQL_LIBS $mysql_lib"
+ MYSQL_LIBS="$MYSQL_LIBS $mysql_lib"
AC_CHECK_LIB(mysqlclient, mysql_ssl_set, [
AC_DEFINE(HAVE_MYSQL_SSL,, Define if your MySQL library has SSL functions)
@@ -1747,13 +1756,18 @@
if test $want_sqlite = yes; then
AC_CHECK_LIB(sqlite3, sqlite3_open, [
AC_CHECK_HEADER(sqlite3.h, [
- SQL_LIBS="$SQL_LIBS -lsqlite3 -lz"
+ SQLITE_LIBS="$SQLITE_LIBS -lsqlite3 -lz"
AC_DEFINE(HAVE_SQLITE,, Build with SQLite3 support)
found_sql_drivers="$found_sql_drivers sqlite"
])
])
fi
+
+SQL_CFLAGS="$MYSQL_CFLAGS $PGSQL_CFLAGS $SQLITE_CFLAGS"
+if test "$want_dynamic_sql" = "no"; then
+ SQL_LIBS="$MYSQL_LIBS $PGSQL_LIBS $SQLITE_LIBS"
+fi
if test "$found_sql_drivers" != "" -o "$want_sql" = "yes"; then
if test "$all_sql_drivers" = "yes"; then
@@ -1828,6 +1842,12 @@
AC_SUBST(AUTH_LIBS)
AC_SUBST(SQL_CFLAGS)
AC_SUBST(SQL_LIBS)
+AC_SUBST(MYSQL_CFLAGS)
+AC_SUBST(MYSQL_LIBS)
+AC_SUBST(PGSQL_CFLAGS)
+AC_SUBST(PGSQL_LIBS)
+AC_SUBST(SQLITE_CFLAGS)
+AC_SUBST(SQLITE_LIBS)
AC_SUBST(DICT_LIBS)
AC_SUBST(dict_drivers)
@@ -1899,17 +1919,27 @@
dnl ** SQL drivers
dnl **
+build_pgsql=no
+build_mysql=no
+build_sqlite=no
for driver in $sql_drivers; do
if test "$driver" = "pgsql"; then
AC_DEFINE(BUILD_PGSQL,, Built-in PostgreSQL support)
+ build_pgsql=yes
elif test "$driver" = "mysql"; then
AC_DEFINE(BUILD_MYSQL,, Built-in MySQL support)
+ build_mysql=yes
elif test "$driver" = "sqlite"; then
AC_DEFINE(BUILD_SQLITE,, Built-in SQLite support)
+ build_sqlite=yes
fi
done
AC_SUBST(sql_drivers)
+AM_CONDITIONAL(BUILD_PGSQL, test "$build_pgsql" = "yes")
+AM_CONDITIONAL(BUILD_MYSQL, test "$build_mysql" = "yes")
+AM_CONDITIONAL(BUILD_SQLITE, test "$build_sqlite" = "yes")
+AM_CONDITIONAL(DYNAMIC_SQL, test "$want_dynamic_sql" = "yes")
dnl **
dnl ** Plugins
@@ -1996,7 +2026,11 @@
echo "Building with GSSAPI support ........ : $have_gssapi"
echo "Building with user database modules . :$userdb"
echo "Building with password lookup modules :$passdb"
-echo "Building with SQL drivers ............:$sql_drivers"
+if test "$want_dynamic_sql" = "yes"; then
+ echo "Building with SQL drivers ............:$sql_drivers (dynamic)"
+else
+ echo "Building with SQL drivers ............:$sql_drivers"
+fi
echo
echo "NOTE: This is the UNSTABLE development branch of Dovecot."

View File

@ -1,10 +1,10 @@
%define dovecot_hg a744ae38a9e1
#%define dovecot_hg a744ae38a9e1
%define sieve_hg 131e25f6862b
%define upstream 1.1.alpha1
%define upstream 1.1.alpha2
%define sieve_upstream 1.1-%{sieve_hg}
%define pkg_version 1.1
%define my_release 14.6
%define pkg_release %{my_release}.hg.%{dovecot_hg}%{?dist}
%define my_release 15
%define pkg_release %{my_release}.alpha2%{?dist}
%define pkg_sieve_version 1.1
%define pkg_sieve_release %{my_release}.hg.%{sieve_hg}%{?dist}
@ -18,6 +18,8 @@ Group: System Environment/Daemons
%define build_postgres 1
%define build_mysql 1
%define build_sqlite 1
%define build_ldap 1
%define build_gssapi 1
%define build_sieve 1
%define sieve_name dovecot-sieve
@ -35,9 +37,8 @@ Patch100: dovecot-1.1.alpha1-default-settings.patch
Patch102: dovecot-1.0.rc2-pam-setcred.patch
Patch103: dovecot-1.0.beta2-mkcert-permissions.patch
Patch105: dovecot-1.0.rc7-mkcert-paths.patch
Patch106: dovecot-1.1.alpha1-split.patch
Patch107: dovecot-1.1-unicodedata.patch
Patch200: dovecot-%{dovecot_hg}.patch
#Patch200: dovecot-%{dovecot_hg}.patch
# XXX this patch needs review and forward porting
#Patch105: dovecot-auth-log.patch
@ -46,14 +47,12 @@ Patch200: dovecot-%{dovecot_hg}.patch
URL: http://www.dovecot.org/
Buildroot: %{_tmppath}/%{name}-%{version}-%{release}-root
BuildRequires: openssl-devel
BuildRequires: openldap-devel
BuildRequires: pam-devel
BuildRequires: pkgconfig
BuildRequires: zlib-devel
BuildRequires: libtool
BuildRequires: autoconf
BuildRequires: automake
BuildRequires: krb5-devel
# gettext-devel is needed for running autoconf because of the
# presence of AM_ICONV
BuildRequires: gettext-devel
@ -77,6 +76,14 @@ BuildRequires: mysql-devel
BuildRequires: sqlite-devel
%endif
%if %{build_ldap}
BuildRequires: openldap-devel
%endif
%if %{build_gssapi}
BuildRequires: krb5-devel
%endif
%define docdir %{_docdir}/%{name}
%define ssldir %{_sysconfdir}/pki/%{name}
%define restart_flag /var/run/%{name}-restart-after-rpm-install
@ -88,6 +95,8 @@ Dovecot is an IMAP server for Linux/UNIX-like systems, written with security
primarily in mind. It also contains a small POP3 server. It supports mail
in either of maildir or mbox formats.
The SQL drivers and authentication plugins are in their subpackages.
%if %{build_sieve}
%package sieve
@ -133,6 +142,24 @@ Group: System Environment/Daemons
This package provides the SQLite backend for dovecot-auth etc.
%endif
%if %{build_ldap}
%package ldap
Requires: %{name} = %{version}-%{release}
Summary: LDAP auth plugin for dovecot
Group: System Environment/Daemons
%description ldap
This package provides the LDAP auth plugin for dovecot-auth etc.
%endif
%if %{build_gssapi}
%package gssapi
Requires: %{name} = %{version}-%{release}
Summary: GSSAPI auth mechanism plugin for dovecot
Group: System Environment/Daemons
%description gssapi
This package provides the GSSAPI auth mechanism plugin for dovecot-auth etc.
%endif
%prep
@ -143,9 +170,7 @@ This package provides the SQLite backend for dovecot-auth etc.
%patch103 -p1 -b .mkcert-permissions
%patch105 -p1 -b .mkcert-paths
%patch107 -p1 -b .unicodedata
%patch200 -p1 -b .%{dovecot_hg}
%patch106 -p1 -b .split
#%patch200 -p1 -b .%{dovecot_hg}
%if %{build_sieve}
%setup -q -n %{name}-%{upstream} -D -T -a 8
@ -167,12 +192,16 @@ autoreconf -i
%if %{build_sqlite}
--with-sqlite \
%endif
--with-dynamic-sql \
--with-sql=plugin \
--with-ssl=openssl \
--with-ssldir=%{ssldir} \
--with-ldap \
%if %{build_ldap}
--with-ldap=plugin \
%endif
--with-inotify \
--with-gssapi
%if %{build_gssapi}
--with-gssapi=plugin
%endif
make
@ -256,7 +285,7 @@ rm -f $RPM_BUILD_ROOT/%{_libdir}/%{name}/dovecot-config
(
find ${RPM_BUILD_ROOT}/%{_libdir}/%{name} -type d | sed -e "s|^|%dir |";
find ${RPM_BUILD_ROOT}/%{_libdir}/%{name} -! -type d | \
grep -v 'lib90_cmusieve_plugin.so\|libdriver_.*.so';
grep -v 'lib90_cmusieve_plugin\.so\|libdriver_.*\.so\|libauthdb_.*\.so\|libmech_.*\.so';
) | sed -e "s|$RPM_BUILD_ROOT||" >libs.filelist
%pre
@ -340,25 +369,45 @@ rm -rf $RPM_BUILD_ROOT
%if %{build_mysql}
%files mysql
%{_libdir}/%{name}/sql/libdriver_mysql.so
%{_libdir}/%{name}/auth/libdriver_mysql.so
%{_libdir}/%{name}/dict/libdriver_mysql.so
%endif
%if %{build_postgres}
%files pgsql
%{_libdir}/%{name}/sql/libdriver_pgsql.so
%{_libdir}/%{name}/auth/libdriver_pgsql.so
%{_libdir}/%{name}/dict/libdriver_pgsql.so
%endif
%if %{build_sqlite}
%files sqlite
%{_libdir}/%{name}/sql/libdriver_sqlite.so
%{_libdir}/%{name}/auth/libdriver_sqlite.so
%{_libdir}/%{name}/dict/libdriver_sqlite.so
%endif
%if %{build_ldap}
%files ldap
%{_libdir}/%{name}/auth/libauthdb_ldap.so
%endif
%if %{build_gssapi}
%files gssapi
%{_libdir}/%{name}/auth/libmech_gssapi.so
%endif
%changelog
* Fri Aug 10 2007 Tomas Janousek <tjanouse@redhat.com> - 1.1-15.alpha2
- updated to latest upstream alpha
- split ldap and gssapi plugins to subpackages
* Wed Jul 25 2007 Tomas Janousek <tjanouse@redhat.com> - 1.1-14.6.hg.a744ae38a9e1
- update to a744ae38a9e1 from hg
- update dovecot-sieve to 131e25f6862b from hg and enable it again
* Thu Jul 19 2007 Tomas Janousek <tjanouse@redhat.com> - 1.1-14.5.alpha1
- update to latest upstream beta
- update to latest upstream alpha
- don't build dovecot-sieve, it's only for 1.0
* Sun Jul 15 2007 Tomas Janousek <tjanouse@redhat.com> - 1.0.2-13.5

View File

@ -1,3 +1,3 @@
e952297f75ab3d042d896eb1e5c52463 dovecot-1.1.alpha1.tar.gz
79a860a7f9aed0812c33708836d548a4 dovecot-1.1.alpha1.tar.gz.sig
e2e52e636dc9c96ad26e3b405aac871f dovecot-1.1.alpha2.tar.gz
7e2931e21f1386c10019b4a23c4bd215 dovecot-1.1.alpha2.tar.gz.sig
c9ec32dc9a14d33120c69a6f18673443 dovecot-sieve-1.1-131e25f6862b.tar.gz