Skip to content
This repository has been archived by the owner on Feb 12, 2021. It is now read-only.

Commit

Permalink
Move here-doc sources to separate files.
Browse files Browse the repository at this point in the history
With the rest of the spec cleaned up, these clutters too much.
  • Loading branch information
Alec Leamas committed May 24, 2013
1 parent f6fea01 commit e622870
Show file tree
Hide file tree
Showing 4 changed files with 34 additions and 39 deletions.
5 changes: 5 additions & 0 deletions find-requires.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
#!/bin/sh

/usr/lib/rpm/find-requires | \
sed -e 's/lib\(nss3\|nssutil3\|smime3\|plc4\|nspr4\)\.so\.[01]d/lib\1.so/
/lib\(crypto\|ssl\)\.so/d'
5 changes: 5 additions & 0 deletions pkg-bundled-README
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
This package was built by the openSUSE Spotify installer; see

https://github.com/aspiers/opensuse-spotify-installer

for more information.
47 changes: 8 additions & 39 deletions spotify-client.spec
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,9 @@ Source1: spotify-client_%{version}-%{release}_amd64.deb
%else
Source1: spotify-client_%{version}-%{release}_i386.deb
%endif
Source2: pkg-bundled-README
Source3: spotify.sh
Source4: find-requires.sh
NoSource: 0
%if 0%{?suse_version}
BuildRequires: update-desktop-files
Expand Down Expand Up @@ -81,20 +84,14 @@ It includes the following features:
- Social media integration with Facebook and Twitter
- 3rd-party applications integrated into the client

%define _use_internal_dependency_generator 0
%define __find_requires %{SOURCE4}


%prep
%setup -qn spotify-make-%{commit}

cat >find-requires.sh <<'EOF'
#!/bin/sh

/usr/lib/rpm/find-requires | \
sed -e 's/lib\(nss3\|nssutil3\|smime3\|plc4\|nspr4\)\.so\.[01]d/lib\1.so/
/lib\(crypto\|ssl\)\.so/d'
EOF
chmod +x find-requires.sh
%define _use_internal_dependency_generator 0
%define __find_requires %_builddir/spotify-make-%{commit}/find-requires.sh
cp %{SOURCE2} README
cp %{SOURCE3} spotify.bash # Use the SUSE wrapper instead of upstream.


%build
Expand All @@ -110,34 +107,6 @@ make install DESTDIR=%{buildroot}
# http://en.opensuse.org/openSUSE:Packaging_desktop_menu_categories#Multimedia
%suse_update_desktop_file spotify

cat >%{buildroot}%{_docdir}/%{name}/README <<EOF
This package was built by the openSUSE Spotify installer; see

https://github.com/aspiers/opensuse-spotify-installer

for more information.
EOF


# install binary wrapper
mkdir -p %{buildroot}%{_bindir}
wrapper="%{buildroot}%{_bindir}/spotify"
cat >"$wrapper" <<'EOF'
#!/bin/sh

if [ -n "$SPOTIFY_CLEAN_CACHE" ]; then
echo
echo -n "Cleaning spotify cache ... "
rm -rf ~/.cache/spotify
echo "done."
fi

cd %{spotifydir}
LD_LIBRARY_PATH=%{spotifylibdir} ./spotify "$@"
EOF

chmod +x "$wrapper"


%post
%desktop_database_post
Expand Down
16 changes: 16 additions & 0 deletions spotify.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
#!/bin/bash

path=$0
[[ "$path" == /* ]] || path=$PWD/$path
cd ${path%/*}

spotify=/usr/bin/spotify

if [ -n "$SPOTIFY_CLEAN_CACHE" ]; then
echo
echo -n "Cleaning spotify cache ... "
rm -rf ~/.cache/spotify
echo "done."
fi

$spotify "$@"

0 comments on commit e622870

Please sign in to comment.