Merge branch 'master' of mathias-kettner.de:omd
[omd.git] / packages / rrdtool / Makefile
blobc2ab6324b682ca430176fd2f2cd3e9d8fd6133e5
1 include ../../Makefile.omd
3 NAME = rrdtool
4 VERSION = 1.5.4
5 DIR = $(NAME)-$(VERSION)
6 PYTHON = LD_LIBRARY_PATH=$(shell pwd)/../python/tmp.python27/lib \
7 $(shell pwd)/../python/tmp.python27/bin/python
9 CONFIGUREOPTS = \
10 --prefix=$(OMD_ROOT) \
11 --disable-ruby \
12 --disable-libwrap \
13 --enable-perl-site-install \
14 --disable-tcl \
15 --disable-lua \
16 --disable-rrdcgi \
17 --with-perl-options="LIB=$(DESTDIR)$(OMD_ROOT)/lib/perl5/lib/perl5"
19 build: check-python
20 if [ -d $(DIR) ]; then rm -rf $(DIR); fi
21 tar xzf $(DIR).tar.gz
22 for p in patches/*.diff ; do \
23 echo "applying $$p..." ; \
24 ( cd $(DIR) ; patch -p1 -b ) < $$p ; \
25 done
27 # set perl environment to match the other perl modules
28 echo "install --install_base $(DESTDIR)$(OMD_ROOT)/lib/perl5" > .modulebuildrc
29 export PERL5LIB=$(P5TMPDIST)/dest/lib/perl5; \
30 export PERL_MM_OPT=INSTALL_BASE=$(DESTDIR)$(OMD_ROOT)/lib/perl5; \
31 export MODULEBUILDRC=$$(pwd)/.modulebuildrc; \
32 export LDFLAGS="-lglib-2.0"; \
33 cd $(DIR) && \
34 ./configure $(CONFIGUREOPTS) && \
35 $(MAKE) all
37 # Python binding
38 export LDFLAGS="-L$(shell pwd)/../python/tmp.python27/lib -L$(shell pwd)/../python/tmp.python27/lib/python2.7/config" ; \
39 cd $(DIR)/bindings/python && $(PYTHON) setup.py build
41 check-python:
42 @if [ ! -d ../python/tmp.python27 ]; then \
43 echo "ERROR: You need to build the \"python\" package first" ; \
44 exit 1 ; \
47 install:
48 export PERL5LIB=$(P5TMPDIST)/dest/lib/perl5; \
49 $(MAKE) DESTDIR=$(DESTDIR) -C $(DIR) install
51 # clean up perl man pages which end up in wrong location
52 # clean up systemd init files
53 if [ -n "$(DESTDIR)" ]; then \
54 rm -fr $(DESTDIR)/usr/local ; \
55 rm -fr $(DESTDIR)/lib ; \
58 mkdir $(DESTDIR)$(OMD_ROOT)/share/doc/rrdtool || true
59 install -m 644 $(DIR)/COPYRIGHT $(DESTDIR)$(OMD_ROOT)/share/doc/rrdtool
60 install -m 644 $(DIR)/CONTRIBUTORS $(DESTDIR)$(OMD_ROOT)/share/doc/rrdtool
62 # Python binding
63 export PYTHONPATH=$$PYTHONPATH:$(DESTDIR)$(OMD_ROOT)/lib/python && \
64 cd $(DIR)/bindings/python && \
65 $(PYTHON) setup.py install --home=$(DESTDIR)/$(OMD_ROOT) --prefix "" \
66 --install-platlib=$(DESTDIR)$(OMD_ROOT)/lib/python \
67 --install-purelib=$(DESTDIR)$(OMD_ROOT)/lib/python \
69 if [ -n "$(DESTDIR)$(OMD_ROOT)" -a -d "$(DESTDIR)$(OMD_ROOT)/lib64" ] ; then \
70 rsync -avh $(DESTDIR)$(OMD_ROOT)/lib64/* $(DESTDIR)$(OMD_ROOT)/lib/ ; \
71 rm -rf $(DESTDIR)$(OMD_ROOT)/lib64 ; \
74 skel:
76 clean:
77 rm -rf $(DIR)
78 rm -rf .modulebuildrc