facter 1.6.11 → 1.6.12.rc1
Sign up to get free protection for your applications and to get access to all the features.
Potentially problematic release.
This version of facter might be problematic. Click here for more details.
- data/CHANGELOG +26 -0
- data/Gemfile +14 -0
- data/Gemfile.lock +28 -0
- data/Rakefile +31 -73
- data/ext/build_defaults.yaml +20 -0
- data/ext/debian/changelog.erb +71 -0
- data/ext/debian/compat +1 -0
- data/ext/debian/control +14 -0
- data/ext/debian/copyright +19 -0
- data/ext/debian/docs +2 -0
- data/ext/debian/lintian-overrides +0 -0
- data/ext/debian/rules +9 -0
- data/ext/debian/source/format +1 -0
- data/ext/facter-diff +74 -0
- data/{conf → ext}/osx/PackageInfo.plist +0 -0
- data/{conf → ext}/osx/createpackage.sh +0 -0
- data/ext/osx/file_mapping.yaml +27 -0
- data/ext/osx/preflight.erb +30 -0
- data/ext/osx/prototype.plist.erb +38 -0
- data/ext/packaging/README.md +89 -0
- data/ext/packaging/tasks/00_utils.rb +214 -0
- data/ext/packaging/tasks/10_setupvars.rake +59 -0
- data/ext/packaging/tasks/apple.rake +201 -0
- data/ext/packaging/tasks/clean.rake +5 -0
- data/ext/packaging/tasks/deb.rake +105 -0
- data/ext/packaging/tasks/gem.rake +50 -0
- data/ext/packaging/tasks/mock.rake +88 -0
- data/ext/packaging/tasks/release.rake +18 -0
- data/ext/packaging/tasks/rpm.rake +39 -0
- data/ext/packaging/tasks/ship.rake +25 -0
- data/ext/packaging/tasks/sign.rake +62 -0
- data/ext/packaging/tasks/tar.rake +19 -0
- data/ext/project_data.yaml +15 -0
- data/{conf/redhat/facter.spec → ext/redhat/facter.spec.erb} +37 -19
- data/{conf → ext}/solaris/pkginfo +0 -0
- data/lib/facter.rb +2 -6
- data/lib/facter/facterversion.rb +5 -2
- data/lib/facter/util/ec2.rb +4 -3
- data/lib/facter/version.rb +13 -0
- data/spec/unit/facter_spec.rb +0 -5
- data/spec/unit/util/ec2_spec.rb +16 -0
- metadata +370 -200
- data/conf/osx/preflight +0 -16
@@ -0,0 +1,105 @@
|
|
1
|
+
def pdebuild args
|
2
|
+
results_dir = args[:work_dir]
|
3
|
+
cow = args[:cow]
|
4
|
+
devel_repo = args[:devel]
|
5
|
+
set_cow_envs(cow)
|
6
|
+
begin
|
7
|
+
sh "pdebuild --configfile #{@pbuild_conf} --buildresult #{results_dir} --pbuilder cowbuilder -- --override-config --othermirror=\"deb #{@apt_repo_url} #{ENV['DIST']} main dependencies #{devel_repo}\" --basepath /var/cache/pbuilder/#{cow}/"
|
8
|
+
rescue
|
9
|
+
STDERR.puts "Something went wrong. Hopefully the backscroll or #{results_dir}/#{@name}_#{@debversion}.build file has a clue."
|
10
|
+
exit 1
|
11
|
+
end
|
12
|
+
end
|
13
|
+
|
14
|
+
def update_cow(cow, is_rc = nil)
|
15
|
+
ENV['FOSS_DEVEL'] = is_rc
|
16
|
+
set_cow_envs(cow)
|
17
|
+
begin
|
18
|
+
sh "sudo cowbuilder --update --override-config --configfile #{@pbuild_conf} --basepath /var/cache/pbuilder/#{cow} --distribution #{ENV['DIST']} --architecture #{ENV['ARCH']}"
|
19
|
+
rescue
|
20
|
+
STDERR.puts "Couldn't update the cow #{cow}. Perhaps you don't have sudo?"
|
21
|
+
exit 1
|
22
|
+
end
|
23
|
+
end
|
24
|
+
|
25
|
+
def debuild args
|
26
|
+
results_dir = args[:work_dir]
|
27
|
+
begin
|
28
|
+
sh "debuild --no-lintian -uc -us"
|
29
|
+
rescue
|
30
|
+
STDERR.puts "Something went wrong. Hopefully the backscroll or #{results_dir}/#{@name}_#{@debversion}.build file has a clue."
|
31
|
+
exit 1
|
32
|
+
end
|
33
|
+
end
|
34
|
+
|
35
|
+
task :prep_deb_tars, :work_dir do |t,args|
|
36
|
+
work_dir = args.work_dir
|
37
|
+
cp_p "pkg/#{@name}-#{@version}.tar.gz", work_dir
|
38
|
+
cd work_dir do
|
39
|
+
sh "tar zxf #{@name}-#{@version}.tar.gz"
|
40
|
+
mv "#{@name}-#{@version}", "#{@name}-#{@debversion}"
|
41
|
+
mv "#{@name}-#{@version}.tar.gz", "#{@name}_#{@origversion}.orig.tar.gz"
|
42
|
+
end
|
43
|
+
end
|
44
|
+
|
45
|
+
task :build_deb, :deb_command, :cow, :devel do |t,args|
|
46
|
+
deb_build = args.deb_command
|
47
|
+
cow = args.cow
|
48
|
+
devel = args.devel
|
49
|
+
work_dir = get_temp
|
50
|
+
dest_dir = "#{@build_root}/pkg/deb/#{cow.split('-')[1] unless cow.nil?}"
|
51
|
+
check_tool(deb_build)
|
52
|
+
mkdir_p dest_dir
|
53
|
+
deb_args = { :work_dir => work_dir, :cow => cow, :devel => devel}
|
54
|
+
Rake::Task[:prep_deb_tars].reenable
|
55
|
+
Rake::Task[:prep_deb_tars].invoke(work_dir)
|
56
|
+
cd "#{work_dir}/#{@name}-#{@debversion}" do
|
57
|
+
mv 'ext/debian', '.'
|
58
|
+
begin
|
59
|
+
send(deb_build, deb_args)
|
60
|
+
cp FileList["#{work_dir}/*.deb", "#{work_dir}/*.dsc", "#{work_dir}/*.changes", "#{work_dir}/*.debian.tar.gz", "#{work_dir}/*.orig.tar.gz"], dest_dir
|
61
|
+
rm_rf "#{work_dir}/#{@name}-#{@debversion}"
|
62
|
+
rescue
|
63
|
+
STDERR.puts "Something went wrong. Hopefully the backscroll or #{work_dir}/#{@name}_#{@debversion}.build file has a clue."
|
64
|
+
end
|
65
|
+
rm_rf work_dir
|
66
|
+
end
|
67
|
+
end
|
68
|
+
|
69
|
+
namespace :package do
|
70
|
+
desc "Create a deb from this repo, using debuild (all builddeps must be installed)"
|
71
|
+
task :deb => :tar do
|
72
|
+
Rake::Task[:build_deb].invoke('debuild')
|
73
|
+
end
|
74
|
+
end
|
75
|
+
|
76
|
+
namespace :pl do
|
77
|
+
desc "Create a deb from this repo using the default cow #{@default_cow}."
|
78
|
+
task :deb => "package:tar" do
|
79
|
+
Rake::Task[:build_deb].invoke('pdebuild', @default_cow)
|
80
|
+
end
|
81
|
+
|
82
|
+
desc "Create an RC deb from this repo using the default cow #{@default_cow}."
|
83
|
+
task :deb_rc => "package:tar" do
|
84
|
+
Rake::Task[:build_deb].invoke('pdebuild', @default_cow, 'devel')
|
85
|
+
end
|
86
|
+
|
87
|
+
desc "Create debs from this git repository using all cows specified in build_defaults yaml"
|
88
|
+
task :deb_all do
|
89
|
+
@cows.split(' ').each do |cow|
|
90
|
+
Rake::Task["package:tar"].invoke
|
91
|
+
Rake::Task[:build_deb].reenable
|
92
|
+
Rake::Task[:build_deb].invoke('pdebuild', cow)
|
93
|
+
end
|
94
|
+
end
|
95
|
+
|
96
|
+
desc "Create RC debs from this git repository using all cows specified in build_defaults yaml"
|
97
|
+
task :deb_all_rc do
|
98
|
+
@cows.split(' ').each do |cow|
|
99
|
+
Rake::Task["package:tar"].invoke
|
100
|
+
Rake::Task[:build_deb].reenable
|
101
|
+
Rake::Task[:build_deb].invoke('pdebuild', cow, 'devel')
|
102
|
+
end
|
103
|
+
end
|
104
|
+
end
|
105
|
+
|
@@ -0,0 +1,50 @@
|
|
1
|
+
if @build_gem == TRUE or @build_gem == 'true' or @build_gem == 'TRUE'
|
2
|
+
require 'rubygems/package_task'
|
3
|
+
|
4
|
+
def glob_gem_files
|
5
|
+
gem_files = []
|
6
|
+
files = FileList[@gem_files.split(' ')]
|
7
|
+
files.each do |file|
|
8
|
+
if File.directory?(file)
|
9
|
+
gem_files << FileList["#{file}/**/*"].exclude("ext/packaging/")
|
10
|
+
else
|
11
|
+
gem_files << file
|
12
|
+
end
|
13
|
+
end
|
14
|
+
gem_files
|
15
|
+
end
|
16
|
+
|
17
|
+
spec = Gem::Specification.new do |s|
|
18
|
+
s.name = @name
|
19
|
+
s.version = @gemversion
|
20
|
+
s.author = @author
|
21
|
+
s.email = @email
|
22
|
+
s.homepage = @homepage
|
23
|
+
s.summary = @summary
|
24
|
+
s.description = @description
|
25
|
+
s.files = glob_gem_files
|
26
|
+
s.require_path = @gem_require_path
|
27
|
+
s.test_files = FileList[@gem_test_files.split(' ')]
|
28
|
+
s.executables = @gem_executables
|
29
|
+
s.rubyforge_project = @gem_forge_project
|
30
|
+
|
31
|
+
@gem_runtime_dependencies.each do |key, value|
|
32
|
+
s.add_runtime_dependency("#{key}", "#{value}")
|
33
|
+
end unless @gem_runtime_dependencies.nil?
|
34
|
+
|
35
|
+
@gem_devel_dependencies.each do |key, value|
|
36
|
+
s.add_devel_dependency("#{key}", "#{value}")
|
37
|
+
end unless @gem_devel_dependencies.nil?
|
38
|
+
|
39
|
+
@gem_rdoc_options.each do |option|
|
40
|
+
s.rdoc_options << option
|
41
|
+
end unless @gem_rdoc_options.nil?
|
42
|
+
end
|
43
|
+
|
44
|
+
namespace :package do
|
45
|
+
Gem::PackageTask.new(spec) do |pkg|
|
46
|
+
pkg.need_tar_gz = true
|
47
|
+
end
|
48
|
+
end
|
49
|
+
end
|
50
|
+
|
@@ -0,0 +1,88 @@
|
|
1
|
+
|
2
|
+
def mock(mock_config, srpm)
|
3
|
+
check_tool('mock')
|
4
|
+
sh "mock -r #{mock_config} #{srpm}"
|
5
|
+
end
|
6
|
+
|
7
|
+
def srpm_file
|
8
|
+
srpm = Dir["pkg/srpm/*.rpm"][0]
|
9
|
+
check_file(srpm)
|
10
|
+
srpm
|
11
|
+
end
|
12
|
+
|
13
|
+
def mock_el_family(mock_config)
|
14
|
+
family = mock_config.split('-')[0]
|
15
|
+
family = 'el' if family == 'pl'
|
16
|
+
family
|
17
|
+
end
|
18
|
+
|
19
|
+
def mock_el_ver(mock_config)
|
20
|
+
version = mock_config.split('-')[1]
|
21
|
+
version = "f#{version}" if mock_config.split('-')[0] == 'fedora'
|
22
|
+
version
|
23
|
+
end
|
24
|
+
|
25
|
+
def build_rpm_with_mock(is_rc, subdir)
|
26
|
+
if is_rc
|
27
|
+
mocks = @rc_mocks
|
28
|
+
else
|
29
|
+
mocks = @final_mocks
|
30
|
+
end
|
31
|
+
|
32
|
+
mocks.split(' ').each do |mock_config|
|
33
|
+
family = mock_el_family(mock_config)
|
34
|
+
version = mock_el_ver(mock_config)
|
35
|
+
arch = mock_config.split('-')[2]
|
36
|
+
result = "/var/lib/mock/#{mock_config}/result/*.rpm"
|
37
|
+
|
38
|
+
mock(mock_config, srpm_file)
|
39
|
+
|
40
|
+
Dir[result].each do |rpm|
|
41
|
+
rpm.strip!
|
42
|
+
unless ENV['RC_OVERRIDE'] == '1'
|
43
|
+
if is_rc == FALSE and rpm =~ /[0-9]+rc[0-9]+\./
|
44
|
+
puts "It looks like you might be trying to ship an RC to the production repos. Leaving rpm in #{result}. Pass RC_OVERRIDE=1 to override."
|
45
|
+
next
|
46
|
+
elsif is_rc and rpm !~ /[0-9]+rc[0-9]+\./
|
47
|
+
puts "It looks like you might be trying to ship a production release to the development repos. Leaving rpm in #{result}. Pass RC_OVERRIDE=1 to override."
|
48
|
+
next
|
49
|
+
end
|
50
|
+
end
|
51
|
+
|
52
|
+
case rpm
|
53
|
+
when /debuginfo/
|
54
|
+
rm_rf(rpm)
|
55
|
+
when /src\.rpm/
|
56
|
+
cp_pr(rpm, "pkg/#{family}/#{version}/#{subdir}/SRPMS")
|
57
|
+
when /i.?86/
|
58
|
+
cp_pr(rpm, "pkg/#{family}/#{version}/#{subdir}/i386")
|
59
|
+
when /x86_64/
|
60
|
+
cp_pr(rpm, "pkg/#{family}/#{version}/#{subdir}/x86_64")
|
61
|
+
when /noarch/
|
62
|
+
cp_pr(rpm, "pkg/#{family}/#{version}/#{subdir}/i386")
|
63
|
+
ln("pkg/#{family}/#{version}/#{subdir}/i386/#{File.basename rpm}", "pkg/#{family}/#{version}/#{subdir}/x86_64/")
|
64
|
+
end
|
65
|
+
end
|
66
|
+
end
|
67
|
+
end
|
68
|
+
|
69
|
+
|
70
|
+
namespace :pl do
|
71
|
+
task :setup_el_dirs do
|
72
|
+
%x{mkdir -p pkg/el/{5,6}/{products,devel,dependencies}/{SRPMS,i386,x86_64}}
|
73
|
+
%x{mkdir -p pkg/fedora/{f15,f16,f17}/{products,devel,dependencies}/{SRPMS,i386,x86_64}}
|
74
|
+
end
|
75
|
+
|
76
|
+
desc "Use specified mocks to make final rpms, keyed to PL infrastructure, pass MOCK to specifiy config"
|
77
|
+
task :mock_final => [ "package:srpm", "pl:setup_el_dirs" ] do
|
78
|
+
subdir = ENV['subdir'] || 'products'
|
79
|
+
build_rpm_with_mock(FALSE, subdir)
|
80
|
+
end
|
81
|
+
|
82
|
+
desc "Use specified mocks to make RC rpms, keyed to PL infrastructure, pass MOCK to specify config"
|
83
|
+
task :mock_rc => [ "package:srpm", "pl:setup_el_dirs" ] do
|
84
|
+
subdir = 'devel'
|
85
|
+
build_rpm_with_mock(TRUE, subdir)
|
86
|
+
end
|
87
|
+
end
|
88
|
+
|
@@ -0,0 +1,18 @@
|
|
1
|
+
namespace :package do
|
2
|
+
desc "Update the version in #{@version_file} to current and commit."
|
3
|
+
task :versionbump do
|
4
|
+
old_version = get_version_file_version
|
5
|
+
contents = IO.read(@version_file)
|
6
|
+
new_version = '"' + get_version.to_s.strip + '"'
|
7
|
+
if contents.match("VERSION = #{old_version}")
|
8
|
+
contents.gsub!("VERSION = #{old_version}", "VERSION = #{new_version}")
|
9
|
+
else
|
10
|
+
contents.gsub!("#{@name.upcase}VERSION = #{old_version}", "#{@name.upcase}VERSION = #{new_version}")
|
11
|
+
end
|
12
|
+
file = File.open(@version_file, 'w')
|
13
|
+
file.write contents
|
14
|
+
file.close
|
15
|
+
git_commit_file(@version_file)
|
16
|
+
end
|
17
|
+
end
|
18
|
+
|
@@ -0,0 +1,39 @@
|
|
1
|
+
def build_rpm(buildarg = "-bs")
|
2
|
+
check_tool('rpmbuild')
|
3
|
+
temp = get_temp
|
4
|
+
rpm_define = "--define \"%dist .el5\" --define \"%_topdir #{temp}\" "
|
5
|
+
rpm_old_version = '--define "_source_filedigest_algorithm 1" --define "_binary_filedigest_algorithm 1" \
|
6
|
+
--define "_binary_payload w9.gzdio" --define "_source_payload w9.gzdio" \
|
7
|
+
--define "_default_patch_fuzz 2"'
|
8
|
+
args = rpm_define + ' ' + rpm_old_version
|
9
|
+
mkdir_pr temp, 'pkg/rpm', 'pkg/srpm', "#{temp}/SOURCES", "#{temp}/SPECS"
|
10
|
+
if @sign_tar
|
11
|
+
Rake::Task["pl:sign_tar"].invoke
|
12
|
+
cp_p "pkg/#{@name}-#{@version}.tar.gz.asc", "#{temp}/SOURCES"
|
13
|
+
end
|
14
|
+
cp_p "pkg/#{@name}-#{@version}.tar.gz", "#{temp}/SOURCES"
|
15
|
+
erb "ext/redhat/#{@name}.spec.erb", "#{temp}/SPECS/#{@name}.spec"
|
16
|
+
sh "rpmbuild #{args} #{buildarg} --nodeps #{temp}/SPECS/#{@name}.spec"
|
17
|
+
mv FileList["#{temp}/SRPMS/*.rpm"], "pkg/srpm"
|
18
|
+
mv FileList["#{temp}/RPMS/*/*.rpm"], "pkg/rpm"
|
19
|
+
rm_rf temp
|
20
|
+
puts
|
21
|
+
output = FileList['pkg/*/*.rpm']
|
22
|
+
puts "Wrote:"
|
23
|
+
output.each do | line |
|
24
|
+
puts line
|
25
|
+
end
|
26
|
+
end
|
27
|
+
|
28
|
+
namespace :package do
|
29
|
+
desc "Create srpm from this git repository (unsigned)"
|
30
|
+
task :srpm => :tar do
|
31
|
+
build_rpm("-bs")
|
32
|
+
end
|
33
|
+
|
34
|
+
desc "Create .rpm from this git repository (unsigned)"
|
35
|
+
task :rpm => :tar do
|
36
|
+
build_rpm("-ba")
|
37
|
+
end
|
38
|
+
end
|
39
|
+
|
@@ -0,0 +1,25 @@
|
|
1
|
+
namespace :pl do
|
2
|
+
desc "Ship mocked rpms to #{@yum_host}"
|
3
|
+
task :ship_rpms do
|
4
|
+
rsync_to('pkg/el', @yum_host, @yum_repo_path)
|
5
|
+
rsync_to('pkg/fedora', @yum_host, @yum_repo_path)
|
6
|
+
end
|
7
|
+
|
8
|
+
desc "Update remote rpm repodata on #{@yum_host}"
|
9
|
+
task :update_yum_repo do
|
10
|
+
remote_ssh_cmd(@yum_host, '/var/lib/gems/1.8/gems/rake-0.9.2.2/bin/rake -I /opt/repository/ mk_repo')
|
11
|
+
end
|
12
|
+
|
13
|
+
desc "Ship cow-built debs to #{@apt_host}"
|
14
|
+
task :ship_debs do
|
15
|
+
rsync_to('pkg/deb/', @apt_host, @apt_repo_path)
|
16
|
+
end
|
17
|
+
|
18
|
+
desc "Ship built gem to rubygems"
|
19
|
+
task :ship_gem do
|
20
|
+
ship_gem("pkg/#{@name}-#{@version}.gem")
|
21
|
+
end
|
22
|
+
|
23
|
+
end
|
24
|
+
|
25
|
+
|
@@ -0,0 +1,62 @@
|
|
1
|
+
def sign_el5(rpm)
|
2
|
+
%x{rpm --define '%_gpg_name #{@gpg_name}' --define '%__gpg_sign_cmd %{__gpg} gpg --force-v3-sigs --digest-algo=sha1 --batch --no-verbose --no-armor --passphrase-fd 3 --no-secmem-warning -u %{_gpg_name} -sbo %{__signature_filename} %{__plaintext_filename}' --addsign #{rpm} > /dev/null}
|
3
|
+
end
|
4
|
+
|
5
|
+
def sign_modern(rpm)
|
6
|
+
%x{rpm --define '%_gpg_name #{@gpg_name}' --addsign #{rpm} > /dev/null}
|
7
|
+
end
|
8
|
+
|
9
|
+
def rpm_has_sig(rpm)
|
10
|
+
%x{rpm -Kv #{rpm} | grep "#{@gpg_key.downcase}" &> /dev/null}
|
11
|
+
$?.success?
|
12
|
+
end
|
13
|
+
|
14
|
+
def sign_deb_changes(file)
|
15
|
+
%x{debsign --re-sign -k#{@gpg_key} #{file}}
|
16
|
+
end
|
17
|
+
|
18
|
+
namespace :pl do
|
19
|
+
desc "Sign the tarball, defaults to PL key, pass GPG_KEY to override or edit build_defaults"
|
20
|
+
task :sign_tar do
|
21
|
+
unless File.exist? "pkg/#{@name}-#{@version}.tar.gz"
|
22
|
+
STDERR.puts "No tarball exists. Try rake package:tar?"
|
23
|
+
exit 1
|
24
|
+
end
|
25
|
+
gpg_sign_file "pkg/#{@name}-#{@version}.tar.gz"
|
26
|
+
end
|
27
|
+
|
28
|
+
desc "Sign mocked rpms, Defaults to PL Key, pass KEY to override"
|
29
|
+
task :sign_rpms do
|
30
|
+
el5_rpms = Dir["pkg/el/5/**/*.rpm"].join(' ')
|
31
|
+
modern_rpms = (Dir["pkg/el/6/**/*.rpm"] + Dir["pkg/fedora/**/*.rpm"]).join(' ')
|
32
|
+
puts "Signing el5 rpms..."
|
33
|
+
sign_el5 el5_rpms
|
34
|
+
puts "Signing el6 and fedora rpms..."
|
35
|
+
sign_modern modern_rpms
|
36
|
+
end
|
37
|
+
|
38
|
+
desc "Check if all rpms are signed"
|
39
|
+
task :check_rpm_sigs do
|
40
|
+
signed = TRUE
|
41
|
+
rpms = Dir["pkg/el/5/**/*.rpm"] + Dir["pkg/el/6/**/*.rpm"] + Dir["pkg/fedora/**/*.rpm"]
|
42
|
+
print 'Checking rpm signatures'
|
43
|
+
rpms.each do |rpm|
|
44
|
+
if rpm_has_sig rpm
|
45
|
+
print '.'
|
46
|
+
else
|
47
|
+
puts "#{rpm} is unsigned."
|
48
|
+
signed = FALSE
|
49
|
+
end
|
50
|
+
end
|
51
|
+
exit 1 unless signed
|
52
|
+
puts "All rpms signed"
|
53
|
+
end
|
54
|
+
|
55
|
+
desc "Sign generated debian changes files. Defaults to PL Key, pass KEY to override"
|
56
|
+
task :sign_deb_changes do
|
57
|
+
restart_keychain
|
58
|
+
sign_deb_changes("pkg/deb/*/*.changes") unless Dir["pkg/deb/*/*.changes"].empty?
|
59
|
+
sign_deb_changes("pkg/deb/*.changes") unless Dir["pkg/deb/*.changes"].empty?
|
60
|
+
end
|
61
|
+
end
|
62
|
+
|
@@ -0,0 +1,19 @@
|
|
1
|
+
namespace :package do
|
2
|
+
desc "Create a source tar archive"
|
3
|
+
task :tar => [ :clean ] do
|
4
|
+
workdir = "pkg/#{@name}-#{@version}"
|
5
|
+
mkdir_p(workdir)
|
6
|
+
FileList[@files.split(' ')].each do |f|
|
7
|
+
cp_pr(f, workdir)
|
8
|
+
end
|
9
|
+
erb("#{workdir}/ext/redhat/#{@name}.spec.erb", "#{workdir}/ext/redhat/#{@name}.spec")
|
10
|
+
erb("#{workdir}/ext/debian/changelog.erb", "#{workdir}/ext/debian/changelog")
|
11
|
+
rm_rf(FileList["#{workdir}/ext/debian/*.erb", "#{workdir}/ext/redhat/*.erb"])
|
12
|
+
cd "pkg" do
|
13
|
+
sh "tar --exclude=.gitignore --exclude=ext/#{@packaging_repo} -zcf #{@name}-#{@version}.tar.gz #{@name}-#{@version}"
|
14
|
+
end
|
15
|
+
rm_rf(workdir)
|
16
|
+
puts
|
17
|
+
puts "Wrote #{`pwd`.strip}/pkg/#{@name}-#{@version}.tar.gz"
|
18
|
+
end
|
19
|
+
end
|
@@ -0,0 +1,15 @@
|
|
1
|
+
---
|
2
|
+
project: 'facter'
|
3
|
+
author: 'Puppet Labs'
|
4
|
+
email: 'info@puppetlabs.com'
|
5
|
+
homepage: 'https://github.com/puppetlabs/facter'
|
6
|
+
summary: 'Facter, a system inventory tool'
|
7
|
+
description: 'You can prove anything with facts!'
|
8
|
+
version_file: 'lib/facter/version.rb'
|
9
|
+
# files and gem_files are space separated lists
|
10
|
+
files: '[A-Z]* acceptance bin documentation etc ext install.rb lib man spec'
|
11
|
+
gem_files: '[A-Z]* install.rb bin etc ext lib spec'
|
12
|
+
gem_require_path: 'lib'
|
13
|
+
gem_test_files: 'spec/**/*'
|
14
|
+
gem_executables: 'facter'
|
15
|
+
gem_default_executables: 'facter'
|
@@ -1,18 +1,25 @@
|
|
1
|
-
|
1
|
+
# Fedora 17 ships with ruby 1.9, which uses vendorlibdir instead
|
2
|
+
# of sitelibdir
|
3
|
+
%if 0%{?fedora} >= 17
|
4
|
+
%global facter_libdir %(ruby -rrbconfig -e 'puts RbConfig::CONFIG["vendorlibdir"]')
|
5
|
+
%else
|
6
|
+
%global facter_libdir %(ruby -rrbconfig -e 'puts Object.const_get(defined?(RbConfig) ? :RbConfig : :Config)::CONFIG["sitelibdir"]')
|
7
|
+
%endif
|
8
|
+
|
9
|
+
# VERSION is subbed out during rake srpm process
|
10
|
+
# %global realversion <%= @version %>
|
11
|
+
# %global rpmversion <%= @rpmversion %>
|
2
12
|
|
3
13
|
Summary: Ruby module for collecting simple facts about a host operating system
|
4
14
|
Name: facter
|
5
|
-
Version:
|
6
|
-
Release:
|
7
|
-
|
8
|
-
Epoch: 1
|
15
|
+
Version: %{rpmversion}
|
16
|
+
Release: <%= @rpmrelease -%>%{?dist}
|
17
|
+
|
9
18
|
License: Apache 2.0
|
10
19
|
Group: System Environment/Base
|
11
20
|
URL: http://www.puppetlabs.com/puppet/related-projects/%{name}
|
12
|
-
|
13
|
-
|
14
|
-
#Source1: http://puppetlabs.com/downloads/%{name}/%{name}-%{version}rc1.tar.gz.asc
|
15
|
-
Source1: http://puppetlabs.com/downloads/%{name}/%{name}-%{version}.tar.gz.asc
|
21
|
+
Source0: http://puppetlabs.com/downloads/%{name}/%{name}-%{realversion}.tar.gz
|
22
|
+
Source1: http://puppetlabs.com/downloads/%{name}/%{name}-%{realversion}.tar.gz.asc
|
16
23
|
|
17
24
|
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
|
18
25
|
|
@@ -20,12 +27,18 @@ Requires: ruby >= 1.8.5
|
|
20
27
|
Requires: which
|
21
28
|
# dmidecode and pciutils are not available on all arches
|
22
29
|
%ifarch %ix86 x86_64 ia64
|
23
|
-
Requires:
|
24
|
-
Requires:
|
30
|
+
Requires: dmidecode
|
31
|
+
Requires: pciutils
|
32
|
+
%endif
|
33
|
+
Requires: ruby(abi) >= 1.8
|
34
|
+
BuildRequires: ruby >= 1.8.5
|
35
|
+
|
36
|
+
# In Fedora 17 ruby-rdoc is called rubygem-rdoc
|
37
|
+
%if 0%{?fedora} >= 17
|
38
|
+
BuildRequires: rubygem-rdoc
|
39
|
+
%else
|
40
|
+
BuildRequires: ruby-rdoc
|
25
41
|
%endif
|
26
|
-
Requires: ruby(abi) >= 1.8
|
27
|
-
BuildRequires: ruby >= 1.8.5
|
28
|
-
BuildRequires: ruby-rdoc
|
29
42
|
|
30
43
|
%description
|
31
44
|
Ruby module for collecting simple facts about a host Operating
|
@@ -33,14 +46,13 @@ system. Some of the facts are preconfigured, such as the hostname and the
|
|
33
46
|
operating system. Additional facts can be added through simple Ruby scripts
|
34
47
|
|
35
48
|
%prep
|
36
|
-
%setup -q -n %{name}-%{
|
37
|
-
#%setup -q -n %{name}-%{version}rc1
|
49
|
+
%setup -q -n %{name}-%{realversion}
|
38
50
|
|
39
51
|
%build
|
40
52
|
|
41
53
|
%install
|
42
54
|
rm -rf %{buildroot}
|
43
|
-
ruby install.rb --destdir=%{buildroot} --quick
|
55
|
+
ruby install.rb --destdir=%{buildroot} --quick --sitelibdir=%{facter_libdir}
|
44
56
|
|
45
57
|
%clean
|
46
58
|
rm -rf %{buildroot}
|
@@ -49,13 +61,19 @@ rm -rf %{buildroot}
|
|
49
61
|
%files
|
50
62
|
%defattr(-,root,root,-)
|
51
63
|
%{_bindir}/facter
|
52
|
-
%{
|
53
|
-
%{
|
64
|
+
%{facter_libdir}/facter.rb
|
65
|
+
%{facter_libdir}/facter
|
54
66
|
%{_mandir}/man8/facter.8.gz
|
55
67
|
%doc CHANGELOG INSTALL LICENSE README.md
|
56
68
|
|
57
69
|
|
58
70
|
%changelog
|
71
|
+
* <%= Time.now.strftime("%a %b %d %Y") %> Puppet Labs Release <info@puppetlabs.com> - <%= @rpmversion %>-<%= @rpmrelease %>
|
72
|
+
- Build for <%= @version %>
|
73
|
+
|
74
|
+
* Wed Aug 08 2012 Moses Mendoza <moses@puppetlabs.com> - 1.6.11-2
|
75
|
+
- Use correct ruby libdir for fedora 17 / ruby 1.9
|
76
|
+
|
59
77
|
* Wed Aug 08 2012 Moses Mendoza <moses@puppetlabs.com> - 1.6.11-1
|
60
78
|
- Update for 1.6.11
|
61
79
|
|