updated on Thu Jan 26 16:09:46 UTC 2012
[aur-mirror.git] / crayonphysicsdeluxe / PKGBUILD
blob840f49da7a8a57b9a32e1bb81285f8b87f7eca43
1 # Maintainer: Gadget3000 <gadget3000 at msn dot com>
2 # Contributor: Otto Allmendinger <otto.allmendinger@gmail.com>
4 pkgname=crayonphysicsdeluxe
5 pkgver=55_3
6 pkgrel=3
7 pkgdesc="A 2D physics puzzle / sandbox game, in which your drawings are transformed into objects"
8 arch=('i686' 'x86_64')
9 url="http://www.crayonphysics.com/"
10 license=('custom')
11 groups=('humblebundle3' 'humbleintbundle' 'humblebundles')
12 if [ "$CARCH" = "x86_64" ]; then
13     depends=('lib32-qt' 'lib32-sdl_image' 'lib32-sdl_mixer' 'lib32-glew1.5')
14 else
15     depends=('qt' 'sdl_image' 'sdl_mixer' 'glew1.5')
17 makedepends=("imagemagick")
18 install=("CrayonPhysicsDeluxe.install")
19 source=("CrayonPhysicsDeluxe.desktop" "crayon.sh")
20 md5sums=('77b35434d5d3d52f7f6071caf306f1d1'
21          'd5425616d72038aa387a23b0974aa931')
23 _archive="crayon-physics-deluxe_${pkgver/_*/}_i386.tar.gz"
24 _archive_md5="03855655d3f4d6ef49ebd31b12476c80"
26 build() {
27     cd $srcdir
29     if [ ! -f ${_crayonarchivelocation}${_archive} ]; then
30         if [ -n "${_crayonarchivelocation}" ] && [ $(echo ${_crayonarchivelocation} | rev | cut -c 1) != "/" ]; then
31             echo _crayonarchivelocation must end in /
32             return 1
33         fi
34         if [ ! -f ${_archive} ] && [ -n "${_humblebundle3key}" ]; then
35             rm -f ${_archive}* index.html\?key\=${_humblebundle3key}*
36             wget http://www.humblebundle.com/?key=${_humblebundle3key}
37             wget $(cat index.html\?key\=${_humblebundle3key} | grep "${_archive}" | cut -d "'" -f 10)
38             mv ${_archive}* ${_archive}
39         elif [ ! -f ${_archive} ] && [ -n "${_humbleintbundlekey}" ]; then
40             rm -f ${_archive}* index.html\?key\=${_humbleintbundlekey}*
41             wget http://www.humblebundle.com/?key=${_humbleintbundlekey}
42             wget $(cat index.html\?key\=${_humbleintbundlekey} | grep "${_archive}" | cut -d "'" -f 10)
43             mv ${_archive}* ${_archive}
44         elif [ -z "${_humblebundle3key}" ] && [ -z "${_humbleintbundlekey}" ]; then
45             echo You can automate the download of the archive using the _humblebundle3key or _humbleintbundlekey bash variables.
46             echo Just add \'export _humblebundle3key\=\<Your key here\>\' and/or
47             echo \'export _humbleintbundlekey\=\<Your key here\>\' to \.bashrc
48             echo
49             echo Otherwise please just place ${_archive} into $(pwd)/
50             echo Press Enter to continue
51             read -a _unused
52         fi
53     fi
55     if [ ! -f ${_crayonarchivelocation}${_archive} ]; then
56         echo "${_crayonarchivelocation}${_archive} not found!"
57         return 1
58     fi
60     if ! echo "${_archive_md5}  ${_crayonarchivelocation}${_archive}" | md5sum -c --quiet; then
61         echo "Invalid checksum for ${_crayonarchivelocation}${_archive}"
62         return 1
63     fi
65     install -d ${pkgdir}/usr/share/CrayonPhysicsDeluxe/
66     tar xzf ${_crayonarchivelocation}${_archive} -C ${pkgdir}/usr/share/CrayonPhysicsDeluxe/
67     rm -rf ${pkgdir}/usr/share/CrayonPhysicsDeluxe/lib32
69     chmod +x ${pkgdir}/usr/share/CrayonPhysicsDeluxe/launcher
70     install -d ${pkgdir}/usr/bin
72     for i in 16x16 22x22 32x32 48x48 64x64 128x128; do
73         mkdir -p ${pkgdir}/usr/share/icons/hicolor/${i}/apps
74         convert -resize ${i} \
75             ${pkgdir}/usr/share/CrayonPhysicsDeluxe/icon.png \
76             ${pkgdir}/usr/share/icons/hicolor/${i}/apps/CrayonPhysicsDeluxe.png
77     done
79     install -Dm644 ${srcdir}/CrayonPhysicsDeluxe.desktop \
80         ${pkgdir}/usr/share/applications/CrayonPhysicsDeluxe.desktop
82     install -D -m644 ${pkgdir}/usr/share/CrayonPhysicsDeluxe/LICENSE.txt \
83         ${pkgdir}/usr/share/licenses/${pkgname}/LICENSE
85     install -Dm755 ${srcdir}/crayon.sh  ${pkgdir}/usr/bin/crayon
87     chown -Rh root:root ${pkgdir}/usr/share/CrayonPhysicsDeluxe