Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
path: root/build.sh
diff options
context:
space:
mode:
Diffstat (limited to 'build.sh')
-rw-r--r--build.sh41
1 files changed, 41 insertions, 0 deletions
diff --git a/build.sh b/build.sh
new file mode 100644
index 0000000..d4ce7aa
--- /dev/null
+++ b/build.sh
@@ -0,0 +1,41 @@
+#!/bin/bash
+
+set -ex
+
+rm -rf src
+git clone git://git.sugarlabs.org/sugar-update-control/mainline.git src
+
+# Prepare spec
+sed '/Version:/ s/$/\nEpoch: 1/' -i src/sugar-update-control.spec
+sed '/Release:/ s/%/.dx%/' -i src/sugar-update-control.spec
+sed "1s/$/\n%define _default_patch_fuzz 20/" -i src/sugar-update-control.spec
+rm src/.git* -rf
+n=1
+for i in *.patch
+do
+sed "/Source0/ s/$/\nPatch$n: $i/" -i src/sugar-update-control.spec
+sed "/%setup/ s/$/\n%patch$n -p1 -b .$i/" -i src/sugar-update-control.spec
+let n++
+done
+
+# Place for compiling
+version=$(grep Version src/sugar-update-control.spec |sed 's/.* //')
+mv src sugar-update-control-$version
+tar -zcvf sugar-update-control-$version.tar.gz sugar-update-control-$version
+mv sugar-update-control-$version.tar.gz /root/rpmbuild/SOURCES
+cp *.patch /root/rpmbuild/SOURCES
+mv sugar-update-control-$version/sugar-update-control.spec /root/rpmbuild/SPECS
+rm sugar-update-control-$version -rf
+
+# Clean and compile
+rm /root/rpmbuild/SRPMS/sugar-update-control*
+rm /root/rpmbuild/RPMS/noarch/sugar-update-control*
+rpmbuild -ba /root/rpmbuild/SPECS/sugar-update-control.spec 2>&1 |tee buildlog
+
+# Copy results
+rm -rf output-$version
+mkdir output-$version
+cp /root/rpmbuild/SRPMS/sugar-update-control* output-$version/
+cp /root/rpmbuild/RPMS/noarch/sugar-update-control* output-$version/
+cp /root/rpmbuild/SPECS/sugar-update-control.spec output-$version/
+mv buildlog output-$version/