]> git.evergreen-ils.org Git - OpenSRF.git/blob - src/Makefile.am
12fb2b90f0cfab34319d4c5fb7b0962552750d74
[OpenSRF.git] / src / Makefile.am
1 # Copyright (C) 2008 Equinox Software, Inc.
2 # Kevin Beswick <kevinbeswick00@gmail.com>
3 #
4 # This program is free software; you can redistribute it and/or
5 # modify it under the terms of the GNU General Public License
6 # as published by the Free Software Foundation; either version 2
7 # of the License, or (at your option) any later version.
8 #
9 # This program is distributed in the hope that it will be useful,
10 # but WITHOUT ANY WARRANTY; without even the implied warranty of
11 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
12 # GNU General Public License for more details.
13
14
15 # Declare some directory variables
16
17 export TMPDIR   = $(TMP)
18 export OPENSRF  = opensrf
19 export BINDIR   = @bindir@
20 export LIBDIR   = @libdir@
21 perldir = $(LIBDIR)/perl5
22 jsdir = $(LIBDIR)/javascript
23 export INCLUDEDIR= @includedir@
24 export OSRF_JAVA_DEPSDIR = @OSRF_JAVA_DEPSDIR@
25 etcdir = $(ETCDIR)
26
27
28 AM_LDFLAGS = $(DEF_LDFLAGS)
29 AM_CFLAGS = $(DEF_CFLAGS)
30
31 if BUILDPYTHON
32 MAYBE_PY = python
33 endif 
34
35 if BUILDJAVA
36 MAYBE_JA = java
37 endif
38
39 SUBDIRS = libopensrf c-apps router srfsh jserver gateway $(MAYBE_PY) $(MAYBE_JA)
40
41 dist_bin_SCRIPTS = ../bin/osrf_ctl.sh
42 bin_SCRIPTS = ../bin/osrf_config
43
44 dist_etc_DATA = @top_srcdir@/examples/opensrf.xml.example @top_srcdir@/examples/opensrf_core.xml.example @top_srcdir@/examples/srfsh.xml.example 
45
46 install-exec-local:
47         mkdir -p $(VAR)
48         mkdir -p $(PID)
49         mkdir -p $(LOG)
50         mkdir -p $(SOCK)
51         mkdir -p $(ETCDIR)
52         mkdir -p $(jsdir)
53         mkdir -p $(perldir)
54
55 install-data-hook:
56         ln -sf $(BINDIR)/opensrf $(BINDIR)/opensrf-c
57         sed -i 's|LOCALSTATEDIR|$(VAR)|g' '$(ETCDIR)/opensrf.xml.example'
58         sed -i 's|SYSCONFDIR|$(ETCDIR)|g' '$(ETCDIR)/opensrf.xml.example'
59         sed -i 's|LOCALSTATEDIR|$(VAR)|g' '$(ETCDIR)/opensrf_core.xml.example'
60         sed -i 's|SYSCONFDIR|$(ETCDIR)|g' '$(ETCDIR)/opensrf_core.xml.example'
61         sed -i 's|LOCALSTATEDIR|$(VAR)|g' '$(ETCDIR)/srfsh.xml.example'
62         sed -i 's|SYSCONFDIR|$(ETCDIR)|g' '$(ETCDIR)/srfsh.xml.example'
63         sed -i 's|SYSCONFDIR|$(ETCDIR)|g' '@abs_top_srcdir@/examples/math_bench.pl'
64         sed -i 's|LIBDIR|$(LIBDIR)|g' '@abs_top_srcdir@/examples/multisession-test.pl'
65         sed -i 's|SYSCONFDIR|$(ETCDIR)|g' '@abs_top_srcdir@/doc/dokuwiki-doc-stubber.pl'
66         cp -r @srcdir@/javascript/* $(jsdir)/
67         sed -i 's|LOCALSTATEDIR|$(VAR)|g' '@srcdir@/perlmods/OpenSRF/Utils/Config.pm'
68         cp -r @srcdir@/perlmods/* $(perldir)/
69
70
71 uninstall-hook:
72         rm $(INCLUDEDIR)/opensrf/apachetools.h
73         rm $(bindir)/opensrf-c