File teamspeak3-client.spec of Package teamspeak3-client
#######################################################################
#
# WARNING WARNING WARNING WARNING WARNING WARNING WARNING WARNING
#
# You are not allowed to build this package in the OBS. If you want
# to build it, you have to download the 2 source files and run osc
# build locally, but never ever upload the .run files!
#
# WARNING WARNING WARNING WARNING WARNING WARNING WARNING WARNING
#
#######################################################################
# norootforbuild
# for setting those bcond_with* configs see
# http://lizards.opensuse.org/2008/09/12/conditional-features-aka-use-flags/
%if 0%{?suse_version} > 1140
%bcond_without intree_qt
%else
%bcond_without intree_qt
%endif
Name: teamspeak3-client
Version: 3.0.16
Release: 0
%define pkg_version %{version}
%define _ts3_dir %{_libexecdir}/teamspeak3/
%define _ts3_client_dir %{_libexecdir}/teamspeak3/client
%ifarch x86_64
%define _ts3_arch amd64
%else
%define _ts3_arch x86
%endif
%define _ts3_binname ts3client_linux_%{_ts3_arch}
#
Group: System/Base
License: Commercial(%{_ts3_client_dir}/LICENSE)
#
BuildRoot: %{_tmppath}/%{name}-%{version}-build
BuildRequires: chrpath
BuildRequires: update-desktop-files
ExclusiveArch: %{ix86} x86_64
# the version is based on the RPATH of the libQt in the package.
%if ! %{with intree_qt}
Requires: libqt4-x11 >= 4.7.2
Requires: libqt4-sql-sqlite >= 4.7.2
%endif
#
Url: http://www.teamspeak.com/
Source0: TeamSpeak3-Client-linux_%{_ts3_arch}-%{pkg_version}.tar.bz2
NoSource: 0
Source1: teamspeak3-client
Source2: teamspeak3-client.desktop
Source3: teamspeak3-client.png
Source4: teamspeak3_find_requires
Source5: teamspeak3_find_provides
Source6: teamspeak3_find_requires_system_qt
Source7: teamspeak3_find_provides_system_qt
#
Summary: Teamspeak 3 Client
%define _use_internal_dependency_generator 0
%if %{with intree_qt}
%define __find_requires env sh %{S:4}
%define __find_provides env sh %{S:5}
%else
%define __find_requires env sh %{S:6}
%define __find_provides env sh %{S:7}
%endif
%description
Teamspeak is a flexible, powerful, scalable software, which allows groups of
people to speak with one another over the internet.
Teamspeak is free of charge to non-profit entities and offers low cost, flexible
licensing options for commercial use.
This package holds the client.
%prep
%setup -n TeamSpeak3-Client-linux_%{_ts3_arch}
# rpath on "." which the script stupidly expands to $BUILD_DIR
for i in error_report \
package_inst \
sqldrivers/libqsqlite.so \
update ; do
chrpath -d $i ;
done
%if %{with intree_qt}
echo "Using intree Qt"
# /usr/local/Qt....
for i in accessible/libqtaccessiblewidgets.so \
imageformats/libqgif.so \
imageformats/libqjpeg.so \
libQtCore.so.4 \
libQtGui.so.4 \
libQtNetwork.so.4 \
libQtSql.so.4 \
sqldrivers/libqsqlite.so \
; do
# -r is broken
echo chrpath -r %{_ts3_client_dir} $i ;
done
%else
echo "Using system Qt"
rm -rv accessible/ imageformats/ libQtCore.so.4 libQtGui.so.4 libQtNetwork.so.4 libQtSql.so.4 # sqldrivers/
%endif
%build
%install
%{__install} -d %{buildroot}%{_ts3_client_dir}
cp -av * %{buildroot}%{_ts3_client_dir}
chmod -R go+rX %{buildroot}%{_ts3_client_dir}
#
%{__install} -D -m 0755 %{S:1} %{buildroot}%{_bindir}/teamspeak3-client
sed -i -e "s|@BASEDIR@|%{_ts3_client_dir}|g; s|@BINNAME@|%{_ts3_binname}|g" \
%{buildroot}%{_bindir}/teamspeak3-client
#
%{__ln_s} teamspeak3-client %{buildroot}%{_bindir}/ts3client
%{__ln_s} teamspeak3-client %{buildroot}%{_bindir}/ts3client_runscript.sh
%{__install} -D -m 0644 %{S:2} %{buildroot}%{_datadir}/applications/teamspeak3-client.desktop
%{__install} -D -m 0644 %{S:3} %{buildroot}%{_datadir}/pixmaps/teamspeak3-client.png
#
%suse_update_desktop_file %{name}
%if %{with intree_qt}
# yes we know about the broken rpath
export NO_BRP_CHECK_RPATH="true"
%endif
%clean
%{__rm} -rf %{buildroot}
%if 0%{?suse_version} > 1130
%post
%desktop_database_post
%postun
%desktop_database_postun
%endif
%files
%defattr(-,root,root,-)
%{_bindir}/teamspeak3-client
%{_bindir}/ts3client
%{_bindir}/ts3client_runscript.sh
%dir %{_ts3_dir}/
%{_ts3_client_dir}/
%{_datadir}/applications/teamspeak3-client.desktop
%{_datadir}/pixmaps/teamspeak3-client.png
%changelog