Skip to content

Commit df07d9c

Browse files
committed
cleanup ytoolshed#6
1 parent b666c4b commit df07d9c

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

68 files changed

+180
-122
lines changed

librange/AUTHORS AUTHORS

File renamed without changes.

librange/COPYING COPYING

File renamed without changes.

librange/ChangeLog ChangeLog

File renamed without changes.

librange/INSTALL INSTALL

File renamed without changes.

Makefile.am

+19
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
if WANT_MODRANGE
2+
MAYBE = mod_range $(MAYBE)
3+
endif
4+
5+
#if WANT_PERL
6+
# MAYBE = perl
7+
#endif
8+
9+
# stealing from http://www.gnu.org/prep/standards/html_node/Directory-Variables.html */
10+
LIBRANGE_CONF = @sysconfdir@/librange.conf
11+
DEFAULT_SQLITE_DB = @localstatedir@/range.sqlite
12+
LIBRANGE_FUNCDIR = @libdir@/librange/
13+
14+
SUBDIRS = src plugins $(MAYBE) doc
15+
EXTRA_DIST = configure attic m4 clients utils
16+
ACLOCAL_AMFLAGS = -I m4
17+
LIBRANGE_DATADIR = "/var/range"
18+
19+

librange/NEWS NEWS

File renamed without changes.

README

-68
Original file line numberDiff line numberDiff line change
@@ -1,68 +0,0 @@
1-
18:24 < e> i've successfully built it on RHEL6
2-
18:24 < e> via multipkg
3-
18:24 < e> you need libcrange, mod_ranged both installed
4-
18:24 < e> and then edit /etc/libcrange.conf to be something sane
5-
18:25 < e> for yaml files, [ebourget@ela4-admin02 ~]$ cat /etc/libcrange.conf
6-
18:25 < e> loadmodule yamlfile
7-
18:25 < e> that's it
8-
18:25 < e> then put *.yaml in /etc/range/
9-
18:25 < e> yaml files are:
10-
18:25 < e> [ebourget@ela4-admin02 range]$ cat ela4-zeppelin1.yaml
11-
18:25 < e> ALL:
12-
18:25 < e> - ela4-app0240.prod.linkedin.com
13-
18:25 < e> - ela4-app0357.prod.linkedin.com
14-
18:25 < e> CLUSTER:
15-
18:25 < e> - ela4-app0240.prod.linkedin.com
16-
18:25 < e> - ela4-app0357.prod.linkedin.com
17-
18:25 < e> CONFIG: zeppelin-war-PROD-ELA4-0.0.1140-RC4.15145
18-
18:25 < e> CONTAINER: zeppelin
19-
18:25 < e> CONTEXTPATH:
20-
18:25 < e> etc
21-
18:32 < p> builds fine on osx
22-
18:32 < p> s/libtoolize/glibtoolize/
23-
18:33 < p> how different is the yaml/range specification stuff than the rolesdb stuff i'm used to?
24-
18:35 < m> in terms of parsing?
25-
18:35 < p> in terms of specification
26-
18:35 < p> like:
27-
18:35 < p> ALL:\n- foo4-10.bar.com
28-
18:36 < p> is that 4..10?
29-
18:36 < m> depend if you have - or .. as the expansion dealie
30-
18:36 < m> I think e switched it
31-
18:36 < p> yeah i saw
32-
18:36 < m> so - does nothing now
33-
18:36 < p> heh
34-
18:36 < p> but .. would, got it
35-
18:36 < m> but foo4..10.bar.com would be 4..10 yes
36-
18:36 < m> no enclosing {} necessary
37-
18:37 < e> - does set diff
38-
18:37 < p> and i guess i'm confused about the difference between the definitions like ALL: and how i'm used to using
39-
role-names. is 'ALL' in this case a rolename?
40-
18:37 < e> (a,b) - b ==> a
41-
18:37 < m> e: with spaces right
42-
18:37 < m> yeah
43-
18:37 < e> uh
44-
18:37 < e> ALL is a metadata key
45-
18:37 < e> if you have foo.yaml
46-
18:37 < e> with ALL: bar
47-
18:37 < e> then
48-
18:37 < m> p: so, the *file* represents a cluster (role)
49-
18:37 < e> %foo:ALL == bar
50-
18:37 < m> and
51-
18:37 < m> every cluster/role is actually a dictionary/hash
52-
18:37 < e> there's only one magic key
53-
18:38 < e> called CLUSTER
54-
18:38 < e> where if you just say %foo
55-
18:38 < e> it means %foo:CLUSTER
56-
18:38 < e> everything else is just whatever you feel like calling it
57-
18:38 < m> so from a roles perspective
58-
18:38 < m> there are two magic clusters, HOSTS and GROUPS
59-
18:38 < p> ahhh
60-
18:38 < p> ok
61-
18:39 < m> and %GROUPS:FOO has a shorthand syntax of @FOO
62-
18:39 < m> and this is what rolesdb implemented
63-
18:39 < m> but the actual underlying cluster labels can have multiple definitions of host lists
64-
18:39 < m> with arbitary names
65-
18:40 < m> and as e said there's one that's magic: %foo:CLUSTER, and a few that are by convention like :ALL
66-
18:40 < p> i'll try to distil this into some actual documentation at some point
67-
18:40 < p> needs QUICKSTART
68-

librange/configure.ac configure.ac

+43-10
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
AC_PREREQ(2.59)
44
AC_INIT([librange], [1.1], [[email protected]])
5-
AC_CONFIG_SRCDIR(src/librange.h)
5+
AC_CONFIG_SRCDIR([src/librange.h])
66
AC_CONFIG_MACRO_DIR([m4])
77
AC_CONFIG_AUX_DIR([build-aux])
88
AM_CONFIG_HEADER([src/config.h])
@@ -21,12 +21,28 @@ AC_PROG_MAKE_SET
2121
AC_PROG_LIBTOOL
2222
AM_PROG_CC_C_O
2323

24-
perl_default="/usr/bin/perl"
25-
AC_ARG_ENABLE([perl], AC_HELP_STRING([--enable-perl=PERL],
26-
["Use this perl binary to build libcrange's perl
27-
functionality.
28-
(Default = /usr/local/bin/perl)"]),
29-
PERL=$enableval,PERL=$perl_default)
24+
25+
# begin perl checking
26+
perl_default="/usr/local/bin/perl"
27+
AC_ARG_ENABLE(
28+
perl,
29+
AC_HELP_STRING([--enable-perl@<:@=PERL@:>@],
30+
[Use this perl binary to build perl functionality. Requires libperl and working PCRE. (default = /usr/local/bin/perl)]),
31+
if test "$enableval" == "yes"; then
32+
PERL=$perl_default
33+
else
34+
PERL=$enableval
35+
fi
36+
)
37+
AM_CONDITIONAL([WANT_PERL], [test ! -z "$PERL"])
38+
39+
AC_ARG_ENABLE(
40+
[mod-range],
41+
AC_HELP_STRING([--enable-mod-range],
42+
[Build apache module (Default = enabled)]),
43+
MOD_RANGE=$enableval)
44+
AM_CONDITIONAL([WANT_MODRANGE], [test "$MOD_RANGE" == "yes"])
45+
3046
AC_DEFUN([AC_CHECK_PERL],[
3147
AC_MSG_CHECKING(perl in $PERL)
3248
if test [ -f "$PERL" ]
@@ -86,10 +102,27 @@ else
86102
fi
87103
])
88104

89-
AC_CHECK_PERL
90-
AC_CHECK_PCRE
105+
AC_DEFUN([AC_CHECK_APXS],[
106+
AC_CHECK_PROGS(APXS,[apxs apxs2],[],[path=$PATH$PATH_SEPARATOR/usr/local/apache$PATH_SEPARATOR/usr/apache])
107+
if test -z "$APXS"; then
108+
AC_MSG_ERROR("apxs not found")
109+
fi
110+
])
111+
112+
# always need APR
91113
AC_CHECK_APR
92114

115+
# optionally check for perl
116+
if test ! -z "$PERL"; then
117+
AC_CHECK_PERL
118+
AC_CHECK_PCRE
119+
fi
120+
121+
# optionally check for apxs
122+
if test -z "$MOD_RANGE"; then
123+
AC_CHECK_APXS
124+
fi
125+
93126
AC_CHECK_LIB([m], [sin], [], [exit 1])
94127
AC_CHECK_LIB([pthread], [pthread_create], [], [exit 1])
95128
AC_CHECK_LIB([z], [zlibVersion], [], [exit 1])
@@ -111,5 +144,5 @@ AC_CONFIG_FILES([Makefile
111144
doc/Makefile
112145
m4/Makefile
113146
src/Makefile
114-
src/functions/Makefile])
147+
plugins/Makefile])
115148
AC_OUTPUT
File renamed without changes.

librange/Makefile.am

-2
This file was deleted.

librange/README

Whitespace-only changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.

librange/src/functions/Makefile.am plugins/Makefile.am

+2-3
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
AM_CFLAGS = -g -pg -Wall -DLIBCRANGE_FUNCDIR=\"$(pkglibdir)\" -DLIBCRANGE_CONF=\"/etc/libcrange.conf\" -DDEFAULT_SQLITE_DB=\"/var/range.sqlite\" -DLIBCRANGE_YAML_DIR=\"/var/range/\" -I../src @PCRE_CFLAGS@ @APR_CFLAGS@
2-
AM_LDFLAGS = -module -L../src -lcrange -lyaml -lsqlite3 @PCRE_LIBS@ @APR_LIBS@
1+
AM_CFLAGS = -g -pg -Wall -DLIBCRANGE_FUNCDIR=\"$(pkglibdir)\" -DLIBCRANGE_CONF=\"/etc/libcrange.conf\" -DDEFAULT_SQLITE_DB=\"/var/range.sqlite\" -DLIBCRANGE_YAML_DIR=\"/var/range/\" @PCRE_CFLAGS@ @APR_CFLAGS@
2+
AM_LDFLAGS = -module -lrange -lyaml -lsqlite3 @PCRE_LIBS@ @APR_LIBS@
33

44
pkglib_LTLIBRARIES = yst-ip-list.la ip.la nodescf.la yamlfile.la sqlite.la
55

@@ -11,4 +11,3 @@ yst_ip_list_la_SOURCES = yst-ip-list.c netblock.c tinydns_ip.c \
1111
ip_la_SOURCES = ip.c tinydns_ip.c
1212

1313

14-

librange/src/functions/group-mysql.c plugins/group-mysql.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
#include <apr_strings.h>
77

88
#include "set.h"
9-
#include "libcrange.h"
9+
#include "librange.h"
1010
#include "range.h"
1111

1212
const char** functions_provided(libcrange* lr)

librange/src/functions/group-sqlite.c plugins/group-sqlite.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
#include <sqlite3.h>
66

77
#include "set.h"
8-
#include "libcrange.h"
8+
#include "librange.h"
99
#include "range.h"
1010

1111
const char** functions_provided(libcrange* lr)
File renamed without changes.

librange/src/functions/hosts-netblocks.h plugins/hosts-netblocks.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
#ifndef HOSTS_NETBLOCKS_H
22
#define HOSTS_NETBLOCKS_H
33

4-
#include "libcrange.h"
4+
#include "librange.h"
55
#include "range.h"
66
#include "netblock.h"
77

librange/src/functions/ip.c plugins/ip.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#include "libcrange.h"
1+
#include "librange.h"
22
#include "range.h"
33
#include "tinydns_ip.h"
44

File renamed without changes.

librange/src/functions/netblock.h plugins/netblock.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
#ifndef NETBLOCK_H
22
#define NETBLOCK_H
33

4-
#include "libcrange.h"
4+
#include "librange.h"
55
#include "range.h"
66
#include "tinydns_ip.h"
77

librange/src/functions/nodescf.c plugins/nodescf.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
#include <sys/stat.h>
88
#include <apr_strings.h>
99
#include <apr_tables.h>
10-
#include "libcrange.h"
10+
#include "librange.h"
1111
#include "range.h"
1212

1313
static const char* nodescf_path = "/etc/range";

librange/src/functions/nodescf.h plugins/nodescf.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
#ifndef NODESCF_H
22
#define NODESCF_H
33

4-
#include "libcrange.h"
4+
#include "librange.h"
55
#include "set.h"
66
#include "filecache.h"
77

librange/src/functions/pgsql.c plugins/pgsql.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
#include <apr_strings.h>
77

88
#include "set.h"
9-
#include "libcrange.h"
9+
#include "librange.h"
1010
#include "range.h"
1111

1212
const char** functions_provided(libcrange* lr)

librange/src/functions/sqlite.c plugins/sqlite.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
#include <sys/stat.h>
99

1010
#include "set.h"
11-
#include "libcrange.h"
11+
#include "librange.h"
1212
#include "range.h"
1313
char* _join_elements(apr_pool_t* pool, char sep, set* the_set);
1414

librange/src/functions/tinydns_ip.c plugins/tinydns_ip.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99

1010
#include "range_request.h"
1111
#include "set.h"
12-
#include "libcrange.h"
12+
#include "librange.h"
1313
#include "tinydns_ip.h"
1414

1515
typedef struct cache_entry

librange/src/functions/tinydns_ip.h plugins/tinydns_ip.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
#ifndef TINYDNS_IP_H
22
#define TINYDNS_IP_H
33

4-
#include "libcrange.h"
4+
#include "librange.h"
55

66
#define A_RE "^\\+([^:]+):([^:]+):0"
77
#define CNAME_RE "^C([^:]+):([^:]+)\\.:0"

librange/src/functions/yamlfile.c plugins/yamlfile.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ the key will be composed of all elements set-added together.
6262
#include <sys/stat.h>
6363
#include <apr_strings.h>
6464
#include <apr_tables.h>
65-
#include "libcrange.h"
65+
#include "librange.h"
6666
#include "range.h"
6767

6868
static const char* yaml_path = LIBCRANGE_YAML_DIR;

librange/src/functions/yst-ip-list.c plugins/yst-ip-list.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
#include <string.h>
33

44
#include "set.h"
5-
#include "libcrange.h"
5+
#include "librange.h"
66
#include "range.h"
77
#include "tinydns_ip.h"
88
#include "hosts-netblocks.h"

librange/src/Makefile.am src/Makefile.am

+1-2
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
SUBDIRS = functions
21
AM_YFLAGS = -d
32
AM_CFLAGS = -fPIC -Wall
43
bin_PROGRAMS = range
@@ -16,7 +15,7 @@ librange_la_SOURCES = range_parser.y range_scanner.l \
1615
librange.c ast.c range_compress.c \
1716
range.c
1817

19-
librange_la_CFLAGS = -Wall -DLIBRANGE_FUNCDIR=\"$(pkglibdir)\" -DLIBRANGE_CONF=\"/etc/range.conf\" -DDEFAULT_SQLITE_DB=\"/var/range.sqlite\" -DLIBRANGE_YAML_DIR=\"/var/range/\" @PERL_CFLAGS@ @PCRE_CFLAGS@ @APR_CFLAGS@
18+
librange_la_CFLAGS = -Wall @PERL_CFLAGS@ @PCRE_CFLAGS@ @APR_CFLAGS@
2019
librange_la_LDFLAGS = @PERL_LIBS@ @PCRE_LIBS@ @APR_LIBS@
2120

2221
range_scanner.h:

librange/src/ast.c src/ast.c

+2-2
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ Copyrights licensed under the New BSD License. See the accompanying LICENSE file
77
#include <stdio.h>
88
#include "ast.h"
99
#include "range.h"
10-
#include "libcrange.h"
10+
#include "librange.h"
1111

1212
rangeast* range_ast_new(apr_pool_t* pool, rangetype type)
1313
{
@@ -114,7 +114,7 @@ range* range_evaluate(range_request* rr, const rangeast* ast)
114114
r = range_new(rr);
115115
return r;
116116
default:
117-
fprintf(stderr, "ERROR IN LIBCRANGE: Corrupted AST\n");
117+
fprintf(stderr, "ERROR IN LIBRANGE: Corrupted AST\n");
118118
abort();
119119
}
120120
}

librange/src/ast.h src/ast.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ Copyrights licensed under the New BSD License. See the accompanying LICENSE file
66
#ifndef AST_H
77
#define AST_H
88

9-
#include "libcrange.h"
9+
#include "librange.h"
1010
#include "range.h"
1111

1212
typedef enum {

librange/src/compile src/compile

File renamed without changes.
File renamed without changes.

librange/src/config.h src/config.h

File renamed without changes.
File renamed without changes.

librange/src/crange.i src/crange.i

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
%module Crange
22
%{
3-
#include "libcrange.h"
3+
#include "librange.h"
44
%}
55
%include "libcrange.h"
66
%inline %{

librange/src/depcomp src/depcomp

File renamed without changes.
File renamed without changes.
File renamed without changes.

0 commit comments

Comments
 (0)