~midori/midori/availactions

« back to all changes in this revision

Viewing changes to win32/x86-mingw32-opensuse/install.sh

  • Committer: Christian Dywan
  • Author(s): Peter de Ridder
  • Date: 2011-04-26 23:42:47 UTC
  • Revision ID: git-v1:d36e12f21d297b6ca5bf0daa38b452fccdf318d8
Provide build scripts for win32 releases

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
#!/bin/sh
 
2
 
 
3
# Copyright (C) 2010-2011 Peter de Ridder <peter@xfce.org>
 
4
#
 
5
# This library is free software; you can redistribute it and/or
 
6
# modify it under the terms of the GNU Lesser General Public
 
7
# License as published by the Free Software Foundation; either
 
8
# version 2.1 of the License, or (at your option) any later version.
 
9
#
 
10
# See the file COPYING for the full license text.
 
11
 
 
12
# config variables
 
13
REPO_URL=http://download.opensuse.org/repositories/windows:/mingw:/win32/openSUSE_11.2
 
14
REPO_ARCH=noarch
 
15
DOWNLOAD_PATH=~/dev/mingw/packages/opensuse
 
16
BUILD_PATH=~/tmp/opensuse
 
17
INSTALL_PATH=~/dev/mingw/mingw32
 
18
 
 
19
if [[ "$1" == "update" ]]
 
20
then
 
21
  UPDATE=yes
 
22
fi
 
23
 
 
24
# create download and build directory
 
25
mkdir -p $DOWNLOAD_PATH
 
26
mkdir -p $BUILD_PATH
 
27
 
 
28
rm $DOWNLOAD_PATH/repomd.xml
 
29
wget -nc $REPO_URL/repodata/repomd.xml -P $DOWNLOAD_PATH || exit 1
 
30
OTHER_FILE=`xmlgrep -c -f $DOWNLOAD_PATH/repomd.xml repomd.data:type=other.location | sed 's/.*href="\([^"]*\)".*/\1/'`
 
31
 
 
32
wget -nc $REPO_URL/$OTHER_FILE -O $DOWNLOAD_PATH/other.xml.gz || exit 1
 
33
rm $DOWNLOAD_PATH/other.xml
 
34
#gunzip -N $DOWNLOAD_PATH/`basename $OTHER_FILE`
 
35
gunzip -N $DOWNLOAD_PATH/other.xml
 
36
 
 
37
rm packages.version
 
38
touch packages.version
 
39
 
 
40
# downlaod all packages
 
41
while read line
 
42
do
 
43
  VERSION=`xmlgrep -c -f $DOWNLOAD_PATH/other.xml otherdata.package:name="$line":arch="$REPO_ARCH" | awk -F\< '{print $2}' |sed -e 'h' -e 's/^.*ver="\([^"]*\)".*$/\1/p' -e 'g' -e 's/^.*rel="\([^"]*\)".*$/\1/' | sed -e N -e 's/\n/-/' | sort -V -r | head -n 1`
 
44
  FILE=$line-$VERSION.$REPO_ARCH.rpm
 
45
  test "$UPDATE" == yes || echo $FILE >> packages.version
 
46
  if [ ! -f $DOWNLOAD_PATH/$FILE ]
 
47
  then
 
48
    test "$UPDATE" == yes && echo $FILE >> packages.version
 
49
    wget -nc $REPO_URL/$REPO_ARCH/$FILE -P $DOWNLOAD_PATH
 
50
  fi
 
51
done < packages.list
 
52
 
 
53
# convert and install packages
 
54
while read line
 
55
do
 
56
  pushd $BUILD_PATH
 
57
  # extract rpm
 
58
  rpm2cpio $DOWNLOAD_PATH/$line | cpio -i -d
 
59
  # convert pkgconfig files
 
60
  if [ -d $BUILD_PATH/usr/i686-pc-mingw32/sys-root/mingw/lib/pkgconfig ]
 
61
  then
 
62
    sed -i -e 's@^prefix=.*@prefix='$INSTALL_PATH'@' -e 's@/usr/i686-pc-mingw32/sys-root/mingw@${prefix}@' $BUILD_PATH/usr/i686-pc-mingw32/sys-root/mingw/lib/pkgconfig/*.pc
 
63
  fi
 
64
  # install the package
 
65
  cp -rf $BUILD_PATH/usr/i686-pc-mingw32/sys-root/mingw/* $INSTALL_PATH/
 
66
  # remove the extracted file
 
67
  rm -rf $BUILD_PATH/usr
 
68
  popd
 
69
done < packages.version
 
70
 
 
71
# remove build directory
 
72
rm -rf $BUILD_PATH