summaryrefslogtreecommitdiff
path: root/packages/media-sound/spotify/spotify-1.0.49.125.exheres-0
blob: 4815469d1a2b7bb18af03e17e226a78ea9caf8b5 (plain)
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
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
# Copyright 2011 Anders Ladegaard Marchsteiner <alm.anma@gmail.com>
# Copyright 2012 Lasse Brun <bruners@gmail.com>
# Distributed under the terms of the GNU General Public License v2

require gtk-icon-cache freedesktop-desktop

SUMMARY="Music streaming service."
DESCRIPTION="
A DRM-based music streaming service offering streaming of selected music from a range of major and
independent record labels, including Sony, EMI, Warner Music Group, and Universal.
"
HOMEPAGE="http://www.spotify.com"

MY_REPO="http://repository-origin.spotify.com/pool/non-free/s/spotify-client"
MY_PN="${PN}-client"
MY_PV="${PV}.g72ee7853-111"
# Source URLĀ : http://repository-origin.spotify.com/pool/non-free/s/spotify-client/spotify-client_1.0.49.125.g72ee7853-111.deb

DOWNLOADS=("${MY_REPO}/${MY_PN}_${MY_PV}_amd64.deb")
LICENCES="Spotify"
SLOT="0"
PLATFORMS="~amd64"
MYOPTIONS="( providers: ffmpeg libav ) [[ number-selected = exactly-one ]]"
DEPENDENCIES="
    run:
        dev-libs/atk[>=2.18]
        dev-libs/expat[>=2.1]
        dev-libs/glib[>=2.46.2]
        dev-libs/nspr[>=4.0]
        dev-libs/nss[>=3.0]
        dev-libs/openssl[>=0.9.8] [[
            description = [ Spotify wants 0.9.8 but runs with warnings with versions >1.0.0 ]
        ]]
        gnome-platform/GConf:2
        media-libs/fontconfig[>=2.11]
        media-libs/freetype[>=2.6]
        net-misc/curl[>=7.43]
        sys-apps/dbus[>=1.10]
        sys-apps/systemd
        sys-apps/usbutils
        sys-devel/gcc:*[>=4.0.0]
        sys-libs/glibc[>=2.6]
        sys-sound/alsa-lib[>=1.0.14]
        x11-libs/cairo[>=1.14.2][X(+)]
        x11-libs/gdk-pixbuf[>=2.32.3]
        x11-libs/libX11[>=1.6.3]
        x11-libs/libXcomposite[>=0.4.4]
        x11-libs/libXcursor[>=1.1.14]
        x11-libs/libXdamage[>=1.1.4]
        x11-libs/libXext[>=1.3.3]
        x11-libs/libXfixes[>=5.0.1]
        x11-libs/libXi[>=1.7.6]
        x11-libs/libXrandr[>=1.5.0]
        x11-libs/libXrender[>=0.9.9]
        x11-libs/libXScrnSaver[>=1.2.0]
        x11-libs/libXtst[>=1.2.2]
        x11-libs/pango[>=1.38.1]
        x11-libs/qt:4[>=4.5.0][dbus][webkit][X(+)]
    install:
        x11-apps/xdg-utils

    suggestion:
        providers:ffmpeg? ( media/ffmpeg[>=1.0] )
        providers:libav? ( media/libav[>=9] )
        net-apps/NetworkManager [[
            description = [ Optional for unknown feature (dbus.freedesktop.org related) ]
        ]]
        net-print/cups [[
            description = [ Optional for unknown feature, should be for printing ...  ]
        ]]
"

BUGS_TO="
    alm.anma@gmail.com
    bruners@gmail.com
"

WORK="${WORKBASE}"

pkg_setup() {
    exdirectory --allow /opt
}

src_unpack() {
    default
    unpack ./data.tar.gz
    edo rm -f {control,data}.tar.gz debian-binary
    edo rm -rf usr/share/doc
}

src_install() {
    edo mkdir -p "${IMAGE}"usr/share
    edo cp -r "${WORK}"/usr/share/* "${IMAGE}"usr/share
}

pkg_prerm() {
  spotifyPath=$PWD
  if [ -e /usr/share/spotify ]; then
    spotifyPath=/usr/share/spotify
  fi

  # Remove icons from the system icon folders
  XDG_ICON_RESOURCE="$(which xdg-icon-resource 2> /dev/null)"
  if [ ! -x "$XDG_ICON_RESOURCE" ]; then
    elog "Error: Could not find xdg-icon-resource"
    exit 1
  fi

  for icon in $(ls -1 $spotifyPath/icons/spotify-linux-*.png); do
    elog "Unregistering icon $icon"
    size="${icon##*/spotify-linux-}"
    "$XDG_ICON_RESOURCE" uninstall --size "${size%.png}" "$icon" "spotify-client"
  done

  # Remove the entry from the system menu
  XDG_DESKTOP_MENU="$(which xdg-desktop-menu 2> /dev/null)"
  UPDATE_MENUS="$(which update-menus 2> /dev/null)"
  if [ ! -x "$XDG_DESKTOP_MENU" ]; then
    elog "Error: Could not find xdg-desktop-menu"
    exit 1
  fi

  elog "Unregistering desktop entry"
  "$XDG_DESKTOP_MENU" uninstall --novendor "spotify.desktop"
  if [ -x "$UPDATE_MENUS" ]; then
   "$UPDATE_MENUS"
  fi
}

pkg_postrm() {
    freedesktop-desktop_pkg_postrm
    gtk-icon-cache_pkg_postrm
}

pkg_preinst(){
    host=$(exhost --target)
    edo mkdir -p "${IMAGE}usr/${host}/bin"
    edo ln -fs "../../share/spotify/spotify" "${IMAGE}usr/${host}/bin/spotify"
}
pkg_postinst() {
  spotifyPath=$PWD
  if [ -e /usr/share/spotify ]; then
    spotifyPath=/usr/share/spotify
  fi

  # Add icons to the system icon folders
  XDG_ICON_RESOURCE="$(which xdg-icon-resource 2> /dev/null)"
  if [ ! -x "$XDG_ICON_RESOURCE" ]; then
    elog "Error: Could not find xdg-icon-resource" >&2
    exit 1
  fi

  for icon in $(ls -1 $spotifyPath/icons/spotify-linux-*.png); do
    elog "Registering icon $icon"
    size="${icon##*/spotify-linux-}"
    "$XDG_ICON_RESOURCE" install --size "${size%.png}" "$icon" "spotify-client"
  done

  # Add an entry to the system menu
  XDG_DESKTOP_MENU="$(which xdg-desktop-menu 2> /dev/null)"
  UPDATE_MENUS="$(which update-menus 2> /dev/null)"
  if [ ! -x "$XDG_DESKTOP_MENU" ]; then
    elog "Error: Could not find xdg-desktop-menu"
    exit 1
  fi

  # It seems the desktop file has to match the MPris name. We don't want to
  # change that, so we use --novendor here instead.
  elog "Registering desktop entry"
  "$XDG_DESKTOP_MENU" install --novendor "$spotifyPath/spotify.desktop"
  if [ -x "$UPDATE_MENUS" ]; then
    "$UPDATE_MENUS"
  fi
  freedesktop-desktop_pkg_postinst
  gtk-icon-cache_pkg_postinst
}