|
| 1 | +component 'augeas' do |pkg, settings, platform| |
| 2 | + pkg.version '1.8.1' |
| 3 | + pkg.md5sum '623ff89d71a42fab9263365145efdbfa' |
| 4 | + pkg.url "http://buildsources.delivery.puppetlabs.net/augeas-#{pkg.get_version}.tar.gz" |
| 5 | + |
| 6 | + # pkg.replaces 'pe-augeas' |
| 7 | + if platform.is_sles? && platform.os_version == '10' |
| 8 | + pkg.apply_patch 'resources/patches/augeas/augeas-1.2.0-fix-services-sles10.patch' |
| 9 | + end |
| 10 | + |
| 11 | + pkg.build_requires "libxml2" |
| 12 | + |
| 13 | + # Ensure we're building against our own libraries when present |
| 14 | + pkg.environment "PKG_CONFIG_PATH", "#{settings[:libdir]}/pkgconfig" |
| 15 | + |
| 16 | + if platform.is_aix? |
| 17 | + pkg.build_requires "http://osmirror.delivery.puppetlabs.net/AIX_MIRROR/pkg-config-0.19-6.aix5.2.ppc.rpm" |
| 18 | + pkg.environment "CC", "/opt/pl-build-tools/bin/gcc" |
| 19 | + pkg.environment "LDFLAGS", settings[:ldflags] |
| 20 | + pkg.environment "CFLAGS", "-I/opt/puppetlabs/puppet/include/" |
| 21 | + pkg.build_requires 'libedit' |
| 22 | + pkg.build_requires 'runtime' |
| 23 | + end |
| 24 | + |
| 25 | + if platform.is_rpm? && !platform.is_aix? |
| 26 | + pkg.build_requires 'readline-devel' |
| 27 | + pkg.build_requires 'pkgconfig' |
| 28 | + |
| 29 | + if platform.is_cisco_wrlinux? |
| 30 | + pkg.requires 'libreadline6' |
| 31 | + else |
| 32 | + pkg.requires 'readline' |
| 33 | + end |
| 34 | + |
| 35 | + if platform.architecture =~ /ppc64le|s390x/ |
| 36 | + pkg.build_requires 'runtime' |
| 37 | + pkg.environment "PATH", "/opt/pl-build-tools/bin:$(PATH):#{settings[:bindir]}" |
| 38 | + pkg.environment "CFLAGS", settings[:cflags] |
| 39 | + pkg.environment "LDFLAGS", settings[:ldflags] |
| 40 | + end |
| 41 | + pkg.environment "PATH" => "/opt/pl-build-tools/bin:$$PATH:#{settings[:bindir]}" |
| 42 | + pkg.environment "CFLAGS" => settings[:cflags] |
| 43 | + pkg.environment "LDFLAGS" => settings[:ldflags] |
| 44 | + elsif platform.is_huaweios? |
| 45 | + pkg.build_requires 'runtime' |
| 46 | + pkg.build_requires 'pl-pkg-config' |
| 47 | + |
| 48 | + pkg.environment "PATH", "/opt/pl-build-tools/bin:$(PATH):#{settings[:bindir]}" |
| 49 | + pkg.environment "CFLAGS", settings[:cflags] |
| 50 | + pkg.environment "LDFLAGS", settings[:ldflags] |
| 51 | + pkg.environment "PKG_CONFIG", "/opt/pl-build-tools/bin/pkg-config" |
| 52 | + elsif platform.is_deb? |
| 53 | + pkg.build_requires 'libreadline-dev' |
| 54 | + if platform.name =~ /debian-9/ |
| 55 | + pkg.requires 'libreadline7' |
| 56 | + else |
| 57 | + pkg.requires 'libreadline6' |
| 58 | + end |
| 59 | + |
| 60 | + pkg.build_requires 'pkg-config' |
| 61 | + if platform.is_cross_compiled_linux? |
| 62 | + pkg.environment "PATH", "/opt/pl-build-tools/bin:$(PATH):#{settings[:bindir]}" |
| 63 | + pkg.environment "CFLAGS", settings[:cflags] |
| 64 | + pkg.environment "LDFLAGS", settings[:ldflags] |
| 65 | + end |
| 66 | + |
| 67 | + elsif platform.is_solaris? |
| 68 | + pkg.environment "PATH", "/opt/pl-build-tools/bin:$(PATH):/usr/local/bin:/usr/ccs/bin:/usr/sfw/bin:#{settings[:bindir]}" |
| 69 | + pkg.environment "CFLAGS", settings[:cflags] |
| 70 | + pkg.environment "LDFLAGS", settings[:ldflags] |
| 71 | + pkg.build_requires 'libedit' |
| 72 | + pkg.build_requires 'runtime' |
| 73 | + if platform.os_version == "10" |
| 74 | + pkg.build_requires 'pkgconfig' |
| 75 | + pkg.environment "PKG_CONFIG_PATH", "/opt/csw/lib/pkgconfig" |
| 76 | + pkg.environment "PKG_CONFIG", "/opt/csw/bin/pkg-config" |
| 77 | + else |
| 78 | + pkg.build_requires 'pl-pkg-config' |
| 79 | + pkg.environment "PKG_CONFIG_PATH", "/usr/lib/pkgconfig" |
| 80 | + pkg.environment "PKG_CONFIG", "/opt/pl-build-tools/bin/pkg-config" |
| 81 | + end |
| 82 | + elsif platform.is_macos? |
| 83 | + pkg.environment "PATH" => "$$PATH:/usr/local/bin" |
| 84 | + pkg.environment "CFLAGS" => settings[:cflags] |
| 85 | + elsif platform.is_windows? |
| 86 | + #nothing to see here |
| 87 | + else |
| 88 | + pkg.environment "PATH" => "/opt/pl-build-tools/bin:$$PATH:#{settings[:bindir]}" |
| 89 | + pkg.environment "CFLAGS" => settings[:cflags] |
| 90 | + pkg.environment "LDFLAGS" => settings[:ldflags] |
| 91 | + end |
| 92 | + |
| 93 | + pkg.configure do |
| 94 | + ["./configure --prefix=#{settings[:prefix]} #{settings[:host]}"] |
| 95 | + end |
| 96 | + |
| 97 | + pkg.build do |
| 98 | + ["#{platform[:make]} -j$(shell expr $(shell #{platform[:num_cores]}) + 1)"] |
| 99 | + end |
| 100 | + |
| 101 | + pkg.install do |
| 102 | + ["#{platform[:make]} -j$(shell expr $(shell #{platform[:num_cores]}) + 1) install"] |
| 103 | + end |
| 104 | +end |
0 commit comments