Projects
Kolab:3.4
cyrus-imapd
0005-Apply-ifdefs-for-building-without-DAV-and-...
Log In
Username
Password
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
File 0005-Apply-ifdefs-for-building-without-DAV-and-without-re.patch of Package cyrus-imapd (Revision 67)
Currently displaying revision
67
,
Show latest
From af772395dc3f45dbc2347fc3611606c7242059b5 Mon Sep 17 00:00:00 2001 From: "Jeroen van Meeuwen (Kolab Systems)" <vanmeeuwen@kolabsys.com> Date: Sat, 8 Mar 2014 23:50:55 +0100 Subject: [PATCH 5/6] Apply ifdefs for building without DAV and without requiring DAV-related software during build --- Makefile.am | 19 ++++++++++++++----- imap/mailbox.c | 10 ++++++++++ imap/mailbox.h | 2 ++ imap/mboxevent.c | 13 ++++++++++++- imap/mboxevent.h | 2 ++ imap/sync_server.c | 6 ++++++ 6 files changed, 46 insertions(+), 6 deletions(-) diff --git a/Makefile.am b/Makefile.am index b1790a5..48d0e8e 100644 --- a/Makefile.am +++ b/Makefile.am @@ -1190,7 +1190,6 @@ dist_man_MANS = \ man/deliver.8 \ man/fetchnews.8 \ man/fud.8 \ - man/httpd.8 \ man/idled.8 \ man/imapd.8 \ man/ipurge.8 \ @@ -1206,17 +1205,27 @@ dist_man_MANS = \ man/rmnews.8 \ man/smmapd.8 \ man/syncnews.8 \ - man/sync_client.8 \ - man/sync_reset.8 \ - man/sync_server.8 \ man/timsieved.8 \ man/tls_prune.8 \ man/unexpunge.8 -if USE_SQUAT + +if SQUATTER dist_man_MANS += \ man/squatter.8 endif +if HTTPD +dist_man_MANS += \ + man/httpd.8 +endif + +if REPLICATION +dist_man_MANS += \ + man/sync_client.8 \ + man/sync_reset.8 \ + man/sync_server.8 +endif + master_master_SOURCES = \ master/cyrusMasterMIB.c \ master/cyrusMasterMIB.h \ diff --git a/imap/mailbox.c b/imap/mailbox.c index 43d8f79..cc457df 100644 --- a/imap/mailbox.c +++ b/imap/mailbox.c @@ -51,7 +51,9 @@ #elif defined(HAVE_STDINT_H) # include <stdint.h> #endif +#ifdef WITH_DAV #include <libical/vcc.h> +#endif #include <stdio.h> #include <stdlib.h> #include <string.h> @@ -81,8 +83,10 @@ #include "annotate.h" #include "assert.h" +#ifdef WITH_DAV #include "caldav_db.h" #include "carddav_db.h" +#endif #include "crc32.h" #include "md5.h" #include "exitcodes.h" @@ -2660,6 +2664,7 @@ out: return r; } +#ifdef WITH_DAV static int mailbox_update_carddav(struct mailbox *mailbox, struct index_record *old, struct index_record *new) @@ -2880,6 +2885,7 @@ static int mailbox_update_dav(struct mailbox *mailbox, return mailbox_update_caldav(mailbox, old, new); return 0; } +#endif //WITH_DAV EXPORTED int mailbox_update_conversations(struct mailbox *mailbox, struct index_record *old, @@ -3106,8 +3112,10 @@ static int mailbox_update_indexes(struct mailbox *mailbox, { int r = 0; +#ifdef WITH_DAV r = mailbox_update_dav(mailbox, old, new); if (r) return r; +#endif r = mailbox_update_conversations(mailbox, old, new); if (r) return r; @@ -4231,6 +4239,7 @@ static int chkchildren(char *name, return r; } +#ifdef WITH_DAV EXPORTED int mailbox_add_dav(struct mailbox *mailbox) { struct index_record record; @@ -4250,6 +4259,7 @@ EXPORTED int mailbox_add_dav(struct mailbox *mailbox) return 0; } +#endif EXPORTED int mailbox_add_conversations(struct mailbox *mailbox) { diff --git a/imap/mailbox.h b/imap/mailbox.h index cdcf878..f6174c6 100644 --- a/imap/mailbox.h +++ b/imap/mailbox.h @@ -577,7 +577,9 @@ extern int mailbox_get_annotate_state(struct mailbox *mailbox, uint32_t mailbox_sync_crc(struct mailbox *mailbox, unsigned vers, int recalc); unsigned mailbox_best_crcvers(unsigned minvers, unsigned maxvers); +#ifdef WITH_DAV extern int mailbox_add_dav(struct mailbox *mailbox); +#endif /* Rename a CID. Note - this is just one mailbox! */ extern int mailbox_cid_rename(struct mailbox *mailbox, diff --git a/imap/mboxevent.c b/imap/mboxevent.c index 97882a5..0f0d298 100644 --- a/imap/mboxevent.c +++ b/imap/mboxevent.c @@ -53,8 +53,10 @@ #include "annotate.h" #include "assert.h" +#ifdef WITH_DAV #include "caldav_db.h" #include "carddav_db.h" +#endif #include "exitcodes.h" #include "imapurl.h" #include "libconfig.h" @@ -131,9 +133,11 @@ static struct mboxevent event_template = { EVENT_PID, "pid", EVENT_PARAM_INT, 0, 0 }, { EVENT_USER, "user", EVENT_PARAM_STRING, 0, 0 }, { EVENT_MESSAGE_SIZE, "messageSize", EVENT_PARAM_INT, 0, 0 }, +#ifdef WITH_DAV { EVENT_MBTYPE, "vnd.cmu.mbtype", EVENT_PARAM_STRING, 0, 0 }, { EVENT_DAV_FILENAME, "vnd.cmu.davFilename", EVENT_PARAM_STRING, 0, 0 }, { EVENT_DAV_UID, "vnd.cmu.davUid", EVENT_PARAM_STRING, 0, 0 }, +#endif { EVENT_MESSAGE_CID, "vnd.fastmail.cid", EVENT_PARAM_STRING, 0, 0 }, /* always at end to let the parser to easily truncate this part */ { EVENT_ENVELOPE, "vnd.cmu.envelope", EVENT_PARAM_STRING, 0, 0 }, @@ -378,8 +382,10 @@ static int mboxevent_expected_param(enum event_type type, enum event_param param return extra_params & IMAP_ENUM_EVENT_EXTRA_PARAMS_VND_FASTMAIL_SESSIONID; case EVENT_MAILBOX_ID: return (type & MAILBOX_EVENTS); +#ifdef WITH_DAV case EVENT_MBTYPE: return (type & MAILBOX_EVENTS); +#endif case EVENT_MAX_MESSAGES: return type & QUOTA_EVENTS; case EVENT_MESSAGE_CONTENT: @@ -388,12 +394,14 @@ static int mboxevent_expected_param(enum event_type type, enum event_param param case EVENT_MESSAGE_SIZE: return (extra_params & IMAP_ENUM_EVENT_EXTRA_PARAMS_MESSAGESIZE) && (type & (EVENT_MESSAGE_APPEND|EVENT_MESSAGE_NEW)); +#ifdef WITH_DAV case EVENT_DAV_FILENAME: return (extra_params & IMAP_ENUM_EVENT_EXTRA_PARAMS_VND_CMU_DAVFILENAME) && (type & EVENT_CALENDAR); case EVENT_DAV_UID: return (extra_params & IMAP_ENUM_EVENT_EXTRA_PARAMS_VND_CMU_DAVUID) && (type & EVENT_CALENDAR); +#endif case EVENT_MESSAGE_CID: return (extra_params & IMAP_ENUM_EVENT_EXTRA_PARAMS_VND_FASTMAIL_CID) && (type & (EVENT_MESSAGE_APPEND|EVENT_MESSAGE_NEW)); @@ -743,6 +751,7 @@ EXPORTED void mboxevent_extract_record(struct mboxevent *event, struct mailbox * cacheitem_size(record, CACHE_BODYSTRUCTURE))); } +#ifdef WITH_DAV /* add caldav items */ if ((mailbox->mbtype & (MBTYPES_DAV)) && (mboxevent_expected_param(event->type, EVENT_DAV_FILENAME) || @@ -783,7 +792,7 @@ EXPORTED void mboxevent_extract_record(struct mboxevent *event, struct mailbox * } } } - +#endif //WITH_DAV void mboxevent_extract_copied_record(struct mboxevent *event, const struct mailbox *mailbox, uint32_t uid) { @@ -993,8 +1002,10 @@ EXPORTED void mboxevent_extract_mailbox(struct mboxevent *event, imapurl_toURL(url, &imapurl); FILL_STRING_PARAM(event, EVENT_URI, xstrdup(url)); +#ifdef WITH_DAV FILL_STRING_PARAM(event, EVENT_MBTYPE, xstrdup(mboxlist_mbtype_to_string(mailbox->mbtype))); +#endif /* mailbox related events also require mailboxID */ if (event->type & MAILBOX_EVENTS) { diff --git a/imap/mboxevent.h b/imap/mboxevent.h index f0977ef..4e111c7 100644 --- a/imap/mboxevent.h +++ b/imap/mboxevent.h @@ -112,9 +112,11 @@ enum event_param { EVENT_PID, EVENT_USER, EVENT_MESSAGE_SIZE, +#ifdef WITH_DAV EVENT_MBTYPE, EVENT_DAV_FILENAME, EVENT_DAV_UID, +#endif EVENT_MESSAGE_CID, EVENT_ENVELOPE, EVENT_BODYSTRUCTURE, diff --git a/imap/sync_server.c b/imap/sync_server.c index 745b3cf..e51983d 100644 --- a/imap/sync_server.c +++ b/imap/sync_server.c @@ -74,9 +74,11 @@ #include "annotate.h" #include "append.h" #include "auth.h" +#ifdef WITH_DAV #include "caldav_db.h" #include "carddav_db.h" #include "dav_db.h" +#endif #include "dlist.h" #include "exitcodes.h" #include "global.h" @@ -291,9 +293,11 @@ int service_init(int argc __attribute__((unused)), statuscache_open(); } +#ifdef WITH_DAV dav_init(); caldav_init(); carddav_init(); +#endif return 0; } @@ -455,9 +459,11 @@ void shut_down(int code) proc_cleanup(); +#ifdef WITH_DAV carddav_done(); caldav_done(); dav_done(); +#endif if (config_getswitch(IMAPOPT_STATUSCACHE)) { statuscache_close(); -- 1.8.3.1
Locations
Projects
Search
Status Monitor
Help
Open Build Service
OBS Manuals
API Documentation
OBS Portal
Reporting a Bug
Contact
Mailing List
Forums
Chat (IRC)
Twitter
Open Build Service (OBS)
is an
openSUSE project
.