forked from AssetTracker/rt-extension-assettracker
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathconfigure.ac
161 lines (136 loc) · 5.19 KB
/
configure.ac
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
# Process this file with autoconf to produce a configure script.
AC_PREREQ(2.57)
AC_INIT([RTx::AssetTracker], [1.0.HEAD], [todd@chaka.net])
AC_CONFIG_SRCDIR([lib/RTx/AssetTracker.pm.in])
dnl Extract AT version number components
AC_SUBST([at_version_major],
m4_bregexp(AC_PACKAGE_VERSION,[^\(\w+\)\.\(\w+\)\(\.\(\w+\)\)?],[\1]))
AC_SUBST([at_version_minor],
m4_bregexp(AC_PACKAGE_VERSION,[^\(\w+\)\.\(\w+\)\(\.\(\w+\)\)?],[\2]))
AC_SUBST([at_version_patch],
m4_bregexp(AC_PACKAGE_VERSION,[^\(\w+\)\.\(\w+\)\(\.\(\w+\)\)?],[\4]))
test "x$at_version_major" = 'x' && at_version_major=0
test "x$at_version_minor" = 'x' && at_version_minor=0
test "x$at_version_patch" = 'x' && at_version_patch=0
dnl Check for programs
AC_PROG_INSTALL
AC_ARG_VAR([PERL],[Perl interpreter command])
AC_PATH_PROG([PERL], [perl], [not found])
if test "$PERL" = 'not found'; then
AC_MSG_ERROR([cannot use $PACKAGE_NAME without perl])
fi
# Checks for programs.
#AC_PROG_INSTALL
AC_ARG_WITH(rt-home,
AC_HELP_STRING([--with-rt-home=/path/to/rt],
[path to your rt home dir (default: /opt/rt3)]),
RT_HOME_PATH=$withval,
RT_HOME_PATH=/opt/rt3)
AC_SUBST(RT_HOME_PATH)
AC_ARG_WITH(rt-lib,
AC_HELP_STRING([--with-rt-lib=/path/to/rt/lib],
[path to your rt lib dir (default: /opt/rt3/lib)]),
RT_LIB_PATH=$withval,
RT_LIB_PATH=/opt/rt3/lib)
AC_SUBST(RT_LIB_PATH)
AC_ARG_WITH(rt-local,
AC_HELP_STRING([--with-rt-local=/path/to/rt/local],
[path to your rt local dir (default: /opt/rt3/local)]),
RT_LOCAL_PATH=$withval,
RT_LOCAL_PATH=/opt/rt3/local)
AC_SUBST(RT_LOCAL_PATH)
AC_ARG_WITH(rt-locallib,
AC_HELP_STRING([--with-rt-locallib=/path/to/rt/locallib],
[path to your rt local lib dir (default: /opt/rt3/local/lib)]),
RT_LOCALLIB_PATH=$withval,
RT_LOCALLIB_PATH=/opt/rt3/local/lib)
AC_SUBST(RT_LOCALLIB_PATH)
AC_ARG_WITH(rt-localhtml,
AC_HELP_STRING([--with-rt-localhtml=/path/to/rt/localhtml],
[path to your rt local html dir (default: /opt/rt3/local/html)]),
RT_LOCALHTML_PATH=$withval,
RT_LOCALHTML_PATH=/opt/rt3/local/html)
AC_SUBST(RT_LOCALHTML_PATH)
AC_ARG_WITH(db-admin,
AC_HELP_STRING([--with-db-admin=db_admin],
[name of database administrator (default: root)]),
DB_ADMIN=$withval,
DB_ADMIN=root)
AC_SUBST(DB_ADMIN)
# ACRT_USER_EXISTS( users, variable, default )
# - users is a list of users [www apache www-docs]
# from highest to lowest priority to high priority (i.e. first match)
# - variable is what you set with the result
#
AC_DEFUN([ACRT_USER_GUESS],
[
$2=$3
for x in $1; do
AC_MSG_CHECKING([if user $x exists])
AS_IF([ $PERL -e"exit( defined getpwnam('$x') ? 0 : 1)" ],
[ AC_MSG_RESULT([found]); $2=$x ; break],
[ AC_MSG_RESULT([not found]) ])
done
])
AC_DEFUN([ACRT_GROUP_GUESS],
[
$2=$3
for x in $1; do
AC_MSG_CHECKING([if group $x exists])
AS_IF([ $PERL -e"exit( defined getgrnam('$x') ? 0 : 1)" ],
[ AC_MSG_RESULT([found]); $2=$x ; break],
[ AC_MSG_RESULT([not found]) ])
done
])
dnl RTGROUP
AC_ARG_WITH(rt-group,
AC_HELP_STRING([--with-rt-group=GROUP],
[group to own all files (default: rt)]),
RTGROUP=$withval,
ACRT_GROUP_GUESS([rt3 rt $WEB_GROUP],[RTGROUP], [rt]))
AC_SUBST(RTGROUP)
dnl BIN_OWNER
AC_ARG_WITH(bin-owner,
AC_HELP_STRING([--with-bin-owner=OWNER],
[user that will own RT binaries (default root)]),
BIN_OWNER=$withval,
BIN_OWNER=root)
AC_SUBST(BIN_OWNER)
dnl LIBS_OWNER
AC_ARG_WITH(libs-owner,
AC_HELP_STRING([--with-libs-owner=OWNER],
[user that will own RT libraries (default root)]),
LIBS_OWNER=$withval,
LIBS_OWNER=root)
AC_SUBST(LIBS_OWNER)
dnl LIBS_GROUP
AC_ARG_WITH(libs-group,
AC_HELP_STRING([--with-libs-group=GROUP],
[group that will own RT binaries (default bin)]),
LIBS_GROUP=$withval,
LIBS_GROUP=bin)
AC_SUBST(LIBS_GROUP)
dnl version numbers
AC_SUBST(AT_VERSION_MAJOR, ${at_version_major})
AC_SUBST(AT_VERSION_MINOR, ${at_version_minor})
AC_SUBST(AT_VERSION_PATCH, ${at_version_patch})
dnl layout paths
AC_SUBST([RT_PATH], ${exp_prefix})
# Checks for libraries.
# Checks for header files.
# Checks for typedefs, structures, and compiler characteristics.
# Checks for library functions.
AC_CONFIG_FILES([
Makefile
sbin/at-setup-database
sbin/at_factory
etc/AssetTracker/upgrade/1.2.0/AT-1.0.x-to-1.2.0.pl
etc/AssetTracker/upgrade/1.2.3/AT-1.2.0-to-1.2.3.pl
lib/RTx/AssetTracker.pm],
[chmod ug=rx,o= sbin/at-setup-database
chmod ug=rx,o= sbin/at_factory
chmod ug=rx,o= etc/AssetTracker/upgrade/1.2.0/AT-1.0.x-to-1.2.0.pl
chmod ug=rx,o= etc/AssetTracker/upgrade/1.2.3/AT-1.2.0-to-1.2.3.pl
]
)
AC_OUTPUT