Index: main/trunk/package-kits/linux/distros/arch
===================================================================
--- main/trunk/package-kits/linux/distros/arch	(revision 29613)
+++ main/trunk/package-kits/linux/distros/arch	(revision 29638)
@@ -11,11 +11,4 @@
 TOMCAT_USER:            tomcat7
 GLI:                    %GREENSTONE_HOME%/gli
-
-ARCH_NATIVE:
-    'x86_64'
-    'i686'
-
-ARCH_ANY:
-    'any'
 
 PKG_SVN:
Index: main/trunk/package-kits/linux/distros/fedora
===================================================================
--- main/trunk/package-kits/linux/distros/fedora	(revision 29613)
+++ main/trunk/package-kits/linux/distros/fedora	(revision 29638)
@@ -11,11 +11,4 @@
 TOMCAT_USER:            tomcat
 GLI:                    %GREENSTONE_HOME%/gli
-
-ARCH_NATIVE:
-    x86_64
-    i686
-
-ARCH_ANY:
-    any
 
 PKG_SVN:
Index: main/trunk/package-kits/linux/distros/ubuntu
===================================================================
--- main/trunk/package-kits/linux/distros/ubuntu	(revision 29613)
+++ main/trunk/package-kits/linux/distros/ubuntu	(revision 29638)
@@ -11,10 +11,4 @@
 TOMCAT_USER:            tomcat7
 GLI:                    %GREENSTONE_HOME%/gli
-
-ARCH_NATIVE:
-    any
-
-ARCH_ANY:
-    all
 
 PKG_SVN:
Index: main/trunk/package-kits/linux/managers/apt/conf
===================================================================
--- main/trunk/package-kits/linux/managers/apt/conf	(revision 29613)
+++ main/trunk/package-kits/linux/managers/apt/conf	(revision 29638)
@@ -1,2 +1,5 @@
 BUILD_LIB_DIR:  %SYSTEMLIB%
 BUILD_BIN_DIR:  %SYSTEMBIN%
+
+ARCH_NATIVE:            any
+ARCH_ANY:               all
Index: main/trunk/package-kits/linux/managers/pacman/conf
===================================================================
--- main/trunk/package-kits/linux/managers/pacman/conf	(revision 29613)
+++ main/trunk/package-kits/linux/managers/pacman/conf	(revision 29638)
@@ -1,2 +1,5 @@
 BUILD_LIB_DIR:  %SYSTEMLIB%
 BUILD_BIN_DIR:  %SYSTEMBIN%
+
+ARCH_NATIVE:            'x86_64' 'i686'
+ARCH_ANY:               'any'
Index: main/trunk/package-kits/linux/managers/rpm/conf
===================================================================
--- main/trunk/package-kits/linux/managers/rpm/conf	(revision 29613)
+++ main/trunk/package-kits/linux/managers/rpm/conf	(revision 29638)
@@ -1,2 +1,5 @@
 BUILD_LIB_DIR:  %{_libdir}/*
 BUILD_BIN_DIR:  %{_bindir}/*
+
+ARCH_NATIVE:            
+ARCH_ANY:               noarch
Index: main/trunk/package-kits/linux/perllib/Greenstone/Package/_rpm.pm
===================================================================
--- main/trunk/package-kits/linux/perllib/Greenstone/Package/_rpm.pm	(revision 29613)
+++ main/trunk/package-kits/linux/perllib/Greenstone/Package/_rpm.pm	(revision 29638)
@@ -53,5 +53,25 @@
         my @optional;
         scalar(@{$self->{config}->{DEPENDS}}) gt 0 and
-            push @optional, 'Requires:  %DEPENDS%';
+            push @optional, 'Requires:      %DEPENDS%';
+        # Cannot set architecture for subpackages because RPM's subpackages
+        #  implementation is broken.
+        # Greenstone core gets split into three packages:
+        #  - The main web servlets (java classes)       - noarch
+        #  - The native libraries used by the servlets  - native
+        #  - The tools for building collections         - native
+        # As RPM forces subpackages to inherit their name from a root package,
+        #  the main web servlets must be set as the root package
+        #  (in order for everything to get the right name).
+        # This means that the root package should be noarch, and the subpackages
+        #  must be native.
+        # But this is impossible with RPM (subpackages must be either the same
+        #  architecture as the root package, or noarch)
+        # To avoid this until someone fixes RPM into an actual working package
+        #  manager, we will just make the core greenstone package pretend to
+        #  be native.
+        unless (defined $packages) {
+            $self->{config}->{ARCHITECTURE} eq $self->{config}->{ARCH_ANY} and
+                push @optional, 'BuildArch:     %ARCHITECTURE%';
+        }
         for my $line (
             'Name:          %NAME%',
@@ -95,9 +115,9 @@
             $self->{config} = $package;
             my @optional;
-            scalar(@{$package->{DEPENDS}}) gt 0 and
-                push @optional, 'Requires:  %DEPENDS%';
+            scalar(@{$self->{config}->{DEPENDS}}) gt 0 and
+                push @optional, 'Requires:      %DEPENDS%';
             for my $line (
                 '%package %NAME%',
-                'Summary:   %DESCRIPTION_SHORT%',
+                'Summary:       %DESCRIPTION_SHORT%',
                 'AutoReqProv:   no',
                 @optional,
