Hello all.
I try to add Autocreate plugin patch to my FreeBSD host. I think I make all wrong. Could you tell me how to patch it?
What I do:
cd /usr/ports/mail/dovecot make extract cd cd work/dovecot-1.1.6/src/ fetch http://www.dovecot.org/patches/1.1/autocreate-plugin.c sh -x /tmp/patch.sh
- export DOVECOT=~/usr/ports/mail/dovecot/work/dovecot-1.1.6/src
- gcc -fPIC -shared -g -Wall -I~/usr/ports/mail/dovecot/work/dovecot-1.1.6/src -I~/usr/ports/mail/dovecot/work/dovecot-1.1.6/src/src/lib -I~/usr/ports/mail/dovecot/work/dovecot-1.1.6/src/src/lib-storage -I~/usr/ports/mail/dovecot/work/dovecot-1.1.6/src/src/lib-mail -I~/usr/ports/mail/dovecot/work/dovecot-1.1.6/src/src/lib-imap -DHAVE_CONFIG_H autocreate-plugin.c -o autocreate_plugin.so autocreate-plugin.c:22:17: error: lib.h: No such file or directory autocreate-plugin.c:23:26: error: mail-storage.h: No such file or directory autocreate-plugin.c:24:28: error: mail-namespace.h: No such file or directory autocreate-plugin.c:28: error: 'PACKAGE_VERSION' undeclared here (not in a function) autocreate-plugin.c:31: warning: 'struct mail_namespace' declared inside parameter list autocreate-plugin.c:31: warning: its scope is only this definition or declaration, which is probably not what you want autocreate-plugin.c:33: warning: 'struct mail_namespace' declared inside parameter list autocreate-plugin.c: In function 'autocreate_mailboxes': autocreate-plugin.c:43: warning: implicit declaration of function 'mail_namespace_find' autocreate-plugin.c:43: warning: assignment makes pointer from integer without a cast autocreate-plugin.c:45: warning: implicit declaration of function 'mail_storage_mailbox_create' autocreate-plugin.c:45: error: dereferencing pointer to incomplete type autocreate-plugin.c:46: error: 'FALSE' undeclared (first use in this function) autocreate-plugin.c:46: error: (Each undeclared identifier is reported only once autocreate-plugin.c:46: error: for each function it appears in.) autocreate-plugin.c:49: warning: implicit declaration of function 'i_snprintf' autocreate-plugin.c: At top level: autocreate-plugin.c:54: warning: 'struct mail_namespace' declared inside parameter list autocreate-plugin.c: In function 'autosubscribe_mailboxes': autocreate-plugin.c:64: warning: assignment makes pointer from integer without a cast autocreate-plugin.c:66: warning: implicit declaration of function 'mailbox_list_set_subscribed' autocreate-plugin.c:66: error: dereferencing pointer to incomplete type autocreate-plugin.c:66: error: 'TRUE' undeclared (first use in this function) autocreate-plugin.c: At top level: autocreate-plugin.c:74: warning: 'struct mail_namespace' declared inside parameter list autocreate-plugin.c: In function 'autocreate_mail_namespaces_created': autocreate-plugin.c:77: warning: passing argument 1 of 'autocreate_next_hook_mail_namespaces_created' from incompatible pointer type autocreate-plugin.c:79: warning: passing argument 1 of 'autocreate_mailboxes' from incompatible pointer type autocreate-plugin.c:80: warning: passing argument 1 of 'autosubscribe_mailboxes' from incompatible pointer type autocreate-plugin.c: In function 'autocreate_plugin_init': autocreate-plugin.c:89: error: 'hook_mail_namespaces_created' undeclared (first use in this function) autocreate-plugin.c: In function 'autocreate_plugin_deinit': autocreate-plugin.c:95: error: 'hook_mail_namespaces_created' undeclared (first use in this function)
- cp autocreate_plugin.so /usr/local/lib/dovecot/imap/autocreate_plugin.so cp: autocreate_plugin.so: No such file or directory
P.S. cat /tmp/patch.sh
# replace * with the correct version: export DOVECOT=~/usr/ports/mail/dovecot/work/dovecot-1.1.6/src
gcc -fPIC -shared -g -Wall -I$DOVECOT -I$DOVECOT/src/lib
-I$DOVECOT/src/lib-storage -I$DOVECOT/src/lib-mail
-I$DOVECOT/src/lib-imap -DHAVE_CONFIG_H
autocreate-plugin.c -o autocreate_plugin.so
# $PREFIX is the installation directory, e.g. /usr/local or /usr: cp autocreate_plugin.so /usr/local/lib/dovecot/imap/autocreate_plugin.so
-- Best regards, Proskurin Kirill