Skip to content

(maint) Allow for multiple augeas versions #7

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Mar 7, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
38 changes: 33 additions & 5 deletions configs/components/augeas.rb
Original file line number Diff line number Diff line change
@@ -1,12 +1,40 @@
component 'augeas' do |pkg, settings, platform|
pkg.version '1.8.1'
pkg.md5sum '623ff89d71a42fab9263365145efdbfa'
pkg.url "#{settings[:buildsources_url]}/augeas-#{pkg.get_version}.tar.gz"
# Projects may define an :augeas_version setting, or we use 1.8.1 by default:
version = settings[:augeas_version] || '1.8.1'
pkg.version version

if platform.is_sles? && platform.os_version == '10'
pkg.apply_patch 'resources/patches/augeas/augeas-1.2.0-fix-services-sles10.patch'
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

SLES 10 is no longer supported in puppet-agent, and pdk doesn't need it

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can you move this into a separate commit?

case version
when '1.4.0'
pkg.md5sum 'a2536a9c3d744dc09d234228fe4b0c93'

pkg.apply_patch 'resources/patches/augeas/augeas-1.4.0-osx-stub-needed-readline-functions.patch'
pkg.apply_patch 'resources/patches/augeas/augeas-1.4.0-sudoers-negated-command-alias.patch'
pkg.apply_patch 'resources/patches/augeas/augeas-1.4.0-src-pathx.c-parse_name-correctly-handle-trailing-ws.patch'
when '1.8.1'
pkg.md5sum '623ff89d71a42fab9263365145efdbfa'
when '1.10.1'
pkg.md5sum '6c0b2ea6eec45e8bc374b283aedf27ce'

if platform.name =~ /^el-(5|6|7)-.*/ || platform.is_fedora?
# Augeas 1.10.1 needs a libselinux pkgconfig file on these platforms:
pkg.build_requires 'ruby-selinux'
elsif platform.name =~ /solaris-10-sparc/
# This patch to gnulib fixes a linking error around symbol versioning in pthread.
pkg.add_source 'file://resources/patches/augeas/augeas-1.10.1-gnulib-pthread-in-use.patch'

pkg.configure do
# gnulib is a submodule, and its files don't exist until after configure,
# so we apply the patch manually here instead of using pkg.apply_patch.
["/usr/bin/gpatch -p0 < ../augeas-1.10.1-gnulib-pthread-in-use.patch"]
end
end
else
raise "augeas version #{version} has not been configured; Cannot continue."
end

pkg.url "http://download.augeas.net/augeas-#{pkg.get_version}.tar.gz"
pkg.mirror "#{settings[:buildsources_url]}/augeas-#{pkg.get_version}.tar.gz"

pkg.build_requires "libxml2"

# Ensure we're building against our own libraries when present
Expand Down
6 changes: 6 additions & 0 deletions configs/components/ruby-selinux.rb
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,12 @@
pkg.apply_patch "resources/patches/ruby-selinux/libselinux-rhat.patch"
pkg.url "http://pkgs.fedoraproject.org/repo/pkgs/libselinux/libselinux-1.33.4.tgz/08762379de2242926854080dad649b67/libselinux-1.33.4.tgz"
pkg.mirror "#{settings[:buildsources_url]}/libselinux-#{pkg.get_version}.tgz"

# This version of libselinux does not supply a file for pkg-config; Augeas 1.10.1 expects one, though:
pkg.add_source "file://resources/files/ruby-selinux/libselinux-1.33.4.pc"
pkg.install do
["cp ../libselinux-1.33.4.pc #{settings[:libdir]}/pkgconfig/libselinux.pc"]
end
else
pkg.version "2.0.94"
pkg.md5sum "544f75aab11c2af352facc51af12029f"
Expand Down
3 changes: 3 additions & 0 deletions configs/projects/agent-runtime-1.10.x.rb
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
project 'agent-runtime-1.10.x' do |proj|
proj.inherit_settings 'puppet-agent', 'git://github.com/puppetlabs/puppet-agent', '1.10.x'

proj.setting :augeas_version, '1.4.0'

# Common agent settings:
instance_eval File.read('configs/projects/base-agent-runtime.rb')

Expand Down
3 changes: 3 additions & 0 deletions configs/projects/agent-runtime-5.3.x.rb
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
project 'agent-runtime-5.3.x' do |proj|
proj.inherit_settings 'puppet-agent', 'git://github.com/puppetlabs/puppet-agent', '5.3.x'

proj.setting :augeas_version, '1.8.1'

# Common agent settings:
instance_eval File.read('configs/projects/base-agent-runtime.rb')

Expand Down
3 changes: 3 additions & 0 deletions configs/projects/agent-runtime-master.rb
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
project 'agent-runtime-master' do |proj|
proj.inherit_settings 'puppet-agent', 'git://github.com/puppetlabs/puppet-agent', 'master'

proj.setting :augeas_version, '1.10.1'

# Common agent settings:
instance_eval File.read('configs/projects/base-agent-runtime.rb')

Expand Down
11 changes: 11 additions & 0 deletions resources/files/ruby-selinux/libselinux-1.33.4.pc
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
prefix=/opt/puppetlabs/puppet
exec_prefix=${prefix}
libdir=${exec_prefix}/lib
includedir=${prefix}/include

Name: libselinux
Description: SELinux utility library
Version: 1.33.4
URL: http://userspace.selinuxproject.org/
Libs: -L${libdir} -lselinux
Cflags: -I${includedir}
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
--- gnulib/lib/glthread/lock.h Mon Feb 5 16:38:27 2018
+++ lock.h Mon Feb 5 16:37:45 2018
@@ -148,10 +148,7 @@
# pragma weak pthread_self
# endif

-# if !PTHREAD_IN_USE_DETECTION_HARD
-# pragma weak pthread_cancel
-# define pthread_in_use() (pthread_cancel != NULL)
-# endif
+# define pthread_in_use() 1

# else
Loading