Skip to content

Commit

Permalink
Merge pull request #315 from mashion/target-os-fix
Browse files Browse the repository at this point in the history
Respect rpmbuild's argument ordering for #309
  • Loading branch information
jordansissel committed Dec 10, 2012
2 parents c40502b + 3e318da commit 5683c41
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions lib/fpm/package/rpm.rb
Expand Up @@ -197,17 +197,19 @@ def output(output_path)
output_check(output_path)
raise FileAlreadyExists.new(output_path) if File.exists?(output_path)
%w(BUILD RPMS SRPMS SOURCES SPECS).each { |d| FileUtils.mkdir_p(build_path(d)) }
args = ["rpmbuild", "-bb",
args = ["rpmbuild", "-bb"]

# issue #309
rpm_target = "#{architecture}-unknown-#{attributes[:rpm_os]}"
args += ["--target", rpm_target]

args += [
"--define", "buildroot #{build_path}/BUILD",
"--define", "_topdir #{build_path}",
"--define", "_sourcedir #{build_path}",
"--define", "_rpmdir #{build_path}/RPMS",
]

# issue #309
rpm_target = "#{architecture}-unknown-#{attributes[:rpm_os]}"
args += ["--target", rpm_target]

args += ["--sign"] if attributes[:rpm_sign?]

(attributes[:rpm_rpmbuild_define] or []).each do |define|
Expand Down

0 comments on commit 5683c41

Please sign in to comment.