Skip to content

Commit

Permalink
Merge pull request #12 from megamaced/develop
Browse files Browse the repository at this point in the history
move libcurl symlink logic to spotify rpm
  • Loading branch information
megamaced committed Mar 30, 2018
2 parents 61820d4 + 53962e0 commit 32b47c3
Showing 1 changed file with 12 additions and 25 deletions.
37 changes: 12 additions & 25 deletions spotify-easyrpm
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ cat <<EOF
EOF
sleep 2
cat <<EOF
VERSION: 1.1.2
VERSION: 1.1.3
SUPPORT: https://github.com/megamaced/spotify-easyrpm/issues
The latest openSUSE Leap, Tumbleweed or SLE are supported only
Expand Down Expand Up @@ -410,20 +410,6 @@ if ! rpm -q update-desktop-files > /dev/null 2>&1; then
fi
}

f_rpm_check_libcurl() {
if [[ "${V_SYS_ARCH}" == i386 ]]; then
if [[ ! -f /usr/lib/libcurl-gnutls.so.4 ]]; then
echo "Spotify now requires libcurl-gnutls.so.4 which is not present on SUSE. Working around by symlinking libcurl.so.4..."
sudo ln -s /usr/lib/libcurl.so.4 /usr/lib/libcurl-gnutls.so.4
fi
elif [[ "${V_SYS_ARCH}" == x86_64 ]]; then
if [[ ! -f /usr/lib64/libcurl-gnutls.so.4 ]]; then
echo "Spotify now requires libcurl-gnutls.so.4 which is not present on SUSE. Working around by symlinking libcurl.so.4..."
sudo ln -s /usr/lib64/libcurl.so.4 /usr/lib64/libcurl-gnutls.so.4
fi
fi
}

f_rpm_prepare_src() {
echo "Preparing RPM src tarball"
mkdir -p "${V_SOURCES_DIR}"/"${V_PKGNAME}"/usr/share/applications
Expand Down Expand Up @@ -486,7 +472,7 @@ cat << EOF > "${V_SPECS_DIR}"/spotify.spec
#
# spec file for package ${V_PKGNAME}
#
# Copyright (c) 2015 SUSE LINUX Products GmbH, Nuernberg, Germany.
# Copyright (c) 2018 SUSE LINUX Products GmbH, Nuernberg, Germany.
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
Expand Down Expand Up @@ -543,13 +529,17 @@ on Linux systems.
%setup -q -n %{name}
%install
mkdir -p %{buildroot}/usr
mkdir -p %{buildroot}%{_prefix}
cp -r usr %{buildroot}/
%post
%desktop_database_post
if [[ ! -f %{_libdir}/libcurl-gnutls.so.4 ]]; then
ln -s %{_libdir}/libcurl.so.4 %{_libdir}/libcurl-gnutls.so.4
fi
%postun
%desktop_database_postun
Expand All @@ -558,12 +548,11 @@ cp -r usr %{buildroot}/
%files
%defattr(-,root,root)
#%doc ChangeLog README COPYING
%dir /usr/share/spotify
/usr/share/spotify/*
/usr/bin/spotify
/usr/share/doc/${V_PKGNAME}/*
/usr/share/applications/spotify.desktop
%dir %{_datadir}/spotify
%{_datadir}/spotify/*
%{_datadir}/applications/spotify.desktop
%{_datadir}/doc/${V_PKGNAME}/*
%{_bindir}/spotify
EOF
}

Expand Down Expand Up @@ -801,7 +790,6 @@ fi
}



## MAIN PROCESS FUNCTION ##


Expand All @@ -813,7 +801,6 @@ if [[ "${V_RUN_MODE}" == *prompt ]]; then
f_logo
f_install_check
f_rpm_install_build_deps
f_rpm_check_libcurl
f_create_local_build_dirs
f_rpm_ver_compare
f_download
Expand Down

0 comments on commit 32b47c3

Please sign in to comment.