]> git.evergreen-ils.org Git - OpenSRF.git/blob - src/Makefile.am
Commit autotools patch from Kevin Beswick
[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 OPENSRF  = opensrf
18 export BINDIR   = @bindir@
19 export LIBDIR   = @libdir@
20 perldir = $(LIBDIR)/perl5
21 jsdir = $(LIBDIR)/javascript
22 export OSRF_JAVA_DEPSDIR = @OSRF_JAVA_DEPSDIR@
23 etcdir = $(ETCDIR)
24
25
26 AM_LDFLAGS = $(DEF_LDFLAGS)
27 AM_CFLAGS = $(DEF_CFLAGS)
28
29 if BUILDPYTHON
30 MAYBE_PY = python
31 endif 
32
33 if BUILDJAVA
34 MAYBE_JA = java
35 endif
36
37 SUBDIRS = libopensrf c-apps router srfsh jserver gateway $(MAYBE_PY) $(MAYBE_JA)
38
39 dist_bin_SCRIPTS = @top_srcdir@/bin/osrf_ctl.sh
40 bin_SCRIPTS = @top_srcdir@/bin/osrf_config
41
42 dist_sysconf_DATA = @top_srcdir@/examples/opensrf.xml.example @top_srcdir@/examples/opensrf_core.xml.example @top_srcdir@/examples/srfsh.xml.example 
43
44 install-exec-local:
45         mkdir -p $(VAR)
46         mkdir -p $(PID)
47         mkdir -p $(LOG)
48         mkdir -p $(SOCK)
49         mkdir -p $(jsdir)
50         mkdir -p $(perldir)
51
52 install-exec-hook:
53         sed -i 's|LOCALSTATEDIR|$(VAR)|g' '$(DESTDIR)@sysconfdir@/opensrf.xml.example'
54         sed -i 's|SYSCONFDIR|$(ETCDIR)|g' '$(DESTDIR)@sysconfdir@/opensrf.xml.example'
55         sed -i 's|LOCALSTATEDIR|$(VAR)|g' '$(DESTDIR)@sysconfdir@/opensrf_core.xml.example'
56         sed -i 's|SYSCONFDIR|$(ETCDIR)|g' '$(DESTDIR)@sysconfdir@/opensrf_core.xml.example'
57         sed -i 's|LOCALSTATEDIR|$(VAR)|g' '$(DESTDIR)@sysconfdir@/srfsh.xml.example'
58         sed -i 's|SYSCONFDIR|$(ETCDIR)|g' '$(DESTDIR)@sysconfdir@/srfsh.xml.example'
59         sed -i 's|SYSCONFDIR|$(ETCDIR)|g' '@abs_top_srcdir@/examples/math_bench.pl'
60         sed -i 's|LIBDIR|$(LIBDIR)|g' '@abs_top_srcdir@/examples/multisession-test.pl'
61         sed -i 's|SYSCONFDIR|$(ETCDIR)|g' '@abs_top_srcdir@/doc/dokuwiki-doc-stubber.pl'
62         cp -r @srcdir@/javascript/* $(jsdir)/
63         sed -i 's|LOCALSTATEDIR|$(VAR)|g' '@srcdir@/perlmods/OpenSRF/Utils/Config.pm'
64         cp -r @srcdir@/perlmods/* $(perldir)/
65
66
67 uninstall-hook:
68         rm @includedir@/opensrf/apachetools.h
69         rm -R $(jsdir)
70         rm -R $(perldir)
71