/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */ /* camel-service.h : Abstract class for an email service */ /* * * Author : * Bertrand Guiheneuf * * Copyright 1999, 2000 Helix Code, Inc. (http://www.helixcode.com) * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License as * published by the Free Software Foundation; either version 2 of the * License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 * USA */ #ifndef CAMEL_SERVICE_H #define CAMEL_SERVICE_H 1 #ifdef __cplusplus extern "C" { #pragma } #endif /* __cplusplus }*/ #include #include #include #include #define CAMEL_SERVICE_TYPE (camel_service_get_type ()) #define CAMEL_SERVICE(obj) (CAMEL_CHECK_CAST((obj), CAMEL_SERVICE_TYPE, CamelService)) #define CAMEL_SERVICE_CLASS(k) (CAMEL_CHECK_CLASS_CAST ((k), CAMEL_SERVICE_TYPE, CamelServiceClass)) #define CAMEL_IS_SERVICE(o) (CAMEL_CHECK_TYPE((o), CAMEL_SERVICE_TYPE)) struct _CamelService { CamelObject parent_object; struct _CamelServicePrivate *priv; CamelSession *session; CamelProvider *provider; gboolean connected; CamelURL *url; }; typedef struct { CamelObjectClass parent_class; void (*construct) (CamelService *service, CamelSession *session, CamelProvider *provider, CamelURL *url, CamelException *ex); gboolean (*connect) (CamelService *service, CamelException *ex); gboolean (*disconnect) (CamelService *service, gboolean clean, CamelException *ex); GList * (*query_auth_types) (CamelService *service, gboolean connect, CamelException *ex); void (*free_auth_types) (CamelService *service, GList *authtypes); char * (*get_name) (CamelService *service, gboolean brief); char * (*get_path) (CamelService *service); } CamelServiceClass; /* query_auth_types returns a GList of these */ typedef struct { char *name, *description, *authproto; gboolean need_password; } CamelServiceAuthType; /* public methods */ void camel_service_construct (CamelService *service, CamelSession *session, CamelProvider *provider, CamelURL *url, CamelException *ex); gboolean camel_service_connect (CamelService *service, CamelException *ex); gboolean camel_service_disconnect (CamelService *service, gboolean clean, CamelException *ex); char * camel_service_get_url (CamelService *service); char * camel_service_get_name (CamelService *service, gboolean brief); char * camel_service_get_path (CamelService *service); CamelSession * camel_service_get_session (CamelService *service); CamelProvider * camel_service_get_provider (CamelService *service); GList * camel_service_query_auth_types (CamelService *service, gboolean connect, CamelException *ex); void camel_service_free_auth_types (CamelService *service, GList *authtypes); /* convenience functions */ struct hostent * camel_service_gethost (CamelService *service, CamelException *ex); /* Standard Camel function */ CamelType camel_service_get_type (void); #ifdef __cplusplus } #endif /* __cplusplus */ #endif /* CAMEL_SERVICE_H */ efile?id=2c467c5afbd45537746e9d808e5e92481c8d28b9'>plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
# Created by: Clement Laforet <sheepkiller@cultdeadsheep.org>
# $FreeBSD$

PORTNAME=   dbmail
PORTVERSION=    2.2.18
PORTREVISION=   4
CATEGORIES= mail
MASTER_SITES=   http://www.dbmail.org/download/2.2/
PKGNAMESUFFIX=  22

MAINTAINER= bofh@FreeBSD.org
COMMENT=    SQL database-based mail system (POP3 and IMAP)

LICENSE=    GPLv2

LIB_DEPENDS=    libgmime-2.0.so:mail/gmime2

CONFLICTS=  dbmail-3.*

OPTIONS_DEFINE= DOCS LDAP SIEVE
OPTIONS_DEFAULT=MYSQL
OPTIONS_MULTI=  DB
OPTIONS_MULTI_DB=MYSQL PGSQL SQLITE
SIEVE_DESC= Support for Sieve mail sorting language

OPTIONS_SUB=    yes

MYSQL_USE=  MYSQL=yes
MYSQL_CONFIGURE_WITH=   mysql
SQLITE_USES=    sqlite:3
SQLITE_CONFIGURE_WITH=  sqlite
PGSQL_USES= pgsql
PGSQL_CONFIGURE_WITH=   pgsql
SIEVE_CONFIGURE_WITH=   sieve
SIEVE_LIB_DEPENDS=  libsieve.so:mail/libsieve
LDAP_CONFIGURE_WITH=    ldap
LDAP_USE=       OPENLDAP=yes
INSTALL_TARGET= install-strip

GNU_CONFIGURE=  yes
USES=       gmake libtool pkgconfig
USE_LDCONFIG=   ${PREFIX}/lib/dbmail
USE_RC_SUBR=    dbmail-pop3d dbmail-lmtpd dbmail-imapd dbmail-timsieved
USE_GNOME=  glib20
USE_OPENSSL=    yes

CFLAGS+=    -I${LOCALBASE}/include
LDFLAGS+=   -L${LOCALBASE}/lib
CONFIGURE_ENV+= LOCALBASE=${LOCALBASE}
CONFIGURE_ARGS+=    --with-pkglibdir=${LOCALBASE}/lib/dbmail
MAKE_ARGS+= mandir=${MANPREFIX}/man

PORTDOCS=   AUTHORS BUGS COPYING INSTALL NEWS README \
        README.aliases README.exim README.ldap \
        README.postfix README.qmail README.sieve \
        README.smtp README.solaris README.usermap \
        THANKS
SUB_FILES=  pkg-message

PLIST_SUB+= PORTNAME=${PORTNAME}

.include <bsd.port.options.mk>

.if ${PORT_OPTIONS:MMYSQL}
DATABASE+=  mysql
.endif

.if ${PORT_OPTIONS:MPGSQL}
DATABASE+=  postgresql
.endif

.if ${PORT_OPTIONS:MSQLITE}
DATABASE+=  sqlite
.endif

post-patch:
    @${FIND} ${WRKSRC} -name CVS -type d | ${XARGS} ${RM} -r
    @${FIND} ${WRKSRC} -name *.orig -type f -delete

post-configure:
    @${REINPLACE_CMD} -i.orig 's!/etc/dbmail.conf!${PREFIX}/etc/dbmail.conf!g' \
                ${WRKSRC}/dbmail.h

post-install:
    @${INSTALL_DATA} ${WRKSRC}/dbmail.conf ${STAGEDIR}${PREFIX}/etc/dbmail.conf-dist
    @${MKDIR} ${STAGEDIR}${DATADIR}
    @for f in ${DATABASE}; do \
      ${MKDIR} ${STAGEDIR}${DATADIR}/$$f ; \
      ${INSTALL_DATA} ${WRKSRC}/sql/$$f/* ${STAGEDIR}${DATADIR}/$$f; \
    done
    @${MKDIR} ${STAGEDIR}${DOCSDIR}
    @cd ${WRKSRC} && ${INSTALL_DATA} ${PORTDOCS} ${STAGEDIR}${DOCSDIR}

.include <bsd.port.mk>