Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSantiago Collazo <scollazo@activitycentral.com>2012-10-17 23:11:45 (GMT)
committer Santiago Collazo <scollazo@activitycentral.com>2012-10-17 23:11:45 (GMT)
commit7912441c78b58d3abae6ca5d79655d9e4db09206 (patch)
tree9f5f6908a5323f783de1c4a6cf15f61873a4f633
parent700c4be3c36cc052a1d65d2aa4cda7f887c4975d (diff)
buildrpm.sh script adapted to new git workflow
-rw-r--r--rpms/buildrpm.sh18
1 files changed, 13 insertions, 5 deletions
diff --git a/rpms/buildrpm.sh b/rpms/buildrpm.sh
index 5e72ae5..e681440 100644
--- a/rpms/buildrpm.sh
+++ b/rpms/buildrpm.sh
@@ -19,6 +19,9 @@
# This script builds Dextrose patched, Sugar rpms from git repositories
# Requirements: git, yum-utils, rpmbuild, patch, libtool, intltool, createrepo
+#
+# This script must be run from the devel
+#
if [ $# != 2 ]
then
@@ -42,19 +45,21 @@ rm -rf ~/rpmbuild/SOURCES ~/rpmbuild/SPECS
mkdir -p ~/rpmbuild/BUILD ~/rpmbuild/BUILDROOT ~/rpmbuild/RPMS ~/rpmbuild/SOURCES ~/rpmbuild/SPECS/$PACKAGE ~/rpmbuild/SRPMS
-cp $PACKAGE/$PACKAGE.spec ~/rpmbuild/SPECS/$PACKAGE/
+cp dextrose/$PACKAGE.spec ~/rpmbuild/SPECS/$PACKAGE/
[ $PACKAGE = "sugar-toolkit" ] && cp $PACKAGE/macros.sugar ~/rpmbuild/SOURCES/
+#Create patches between dx and sugar
git clone git://git.sugarlabs.org/$PACKAGE/mainline.git ~/rpmbuild/SOURCES/$PACKAGE-$VERSION
cd ~/rpmbuild/SOURCES/$PACKAGE-$VERSION
git checkout v$VERSION
cd $WD
+#We change version from spec using parameter
sed "s/Version:.*/Version: $VERSION/" ~/rpmbuild/SPECS/$PACKAGE/$PACKAGE.spec -i
-sed "s/Release:.*/Release: $(date +%Y%m%d)dx3/" ~/rpmbuild/SPECS/$PACKAGE/$PACKAGE.spec -i
+#sed "s/Release:.*/Release: $(date +%Y%m%d)dx3/" ~/rpmbuild/SPECS/$PACKAGE/$PACKAGE.spec -i
# Since sugar and sugar-artwork DX3 specs *already* have epoch set to the
# date number, we will continue that hack for DX3. BUT THIS IS WRONG!!!
-sed '/^Epoch:/d' -i ~/rpmbuild/SPECS/$PACKAGE/$PACKAGE.spec
-sed "/^Name:/s/$/\nEpoch: $(date +%Y%m%d)/" -i ~/rpmbuild/SPECS/$PACKAGE/$PACKAGE.spec
+#sed '/^Epoch:/d' -i ~/rpmbuild/SPECS/$PACKAGE/$PACKAGE.spec
+#sed "/^Name:/s/$/\nEpoch: $(date +%Y%m%d)/" -i ~/rpmbuild/SPECS/$PACKAGE/$PACKAGE.spec
# Let's allow some fuzz
sed "1s/$/\n%define _default_patch_fuzz $FUZZ/" -i ~/rpmbuild/SPECS/$PACKAGE/$PACKAGE.spec
@@ -80,10 +85,13 @@ sed "/ListPatches/s%^%Patch$1: $3\n%" ~/rpmbuild/SPECS/$PACKAGE/$PACKAGE.spec -i
sed "/MakePatches/s/^/%patch$1 -p$4 -b $2\n/" ~/rpmbuild/SPECS/$PACKAGE/$PACKAGE.spec -i
}
+PATCHESTMP=$(mktemp -d)
+git format-patch -o $PATCHESTMP master
+
rm -rf ~/rpmbuild/RPMS/$PACKAGE-$VERSION.*patches
cp ~/rpmbuild/SOURCES/$PACKAGE-$VERSION $TEST/src -a
cd $TEST/src
-for i in $WD/$PACKAGE/*patch
+for i in $PATCHESTMP/*patch
do
file=${i//*\//}
number=${file//-*/}