~tgc/mailman/2.1-da

1139 by Barry Warsaw
Python 2.4 is a minimum. Also, fix some autoconf complaints and remove
1
# Copyright (C) 1998-2008 by the Free Software Foundation, Inc.
1 by
This commit was manufactured by cvs2svn to create branch
2
#
3
# This program is free software; you can redistribute it and/or
4
# modify it under the terms of the GNU General Public License
5
# as published by the Free Software Foundation; either version 2
6
# of the License, or (at your option) any later version.
7
#
8
# This program is distributed in the hope that it will be useful,
9
# but WITHOUT ANY WARRANTY; without even the implied warranty of
10
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
11
# GNU General Public License for more details.
12
#
13
# You should have received a copy of the GNU General Public License
14
# along with this program; if not, write to the Free Software
749 by tkikuchi
FSF office has moved to 51 Franklin Street.
15
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
1 by
This commit was manufactured by cvs2svn to create branch
16
17
dnl Process this file with autoconf to produce a configure script.
955 by bwarsaw
Port the Mailman trunk's export.py script to Mailman 2.1. Anyone wanting to
18
AC_REVISION($Revision: 8122 $)
1 by
This commit was manufactured by cvs2svn to create branch
19
AC_PREREQ(2.0)
20
AC_INIT(src/common.h)
21
22
23
# /usr/local/mailman is the default installation directory
24
AC_PREFIX_DEFAULT(/usr/local/mailman)
25
26
27
# Check for Python!  Better be found on $PATH
28
AC_MSG_CHECKING(for --with-python)
29
AC_ARG_WITH(python, dnl
30
[  --with-python                specify path to Python interpreter])
31
case "$with_python" in
32
    "") ans="no";;
33
    *)  ans="$with_python"
34
esac
35
AC_MSG_RESULT($ans)
36
37
if test -z "$with_python"
38
then
39
        AC_PATH_PROG(with_python, python, /usr/local/bin/python)
40
fi
41
42
AC_MSG_CHECKING(Python interpreter)
43
if test ! -x $with_python
44
then
45
    AC_MSG_ERROR([
46
47
***** No Python interpreter found!
48
***** Try including the configure option
49
***** --with-python=/path/to/python/interpreter])
50
fi
51
AC_SUBST(PYTHON)
52
PYTHON=$with_python
53
AC_MSG_RESULT($PYTHON)
54
1134 by Barry Warsaw
Try to guess whether the email package is actually needed or not.
55
# See if Python is new enough.
1 by
This commit was manufactured by cvs2svn to create branch
56
AC_MSG_CHECKING(Python version)
57
changequote(,)
58
cat > conftest.py <<EOF
59
import sys
60
try:
61
    v = sys.hexversion
62
except AttributeError:
63
    v = 0
1139 by Barry Warsaw
Python 2.4 is a minimum. Also, fix some autoconf complaints and remove
64
if v >= 0x2040000:
1 by
This commit was manufactured by cvs2svn to create branch
65
    s = sys.version.split()[0]
66
else:
67
    s = ""
68
fp = open("conftest.out", "w")
69
fp.write("%s\n" % s)
70
fp.close()
71
EOF
72
changequote([, ])
73
$PYTHON conftest.py
74
version=`cat conftest.out`
75
rm -f conftest.out conftest.py
76
if test -z "$version"
77
then
78
    AC_MSG_ERROR([
79
80
***** $PYTHON is too old (or broken)
1139 by Barry Warsaw
Python 2.4 is a minimum. Also, fix some autoconf complaints and remove
81
***** Python 2.4 or newer is required])
1 by
This commit was manufactured by cvs2svn to create branch
82
fi
83
AC_MSG_RESULT($version)
84
1134 by Barry Warsaw
Try to guess whether the email package is actually needed or not.
85
# Check the email package version.
86
AC_MSG_CHECKING(Python's email package)
87
changequote(,)
88
cat > conftest.py <<EOF
89
import sys
90
try:
91
    import email
92
except ImportError:
93
    res = "not ok"
94
else:
95
    provided = (2, 5, 8)
1139 by Barry Warsaw
Python 2.4 is a minimum. Also, fix some autoconf complaints and remove
96
    version = tuple(int(v) for v in email.__version__.split('.'))
1134 by Barry Warsaw
Try to guess whether the email package is actually needed or not.
97
    if provided > version:
98
        res = "not ok"
99
    else:
100
        res = "ok"
101
fp = open("conftest.out", "w")
102
fp.write("%s\n" % res)
103
fp.close()
104
EOF
105
changequote([, ])
106
$PYTHON conftest.py
107
needemailpkg=`cat conftest.out`
108
rm -f conftest.out conftest.py
109
110
# Should we rely on Python's own email package or use the pre-packaged version?
111
AC_SUBST(EMAILPKG)
112
if test "$needemailpkg" = "ok"
113
then
114
    EMAILPKG=""
115
else
116
    EMAILPKG=email-2.5.8
117
fi
118
AC_MSG_RESULT($needemailpkg)
119
1197 by Mark Sapiro
Configure/make no longer builds Japanese and Korean codecs in
120
# Check Japanese codecs.
121
AC_MSG_CHECKING(Japanese codecs)
122
changequote(,)
123
cat > conftest.py <<EOF
124
try:
125
    unicode('OK', 'iso-2022-jp')
126
except LookupError:
127
    res = "not ok"
128
else:
129
    res = "ok"
130
fp = open("conftest.out", "w")
131
fp.write("%s\n" % res)
132
fp.close()
133
EOF
134
changequote([, ])
135
$PYTHON conftest.py
136
needjacodecs=`cat conftest.out`
137
rm -f conftest.out conftest.py
138
139
# Does Python have Japanese codecs or do we need the pre-packaged version?
140
AC_SUBST(JACODECSPKG)
141
if test "$needjacodecs" = "ok"
142
then
143
    JACODECSPKG=""
144
else
145
    JACODECSPKG=JapaneseCodecs-1.4.11
146
fi
147
AC_MSG_RESULT($needjacodecs)
148
149
# Check Korean codecs.
150
AC_MSG_CHECKING(Korean codecs)
151
changequote(,)
152
cat > conftest.py <<EOF
153
try:
154
    unicode('OK', 'euc-kr')
155
except LookupError:
156
    res = "not ok"
157
else:
158
    res = "ok"
159
fp = open("conftest.out", "w")
160
fp.write("%s\n" % res)
161
fp.close()
162
EOF
163
changequote([, ])
164
$PYTHON conftest.py
165
needkocodecs=`cat conftest.out`
166
rm -f conftest.out conftest.py
167
168
# Does Python have Korean codecs or do we need the pre-packaged version?
169
AC_SUBST(KOCODECSPKG)
170
if test "$needkocodecs" = "ok"
171
then
172
    KOCODECSPKG=""
173
else
174
    KOCODECSPKG=KoreanCodecs-2.0.5
175
fi
176
AC_MSG_RESULT($needkocodecs)
1134 by Barry Warsaw
Try to guess whether the email package is actually needed or not.
177
1 by
This commit was manufactured by cvs2svn to create branch
178
# Make sure distutils is available.  Some Linux Python packages split
179
# distutils into the "-devel" package, so they need both.
180
AC_MSG_CHECKING(that Python has a working distutils)
181
changequote(,)
182
cat > conftest.py <<EOF
183
try:
184
    import distutils.errors
185
    import distutils.sysconfig
186
except ImportError:
187
    res = "no"
188
else:
189
    try:
61 by bwarsaw
Backporting once again from the trunk.
190
        distutils.sysconfig.get_config_vars()
1 by
This commit was manufactured by cvs2svn to create branch
191
    except distutils.errors.DistutilsPlatformError:
61 by bwarsaw
Backporting once again from the trunk.
192
        res = "no"
1 by
This commit was manufactured by cvs2svn to create branch
193
    else:
990 by Mark Sapiro
It is reported that some RedHat packages (for at least FC5 and FC6, but not
194
        # some RedHat packages put distutils in python, but the C headers
195
        # are in python-devel so check for headers too.
196
        import os.path
1374 by Mark Sapiro
Changed configure's method for getting Python's include directory from
197
        pdothpath = distutils.sysconfig.get_python_inc()
990 by Mark Sapiro
It is reported that some RedHat packages (for at least FC5 and FC6, but not
198
        if os.path.isfile(os.path.join(pdothpath, "Python.h")):
199
            res = "yes"
200
        else:
201
            res = "no"
1 by
This commit was manufactured by cvs2svn to create branch
202
fp = open("conftest.out", "w")
203
fp.write("%s\n" % res)
204
fp.close()
205
EOF
206
changequote([, ])
207
$PYTHON conftest.py
208
havedistutils=`cat conftest.out`
209
rm -f conftest.out conftest.py
210
if test "$havedistutils" != "yes"
211
then
212
    AC_MSG_ERROR([
213
214
***** Distutils is not available or is incomplete for $PYTHON
215
***** If you installed Python from RPM (or other package manager)
216
***** be sure to install the -devel package, or install Python
990 by Mark Sapiro
It is reported that some RedHat packages (for at least FC5 and FC6, but not
217
***** from source.  See sec. 15.1 of the Installation Manual for
218
***** details])
1 by
This commit was manufactured by cvs2svn to create branch
219
fi
220
AC_MSG_RESULT($havedistutils)
221
222
# Checks for programs.
223
AC_PROG_INSTALL
224
AC_PROG_MAKE_SET
225
AC_PATH_PROG(TRUE, true, true, $PATH:/bin:/usr/bin)
226
227
# Find compiler, allow alternatives to gcc
228
AC_MSG_CHECKING(for --without-gcc)
229
AC_ARG_WITH(gcc, [  --without-gcc               never use gcc], [
230
        case $withval in
231
        no)     CC=cc
232
                without_gcc=yes;;
233
        yes)    CC=gcc
234
                without_gcc=no;;
235
        *)      CC=$withval
236
                without_gcc=$withval;;
237
        esac], without_gcc=no;)
238
AC_MSG_RESULT($without_gcc)
239
240
# If the user switches compilers, we can't believe the cache
241
if test ! -z "$ac_cv_prog_CC" -a ! -z "$CC" -a "$CC" != "$ac_cv_prog_CC"
242
then
243
  AC_ERROR(cached CC is different -- throw away $cache_file
244
(it is also a good idea to do 'make clean' before compiling))
245
fi
246
247
AC_PROG_CC
248
249
250
# Optimizer/debugger flags passed between Makefiles
251
AC_SUBST(OPT)
252
if test -z "$OPT"
253
then
254
        case $GCC in
255
        yes)
256
                case $ac_cv_prog_cc_g in
257
                yes)    OPT="-g -O2";;
258
                *)      OPT="-O2";;
259
                esac
260
                ;;
261
        *)      OPT="-O";;
262
        esac
263
fi
264
265
# We better be able to execute interpreters
266
AC_SYS_INTERPRETER
267
if test "$ac_cv_sys_interpreter" != "yes"
268
then
269
    AC_MSG_ERROR([
270
271
***** Cannot execute interpreter scripts?
272
***** Are you sure you system doesn't support this?])
273
fi
274
275
276
# Check for an alternate data directory, separate from installation dir.
277
default_var_prefix="/var/mailman"
278
AC_SUBST(VAR_PREFIX)
279
AC_MSG_CHECKING(for --with-var-prefix)
280
AC_ARG_WITH(var-prefix, dnl
281
[  --with-var-prefix     directory for mutable data [/var/mailman]])
282
case "$with_var_prefix" in
283
        yes)    VAR_PREFIX="$default_var_prefix"; ans=$VAR_PREFIX;;
284
        ""|no)  VAR_PREFIX="$prefix"; ans="no";;
285
        *)      VAR_PREFIX="$with_var_prefix"; ans=$VAR_PREFIX;
286
esac
287
AC_MSG_RESULT($ans)
288
289
AC_MSG_CHECKING(for --with-permcheck)
290
AC_ARG_WITH(permcheck, dnl
291
[  --without-permcheck  skip the check for target directory permissions])
292
if test -z "$with_permcheck"
293
then
294
        with_permcheck="yes"
295
fi
296
AC_MSG_RESULT($with_permcheck)
297
# Now make sure that $prefix is set up correctly.  It must be group
298
# owned by the target group, it must have the group sticky bit set, and
299
# it must be a+rx
300
if test "$VAR_PREFIX" = "NONE"
301
then
302
    VAR_PREFIX=$ac_default_prefix
303
    prefixcheck=$ac_default_prefix
304
else
305
    prefixcheck=$VAR_PREFIX
306
fi
307
308
# new macro for finding group names
1139 by Barry Warsaw
Python 2.4 is a minimum. Also, fix some autoconf complaints and remove
309
AC_DEFUN([MM_FIND_GROUP_NAME], [
1 by
This commit was manufactured by cvs2svn to create branch
310
# $1 == variable name
311
# $2 == user id to check for
312
AC_SUBST($1)
313
changequote(,)
314
if test -z "$$1"
315
then
316
    cat > conftest.py <<EOF
317
import grp
318
gid = ''
319
for group in "$2".split():
320
    try:
321
        try:
322
            gname = grp.getgrgid(int(group))[0]
323
            break
324
        except ValueError:
325
            gname = grp.getgrnam(group)[0]
326
            break
327
    except KeyError:
328
        gname = ''
329
fp = open("conftest.out", "w")
330
fp.write("%s\n" % gname)
331
fp.close()
332
EOF
333
    $PYTHON conftest.py
334
    $1=`cat conftest.out`
335
fi
336
changequote([, ])
337
rm -f conftest.out conftest.py])
338
339
340
# new macro for finding UIDs
1139 by Barry Warsaw
Python 2.4 is a minimum. Also, fix some autoconf complaints and remove
341
AC_DEFUN([MM_FIND_USER_NAME], [
1 by
This commit was manufactured by cvs2svn to create branch
342
# $1 == variable name
343
# $2 == user id to check for
344
AC_SUBST($1)
345
changequote(,)
346
if test -z "$$1"
347
then
348
    cat > conftest.py <<EOF
349
import pwd
350
uid = ''
351
for user in "$2".split():
352
    try:
353
        try:
354
            uname = pwd.getpwuid(int(user))[0]
355
            break
356
        except ValueError:
357
            uname = pwd.getpwnam(user)[0]
358
            break
359
    except KeyError:
360
        uname = ''
361
fp = open("conftest.out", "w")
362
fp.write("%s\n" % uname)
363
fp.close()
364
EOF
365
    $PYTHON conftest.py
366
    $1=`cat conftest.out`
367
fi
368
changequote([, ])
369
rm -f conftest.out conftest.py])
370
371
# Check for some other uid to use than `mailman'
372
AC_MSG_CHECKING(for --with-username)
373
AC_ARG_WITH(username, dnl
374
[  --with-username      specify a user name other than \"mailman\"])
375
376
if test -z "$with_username"
377
then
378
        with_username="mailman"
379
fi
380
USERNAME=$with_username
381
AC_MSG_RESULT($USERNAME)
382
383
# User `mailman' must exist
384
AC_SUBST(MAILMAN_USER)
385
AC_MSG_CHECKING(for user name \"$USERNAME\")
386
MM_FIND_USER_NAME(MAILMAN_USER, $USERNAME)
387
if test -z "$MAILMAN_USER"
388
then
389
  if test "$with_permcheck" = "yes"
390
  then
391
    AC_MSG_ERROR([
392
***** No \"$USERNAME\" user found!
393
***** Your system must have a \"$USERNAME\" user defined
394
***** (usually in your /etc/passwd file).  Please see the INSTALL
395
***** file for details.])
396
  fi
397
fi
398
AC_MSG_RESULT(okay)
399
400
401
# Check for some other gid to use than `mailman'
402
AC_MSG_CHECKING(for --with-groupname)
403
AC_ARG_WITH(groupname, dnl
404
[  --with-groupname     specify a group name other than \"mailman\"])
405
406
if test -z "$with_groupname"
407
then
408
        with_groupname="mailman"
409
fi
410
GROUPNAME=$with_groupname
411
AC_MSG_RESULT($GROUPNAME)
412
413
414
# Target group must exist
415
AC_SUBST(MAILMAN_GROUP)
416
AC_MSG_CHECKING(for group name \"$GROUPNAME\")
417
MM_FIND_GROUP_NAME(MAILMAN_GROUP, $GROUPNAME)
418
if test -z "$MAILMAN_GROUP"
419
then
420
  if test "$with_permcheck" = "yes"
421
  then
422
    AC_MSG_ERROR([
423
***** No \"$GROUPNAME\" group found!
424
***** Your system must have a \"$GROUPNAME\" group defined
425
***** (usually in your /etc/group file).  Please see the INSTALL
426
***** file for details.])
427
  fi
428
fi
429
AC_MSG_RESULT(okay)
430
431
432
AC_MSG_CHECKING(permissions on $prefixcheck)
433
changequote(,)
434
cat > conftest.py <<EOF
435
import os, grp
436
from stat import *
437
prefix = "$prefixcheck"
438
groupname = "$GROUPNAME"
439
mailmangroup = "$MAILMAN_GROUP"
49 by bwarsaw
Backport from the trunk, and catalog regeneration.
440
try:
441
    mailmangid = grp.getgrnam(mailmangroup)[2]
442
except KeyError:
443
    mailmangid = -1
1 by
This commit was manufactured by cvs2svn to create branch
444
problems = []
445
try: statdata = os.stat(prefix)
446
except OSError:
447
    problems.append("Directory doesn't exist: " + prefix)
448
else:
449
    mode = statdata[ST_MODE]
450
    gid = statdata[ST_GID]
451
    if mailmangid <> gid:
452
        problems.append("Directory must be owned by group " +
453
                        groupname + ": " + prefix)
454
    if (mode & S_ISGID) <> S_ISGID:
455
        problems.append("Set-gid bit must be set for directory: " + prefix)
456
    perms = S_IRWXU | S_IRWXG | S_IROTH | S_IXOTH
457
    if (mode & perms) <> perms:
458
        problems.append("Permissions should be at least 02775: " + prefix)
459
if not problems:
460
    msg = "okay\n"
461
else:
462
    msg = '***** ' + '\n***** '.join(problems) + '\n'
463
fp = open("conftest.out", "w")
464
fp.write(msg)
465
fp.close()
466
EOF
467
changequote([, ])
468
$PYTHON conftest.py
469
status=`cat conftest.out`
470
rm -f conftest.out conftest.py
471
if test "$with_permcheck" = "yes"
472
then
473
    if test "$status" != "okay"
474
    then
475
        AC_MSG_ERROR([
476
***** Installation directory $prefixcheck is not configured properly!
477
$status])
478
    fi
479
else
480
    status="skipped"
481
fi
482
AC_MSG_RESULT($status)
483
484
485
# Now find the UIDs and GIDs
486
# Support --with-mail-gid and --with-cgi-gid
487
AC_MSG_CHECKING(for mail wrapper group; i.e. --with-mail-gid)
488
AC_ARG_WITH(mail-gid, dnl
489
[  --with-mail-gid      group name mail programs run as])
490
if test -z "$with_mail_gid"
491
then
492
    with_mail_gid="mailman other mail daemon"
493
fi
494
MM_FIND_GROUP_NAME(MAIL_GROUP, $with_mail_gid)
495
if test -z "$MAIL_GROUP"
496
then
497
  if test "$with_permcheck" = "yes"
498
  then
499
    AC_MSG_ERROR([
500
***** No group name \"$with_mail_gid\" found for the mail wrapper program.
501
***** This is the group that your mail server will use to run Mailman's
502
***** programs.  You should specify an existing group with the
503
***** --with-mail-gid configure option, or use --without-permcheck to
504
***** skip this verification step.  See also your mail server's documentation,
505
***** and Mailman's INSTALL file for details])
506
  else
507
    MAIL_GROUP=$with_mail_gid
508
  fi
509
fi
510
AC_MSG_RESULT($MAIL_GROUP)
511
512
513
AC_MSG_CHECKING(for CGI wrapper group; i.e. --with-cgi-gid)
514
AC_ARG_WITH(cgi-gid, dnl
515
[  --with-cgi-gid       group name CGI programs run as])
516
if test -z "$with_cgi_gid"
517
then
518
    with_cgi_gid="www www-data nobody"
519
fi
520
521
MM_FIND_GROUP_NAME(CGI_GROUP, $with_cgi_gid)
522
if test -z "$CGI_GROUP"
523
then
524
  if test "$with_permcheck" = "yes"
525
  then
526
    AC_MSG_ERROR([
527
***** No group name \"$with_cgi_gid\" found for the CGI wrapper program.
528
***** This is the group that your web server will use to run Mailman's
529
***** programs.  You should specify an existing group with the
530
***** --with-cgi-gid configure option, or use --without-permcheck to
531
***** skip this verification step.  See also your web server's documentation,
532
***** and Mailman's INSTALL file for details])
533
  else
534
    CGI_GROUP=$with_cgi_gid
535
  fi
536
fi
537
AC_MSG_RESULT($CGI_GROUP)
538
539
540
# Check for CGI extensions, required by some Web servers
541
AC_SUBST(CGIEXT)
542
AC_MSG_CHECKING(for CGI extensions)
543
AC_ARG_WITH(cgi-ext, dnl
544
[  --with-cgi-ext       specify extension for CGI programs (include dot)])
545
if test -z "$with_cgi_ext"
546
then
547
        CGIEXT=''
548
        with_cgi_ext='no'
549
else
550
        CGIEXT=$with_cgi_ext
551
fi
552
AC_MSG_RESULT($with_cgi_ext)
553
554
555
# figure out the default mail hostname and url host component
556
AC_SUBST(MAILHOST)
557
AC_MSG_CHECKING(for --with-mailhost)
558
AC_ARG_WITH(mailhost, dnl
559
[  --with-mailhost      specify the hostname part for outgoing email])
560
if test -z "$with_mailhost"
561
then
562
        MAILHOST=''
563
        with_mailhost='no'
564
else
565
        MAILHOST=$with_mailhost
566
fi
567
AC_MSG_RESULT($with_mailhost)
568
569
AC_SUBST(URLHOST)
570
AC_MSG_CHECKING(for --with-urlhost)
571
AC_ARG_WITH(urlhost, dnl
572
[  --with-urlhost       specify the hostname part of urls])
573
if test -z "$with_urlhost"
574
then
575
        URLHOST=''
576
        with_urlhost='no'
577
else
578
        URLHOST=$with_urlhost
579
fi
580
AC_MSG_RESULT($with_urlhost)
581
1134 by Barry Warsaw
Try to guess whether the email package is actually needed or not.
582
1 by
This commit was manufactured by cvs2svn to create branch
583
changequote(,)
584
cat > conftest.py <<EOF
585
# python
586
from socket import *
587
fqdn = getfqdn()
588
fp = open('conftest.out', 'w')
589
print >> fp, fqdn
590
print >> fp, fqdn
591
fp.close()
592
EOF
593
$PYTHON conftest.py
594
changequote([, ])
595
AC_MSG_CHECKING(for default mail host name)
596
if test -z "$MAILHOST"
597
then
598
    MAILHOST=`sed q conftest.out`
599
fi
600
AC_MSG_RESULT($MAILHOST)
601
AC_MSG_CHECKING(for default URL host component)
602
if test -z "$URLHOST"
603
then
604
    URLHOST=`sed -n '$p' conftest.out`
605
fi
606
AC_MSG_RESULT($URLHOST)
607
rm -f conftest.out conftest.py
608
609
# Checks for libraries.
610
AC_CHECK_FUNCS(strerror setregid syslog)
611
if test $ac_cv_func_syslog = no; then
612
  # syslog is not in the default libraries.  See if it's in some other.
613
  # Additionally, for at least SCO OpenServer, syslog() is #defined to
614
  # one of several _real_ functions in syslog.h, so we need to do the test
615
  # with the appropriate include.
616
  for lib in bsd socket inet; do
617
    AC_MSG_CHECKING(for syslog in -l$lib)
618
    Mailman_LIBS_save="$LIBS"; LIBS="$LIBS -l$lib"
619
    AC_TRY_LINK([#include <syslog.h>],
620
                [syslog(LOG_DEBUG, "Just a test...");],
621
                [AC_MSG_RESULT(yes)
622
      AC_DEFINE(HAVE_SYSLOG)
623
      break],
624
                [AC_MSG_RESULT(no)
625
      LIBS="$Mailman_LIBS_save"])
626
    unset Mailman_LIBS_save
627
  done
628
fi
629
630
# Checks for header files.
631
AC_HEADER_STDC
632
AC_CHECK_HEADERS(syslog.h)
633
634
# Checks for typedefs, structures, and compiler characteristics.
635
AC_TYPE_UID_T
636
AC_TYPE_GETGROUPS
637
638
# Checks for library functions.
639
AC_CHECK_FUNCS(vsnprintf)
640
641
dnl Expand PYTHON path in the scripts, output into build/scriptname
642
1139 by Barry Warsaw
Python 2.4 is a minimum. Also, fix some autoconf complaints and remove
643
AC_DEFUN([MM_SCRIPTS], [dnl
1 by
This commit was manufactured by cvs2svn to create branch
644
bin/add_members \
645
bin/arch \
646
bin/change_pw \
647
bin/check_db \
648
bin/check_perms \
649
bin/cleanarch \
650
bin/clone_member \
651
bin/config_list \
652
bin/convert.py \
89 by bwarsaw
Backporting from the HEAD -- top level files
653
bin/discard \
1 by
This commit was manufactured by cvs2svn to create branch
654
bin/dumpdb \
955 by bwarsaw
Port the Mailman trunk's export.py script to Mailman 2.1. Anyone wanting to
655
bin/export.py \
1 by
This commit was manufactured by cvs2svn to create branch
656
bin/find_member \
657
bin/fix_url.py \
658
bin/genaliases \
659
bin/inject \
660
bin/list_admins \
661
bin/list_lists \
662
bin/list_members \
663
bin/list_owners \
664
bin/mailmanctl \
665
bin/mmsitepass \
61 by bwarsaw
Backporting once again from the trunk.
666
bin/msgfmt.py \
1 by
This commit was manufactured by cvs2svn to create branch
667
bin/newlist \
668
bin/pygettext.py \
669
bin/qrunner \
670
bin/remove_members \
569 by bwarsaw
Renamed reset_pw to reset_pw.py so that the file looks like a Python module.
671
bin/reset_pw.py \
1 by
This commit was manufactured by cvs2svn to create branch
672
bin/rmlist \
89 by bwarsaw
Backporting from the HEAD -- top level files
673
bin/show_qfiles \
1 by
This commit was manufactured by cvs2svn to create branch
674
bin/sync_members \
675
bin/transcheck \
676
bin/unshunt \
677
bin/update \
678
bin/version \
679
bin/withlist \
680
bin/b4b5-archfix \
244 by bwarsaw
Added Richard Barrett's bin/rb-archfix script to reduce Pipermail
681
bin/rb-archfix \
1 by
This commit was manufactured by cvs2svn to create branch
682
contrib/check_perms_grsecurity.py \
683
contrib/qmail-to-mailman.py \
1341 by Mark Sapiro
A configured version of contrib/courier-to-mailman.py is now created in
684
contrib/courier-to-mailman.py \
1 by
This commit was manufactured by cvs2svn to create branch
685
contrib/rotatelogs.py \
686
cron/bumpdigests \
687
cron/checkdbs \
1073.1.1 by Mark Sapiro
Added new cron/cull_bad_shunt and supporting Defaults.py.in settings.
688
cron/cull_bad_shunt \
1 by
This commit was manufactured by cvs2svn to create branch
689
cron/disabled \
690
cron/gate_news \
691
cron/mailpasswds \
692
cron/nightly_gzip \
693
cron/senddigests \
694
])
695
696
dnl Please make sure to leave a space at the end of the last entry.
697
dnl (This is so we don't have to use [a-z/] style character classes
698
dnl in the regexp below and mess with m4 quoting, which is not fun.)
699
700
dnl This regexp munges each line in MM_SCRIPTS, replacing:
701
dnl   path/script \
702
dnl with:
703
dnl   build/path/script:path/script \
704
dnl so that we can macro-expand variables in scripts without using
705
dnl script.in filenames, outputting the new files in build/ .
706
707
SCRIPTS="patsubst(MM_SCRIPTS, \(.+\) \(\\?\), build/\1:\1 \2)"
708
709
AC_SUBST(SCRIPTS)
710
711
# These directories are temporary directories to store macro-expanded
712
# scripts.  They're removed on a make distclean, so we make them here.
713
mkdir -p build/bin build/contrib build/cron
714
715
dnl Output everything
716
AC_OUTPUT([misc/paths.py Mailman/Defaults.py Mailman/mm_cfg.py.dist
717
           src/Makefile misc/Makefile bin/Makefile
718
           Mailman/Makefile Mailman/Cgi/Makefile Mailman/Logging/Makefile
719
           Mailman/Archiver/Makefile Mailman/Commands/Makefile
720
           Mailman/Handlers/Makefile Mailman/Bouncers/Makefile
721
           Mailman/Queue/Makefile Mailman/MTA/Makefile Mailman/Gui/Makefile
722
           templates/Makefile cron/Makefile scripts/Makefile messages/Makefile
723
           cron/crontab.in misc/mailman Makefile
724
           tests/Makefile tests/bounces/Makefile tests/msgs/Makefile
725
           $SCRIPTS],
61 by bwarsaw
Backporting once again from the trunk.
726
        echo "configuration completed at" `date`)
1 by
This commit was manufactured by cvs2svn to create branch
727
728
# Make sure all the build scripts are executable.
729
chmod -R +x build
730
731
# Test for the Chinese codecs.
732
dnl AC_MSG_CHECKING(for Python Chinese Unicode codecs)
733
dnl cat > conftest.py <<EOF
734
dnl try:
735
dnl   unicode("abc", "big5-tw")
736
dnl   print "found"
737
dnl except LookupError:
738
dnl   print "not found"
739
dnl EOF
740
dnl chinese=`$PYTHON conftest.py 2>/dev/null`
741
dnl rm -f conftest.py
742
dnl AC_MSG_RESULT($chinese)
743
dnl if test "x$chinese" != "xfound"
744
dnl then
745
dnl     AC_MSG_WARN([
746
747
dnl ***** Python Unicode codecs for Chinese not found.
748
dnl ***** Chinese emails generated by or manipulated in Mailman will not
749
dnl ***** be sent in the correct encoding and may be unreadable.
750
dnl ***** Please uncompress and install the Chinese codecs from:
751
dnl ***** http://sourceforge.net/projects/python-codecs/
752
dnl *****
753
dnl ***** Note: Everything else will work just fine.
754
dnl ])
755
dnl fi