pidgin: 9c5dc525: Add support for the binaries built by th...

datallah at pidgin.im datallah at pidgin.im
Thu May 20 22:45:45 EDT 2010


-----------------------------------------------------------------
Revision: 9c5dc525d1a6b0582c1eea5805b5a895ffbec47a
Ancestor: 4ba4181599a3b3f6a80652cd859e0f8aac6ff524
Author: datallah at pidgin.im
Date: 2010-05-21T02:40:53
Branch: im.pidgin.pidgin
URL: http://d.pidgin.im/viewmtn/revision/info/9c5dc525d1a6b0582c1eea5805b5a895ffbec47a

Added files:
        pidgin/win32/nsis/rpm2zip.sh
Modified files:
        pidgin/Makefile.am pidgin/win32/nsis/generate_gtk_zip.sh
Modified attrs:
        pidgin/win32/nsis/rpm2zip.sh

ChangeLog: 

Add support for the binaries built by the opensuse build service to the
Gtk zip generation script.  This isn't actually in use yet.

-------------- next part --------------
============================================================
--- pidgin/win32/nsis/rpm2zip.sh	07be8e4e72f06ffad64389d4b78d9500b0d3bc10
+++ pidgin/win32/nsis/rpm2zip.sh	07be8e4e72f06ffad64389d4b78d9500b0d3bc10
@@ -0,0 +1,65 @@
+#!/bin/sh
+
+here=`pwd`
+for F in $*; do
+    case $F in
+        mingw32-*.noarch.rpm|mingw64-*.noarch.rpm|*/mingw32-*.noarch.rpm|*/mingw64-*.noarch.rpm)
+        package=`rpm -qp $F 2>/dev/null`
+        case $package in
+            mingw32-*|mingw64-*)
+            case $package in
+                mingw32-*)
+                cpu=i686
+                bits=32
+                ;;
+                mingw64-*)
+                cpu=x86_64
+                bits=64
+                ;;
+            esac
+            origname=`rpm -qp --queryformat='%{NAME}'  $F 2>/dev/null`
+            name=$origname
+            case $name in
+                *-devel)
+                name=${name%el}
+                ;;
+            esac
+            shortpackage="$name"_`rpm -qp --queryformat='%{VERSION}-%{RELEASE}'_win${bits} $F 2>/dev/null`
+            shortpackage=${shortpackage#mingw32-}
+            shortpackage=${shortpackage#mingw64-}
+            shortname=$name
+            shortname=${shortname#mingw32-}
+            shortname=${shortname#mingw64-}
+            tmp=`mktemp -d`
+            #rpm2cpio $F | lzcat | (cd $tmp && cpio --quiet -id)
+            rpm2cpio $F |  (cd $tmp && cpio --quiet -id)
+            (
+                cd $tmp
+                zipfile="$here/$shortpackage.zip"
+                rm -f $zipfile
+                (cd usr/${cpu}-pc-mingw32/sys-root/mingw && zip -q -r -D $zipfile .)
+                if [ -d usr/share/doc/packages/$origname ] ; then
+                    mv usr/share/doc/packages/$origname usr/share/doc/packages/$shortname
+                    (cd usr && zip -q -r -D $zipfile share/doc/packages/$shortname)
+                fi
+                mkdir -p manifest
+                unzip -l $zipfile >manifest/$shortpackage.mft
+                zip -q $zipfile manifest/$shortpackage.mft
+                N=`unzip -l $zipfile | wc -l | sed -e 's/^ *\([0-9]*\).*/\1/'`
+                Nm1=`expr $N - 1`
+                unzip -l $zipfile | sed -e "1,3 d" -e "$Nm1,$N d" | awk '{print $4}' | grep -v -E '/$' >manifest/$shortpackage.mft
+                zip -q $zipfile manifest/$shortpackage.mft
+                echo $zipfile
+            )
+            rm -rf $tmp
+            ;;
+            *)
+            echo $F is not a mingw32/64 RPM package >&2
+            ;;
+        esac
+        ;;
+        *)
+        echo $F is not a mingw32/64 RPM package >&2
+        ;;
+    esac
+done
============================================================
--- pidgin/Makefile.am	d36cf2feb571e0b87069a05ce68edfc0efdf3bbc
+++ pidgin/Makefile.am	a3822d9404440beb77348dd4aefc63a8002e63ba
@@ -22,6 +22,7 @@ EXTRA_DIST = \
 		win32/wspell.c \
 		win32/wspell.h \
 		win32/nsis/generate_gtk_zip.sh \
+		win32/nsis/rpm2zip.sh \
 		win32/nsis/pixmaps/pidgin-header.bmp \
 		win32/nsis/pixmaps/pidgin-intro.bmp \
 		win32/nsis/pixmaps/pidgin-install.ico \
============================================================
--- pidgin/win32/nsis/generate_gtk_zip.sh	5bcc43254c28d354b248c8961188a3b6652933da
+++ pidgin/win32/nsis/generate_gtk_zip.sh	58792db7f6610c13cee15f47e654bcc4cf935d88
@@ -3,8 +3,8 @@ PIDGIN_BASE=$1
 
 PIDGIN_BASE=$1
 
-if [ ! -e $PIDGIN_BASE/ChangeLog.win32 ]; then
-	echo `basename $0` must must have the pidgin base dir specified as a parameter.
+if [ ! -e $PIDGIN_BASE/ChangeLog ]; then
+	echo $(basename $0) must must have the pidgin base dir specified as a parameter.
 	exit 1
 fi
 
@@ -42,11 +42,16 @@ function download_and_extract {
 function download_and_extract {
 	URL=${1%%\ *}
 	NAME=${1#*\ }
-	FILE=`basename $URL`
+	FILE=$(basename $URL)
 	if [ ! -e $FILE ]; then
 		echo Downloading $NAME
 		wget $URL
 	fi
+	EXTENSION=${FILE##*.}
+	#This is an OpenSuSE build service RPM
+	if [ $EXTENSION == 'rpm' ]; then
+		FILE=$(../rpm2zip.sh $FILE)
+	fi
 	unzip -q $FILE -d $INSTALL_DIR
 	echo "$NAME" >> $CONTENTS_FILE
 }
@@ -63,9 +68,9 @@ do
 #Blow away translations that we don't have in Pidgin
 for LOCALE_DIR in $INSTALL_DIR/share/locale/*
 do
-	LOCALE=`basename $LOCALE_DIR`
+	LOCALE=$(basename $LOCALE_DIR)
 	if [ ! -e $PIDGIN_BASE/po/$LOCALE.po ]; then
-		echo Remove $LOCALE translation as it is missing from Pidgin
+		echo Removing $LOCALE translation as it is missing from Pidgin
 		rm -r $LOCALE_DIR
 	fi
 done


More information about the Commits mailing list