~armagetronad-dev/armagetronad/0.2.8-armagetronad-work

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
#!/bin/bash
# builds portable client

# set -x

# add AppRun
cp portable/AppRun ${APPDIR}/

# add desktop file to main dir and canonical place
find ${APPDIR} -type f -name "*.desktop" -exec mv \{\} ${APPDIR}/org.armagetronad.${PACKAGE}.desktop \;
find ${APPDIR} -type l -name "*.desktop" -exec rm -f \{\} \;
mkdir -p ${APPDIR}/usr/share/applications/
cp ${APPDIR}/org.armagetronad.${PACKAGE}.desktop ${APPDIR}/usr/share/applications/ || exit $?

# add appinfo
mkdir -p ${APPDIR}/usr/share/metainfo || exit $?
cp ${APPDIR}/usr/share/games/${PACKAGE}/desktop/armagetronad.appdata.xml ${APPDIR}/usr/share/metainfo/org.armagetronad.${PACKAGE}.appdata.xml || exit $?
#sed -i -e 's,type="desktop-id">,type="desktop-id">../../../,' ${APPDIR}/usr/share/metainfo/org.armagetronad.${PACKAGE}.appdata.xml || exit $?

# hack Icon
for f in $(find ${APPDIR} -type d -name "desktop"); do
  cp $f/icons/48x48/*.png ${APPDIR}/${PACKAGE}.png
done

# correct absolute symlinks
APPDIR=${APPDIR} $(dirname $0)/fixlinks

lastpath=/usr/lib/*linux-gnu
otherpath=${lastpath}

function copylib()
{
    baselib=$1
    while test -n "${baselib}"; do
      if echo ${baselib} | grep -q \^/; then
        # absolute path, split
        path=$(dirname ${baselib})
        baselib=$(basename ${baselib})
        echo "Found in ${path}."
        if test "$lastpath" != "$path"; then
            otherpath=$lastpath
        fi
        lastpath=$path
      fi
      # copy libary
      echo Copying ${baselib}...
      cp -a "${path}/${baselib}" ${APPDIR}/usr/lib/ || exit $?
      # resolve links
      baselib=$(ls -l ${path}/${baselib} | grep -- "->" | sed -e "s,.*-> ,,")
    done
}

# Luckily, This seems to only be an OPTIONAL dependency of libxml. It's huge.
#libicudata \
#libtiff \

#   include libraries
mkdir -p ${APPDIR}/usr/lib/
for library in \
libboost_thread \
libcaca \
libfreetype \
libftgl \
libGLEW \
libGLU \
libicuuc \
libncursesw \
libpng \
libprotobuf \
libSDL-1 \
libslang \
libstdc++ \
libSDL_image \
libSDL_mixer \
libtinfo \
libwebp \
libxml2 \
libZThread \
; do
  echo "Checking for library ${library}...."
  baselib=$(ldd ${APPDIR}/usr/bin/${PACKAGE} | grep "${library}" | sed -e "s,.*=> ,," -e "s, (.*,,")
  if test -z "${baselib}"; then
    echo "Not linked."
  else
    copylib ${baselib}
  fi
done

if ! echo ${PACKAGE} | grep dedicated; then
# libraries we know are dynamically loaded later, so they don't appear in ldd's output
for library in \
libjpeg.so.8 \
; do
    echo "Installing library ${library} anyway, we know it's needed."
    if test -r ${lastpath}/${library}; then
        copylib ${lastpath}/${library}
    else
        copylib ${otherpath}/${library}
    fi
done
fi

# more libraries for 0.4, later
#libogg.so \
#libogg.so.0 \
#libvorbis.so \
#libvorbis.so.0 \
#libvorbisfile.so \
#libvorbisfile.so.3 \
#libmikmod.so \
#libmikmod.so.2 \

echo $lastpath