diff --git a/pisi-spec.dtd b/pisi-spec.dtd
index cf677201..d1892176 100644
--- a/pisi-spec.dtd
+++ b/pisi-spec.dtd
@@ -50,6 +50,7 @@
+
diff --git a/pisi-spec.rng b/pisi-spec.rng
index 29e5f4dc..6c1e5f51 100644
--- a/pisi-spec.rng
+++ b/pisi-spec.rng
@@ -1309,6 +1309,9 @@
binary
+
+
+
diff --git a/pisi/sourcearchive.py b/pisi/sourcearchive.py
index 6b681d75..7e989277 100644
--- a/pisi/sourcearchive.py
+++ b/pisi/sourcearchive.py
@@ -120,4 +120,5 @@ class SourceArchive:
raise Error, _("unpack: check_file_hash failed")
archive = pisi.archive.Archive(self.archiveFile, self.archive.type)
- archive.unpack(self.pkg_work_dir, clean_dir)
+ target_dir = os.path.join(self.pkg_work_dir, self.archive.target or "")
+ archive.unpack(target_dir, clean_dir)
diff --git a/pisi/specfile.py b/pisi/specfile.py
index 711dbf0d..1574f9d8 100644
--- a/pisi/specfile.py
+++ b/pisi/specfile.py
@@ -151,6 +151,7 @@ class Archive:
s_uri = [ autoxml.String, autoxml.mandatory ]
a_type = [ autoxml.String, autoxml.mandatory ]
a_sha1sum =[ autoxml.String, autoxml.mandatory ]
+ a_target =[ autoxml.String, autoxml.optional ]
def decode_hook(self, node, errs, where):
self.name = os.path.basename(self.uri)