diff --git a/lib/fpm/package/deb.rb b/lib/fpm/package/deb.rb index a8a60b17d6..d49afbebea 100644 --- a/lib/fpm/package/deb.rb +++ b/lib/fpm/package/deb.rb @@ -228,6 +228,9 @@ def architecture when "x86_64" # Debian calls x86_64 "amd64" @architecture = "amd64" + when "aarch64" + # Debian calls aarch64 "arm64" + @architecture = "arm64" when "noarch" # Debian calls noarch "all" @architecture = "all" diff --git a/lib/fpm/package/freebsd.rb b/lib/fpm/package/freebsd.rb index b1db9d9850..4f812c3d3b 100644 --- a/lib/fpm/package/freebsd.rb +++ b/lib/fpm/package/freebsd.rb @@ -110,6 +110,8 @@ def architecture wordsize = case @architecture when nil, 'native' %x{getconf LONG_BIT}.chomp # 'native' is current arch + when 'arm64' + '64' when 'amd64' '64' when 'i386' diff --git a/lib/fpm/package/rpm.rb b/lib/fpm/package/rpm.rb index 89c92f1be3..c6f0c7661f 100644 --- a/lib/fpm/package/rpm.rb +++ b/lib/fpm/package/rpm.rb @@ -239,6 +239,8 @@ def architecture return %x{uname -m}.chomp # default to current arch when "amd64" # debian and redhat disagree on architecture names return "x86_64" + when "arm64" # debian and redhat disagree on architecture names + return "aarch64" when "native" return %x{uname -m}.chomp # 'native' is current arch when "all" diff --git a/spec/fpm/package/deb_spec.rb b/spec/fpm/package/deb_spec.rb index ed726ae4a5..83f15930de 100644 --- a/spec/fpm/package/deb_spec.rb +++ b/spec/fpm/package/deb_spec.rb @@ -33,6 +33,11 @@ expect(subject.architecture).to(be == "amd64") end + it "should convert aarch64 to arm64" do + subject.architecture = "aarch64" + expect(subject.architecture).to(be == "arm64") + end + it "should convert noarch to all" do subject.architecture = "noarch" expect(subject.architecture).to(be == "all") diff --git a/spec/fpm/package/rpm_spec.rb b/spec/fpm/package/rpm_spec.rb index 635fc8d017..e5a749025e 100644 --- a/spec/fpm/package/rpm_spec.rb +++ b/spec/fpm/package/rpm_spec.rb @@ -21,6 +21,11 @@ insist { subject.architecture } == "x86_64" end + it "should convert arm64 to aarch64" do + subject.architecture = "arm64" + expect(subject.architecture).to(be == "aarch64") + end + it "should convert 'all' to 'noarch'" do subject.architecture = "all" insist { subject.architecture } == "noarch" @@ -596,14 +601,14 @@ def subject.render_template; @rpmspec = template("rpm.erb").result(binding); end it "should not cause errors when reading basic rpm in input (#802)" do # Write the rpm out @generator.output(@target) - + # Load generated rpm subject.input(@target) - + # Value sanity check insist { subject.name } == "name" insist { subject.version } == "1.23" - end + end it "should not cause errors when reading more complete rpm in input (#802)" do @generator.architecture = "all" @@ -632,7 +637,7 @@ def subject.render_template; @rpmspec = template("rpm.erb").result(binding); end insist { subject.conflicts[0] } == "bad < 2" insist { subject.license } == @generator.license.split("\n").join(" ") # See issue #252 insist { subject.provides[0] } == "bacon = 1.0" - + end it "should not cause errors when reading rpm with script in input (#802)" do @generator.scripts[:before_install] = "example before_install"