Ravenports generated: 14 Jan 2024 04:52
[ravenports.git] / bucket_51 / cyrus-sasl
1 # Buildsheet autogenerated by ravenadm tool -- Do not edit.
2
3 NAMEBASE=               cyrus-sasl
4 VERSION=                2.1.28
5 REVISION=               1
6 KEYWORDS=               security
7 VARIANTS=               standard
8 SDESC[standard]=        Cyrus Simple Authentication Service Layer (SASL)
9 HOMEPAGE=               https://www.cyrusimap.org/sasl/
10 CONTACT=                nobody
11
12 DOWNLOAD_GROUPS=        main
13 SITES[main]=            https://github.com/cyrusimap/cyrus-sasl/releases/download/cyrus-sasl-2.1.28/
14 DISTFILE[1]=            cyrus-sasl-2.1.28.tar.gz:main
15 DF_INDEX=               1
16 SPKGS[standard]=        complete
17                         primary
18                         docs
19
20 OPTIONS_AVAILABLE=      none
21 OPTIONS_STANDARD=       none
22
23 USERS=                  cyrus
24 GROUPS=                 cyrus
25 USERGROUP_SPKG=         primary
26
27 USES=                   cpe gmake libtool:keepla perl:build bdb ssl mbsdfix
28
29 LICENSE=                BSD4CLAUSE:primary
30 LICENSE_FILE=           BSD4CLAUSE:{{WRKSRC}}/COPYING
31 LICENSE_SCHEME=         solo
32
33 CPE_VENDOR=             cyrusimap
34 FPC_EQUIVALENT=         security/cyrus-sasl2
35
36 MUST_CONFIGURE=         gnu
37 CONFIGURE_ARGS=         --disable-alwaystrue
38                         --disable-keep-db-open
39                         --disable-srp
40                         --disable-krb4
41                         --disable-gssapi
42                         --disable-otp
43                         --disable-sample
44                         --enable-anon
45                         --enable-cram
46                         --enable-digest
47                         --enable-login
48                         --enable-ntlm
49                         --enable-plain
50                         --enable-scram
51                         --sysconfdir={{PREFIX}}/etc
52                         --with-dblib=berkeley
53                         --with-bdb-libdir={{BDB_LIB_DIR}}
54                         --with-bdb-incdir={{BDB_INCLUDE_DIR}}
55                         --with-authdaemond=/var/run/authdaemond/socket
56                         --with-configdir={{PREFIX}}/lib/sasl2:{{PREFIX}}/etc/sasl2
57                         --with-plugindir={{PREFIX}}/lib/sasl2
58                         --with-dbpath={{PREFIX}}/etc/sasldb2
59                         --with-lib-subdir=lib
60                         --includedir={{PREFIX}}/include
61                         --enable-static
62                         --with-rc4=openssl
63                         --with-saslauthd=/var/run/saslauthd
64                         --with-openssl={{OPENSSLBASE}}
65
66 SINGLE_JOB=             yes
67
68 INSTALL_REQ_TOOLCHAIN=  yes
69 SOVERSION=              3.0.0
70 PLIST_SUB=              UNDERSCORE=1.13.1
71                         JQUERY=3.5.1
72 SUB_FILES=              pkg-install-primary
73                         pkg-deinstall-primary
74 SUB_LIST=               SASLDB_NAME=sasldb2
75                         CYRUS_USER=cyrus
76
77 CFLAGS=                 -Wno-pointer-sign
78 VAR_OPSYS[netbsd]=      CONFIGURE_ENV=ac_cv_lib_dl_dlopen=no
79 VAR_ARCH[x86_64]=       CPPFLAGS=-fPIC
80
81 post-install:
82         ${MKDIR} ${STAGEDIR}${STD_DOCDIR}
83         (cd ${WRKSRC}/doc && ${COPYTREE_SHARE} . ${STAGEDIR}${STD_DOCDIR} \
84                 "! \( -path */html/_sources* \
85                 -o -name .buildinfo \
86                 -o -name Makefile \
87                 -o -name Makefile.in \
88                 -o -name Makefile.in.bak \
89                 -o -name Makefile.am \
90                 -o -name NTMakefile \
91                 -o -name .cvsignore \)" \
92         )
93         (cd ${WRKSRC} && \
94                 ${INSTALL_DATA} AUTHORS ChangeLog INSTALL.TXT README ${STAGEDIR}${STD_DOCDIR})
95         ${INSTALL_DATA} ${FILESDIR}/Sendmail.README ${STAGEDIR}${STD_DOCDIR}
96         ${STRIP_CMD} ${STAGEDIR}${PREFIX}/lib/sasl2/*.${LIBEXT}
97         ${STRIP_CMD} ${STAGEDIR}${PREFIX}/lib/*.${LIBEXT}
98
99 post-configure:
100         # work around horrible libtool
101         ${REINPLACE_CMD} -e "/^archive_cmds=/ \
102                 s|linkopts|linkopts -Wl,-R,${BDB_LIB_DIR}:${OPENSSLRPATH}|" \
103                 ${WRKSRC}/libtool
104
105 [FILE:460:descriptions/desc.primary]
106 The Cyrus SASL (Simple Authentication and Security Layer)
107
108 SASL is the Simple Authentication and Security Layer, a method for
109 adding authentication support to connection-based protocols.  To use
110 SASL, a protocol includes a command for identifying and authenticating
111 a user to a server and for optionally negotiating protection of
112 subsequent protocol interactions. If its use is negotiated, a security
113 layer is inserted between the protocol and the connection.
114
115
116 [FILE:103:distinfo]
117 7ccfc6abd01ed67c1a0924b353e526f1b766b21f42d4562ee635a8ebfc5bb38c      4034803 cyrus-sasl-2.1.28.tar.gz
118
119
120 [FILE:2072:manifests/plist.primary]
121 include/sasl/
122  hmac-md5.h
123  md5.h
124  md5global.h
125  prop.h
126  sasl.h
127  saslplug.h
128  saslutil.h
129 lib/
130  libsasl2.a
131  libsasl2.la
132  libsasl2.so
133  libsasl2.so.%%SOMAJOR%%
134  libsasl2.so.%%SOVERSION%%
135 lib/pkgconfig/libsasl2.pc
136 lib/sasl2/
137  libanonymous.a
138  libanonymous.la
139  libanonymous.so
140  libanonymous.so.%%SOMAJOR%%
141  libanonymous.so.%%SOVERSION%%
142  libcrammd5.a
143  libcrammd5.la
144  libcrammd5.so
145  libcrammd5.so.%%SOMAJOR%%
146  libcrammd5.so.%%SOVERSION%%
147  libdigestmd5.a
148  libdigestmd5.la
149  libdigestmd5.so
150  libdigestmd5.so.%%SOMAJOR%%
151  libdigestmd5.so.%%SOVERSION%%
152  liblogin.a
153  liblogin.la
154  liblogin.so
155  liblogin.so.%%SOMAJOR%%
156  liblogin.so.%%SOVERSION%%
157  libntlm.a
158  libntlm.la
159  libntlm.so
160  libntlm.so.%%SOMAJOR%%
161  libntlm.so.%%SOVERSION%%
162  libplain.a
163  libplain.la
164  libplain.so
165  libplain.so.%%SOMAJOR%%
166  libplain.so.%%SOVERSION%%
167  libsasldb.a
168  libsasldb.la
169  libsasldb.so
170  libsasldb.so.%%SOMAJOR%%
171  libsasldb.so.%%SOVERSION%%
172  libscram.a
173  libscram.la
174  libscram.so
175  libscram.so.%%SOMAJOR%%
176  libscram.so.%%SOVERSION%%
177 sbin/
178  pluginviewer
179  sasldblistusers2
180  saslpasswd2
181 share/man/man3/
182  sasl.3.gz
183  sasl_authorize_t.3.gz
184  sasl_auxprop.3.gz
185  sasl_auxprop_getctx.3.gz
186  sasl_auxprop_request.3.gz
187  sasl_callbacks.3.gz
188  sasl_canon_user_t.3.gz
189  sasl_chalprompt_t.3.gz
190  sasl_checkapop.3.gz
191  sasl_checkpass.3.gz
192  sasl_client_init.3.gz
193  sasl_client_new.3.gz
194  sasl_client_start.3.gz
195  sasl_client_step.3.gz
196  sasl_decode.3.gz
197  sasl_dispose.3.gz
198  sasl_done.3.gz
199  sasl_encode.3.gz
200  sasl_encodev.3.gz
201  sasl_errdetail.3.gz
202  sasl_errors.3.gz
203  sasl_errstring.3.gz
204  sasl_getconfpath_t.3.gz
205  sasl_getopt_t.3.gz
206  sasl_getpath_t.3.gz
207  sasl_getprop.3.gz
208  sasl_getrealm_t.3.gz
209  sasl_getsecret_t.3.gz
210  sasl_getsimple_t.3.gz
211  sasl_global_listmech.3.gz
212  sasl_idle.3.gz
213  sasl_listmech.3.gz
214  sasl_log_t.3.gz
215  sasl_server_init.3.gz
216  sasl_server_new.3.gz
217  sasl_server_start.3.gz
218  sasl_server_step.3.gz
219  sasl_server_userdb_checkpass_t.3.gz
220  sasl_server_userdb_setpass_t.3.gz
221  sasl_setpass.3.gz
222  sasl_setprop.3.gz
223  sasl_user_exists.3.gz
224  sasl_verifyfile_t.3.gz
225 share/man/man8/
226  pluginviewer.8.gz
227  sasldblistusers2.8.gz
228  saslpasswd2.8.gz
229
230
231 [FILE:4070:manifests/plist.docs]
232 share/doc/cyrus-sasl/
233  AUTHORS
234  ChangeLog
235  INSTALL.TXT
236  README
237  Sendmail.README
238 share/doc/cyrus-sasl/html/
239  developer.html
240  download.html
241  genindex.html
242  getsasl.html
243  index.html
244  objects.inv
245  operations.html
246  packager.html
247  search.html
248  searchindex.js
249  setup.html
250  support.html
251 share/doc/cyrus-sasl/html/_static/
252  basic.css
253  cyrus.css
254  doctools.js
255  documentation_options.js
256  file.png
257  graphviz.css
258  headimg.gif
259  jquery-%%JQUERY%%.js
260  jquery.js
261  language_data.js
262  minus.png
263  plus.png
264  pygments.css
265  searchtools.js
266  underscore-%%UNDERSCORE%%.js
267  underscore.js
268 share/doc/cyrus-sasl/html/_static/css/
269  badge_only.css
270  theme.css
271 share/doc/cyrus-sasl/html/_static/event_notifications/
272  AclChange.json
273  ApplePushService.json
274  CalendarAlarm.json
275  FlagsClear.json
276  FlagsSet.json
277  Login.json
278  Logout.json
279  MailboxCreate.json
280  MailboxDelete.json
281  MailboxRename.json
282  MailboxSubscribe.json
283  MailboxUnSubscribe.json
284  MessageAppend.json
285  MessageCopy.json
286  MessageExpunge.json
287  MessageMove.json
288  MessageNew.json
289  MessageRead.json
290  MessageTrash.json
291  QuotaChange.json
292  QuotaExceed.json
293  QuotaWithin.json
294 share/doc/cyrus-sasl/html/_static/fonts/
295  Inconsolata-Bold.ttf
296  Inconsolata.ttf
297  Lato-Bold.ttf
298  Lato-Regular.ttf
299  RobotoSlab-Bold.ttf
300  RobotoSlab-Regular.ttf
301  fontawesome-webfont.eot
302  fontawesome-webfont.svg
303  fontawesome-webfont.ttf
304  fontawesome-webfont.woff
305 share/doc/cyrus-sasl/html/_static/js/
306  modernizr.min.js
307  theme.js
308 share/doc/cyrus-sasl/html/sasl/
309  advanced.html
310  appconvert.html
311  authentication_mechanisms.html
312  auxiliary_properties.html
313  components.html
314  concepts.html
315  faq.html
316  gssapi.html
317  installation.html
318  macosx.html
319  manpages.html
320  options.html
321  os390.html
322  pwcheck.html
323  quickstart.html
324  resources.html
325  sysadmin.html
326  upgrading.html
327  windows.html
328 share/doc/cyrus-sasl/html/sasl/developer/
329  installation.html
330  plugprog.html
331  programming.html
332  testing.html
333 share/doc/cyrus-sasl/html/sasl/faqs/
334  authorize-vs-authenticate.html
335  crammd5-digestmd5-scram.html
336  openldap-sasl-gssapi.html
337  plaintextpasswords.html
338  rfcs.html
339  upgrade-saslv2.html
340 share/doc/cyrus-sasl/html/sasl/reference/manpages/template.html
341 share/doc/cyrus-sasl/html/sasl/reference/manpages/library/
342  sasl.html
343  sasl_authorize_t.html
344  sasl_auxprop.html
345  sasl_auxprop_add_plugin.html
346  sasl_auxprop_getctx.html
347  sasl_auxprop_request.html
348  sasl_callbacks.html
349  sasl_canon_user_t.html
350  sasl_canonuser_add_plugin.html
351  sasl_chalprompt_t.html
352  sasl_checkapop.html
353  sasl_checkpass.html
354  sasl_client_add_plugin.html
355  sasl_client_done.html
356  sasl_client_init.html
357  sasl_client_new.html
358  sasl_client_plug_init_t.html
359  sasl_client_start.html
360  sasl_client_step.html
361  sasl_decode.html
362  sasl_decode64.html
363  sasl_dispose.html
364  sasl_done.html
365  sasl_encode.html
366  sasl_encode64.html
367  sasl_encodev.html
368  sasl_erasebuffer.html
369  sasl_errdetail.html
370  sasl_errors.html
371  sasl_errstring.html
372  sasl_getcallback_t.html
373  sasl_getconfpath_t.html
374  sasl_getopt_t.html
375  sasl_getpath_t.html
376  sasl_getprop.html
377  sasl_getrealm_t.html
378  sasl_getsecret_t.html
379  sasl_getsimple_t.html
380  sasl_global_listmech.html
381  sasl_idle.html
382  sasl_listmech.html
383  sasl_log_t.html
384  sasl_server_add_plugin.html
385  sasl_server_done.html
386  sasl_server_init.html
387  sasl_server_new.html
388  sasl_server_plug_init_t.html
389  sasl_server_start.html
390  sasl_server_step.html
391  sasl_server_userdb_checkpass_t.html
392  sasl_server_userdb_setpass_t.html
393  sasl_set_alloc.html
394  sasl_set_mutex.html
395  sasl_seterror.html
396  sasl_setpass.html
397  sasl_setprop.html
398  sasl_user_exists.html
399  sasl_usererr.html
400  sasl_utf8verify.html
401  sasl_verifyfile_t.html
402 share/doc/cyrus-sasl/html/sasl/release-notes/index.html
403 share/doc/cyrus-sasl/html/sasl/release-notes/1/index.html
404 share/doc/cyrus-sasl/html/sasl/release-notes/2.0/index.html
405 share/doc/cyrus-sasl/html/sasl/release-notes/2.1/index.html
406 share/doc/cyrus-sasl/legacy/
407  TODO
408  advanced.html
409  appconvert.html
410  components.html
411  gssapi.html
412  index.html
413  install.html
414  macosx.html
415  mechanisms.html
416  options.html
417  os390.html
418  plugprog.html
419  programming.html
420  readme.html
421  server-plugin-flow.fig
422  sysadmin.html
423  testing.txt
424  upgrading.html
425  windows.html
426
427
428 [FILE:1733:patches/patch-configure]
429 --- configure.orig      2022-02-18 21:53:52 UTC
430 +++ configure
431 @@ -15244,6 +15244,8 @@ else
432    SASLAUTHD_TRUE='#'
433    SASLAUTHD_FALSE=
434  fi
435 +SASLAUTHD_TRUE='#'
436 +SASLAUTHD_FALSE=
437  
438  { $as_echo "$as_me:${as_lineno-$LINENO}: checking if I should include saslauthd" >&5
439  $as_echo_n "checking if I should include saslauthd... " >&6; }
440 @@ -16859,6 +16861,7 @@ fi
441       gssapi_dir="${gssapi}/lib"
442       GSSAPIBASE_LIBS="-L$gssapi_dir"
443       GSSAPIBASE_STATIC_LIBS="-L$gssapi_dir"
444 +     gssapi_bindir="${gssapi}/bin/"
445    else
446       # FIXME: This is only used for building cyrus, and then only as
447       # a real hack.  it needs to be fixed.
448 @@ -16878,7 +16881,7 @@ if ${ac_cv_lib_gssapi_gss_unwrap+:} fals
449    $as_echo_n "(cached) " >&6
450  else
451    ac_check_lib_save_LIBS=$LIBS
452 -LIBS="-lgssapi ${GSSAPIBASE_LIBS} -lgssapi -lkrb5 -lasn1 -lroken ${LIB_CRYPT} ${LIB_DES} -lcom_err ${LIB_SOCKET} $LIBS"
453 +LIBS="${GSSAPIBASE_LIBS} `${gssapi_bindir}krb5-config --libs gssapi` $LIBS"
454  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
455  /* end confdefs.h.  */
456  
457 @@ -17138,7 +17141,7 @@ fi
458      GSSAPIBASE_STATIC_LIBS="$GSSAPIBASE_LIBS $gssapi_dir/libgssapi_krb5.a $gssapi_dir/libkrb5.a $gssapi_dir/libk5crypto.a $gssapi_dir/libcom_err.a"
459    elif test "$gss_impl" = "heimdal"; then
460      CPPFLAGS="$CPPFLAGS"
461 -    GSSAPIBASE_LIBS="$GSSAPIBASE_LIBS -lgssapi -lkrb5 -lasn1 -lroken ${LIB_CRYPT} ${LIB_DES} -lcom_err"
462 +    GSSAPIBASE_LIBS="$GSSAPIBASE_LIBS `${gssapi_bindir}krb5-config --libs gssapi`"
463      GSSAPIBASE_STATIC_LIBS="$GSSAPIBASE_STATIC_LIBS $gssapi_dir/libgssapi.a $gssapi_dir/libkrb5.a $gssapi_dir/libasn1.a $gssapi_dir/libroken.a $gssapi_dir/libcom_err.a ${LIB_CRYPT}"
464    elif test "$gss_impl" = "cybersafe03"; then
465  # Version of CyberSafe with two libraries
466
467
468 [FILE:348:patches/patch-plugins_gssapi.c]
469 --- plugins/gssapi.c.orig       2022-02-18 21:53:25 UTC
470 +++ plugins/gssapi.c
471 @@ -1668,8 +1668,10 @@ static int gssapi_client_mech_step(void
472      if (clientoutlen)
473          *clientoutlen = 0;
474      
475 +#if 0
476      params->utils->log(params->utils->conn, SASL_LOG_DEBUG,
477                        "GSSAPI client step %d", text->state);
478 +#endif
479  
480      switch (text->state) {
481  
482
483
484 [FILE:718:patches/patch-utils__Makefile.in]
485 --- utils/Makefile.in.orig      2022-02-18 21:53:55 UTC
486 +++ utils/Makefile.in
487 @@ -495,7 +495,7 @@ top_srcdir = @top_srcdir@
488  all_sasl_libs = ../lib/libsasl2.la $(SASL_DB_LIB) $(LIB_SOCKET)
489  all_sasl_static_libs = ../lib/.libs/libsasl2.a $(SASL_DB_LIB) $(LIB_SOCKET) $(GSSAPIBASE_LIBS) $(GSSAPI_LIBS) $(SASL_KRB_LIB) $(LIB_DES) $(PLAIN_LIBS) $(SRP_LIBS) $(LIB_MYSQL) $(LIB_PGSQL) $(LIB_SQLITE)
490  @NO_SASL_DB_MANS_FALSE@man_MANS = saslpasswd2.8 sasldblistusers2.8 pluginviewer.8
491 -@NO_SASL_DB_MANS_TRUE@man_MANS = 
492 +@NO_SASL_DB_MANS_TRUE@man_MANS = pluginviewer.8
493  saslpasswd2_LDADD = ../sasldb/libsasldb.la $(all_sasl_libs)
494  saslpasswd2_SOURCES = saslpasswd.c
495  sasldblistusers2_LDADD = ../sasldb/libsasldb.la $(all_sasl_libs)
496
497
498 [FILE:2307:files/Sendmail.README]
499 How to enable SMTP AUTH with FreeBSD default Sendmail
500
501 1) Add the following to  /etc/make.conf:
502
503     # Add SMTP AUTH support to Sendmail
504     SENDMAIL_CFLAGS+=   -I/usr/local/include -DSASL=2
505     SENDMAIL_LDFLAGS+=  -L/usr/local/lib
506     SENDMAIL_LDADD+=    -lsasl2
507
508 2) Rebuild FreeBSD (make buildworld, ...)
509
510 3) Make sure that the pwcheck_method is correct in Sendmail.conf.
511
512    Sendmail.conf (${PREFIX}/lib/sasl2/Sendmail.conf) is created by
513    the cyrus-sasl2 ports during installation.  It may have
514    pwcheck_method set to saslauthd by default.  Change this to what is
515    appropriate for your site.
516
517 4) Add the following to your sendmail.mc file:
518
519    dnl The group needs to be mail in order to read the sasldb2 file
520    define(`confRUN_AS_USER',`root:mail')dnl
521
522    TRUST_AUTH_MECH(`DIGEST-MD5 CRAM-MD5')dnl
523    define(`confAUTH_MECHANISMS',`DIGEST-MD5 CRAM-MD5')dnl
524
525    define(`confDONT_BLAME_SENDMAIL',`GroupReadableSASLDBFile')dnl
526
527 5) Add the following before FEATURE(msp) in your submit.mc file:
528
529    DAEMON_OPTIONS(`Name=NoMTA, Addr=127.0.0.1, M=EA')dnl
530
531    This disables SMTP AUTH on the loopback interface. Otherwise you may get
532    the following error in the log:
533
534         error: safesasl(/usr/local/etc/sasldb2) failed: Group readable file
535
536    when sending mail locally (seen when using pine locally on same server).
537
538  ----
539
540    Additional AUTH Mechanisms are LOGIN, PLAIN, GSSAPI, and KERBEROS_V4.
541    These can be added to TRUST_AUTH_MECH and confAUTH_MECHANISMS as a space
542    seperated list.  You may want to restrict LOGIN, and PLAIN authentication
543    methods for use with STARTTLS, as the password is not encrypted when
544    passed to sendmail.
545
546    LOGIN is required for Outlook Express users.  "My server requires
547    authentication" needs to be checked in the accounts properties to 
548    use SASL Authentication.
549
550    PLAIN is required for Netscape Communicator users.  By default Netscape
551    Communicator will use SASL Authentication when sendmail is compiled with
552    SASL and will cause your users to enter their passwords each time they
553    retreive their mail (NS 4.7).
554
555    The DONT_BLAME_SENDMAIL option GroupReadableSASLDBFile is needed when you
556    are using cyrus-imapd and sendmail on the same server that requires access
557    to the sasldb2 database.
558
559    SASLv2 support of Sendmail is starting with 8.12.4.
560
561
562 [FILE:704:files/pkg-deinstall-primary.in]
563 #!/bin/sh
564 #
565
566 PKG_BATCH=${BATCH:=NO}
567 PKG_PREFIX=${PKG_PREFIX:=%%PREFIX%%}
568 SASLDB_NAME=%%SASLDB_NAME%%
569 SASLDB_NAME=${SASLDB_NAME:+${PKG_PREFIX}/etc/%%SASLDB_NAME%%}
570 CYRUS_USER=${CYRUS_USER:=%%CYRUS_USER%%}
571
572 # delete sasldb database
573 delete_sasldb() {
574         if [ -f ${SASLDB_NAME} ] ; then
575                 if [ `${PKG_PREFIX}/sbin/sasldblistusers2 | wc -l` -eq 0 ]; then
576                         echo "Removing ${SASLDB_NAME} as part of cyrus-sasl deinstallation."
577                         rm ${SASLDB_NAME}
578                         if [ -f ${SASLDB_NAME}-lock ] ; then
579                                 rm ${SASLDB_NAME}-lock
580                         fi
581                 else
582                         echo "WARNING: Users SASL passwords are in ${SASLDB_NAME}, keeping this file"
583                 fi
584         fi
585 }
586
587 case $2 in
588         DEINSTALL)
589                 if [ -n "${SASLDB_NAME}" ]; then
590                         delete_sasldb
591                 fi
592                 ;;
593 esac
594
595
596 [FILE:1140:files/pkg-install-primary.in]
597 #!/bin/sh
598 #
599
600 PKG_BATCH=${BATCH:=NO}
601 PKG_PREFIX=${PKG_PREFIX:=%%PREFIX%%}
602 SASLDB_NAME=%%SASLDB_NAME%%
603 SASLDB_NAME=${SASLDB_NAME:+${PKG_PREFIX}/etc/%%SASLDB_NAME%%}
604 CYRUS_USER=${CYRUS_USER:=%%CYRUS_USER%%}
605
606 create_sasldb() {
607         if [ ! -f ${SASLDB_NAME} ]; then
608                 echo "test" | ${PKG_PREFIX}/sbin/saslpasswd2 -p -c ${CYRUS_USER}
609                 if [ `${PKG_PREFIX}/sbin/sasldblistusers2 | wc -l` -eq 0 ] ; then
610                         echo "WARNING: Failed to create ${SASLDB_NAME}"
611                 else
612                         ${PKG_PREFIX}/sbin/saslpasswd2 -d ${CYRUS_USER}
613                         chown ${CYRUS_USER}:mail ${SASLDB_NAME}
614                         chmod 640 ${SASLDB_NAME}
615                         if [ -f ${SASLDB_NAME}-lock ]; then
616                                 chown ${CYRUS_USER}:mail ${SASLDB_NAME}-lock
617                                 chmod 640 ${SASLDB_NAME}-lock
618                         fi
619                 fi
620         fi
621 }
622
623 case $2 in
624         POST-INSTALL)
625                 if [ "${PKG_BATCH}" = "NO" ]; then
626                         if [ -n "${SASLDB_NAME}" ]; then
627                                 create_sasldb
628                         fi
629                 elif [ -n "${SASLDB_NAME}" -a ! -f ${SASLDB_NAME} ]; then
630                         echo "*** We do not create ${SASLDB_NAME} automatically in"
631                         echo "*** BATCH mode.  Please create it by yourself.  It should be"
632                         echo "*** owner: ${CYRUS_USER}, group: mail, mode: 0640."
633                 fi
634                 ;;
635 esac
636