1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20
#!/usr/sbin/perl # $Id$ use strict; use warnings; my @ALLARCH=qw{ @RPMALLARCH@ }; my $suffix = '-@RPMCANONVENDOR@-@RPMOS@-gnu'; my $canonarch = $ARGV[0] || `uname -m`; chomp($canonarch); my $found = 0; foreach my $arch (reverse @ALLARCH) { $arch eq $canonarch and $found = 1; $found or next; printf "$arch$suffix\n"; }