invirt-build-release: handle amd64 and i386
[invirt/packages/invirt-dev.git] / invirt-build-release
index ea09e2c..05c9d18 100755 (executable)
@@ -14,11 +14,21 @@ for package; do
     
     eval  `perl '-F:\s+' -lane 'print  $F[0]."=".$F[1] if /^Version|^Source|^Distribution/' \
         <(dpkg-parsechangelog)`
-    
+    eval $(perl '-F:\s+' -lane 'print $F[0]."=".$F[1] if /^Binary|Architecture/' <"../${Source}_${Version}.dsc")
+
     dpkg-buildpackage -us -uc -rfakeroot -S
     cd ..
-    sbuild -A -d hardy-amd64 "${Source}_${Version}.dsc"
-    
+    case $Architecture in
+      all)
+        sbuild -A -d hardy "${Source}_${Version}.dsc";;
+      any)
+        sbuild -d hardy-amd64 "${Source}_${Version}.dsc"
+        sbuild -d hardy-i386  "${Source}_${Version}.dsc";;
+      *)
+        echo "invirt-build-release: architecture '$Architecture' not 'all' or 'any'" >&2
+        exit 1
+    esac
+
     if ! svn ls $svnuri/package_tags/$Source >/dev/null 2>&1; then
         svn mkdir $svnuri/package_tags/$Source \
             -m "Create package tags directory"