forked from csirtgadgets/massive-octo-spice
-
Notifications
You must be signed in to change notification settings - Fork 0
/
configure.ac
124 lines (101 loc) · 3.83 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
# -*- Autoconf -*-
# Process this file with autoconf to produce a configure script.
AC_PREREQ([2.64])
AC_INIT(cif, m4_esyscmd([./version.sh]), m4_esyscmd([( cat .issuetracker )| tr -d "\n"]))
AM_INIT_AUTOMAKE
AC_PREFIX_DEFAULT([/opt/cif])
AC_SUBST([cif_version_major],
m4_bregexp(AC_PACKAGE_VERSION,[^\(\w+\)\.\(\w+\)\.\(\w+\)-?\(\w+\.\d+\)?],[\1]))
AC_SUBST([cif_version_minor],
m4_bregexp(AC_PACKAGE_VERSION,[^\(\w+\)\.\(\w+\)\.\(\w+\)-?\(\w+\.\d+\)?],[\2]))
AC_SUBST([cif_version_patch],
m4_bregexp(AC_PACKAGE_VERSION,[^\(\w+\)\.\(\w+\)\.\(\w+\)-?\(\w+\.\d+\)?],[\3]))
AC_SUBST([cif_version_meta],
m4_bregexp(AC_PACKAGE_VERSION,[\(-\S+\)$],[\1]))
test "x$cif_version_major" = 'x' && cif_version_major=0
test "x$cif_version_minor" = 'x' && cif_version_minor=0
test "x$cif_version_patch" = 'x' && cif_version_patch=0
test "x$cif_version_meta" = 'x' && cif_version_meta=''
dnl version numbers
AC_SUBST(CIF_VERSION,AC_PACKAGE_VERSION)
AC_SUBST(CIF_VERSION_MAJOR, ${cif_version_major})
AC_SUBST(CIF_VERSION_MINOR, ${cif_version_minor})
AC_SUBST(CIF_VERSION_PATCH, ${cif_version_patch})
AC_SUBST(CIF_VERSION_META, ${cif_version_meta})
AC_SUBST(CIF_PROTOCOL_VERSION, m4_esyscmd([( cat .protocol_version ) | tr -d "\n"]))
AC_SUBST(ORG,'csirtgadgets.org')
AC_SUBST(DEFAULT_PORT, m4_esyscmd([( cat .default_port ) | tr -d "\n"]))
AC_PROG_INSTALL
# perl stuff
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
AC_ARG_VAR([CPANM],[cpanminus app])
AC_PATH_PROG([CPANM],[cpanm],[not found])
AM_CONDITIONAL(HAVE_CPANM, test "x$CPANM" != 'not found')
AC_PATH_PROG([CURL],[curl],[not found])
if test "$CURL" = 'not found'; then
AC_MSG_ERROR([curl required to configure elasticsearch...])
fi
AC_PATH_PROG([GZIP],[gzip],[not found])
if test "$GZIP" = 'not found'; then
AC_MSG_ERROR([gzip2 required to decompress geoip database])
fi
AC_ARG_ENABLE(perl-critic, AC_HELP_STRING(--enable-perl-critic, Enable Perl::Critic in testing @<:@default=no@:>@),
enable_perl_critic=$enableval, enable_perl_critic="no")
if test x$enable_perl_critic = xyes; then
AC_SUBST(PERL_CRITIC,1)
fi
AC_ARG_VAR([ES_HOST],[ElasticSearch Host])
AC_ARG_WITH(es-host,
AC_HELP_STRING([--with-es-host=ES_HOST],
[elastic search host @<:@default=localhost:9200@:>@]),
ES_HOST=$withval,
ES_HOST='localhost:9200')
AC_SUBST(ES_HOST)
AC_CONFIG_FILES([
Makefile
src/Makefile.PL
src/lib/CIF/Generated.pm
elasticsearch/Makefile
hacking/packaging/ubuntu/default/cif
])
#dnl CIF_USER
AC_ARG_WITH(user,
AC_HELP_STRING([--with-user=USER],
[user the cif scripts will run as (default: cif)]),
CIF_USER=$withval,
CIF_USER=cif)
AC_SUBST(CIF_USER)
#dnl CIF_GROUP
AC_ARG_WITH(group,
AC_HELP_STRING([--with-group=GROUP],
[group the cif scripts will run as (default: cif)]),
CIF_GROUP=$withval,
CIF_GROUP=$CIF_USER
)
AC_SUBST(CIF_GROUP)
AC_ARG_ENABLE(geoip,
AS_HELP_STRING(--enable-geoip, Enable Maxmind GeoIP @<:@default=no@:>@),
enable_geoip=$enableval, enable_geoip="no")
AM_CONDITIONAL([HAVE_GEOIP], [test "x$enable_geoip" != "xno"])
#TODO make this configurable
if test "x$prefix" != xNONE; then
AC_SUBST(CIF_PATH, `eval "echo ${prefix}"`)
else
AC_SUBST(CIF_PATH, `eval "echo ${ac_default_prefix}"`)
fi
AC_SUBST(siteperldir, `eval "echo ${CIF_PATH}/lib/perl5"`)
if test "x$sysconfdir" == 'x${prefix}/etc'; then
AC_SUBST(ext_sysconfdir, `eval "echo ${CIF_PATH}/etc"`)
else
AC_SUBST(ext_sysconfdir, `eval "echo $sysconfdir"`)
fi
if test "x$localstatedir" == 'x${prefix}/var'; then
AC_SUBST(ext_localstatedir, `eval "echo ${CIF_PATH}/var"`)
else
AC_SUBST(ext_localstatedir, `eval "echo $localstatedir"`)
fi
AC_OUTPUT