updated on Thu Jan 26 16:09:46 UTC 2012
[aur-mirror.git] / mullerfoto-fotostar_cz / PKGBUILD
blob236d2b4eadecadb7c65d525fdd2ff2dff7b352e5
1 # Maintainer: Jozef Riha <jose1711 at gmail dot com>
3 pkgname=mullerfoto-fotostar_cz
4 pkgver=4.6.8
5 pkgrel=2
6 pkgdesc="an offline client for uploading and ordering photos at fotolab.cz (aka FotoStar Client)"
7 url="http://foto-sberna.fotolab.cz/objednat-foto-komfortni-software-zdarma.html"
8 license=("custom:eula")
9 depends=('libx11' 'curl')
10 arch=('i686')
11 source=("http://dls.photoprintit.de/download/Data/4860/hps/setup_Fotolab_Fotosvet_4.tgz" "mullerfoto.desktop" "fotosvet.desktop")
12 install=('mullerfoto.install')
13 conflicts=('mullerfoto-fotostar_de' 'mullerfoto-fotostar_sk')
14 md5sums=('a7a70e128056fa8ebd0a6a6104488d3b'
15          'de6d7b4e78b7e9ff17dad0631e373e9e'
16          '442801b82feee66d61aa796d573b3d82')
18 build() {
19         cd $srcdir
20         mkdir -p $pkgdir/usr/{share/$pkgname,bin}
21         KEYACCID=4860
22         CLIENTID=38
23         HPS_VER=$pkgver
24         # download list of links
25         wget -O url_list.txt "http://dls.photoprintit.de/download/Data/${KEYACCID}/hps/${CLIENTID}-index-${HPS_VER}.txt"
26         echo "Downloading and extracting files.."
27         for url in $(awk -F\; '{print $1}' url_list.txt|egrep -v "dll|cewe|setup_Mueller|setup_Fotostar|setup_bol_de|setup_Moj_CeWe"); do
28                 wget "http://dls.photoprintit.de/$url"
29                 unzip -d $pkgdir/usr/share/$pkgname $(basename $url)
30         done
31         echo "Creating symlinks.."
32         # weird stuff, but this is what the installation script is doing also
33         cd $pkgdir/usr/share/$pkgname
34         version_array=()
35         rm {libCWImageLoader,libCWGUIWidgets}.so{,.0,.0.1} libexpat.so{,.1}
36         for source in *.so*; do
37                 libversion=$(echo $source|sed -n 's/\(.*\).so\.\(.*\)/\2/p')
38                 libname=$(echo $source|sed -n 's/\(.*\.so\)\..*/\1/p');
39                 IFS=$'.' read -a version_array <<< "${libversion}"
40                 unset IFS
41                 n=${#version_array[*]}
42                 target=()
43                 for ((i=0;i<n-1;i++)); do
44                         target=$(echo -n "$target"."${version_array[i]}")
45                         ln -s "$source" "${libname}${target}" || true
46                 done
47         done
48         # non-ascii characters in executable filenames is generally a bad idea
49         mv "CEWE prezentace fotografií" "MullerFoto"
50         # make files executable
51         chmod 0755 ./MullerFoto
52         chmod 0755 ./assistant
53         chmod 0755 ./Fotolab\ Fotosvet\ 4
54         chmod 0755 ./facedetection
55         # copy EULA
56         install -D -m644 $srcdir/EULA.txt $pkgdir/usr/share/$pkgname/EULA.txt
57         # create startup script
58         (echo "#!/bin/bash
59 cd /usr/share/$pkgname
60 ./Fotolab\ Fotosvet\ 4 \"\$@\"") > $pkgdir/usr/bin/Fotosvet4
61         (echo "#!/bin/bash
62 cd /usr/share/$pkgname
63 ./MullerFoto \"\$@\"") > $pkgdir/usr/bin/MullerFoto
64         chmod 0755 $pkgdir/usr/bin/MullerFoto
65         chmod 0755 $pkgdir/usr/bin/Fotosvet4
66         # create desktop shortcut
67         install -D -m644 Resources/keyaccount/32.xpm $pkgdir/usr/share/pixmaps/mullerfoto.xpm
68         install -D -m644 Resources/keyaccount/fotoschau.xpm $pkgdir/usr/share/pixmaps/fotoschau.xpm
69         install -D -m644 $srcdir/mullerfoto.desktop $pkgdir/usr/share/applications/mullerfoto.desktop
70         install -D -m644 $srcdir/fotosvet.desktop $pkgdir/usr/share/applications/fotosvet.desktop