]> git.evergreen-ils.org Git - OpenSRF.git/blob - src/Makefile.am
typo
[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 jsdir = $(LIBDIR)/javascript
21 export OSRF_JAVA_DEPSDIR = @OSRF_JAVA_DEPSDIR@
22 etcdir = $(ETCDIR)
23
24
25 AM_LDFLAGS = $(DEF_LDFLAGS)
26 AM_CFLAGS = $(DEF_CFLAGS)
27
28 if BUILDPYTHON
29 MAYBE_PY = python
30 endif 
31
32 if BUILDJAVA
33 MAYBE_JA = java
34 endif
35
36 SUBDIRS = libopensrf c-apps router srfsh jserver gateway $(MAYBE_PY) $(MAYBE_JA)
37
38 dist_bin_SCRIPTS = @top_srcdir@/bin/osrf_ctl.sh @top_srcdir@/bin/opensrf-perl.pl
39 bin_SCRIPTS = @top_srcdir@/bin/osrf_config
40
41 dist_sysconf_DATA = @top_srcdir@/examples/opensrf.xml.example @top_srcdir@/examples/opensrf_core.xml.example @top_srcdir@/examples/srfsh.xml.example 
42
43 install-exec-local:
44         mkdir -p $(VAR)
45         mkdir -p $(PID)
46         mkdir -p $(LOG)
47         mkdir -p $(SOCK)
48         mkdir -p $(jsdir)
49         make install-perl
50
51 install-exec-hook:
52         sed -i 's|LOCALSTATEDIR|$(VAR)|g' '$(DESTDIR)@sysconfdir@/opensrf.xml.example'
53         sed -i 's|SYSCONFDIR|$(ETCDIR)|g' '$(DESTDIR)@sysconfdir@/opensrf.xml.example'
54         sed -i 's|LOCALSTATEDIR|$(VAR)|g' '$(DESTDIR)@sysconfdir@/opensrf_core.xml.example'
55         sed -i 's|SYSCONFDIR|$(ETCDIR)|g' '$(DESTDIR)@sysconfdir@/opensrf_core.xml.example'
56         sed -i 's|LOCALSTATEDIR|$(VAR)|g' '$(DESTDIR)@sysconfdir@/srfsh.xml.example'
57         sed -i 's|SYSCONFDIR|$(ETCDIR)|g' '$(DESTDIR)@sysconfdir@/srfsh.xml.example'
58         sed -i 's|SYSCONFDIR|$(ETCDIR)|g' '@abs_top_srcdir@/examples/math_bench.pl'
59         sed -i 's|LIBDIR|$(LIBDIR)|g' '@abs_top_srcdir@/examples/multisession-test.pl'
60         sed -i 's|SYSCONFDIR|$(ETCDIR)|g' '@abs_top_srcdir@/doc/dokuwiki-doc-stubber.pl'
61         cp -r @srcdir@/javascript/* $(jsdir)/
62
63
64 install-perl:
65         cd ./perl && perl Makefile.PL || make -s install-perl-fail
66         make -C perl
67         make -C perl test || make -s install-perl-fail
68         make -C perl install
69
70 install-perl-fail:
71         echo
72         echo ">>> Installation of Perl modules has failed. The most likely"
73         echo ">>> possibility is that a dependency is not pre-installed"
74         echo ">>> or that a test has failed."
75         echo ">>> See the messages above this one for more information."
76         echo
77         exit 1
78
79 uninstall-hook:
80         rm @includedir@/opensrf/apachetools.h
81         rm -R $(jsdir)
82