2 dnl Process this file with autoconf to produce a configure script
4 dnl Embed in generated ./configure script the following CVS info:
5 AC_REVISION($Revision: 1.1.1.2 $)dnl
9 AC_INIT(RT, [3.0.9], [rt-3.0-bugs@fsck.com])
10 AC_CONFIG_SRCDIR([lib/RT.pm.in])
12 dnl Extract RT version number components
13 AC_SUBST([rt_version_major],
14 m4_bregexp(AC_PACKAGE_VERSION,[^\(\w+\)\.\(\w+\)\(\.\(\w+\)\)?],[\1]))
15 AC_SUBST([rt_version_minor],
16 m4_bregexp(AC_PACKAGE_VERSION,[^\(\w+\)\.\(\w+\)\(\.\(\w+\)\)?],[\2]))
17 AC_SUBST([rt_version_patch],
18 m4_bregexp(AC_PACKAGE_VERSION,[^\(\w+\)\.\(\w+\)\(\.\(\w+\)\)?],[\4]))
19 test "x$rt_version_major" = 'x' && rt_version_major=0
20 test "x$rt_version_minor" = 'x' && rt_version_minor=0
21 test "x$rt_version_patch" = 'x' && rt_version_patch=0
23 dnl Check for programs
25 AC_ARG_VAR([PERL],[Perl interpreter command])
26 AC_PATH_PROG([PERL], [perl], [not found])
27 if test "$PERL" = 'not found'; then
28 AC_MSG_ERROR([cannot use $PACKAGE_NAME without perl])
31 AC_ARG_WITH(speedycgi,
32 AC_HELP_STRING([--with-speedycgi=/path/to/speedy],
33 [path to your speedycgi binary, if it exists]),
35 SPEEDY_BIN=/usr/local/bin/speedy)
39 dnl Defaults paths for installation
40 AC_PREFIX_DEFAULT([/opt/rt3])
45 AC_HELP_STRING([--with-rt-group=GROUP],
46 [group to own all files (default: rt)]),
52 AC_ARG_WITH(bin-owner,
53 AC_HELP_STRING([--with-bin-owner=OWNER],
54 [user that will own rt binaries (default root)]),
60 AC_ARG_WITH(libs-owner,
61 AC_HELP_STRING([--with-libs-owner=OWNER],
62 [user that will own RT libraries (default root)]),
68 AC_ARG_WITH(libs-group,
69 AC_HELP_STRING([--with-libs-group=GROUP],
70 [group that will own rt binaries (default bin)]),
77 AC_HELP_STRING([--with-db-type=TYPE],
78 [sort of database RT will use (default: mysql) (mysql, Pg, Oracle and Informix are valid)]),
81 if test "$DB_TYPE" != 'mysql' -a "$DB_TYPE" != 'Pg' -a "$DB_TYPE" != 'SQLite' -a "$DB_TYPE" != 'Oracle' -a "$DB_TYPE" != 'Informix' ; then
82 AC_MSG_ERROR([Only Oracle, Informix, Pg and mysql are valid db types])
87 if test "$DB_TYPE" = 'Oracle'; then
88 test "x$ORACLE_HOME" = 'x' && AC_MSG_ERROR([Please declare the ORACLE_HOME environment variable])
89 ORACLE_ENV_PREF="\$ENV{'ORACLE_HOME'} = '$ORACLE_HOME';"
91 AC_SUBST(ORACLE_ENV_PREF)
95 AC_HELP_STRING([--with-db-host=HOSTNAME],
96 [FQDN of database server (default: localhost)]),
103 AC_HELP_STRING([--with-db-port=PORT],
104 [port on which the database listens on]),
110 AC_ARG_WITH(db-rt-host,
111 AC_HELP_STRING([--with-db-rt-host=HOSTNAME],
112 [FQDN of RT server which talks to the database server (default: localhost)]),
114 DB_RT_HOST=localhost)
117 dnl DB_DATABASE_ADMIN
119 AC_HELP_STRING([--with-db-dba=DBA],
120 [name of database administrator (default: root)]),
126 AC_ARG_WITH(db-database,
127 AC_HELP_STRING([--with-db-database=DBNAME],
128 [name of the database to use (default: rt3)]),
129 DB_DATABASE=$withval,
131 AC_SUBST(DB_DATABASE)
134 AC_ARG_WITH(db-rt-user,
135 AC_HELP_STRING([--with-db-rt-user=DBUSER],
136 [name of database user (default: rt_user)]),
142 AC_ARG_WITH(db-rt-pass,
143 AC_HELP_STRING([--with-db-rt-pass=PASSWORD],
144 [password for database user (default: rt_pass)]),
150 AC_ARG_WITH(web-user,
151 AC_HELP_STRING([--with-web-user=USER],
152 [user the web server runs as (default: www)]),
158 AC_ARG_WITH(web-group,
159 AC_HELP_STRING([--with-web-group=GROUP],
160 [group the web server runs as (default: www)]),
166 my_group=$(groups|cut -f1 -d' ')
167 AC_ARG_WITH(my-user-group,
168 AC_HELP_STRING([--with-my-user-group],
169 [set all users and groups to current user/group]),
177 dnl This section maps the variable names this script 'natively' generates
178 dnl to their existing names. They should be removed from here as the .in
179 dnl files are changed to use the new names.
182 AC_SUBST(RT_VERSION_MAJOR, ${rt_version_major})
183 AC_SUBST(RT_VERSION_MINOR, ${rt_version_minor})
184 AC_SUBST(RT_VERSION_PATCH, ${rt_version_patch})
187 AC_SUBST([RT_PATH], ${exp_prefix})
188 AC_SUBST([RT_DOC_PATH], ${exp_manualdir})
189 AC_SUBST([RT_LOCAL_PATH], ${exp_customdir})
190 AC_SUBST([RT_LIB_PATH], ${exp_libdir})
191 AC_SUBST([RT_ETC_PATH], ${exp_sysconfdir})
192 AC_SUBST([CONFIG_FILE_PATH], ${exp_sysconfdir})
193 AC_SUBST([RT_BIN_PATH], ${exp_bindir})
194 AC_SUBST([RT_SBIN_PATH], ${exp_sbindir})
195 AC_SUBST([RT_VAR_PATH], ${exp_localstatedir})
196 AC_SUBST([RT_MAN_PATH], ${exp_mandir})
197 AC_SUBST([MASON_DATA_PATH], ${exp_masonstatedir})
198 AC_SUBST([MASON_SESSION_PATH], ${exp_sessionstatedir})
199 AC_SUBST([MASON_HTML_PATH], ${exp_htmldir})
200 AC_SUBST([LOCAL_ETC_PATH], ${exp_custometcdir})
201 AC_SUBST([MASON_LOCAL_HTML_PATH], ${exp_customhtmldir})
202 AC_SUBST([LOCAL_LEXICON_PATH], ${exp_customlexdir})
203 AC_SUBST([LOCAL_LIB_PATH], ${exp_customlibdir})
204 AC_SUBST([DESTDIR], ${exp_prefix})
205 AC_SUBST([RT_LOG_PATH], ${exp_logfiledir})
207 dnl Configure the output files, and generate them.
210 sbin/rt-setup-database
211 sbin/rt-test-dependencies
219 lib/t/04_send_email.pl
220 bin/mason_handler.fcgi
221 bin/mason_handler.scgi
222 bin/mason_handler.svc
223 bin/rt-commit-handler