comparison pidgin/win32/nsis/rpm2zip.sh @ 30427:23b3627ecec3

Add support for the binaries built by the opensuse build service to the Gtk zip generation script. This isn't actually in use yet.
author Daniel Atallah <daniel.atallah@gmail.com>
date Fri, 21 May 2010 02:40:53 +0000
parents
children
comparison
equal deleted inserted replaced
30426:cbae3d450db8 30427:23b3627ecec3
1 #!/bin/sh
2
3 here=`pwd`
4 for F in $*; do
5 case $F in
6 mingw32-*.noarch.rpm|mingw64-*.noarch.rpm|*/mingw32-*.noarch.rpm|*/mingw64-*.noarch.rpm)
7 package=`rpm -qp $F 2>/dev/null`
8 case $package in
9 mingw32-*|mingw64-*)
10 case $package in
11 mingw32-*)
12 cpu=i686
13 bits=32
14 ;;
15 mingw64-*)
16 cpu=x86_64
17 bits=64
18 ;;
19 esac
20 origname=`rpm -qp --queryformat='%{NAME}' $F 2>/dev/null`
21 name=$origname
22 case $name in
23 *-devel)
24 name=${name%el}
25 ;;
26 esac
27 shortpackage="$name"_`rpm -qp --queryformat='%{VERSION}-%{RELEASE}'_win${bits} $F 2>/dev/null`
28 shortpackage=${shortpackage#mingw32-}
29 shortpackage=${shortpackage#mingw64-}
30 shortname=$name
31 shortname=${shortname#mingw32-}
32 shortname=${shortname#mingw64-}
33 tmp=`mktemp -d`
34 #rpm2cpio $F | lzcat | (cd $tmp && cpio --quiet -id)
35 rpm2cpio $F | (cd $tmp && cpio --quiet -id)
36 (
37 cd $tmp
38 zipfile="$here/$shortpackage.zip"
39 rm -f $zipfile
40 (cd usr/${cpu}-pc-mingw32/sys-root/mingw && zip -q -r -D $zipfile .)
41 if [ -d usr/share/doc/packages/$origname ] ; then
42 mv usr/share/doc/packages/$origname usr/share/doc/packages/$shortname
43 (cd usr && zip -q -r -D $zipfile share/doc/packages/$shortname)
44 fi
45 mkdir -p manifest
46 unzip -l $zipfile >manifest/$shortpackage.mft
47 zip -q $zipfile manifest/$shortpackage.mft
48 N=`unzip -l $zipfile | wc -l | sed -e 's/^ *\([0-9]*\).*/\1/'`
49 Nm1=`expr $N - 1`
50 unzip -l $zipfile | sed -e "1,3 d" -e "$Nm1,$N d" | awk '{print $4}' | grep -v -E '/$' >manifest/$shortpackage.mft
51 zip -q $zipfile manifest/$shortpackage.mft
52 echo $zipfile
53 )
54 rm -rf $tmp
55 ;;
56 *)
57 echo $F is not a mingw32/64 RPM package >&2
58 ;;
59 esac
60 ;;
61 *)
62 echo $F is not a mingw32/64 RPM package >&2
63 ;;
64 esac
65 done