Skip to content

Commit c137603

Browse files
committed
(maint) Allow for multiple augeas versions
Allows for a choice between augeas 1.4.0, 1.8.1, or 1.10.1 based on an :augeas_version project setting. 1.8.1 is kept as the default. Ports several patches over from puppet-agent for versions 1.4.0 and 1.10.1.
1 parent 47fd6e7 commit c137603

10 files changed

+3349
-3
lines changed

configs/components/augeas.rb

+35-3
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,39 @@
11
component 'augeas' do |pkg, settings, platform|
2-
pkg.version '1.8.1'
3-
pkg.md5sum '623ff89d71a42fab9263365145efdbfa'
4-
pkg.url "#{settings[:buildsources_url]}/augeas-#{pkg.get_version}.tar.gz"
2+
# Projects may define an :augeas_version setting, or we use 1.8.1 by default:
3+
version = settings[:augeas_version] || '1.8.1'
4+
pkg.version version
5+
6+
case version
7+
when '1.4.0'
8+
pkg.md5sum 'a2536a9c3d744dc09d234228fe4b0c93'
9+
10+
pkg.apply_patch 'resources/patches/augeas/augeas-1.4.0-osx-stub-needed-readline-functions.patch'
11+
pkg.apply_patch 'resources/patches/augeas/augeas-1.4.0-sudoers-negated-command-alias.patch'
12+
pkg.apply_patch 'resources/patches/augeas/augeas-1.4.0-src-pathx.c-parse_name-correctly-handle-trailing-ws.patch'
13+
when '1.8.1'
14+
pkg.md5sum '623ff89d71a42fab9263365145efdbfa'
15+
when '1.10.1'
16+
pkg.md5sum '6c0b2ea6eec45e8bc374b283aedf27ce'
17+
18+
if platform.name =~ /^el-(5|6|7)-.*/ || platform.is_fedora?
19+
# Augeas 1.10.1 needs a libselinux pkgconfig file on these platforms:
20+
pkg.build_requires 'ruby-selinux'
21+
elsif platform.name =~ /solaris-10-sparc/
22+
# This patch to gnulib fixes a linking error around symbol versioning in pthread.
23+
pkg.add_source 'file://resources/patches/augeas/augeas-1.10.1-gnulib-pthread-in-use.patch'
24+
25+
pkg.configure do
26+
# gnulib is a submodule, and its files don't exist until after configure,
27+
# so we apply the patch manually here instead of using pkg.apply_patch.
28+
["/usr/bin/gpatch -p0 < ../augeas-1.10.1-gnulib-pthread-in-use.patch"]
29+
end
30+
end
31+
else
32+
raise "augeas version #{version} has not been configured; Cannot continue."
33+
end
34+
35+
pkg.url "http://download.augeas.net/augeas-#{pkg.get_version}.tar.gz"
36+
pkg.mirror "#{settings[:buildsources_url]}/augeas-#{pkg.get_version}.tar.gz"
537

638
pkg.build_requires "libxml2"
739

configs/components/ruby-selinux.rb

+6
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,12 @@
66
pkg.apply_patch "resources/patches/ruby-selinux/libselinux-rhat.patch"
77
pkg.url "http://pkgs.fedoraproject.org/repo/pkgs/libselinux/libselinux-1.33.4.tgz/08762379de2242926854080dad649b67/libselinux-1.33.4.tgz"
88
pkg.mirror "#{settings[:buildsources_url]}/libselinux-#{pkg.get_version}.tgz"
9+
10+
# This version of libselinux does not supply a file for pkg-config; Augeas 1.10.1 expects one, though:
11+
pkg.add_source "file://resources/files/ruby-selinux/libselinux-1.33.4.pc"
12+
pkg.install do
13+
["cp ../libselinux-1.33.4.pc #{settings[:libdir]}/pkgconfig/libselinux.pc"]
14+
end
915
else
1016
pkg.version "2.0.94"
1117
pkg.md5sum "544f75aab11c2af352facc51af12029f"

configs/projects/agent-runtime-1.10.x.rb

+3
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
project 'agent-runtime-1.10.x' do |proj|
22
proj.inherit_settings 'puppet-agent', 'git://github.com/puppetlabs/puppet-agent', '1.10.x'
3+
4+
proj.setting :augeas_version, '1.4.0'
5+
36
# Common agent settings:
47
instance_eval File.read('configs/projects/base-agent-runtime.rb')
58

configs/projects/agent-runtime-5.3.x.rb

+3
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
project 'agent-runtime-5.3.x' do |proj|
22
proj.inherit_settings 'puppet-agent', 'git://github.com/puppetlabs/puppet-agent', '5.3.x'
3+
4+
proj.setting :augeas_version, '1.8.1'
5+
36
# Common agent settings:
47
instance_eval File.read('configs/projects/base-agent-runtime.rb')
58

configs/projects/agent-runtime-master.rb

+3
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
project 'agent-runtime-master' do |proj|
22
proj.inherit_settings 'puppet-agent', 'git://github.com/puppetlabs/puppet-agent', 'master'
3+
4+
proj.setting :augeas_version, '1.10.1'
5+
36
# Common agent settings:
47
instance_eval File.read('configs/projects/base-agent-runtime.rb')
58

Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
prefix=/opt/puppetlabs/puppet
2+
exec_prefix=${prefix}
3+
libdir=${exec_prefix}/lib
4+
includedir=${prefix}/include
5+
6+
Name: libselinux
7+
Description: SELinux utility library
8+
Version: 1.33.4
9+
URL: http://userspace.selinuxproject.org/
10+
Libs: -L${libdir} -lselinux
11+
Cflags: -I${includedir}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
--- gnulib/lib/glthread/lock.h Mon Feb 5 16:38:27 2018
2+
+++ lock.h Mon Feb 5 16:37:45 2018
3+
@@ -148,10 +148,7 @@
4+
# pragma weak pthread_self
5+
# endif
6+
7+
-# if !PTHREAD_IN_USE_DETECTION_HARD
8+
-# pragma weak pthread_cancel
9+
-# define pthread_in_use() (pthread_cancel != NULL)
10+
-# endif
11+
+# define pthread_in_use() 1
12+
13+
# else

0 commit comments

Comments
 (0)