aboutsummaryrefslogtreecommitdiffstats
path: root/rpmgenplatform.in
diff options
context:
space:
mode:
Diffstat (limited to 'rpmgenplatform.in')
-rw-r--r--rpmgenplatform.in27
1 files changed, 27 insertions, 0 deletions
diff --git a/rpmgenplatform.in b/rpmgenplatform.in
new file mode 100644
index 0000000..fc6bf82
--- /dev/null
+++ b/rpmgenplatform.in
@@ -0,0 +1,27 @@
+#!/usr/sbin/perl
+
+# $Id$
+use strict;
+use warnings;
+
+my @ALLARCH=qw{
+ noarch
+ @RPMALLARCH@
+};
+
+my $anysuffix = '-.*-@RPMOS@-gnu';
+my $suffix = '-@RPMCANONVENDOR@-@RPMOS@-gnu';
+my $canonarch = $ARGV[0] || `uname -m`;
+chomp($canonarch);
+
+foreach my $suf ($suffix, $anysuffix) {
+ my $found = 0;
+ my %done = ();
+ foreach my $arch (reverse @ALLARCH) {
+ $arch eq $canonarch and $found = 1;
+ $found or next;
+ $done{$arch} and next;
+ $done{$arch} = 1;
+ print "$arch$suf\n";
+ }
+}