version up : percona-toolkit 2.2.10.
[slapos.git] / component / mydumper / buildout.cfg
1 [buildout]
2
3 extends =
4     ../cmake/buildout.cfg
5     ../glib/buildout.cfg
6     ../pkgconfig/buildout.cfg
7     ../openssl/buildout.cfg
8     ../pcre/buildout.cfg
9     ../mariadb/buildout.cfg
10
11 parts = mydumper
12
13 # XXX-Antoine:
14 # This is really dirty, but it's the only way to install
15 # mydumper that works
16 [mydumper]
17 recipe = slapos.recipe.build
18 url = https://launchpad.net/mydumper/0.5/0.5.1/+download/mydumper-0.5.1.tar.gz
19 md5sum = b4df42dfe23f308ab13eb6ecb73a0d21
20 buildout-bin-dir = ${buildout:bin-directory}
21 cmake-command = ${cmake:location}/bin/cmake
22 mysql-config = ${mariadb:location}/bin/mysql_config
23 mysqllib = ${mariadb:location}/lib
24 path = ${pkgconfig:location}/bin
25 pkg-config-path = ${glib:location}/lib/pkgconfig/:${pcre:location}/lib/pkgconfig/:${openssl:location}/lib/pkgconfig/
26 libraries = ${zlib:location}/lib/:${glib:location}/lib/:${pcre:location}/lib/:${mariadb:location}/lib/:${openssl:location}/lib/
27 includes = ${zlib:location}/include/:${glib:location}/include/:${pcre:location}/include/:${mariadb:location}/include:${openssl:location}/include/
28 cflags = -I${zlib:location}/include/ -I${glib:location}/include/ -I${pcre:location}/include/ -I${mariadb:location}/include -I${openssl:location}/include/
29 mysql-include-dir = ${mariadb:location}/include
30 mydumper-patches =
31    ${:_profile_base_location_}/mydumper-remove-warnings-errors.patch 917fea16b5ddea195cfa33fbd9827f57 -p1
32 slapos_promise =
33     directory:bin
34     file:bin/mydumper
35     file:bin/myloader
36 script =
37     import os
38     url = self.download(self.options['url'], self.options.get('md5sum'))
39     extract_dir = self.extract(url)
40     workdir = guessworkdir(extract_dir)
41     self.applyPatchList(self.options['mydumper-patches'], cwd=workdir)
42     env['PATH'] = self.options['path'] + ':' + self.options['buildout-bin-dir'] + ':' + env.get('PATH', '')
43     env['PKG_CONFIG_PATH'] = self.options['pkg-config-path'] + ':' + \
44                              env.get('PKG_CONFIG_PATH', '')
45     env['CMAKE_INCLUDE_PATH'] = self.options['includes']
46     env['CMAKE_LIBRARY_PATH'] = self.options['libraries']
47     env['CFLAGS'] = self.options['cflags']
48     command_line = [self.options['cmake-command'],
49                     '-DCMAKE_INSTALL_PREFIX=%%s' %% self.options['location'],
50                     '-DMYSQL_CONFIG=%%s' %% self.options['mysql-config'],
51                     '-DCMAKE_C_FLAGS=%%s' %% self.options['cflags'],
52                     '-DCMAKE_INSTALL_RPATH=%%s' %% self.options['libraries'],
53                     '-DMYSQL_INCLUDE_DIR=%%s' %% self.options['mysql-include-dir'],
54                     '-DBUILD_DOCS=OFF',
55                     '.']
56     call(command_line, cwd=workdir, env=env)
57     call(['make'], cwd=workdir, env=env)
58     call(['make', 'install'], cwd=workdir, env=env)
59
60 # XXX-Antoine: here's what I did using slapos.recipe.cmmi.
61 # and it wasn't working !
62 #[mydumper]
63 #recipe = slapos.recipe.cmmi
64 #url = http://launchpad.net/mydumper/0.2/0.2.3/+download/mydumper-0.2.3.tar.gz
65 #md5sum = 36e6a1c97a9634a6882ddaac5e2697d5
66 #strip-top-level-dir = true
67 #location = ${buildout:parts-directory}/${:_buildout_section_name_}
68 #configure-command =
69 #    ${cmake:location}/bin/cmake \
70 #    -DCMAKE_INSTALL_PREFIX=${:location} \
71 #    -DMYSQL_CONFIG=${mariadb:location}/bin/mysql_config \
72 #    -DCMAKE_INCLUDE_PATH=${zlib:location}/include \
73 #    -DCMAKE_LIBRARY_PATH=${zlib:location}/lib \
74 #    .
75 #environment=
76 #    PATH=$PATH:${buildout:bin-directory}
77 #    PKG_CONFIG_PATH=${glib:location}/lib/pkgconfig/:${pcre:location}/lib/pkgconfig/