diff --git a/pisi-spec.rng b/pisi-spec.rng
index a4db427a..183835d0 100644
--- a/pisi-spec.rng
+++ b/pisi-spec.rng
@@ -175,8 +175,9 @@
- i686
+ i[3-6]86
x86_64
+ arm.*
diff --git a/pisi/operations/build.py b/pisi/operations/build.py
index 94530bb8..f87e4289 100644
--- a/pisi/operations/build.py
+++ b/pisi/operations/build.py
@@ -311,11 +311,15 @@ class Builder:
def build(self):
"""Build the package in one shot."""
+ # excludeArch should accept regex.
+ # eg. arm.* armv7l, armv5te matches
+ # i[3-6]86 i386, i486, i586, i686 matches
architecture = ctx.config.values.general.architecture
- if architecture in self.spec.source.excludeArch:
- raise ExcludedArchitectureException(
- _("pspec.xml avoids this package from building for '%s'")
- % architecture)
+ for arch in self.spec.source.excludeArch:
+ if re.match(arch, architecture):
+ raise ExcludedArchitectureException(
+ _("pspec.xml avoids this package from building for '%s'")
+ % architecture)
ctx.ui.status(_("Building source package: %s")
% self.spec.source.name)