updated on Thu Jan 26 12:02:26 UTC 2012
[aur-mirror.git] / mullerfoto-fotostar_sk / PKGBUILD
blob260249ece12ad14de7c957d1d2899bad0b8ebd1a
1 # Maintainer: Jozef Riha <jose1711 at gmail dot com>
3 pkgname=mullerfoto-fotostar_sk
4 pkgver=4.6.7
5 pkgrel=1
6 pkgdesc="an offline client for uploading and ordering photos at fotolab.sk (aka FotoStar Client)"
7 url="http://www.fotolab.sk/"
8 license=("custom:eula")
9 depends=('libx11' 'curl')
10 arch=('i686')
11 source=("http://dls.photoprintit.de/download/Data/5316/hps/setup_Moj_CEWE_FOTOSVET_46.tgz" "mullerfoto.desktop")
12 install=('mullerfoto.install')
13 conflicts=('mullerfoto-fotostar_de' 'mullerfoto-fotostar_cz')
14 md5sums=('d1f2d5913de2a0652255e3f608c2ec93'
15          '7d751150ce96432e66a28b4e8fd6aca2')
17 build() {
18         cd $srcdir
19         mkdir -p $pkgdir/usr/{share/$pkgname,bin}
20         KEYACCID=5316
21         CLIENTID=38
22         HPS_VER=$pkgver
23         # download list of links
24         wget -O url_list.txt "http://dls.photoprintit.de/download/Data/${KEYACCID}/hps/${CLIENTID}-index-${HPS_VER}.txt"
25         echo "Downloading and extracting files.."
26         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
27                 wget "http://dls.photoprintit.de/$url"
28                 unzip -d $pkgdir/usr/share/$pkgname $(basename $url)
29         done
30         echo "Creating symlinks.."
31         # weird stuff, but this is what the installation script is doing also
32         cd $pkgdir/usr/share/$pkgname
33         version_array=()
34         for source in *.so*; do
35                 libversion=$(echo $source|sed -n 's/\(.*\).so\.\(.*\)/\2/p')
36                 libname=$(echo $source|sed -n 's/\(.*\.so\)\..*/\1/p');
37                 IFS=$'.' read -a version_array <<< "${libversion}"
38                 unset IFS
39                 n=${#version_array[*]}
40                 target=()
41                 for ((i=0;i<n-1;i++)); do
42                         target=$(echo -n "$target"."${version_array[i]}")
43                         rm "${libname}${target}" || true
44                         ln -s "$source" "${libname}${target}"
45                 done
46         done
47         # utf-8 and space in executable filenames is generally a bad idea
48         mv M*"CEWE FOTOSVET" "MullerFoto"
49         # make files executable
50         chmod 0755 ./MullerFoto
51         chmod 0755 ./assistant
52         #chmod 0755 "./CEWE n*"
53         chmod 0755 ./facedetection
54         # copy EULA
55         install -D -m644 $srcdir/EULA.txt $pkgdir/usr/share/$pkgname/EULA.txt
56         # create startup script
57         (echo "#!/bin/bash
58 cd /usr/share/$pkgname
59 ./MullerFoto \"\$@\"") > $pkgdir/usr/bin/MullerFoto
60         chmod 755 $pkgdir/usr/bin/MullerFoto
61         # create desktop shortcut
62         install -D -m644 Resources/keyaccount/32.xpm $pkgdir/usr/share/pixmaps/mullerfoto.xpm
63         install -D -m644 $srcdir/mullerfoto.desktop $pkgdir/usr/share/applications/mullerfoto.desktop