Skip to content
Browse files

Respect rpmbuild's argument ordering for #309

rpmbuild is weird (on OSX at least) and requires target to come before
the --defines.
  • Loading branch information...
1 parent 4a92657 commit 0f44767997a105fda765a3edddbc3af5d4c78f34 @trotter trotter committed Dec 10, 2012
Showing with 7 additions and 5 deletions.
  1. +7 −5 lib/fpm/package/rpm.rb
View
12 lib/fpm/package/rpm.rb
@@ -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|

0 comments on commit 0f44767

Please sign in to comment.
Something went wrong with that request. Please try again.