1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
[buildout]
extends =
../gdbm/buildout.cfg
../patch/buildout.cfg
../xz-utils/buildout.cfg
parts =
perl
[perl]
recipe = slapos.recipe.cmmi
version = 5.28.1
url = http://www.cpan.org/src/5.0/perl-${:version}.tar.xz
md5sum = fbb590c305f2f88578f448581b8cf9c4
siteprefix = ${buildout:parts-directory}/site_${:_buildout_section_name_}
patch-options = -p1
patches =
${:_profile_base_location_}/perl-keep-linker-flags-in-ldflags.patch#4e8e0c59d7176eafb0c7402dea17bef1
${:_profile_base_location_}/0001-Fix-missing-build-dependency-for-pods.patch#85aff81f3bea34fcd6ce9a611ee1cdb2
${:_profile_base_location_}/0002-prereq1.patch#c9bf3b521a39134d044eaa2c2312174f
${:_profile_base_location_}/0003-prereq2.patch#5268ff6dd06718cff34e6fb758045996
${:_profile_base_location_}/0004-disable-probing.patch#e68446ccd155c2282639e495a5be612b
configure-command =
sh Configure -des \
-Dprefix=${buildout:parts-directory}/${:_buildout_section_name_} \
-Dsiteprefix=${:siteprefix} \
-Dcflags=-I${gdbm:location}/include \
-Dldflags="-L${gdbm:location}/lib -Wl,-rpath=${gdbm:location}/lib" \
-Ui_db \
-Dnoextensions=ODBM_File \
-Dusethreads
environment =
PATH=${patch:location}/bin:${xz-utils:location}/bin:%(PATH)s
post-make-hook = ${:_profile_base_location_}/perl-create-libs-symlink.py#943453b7d3ff8d49ed12d44a7f7076ee:post_make_hook
[perl-CPAN-package]
# Macro to install a perl package from CPAN
# This macro will generate a perl wrapper as {:perl-bin} and rewrite all
# scripts installed by the package to use this perl. Executable scripts are
# installed in ${:perl-PATH}
# Inputs:
# - module name, ie. Category/Category-Name
module = (required)
# - module version
version = (required)
# - checksum of module
md5sum = (required)
# - colon (:) separated site perl of runtime dependencies, for example
# ${perl-X-Y:site_perl}:${perl-X-Z:site_perl} these paths will be included in
# the generated wrappers
inc =
# - colon (:) separated site perl of install dependencies, for example
# ${perl-X-Y:site_perl}:${perl-X-Z:site_perl} these paths will be used only
# for installation. A typical use case is to add current directory (.) for
# packages using a local version of Module::Install.
install-inc =
# - extra arguments passed to perl Makefile.PL
extra-configure-args =
# - extra environ varialbles for configure and make
extra-env =
# Outputs:
# - site_perl, to use in inc in dependent packages
site_perl=${:location}/lib/site_perl/${perl:version}:${:location}:${:inc}
# - a $PATH that contain the perl wrapper
perl-PATH = ${:location}/bin/
# - the path for a perl wrapper with @INC set to this CPAN package and all the
# dependencies
perl-bin = ${:perl-PATH}/perl
perl-PERL5LIB =
# Implementation
recipe = slapos.recipe.cmmi
url = https://www.cpan.org/modules/by-module/${:module}-${:version}.tar.gz
configure-command =
${:extra-env}
PERL5LIB="${:inc}:${:install-inc}:${:perl-PERL5LIB}" \
${perl:location}/bin/perl \
Makefile.PL \
PREFIX=${:location} \
${:extra-configure-args}
location = ${buildout:parts-directory}/${:_buildout_section_name_}
# Install scripts in "perl-bin", but create wrappers in ./bin/
make-options =
INSTALLSITESCRIPT=${:location}/perl-bin/
make-binary=
${:extra-env} PERL5LIB="${:inc}:${:install-inc}:${:perl-PERL5LIB}" make
# this post-make-hook is same for all users of the macro.
post-make-hook = ${:_profile_base_location_}/../../component/perl/perl-CPAN-package-create-wrapper.py#d012f7ba3300b14b2c6b173351d410be:post_make_hook
perl_location = ${perl:location}
[perl-wrapper]
# Macro to generate a perl wrapper with @INC set as ${:inc}
# The wrapper will be named as the section name, in buildout's bin directory.
#
# Note that this is usually not needed, because each part installed with
# perl-CPAN-package generates its own wrapper with the package and all
# dependencies available.
# This macro is useful to build a wrapper with several independent package
# available.
# It also takes care of executing perl with -I argument and not with $PERL5LIB
# environment variable, because the later is ignored when perl runs in tainted
# mode ( with -T argument )
#
# Inputs:
# - inc : colon (:) separated site perl of modules to include in @INC
# Outputs:
# - perl-bin : an executable perl
recipe = slapos.recipe.template:jinja2
template = inline:
#!/bin/sh
{% set inc = "${:inc}".split(':') %} {# XXX we could remove duplicates from inc #}
exec ${perl:location}/bin/perl \
{% for item in inc -%}{% if item %} -I "{{ item }}" \
{% endif %}{% endfor %} "$@"
mode = 0755
rendered = ${buildout:bin-directory}/${:_buildout_section_name_}
perl-bin = ${:rendered}