apachetoolbox instead i guess
[freeside.git] / rt / configure.ac
1 dnl
2 dnl Process this file with autoconf to produce a configure script
3 dnl
4 dnl Embed in generated ./configure script the following CVS info:
5 AC_REVISION($Revision: 1.1.1.2 $)dnl
6
7 dnl Setup autoconf
8 AC_PREREQ(2.53)
9 AC_INIT(RT, [3.0.9], [rt-3.0-bugs@fsck.com])
10 AC_CONFIG_SRCDIR([lib/RT.pm.in])
11
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
22
23 dnl Check for programs
24 AC_PROG_INSTALL
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])
29 fi
30 dnl SPEED_BIN
31 AC_ARG_WITH(speedycgi,
32             AC_HELP_STRING([--with-speedycgi=/path/to/speedy],
33                            [path to your speedycgi binary, if it exists]),
34             SPEEDY_BIN=$withval,
35             SPEEDY_BIN=/usr/local/bin/speedy) 
36 AC_SUBST(SPEEDY_BIN)
37
38
39 dnl Defaults paths for installation
40 AC_PREFIX_DEFAULT([/opt/rt3])
41 RT_ENABLE_LAYOUT
42
43 dnl RTGROUP
44 AC_ARG_WITH(rt-group,
45             AC_HELP_STRING([--with-rt-group=GROUP],
46                            [group to own all files (default: rt)]),
47             RTGROUP=$withval,
48             RTGROUP=rt)
49 AC_SUBST(RTGROUP)
50
51 dnl BIN_OWNER
52 AC_ARG_WITH(bin-owner,
53             AC_HELP_STRING([--with-bin-owner=OWNER],
54                            [user that will own rt binaries (default root)]),
55             BIN_OWNER=$withval,
56             BIN_OWNER=root)
57 AC_SUBST(BIN_OWNER)
58
59 dnl LIBS_OWNER
60 AC_ARG_WITH(libs-owner,
61             AC_HELP_STRING([--with-libs-owner=OWNER],
62                            [user that will own RT libraries (default root)]),
63             LIBS_OWNER=$withval,
64             LIBS_OWNER=root)
65 AC_SUBST(LIBS_OWNER)
66
67 dnl LIBS_GROUP
68 AC_ARG_WITH(libs-group,
69             AC_HELP_STRING([--with-libs-group=GROUP],
70                            [group that will own rt binaries (default bin)]),
71             LIBS_GROUP=$withval,
72             LIBS_GROUP=bin)
73 AC_SUBST(LIBS_GROUP)
74
75 dnl DB_TYPE
76 AC_ARG_WITH(db-type,
77             AC_HELP_STRING([--with-db-type=TYPE],
78                            [sort of database RT will use (default: mysql) (mysql, Pg, Oracle and Informix are valid)]), 
79             DB_TYPE=$withval,
80             DB_TYPE=mysql)
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])
83 fi
84 AC_SUBST(DB_TYPE)
85
86 dnl ORACLE_ENV_PREF
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';"
90 fi
91 AC_SUBST(ORACLE_ENV_PREF)
92
93 dnl DB_HOST
94 AC_ARG_WITH(db-host,
95             AC_HELP_STRING([--with-db-host=HOSTNAME],
96                            [FQDN of database server (default: localhost)]),
97             DB_HOST=$withval,
98             DB_HOST=localhost)
99 AC_SUBST(DB_HOST)
100
101 dnl DB_PORT
102 AC_ARG_WITH(db-port,
103             AC_HELP_STRING([--with-db-port=PORT],
104                            [port on which the database listens on]),
105             DB_PORT=$withval,
106             DB_PORT=)
107 AC_SUBST(DB_PORT)
108
109 dnl DB_RT_HOST
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)]),
113             DB_RT_HOST=$withval,
114             DB_RT_HOST=localhost)
115 AC_SUBST(DB_RT_HOST)
116
117 dnl DB_DATABASE_ADMIN
118 AC_ARG_WITH(db-dba,
119             AC_HELP_STRING([--with-db-dba=DBA],
120                            [name of database administrator (default: root)]),
121             DB_DBA=$withval,
122             DB_DBA=root)
123 AC_SUBST(DB_DBA)
124
125 dnl DB_DATABASE
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,
130             DB_DATABASE=rt3)
131 AC_SUBST(DB_DATABASE)
132
133 dnl DB_RT_USER
134 AC_ARG_WITH(db-rt-user,
135             AC_HELP_STRING([--with-db-rt-user=DBUSER],
136                            [name of database user (default: rt_user)]),
137             DB_RT_USER=$withval,
138             DB_RT_USER=rt_user)
139 AC_SUBST(DB_RT_USER)
140
141 dnl DB_RT_PASS
142 AC_ARG_WITH(db-rt-pass,
143             AC_HELP_STRING([--with-db-rt-pass=PASSWORD],
144                            [password for database user (default: rt_pass)]),
145             DB_RT_PASS=$withval,
146             DB_RT_PASS=rt_pass)
147 AC_SUBST(DB_RT_PASS)
148
149 dnl WEB_USER
150 AC_ARG_WITH(web-user,
151             AC_HELP_STRING([--with-web-user=USER],
152                            [user the web server runs as (default: www)]),
153             WEB_USER=$withval,
154             WEB_USER=www)
155 AC_SUBST(WEB_USER)
156
157 dnl WEB_GROUP
158 AC_ARG_WITH(web-group,
159             AC_HELP_STRING([--with-web-group=GROUP],
160                            [group the web server runs as (default: www)]),
161             WEB_GROUP=$withval,
162             WEB_GROUP=www)
163 AC_SUBST(WEB_GROUP)
164
165 dnl INSTALL AS ME
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]),
170             RTGROUP=$my_group
171             BIN_OWNER=$USER
172             LIBS_OWNER=$USER
173             LIBS_GROUP=$my_group
174             WEB_USER=$USER
175             WEB_GROUP=$my_group)
176
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.
180
181 dnl version numbers
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})
185
186 dnl layout paths
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})
206
207 dnl Configure the output files, and generate them.
208
209 AC_CONFIG_FILES([
210                  sbin/rt-setup-database
211                  sbin/rt-test-dependencies
212                  Makefile
213                  etc/RT_Config.pm
214                  lib/RT.pm
215                  lib/t/00smoke.t
216                  lib/t/01harness.t
217                  lib/t/02regression.t
218                  lib/t/03web.pl
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
224                  bin/rt-crontool
225                  bin/rt-mailgate
226                  bin/rt
227                  bin/webmux.pl]
228                 )
229 AC_OUTPUT