diff --git a/pisi-spec.rng b/pisi-spec.rng
index 1c72dfe7..92dd4363 100644
--- a/pisi-spec.rng
+++ b/pisi-spec.rng
@@ -26,6 +26,9 @@
+
+ [
+ ]
diff --git a/pisi/operations/build.py b/pisi/operations/build.py
index d3cdb5de..4364c5f2 100644
--- a/pisi/operations/build.py
+++ b/pisi/operations/build.py
@@ -51,6 +51,9 @@ class ActionScriptException(Error):
class AbandonedFilesException(Error):
pass
+class ExcludedArchitectureException(Error):
+ pass
+
# Helper Functions
def get_file_type(path, pinfo_list, install_dir):
"""Return the file type of a path according to the given PathInfo
@@ -241,6 +244,11 @@ class Builder:
def build(self):
"""Build the package in one shot."""
+ 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)
+
+
ctx.ui.status(_("Building PiSi source package: %s") % self.spec.source.name)
self.compile_action_script()
diff --git a/pisi/specfile.py b/pisi/specfile.py
index 48755b9d..ca9e954f 100644
--- a/pisi/specfile.py
+++ b/pisi/specfile.py
@@ -164,6 +164,7 @@ class Source:
t_Name = [autoxml.String, autoxml.mandatory]
t_Homepage = [autoxml.String, autoxml.optional]
t_Packager = [Packager, autoxml.mandatory]
+ t_ExcludeArch = [ [autoxml.String], autoxml.optional]
t_License = [ [autoxml.String], autoxml.mandatory]
t_IsA = [ [autoxml.String], autoxml.optional]
t_PartOf = [autoxml.String, autoxml.optional]