Buildscript based on Adam release procedure
authorDennis Schafroth <dennis@indexdata.com>
Wed, 7 Mar 2012 14:42:54 +0000 (14:42 +0000)
committerDennis Schafroth <dennis@indexdata.com>
Wed, 7 Mar 2012 14:42:54 +0000 (14:42 +0000)
buildscript_centos5.sh [new file with mode: 0755]
buildscript_debian.sh [new file with mode: 0755]

diff --git a/buildscript_centos5.sh b/buildscript_centos5.sh
new file mode 100755 (executable)
index 0000000..2323bbe
--- /dev/null
@@ -0,0 +1,26 @@
+PROJECT=$1
+VERSION=$2
+TYPE=tar.gz
+
+if [ "$VERSION" == "" ] ; then 
+    echo buildscript  project version
+    exit 1
+fi
+# if (You need to have a rpmbuild directory - Adam has a script in git-tools )
+# (You need to have .rpmmacros - edit it to point to your rpmbuild)
+if cd ~/rpmbuild/SOURCES ; then 
+    if tar xzf $PROJECT-$VERSION.$TYPE ; then
+       cd $PROJECT-$VERSION
+       if rpmbuild -ba $PROJECT.spec ; then 
+           echo success. Do upload, and update repo
+       else
+           echo failed to rpmbuild $PROJECT
+       fi
+
+    else
+       echo failed tar xzf $PROJECT-$VERSION.tgz
+    fi
+else
+    echo "Unable to CD"
+    exit 1;
+fi
diff --git a/buildscript_debian.sh b/buildscript_debian.sh
new file mode 100755 (executable)
index 0000000..3d020b1
--- /dev/null
@@ -0,0 +1,43 @@
+PROJECT=$1
+TYPE=tar.gz
+RPMBUILD_HOST=centos5
+
+if ~/proj/git-tools/id-deb-build/check-for-dummy.sh ; then 
+    echo "Version $VERSION OK"
+    . IDMETA
+else 
+    echo "Mismatch in IDMETA and debian/changelog"
+fi
+
+if [ "$PROJECT" == "" ] ; then 
+    echo buildscript  project [TYPE]
+    exit 1
+fi
+
+if [ "$2" != ""]
+    TYPE=$2
+fi
+
+if ./buildconf.sh -d ; then 
+    if make dist ; then
+       if scp ${PROJECT}-${VERSION}.${TYPE} ${RPMBUILD_HOST}:rpmbuild/SOURCES ; then 
+           echo uploaded to ${RPMBUILD_HOST}. Run buildscript_rpm.sh $PROJECT $VERSION $TYPE from here
+           sleep 5
+       else
+           echo failed to upload to ${RPMBUILD_HOST}
+           exit 1
+       fi
+       # Now debian (p)build
+       if ~/proj/git-tools/id-deb-build/id-pbuild.sh ; then
+           echo Upload and update repo
+       else
+           echo "Failed to build $PROJECT $VERSION
+           exit 
+       fi
+    else
+       echo failed to make dist
+    fi
+else
+    echo "buildconf -d failed"
+    exit 1;
+fi