File vacuum-im.spec of Package vacuum-im

#
# spec file for package vacuum-im
#
# Copyright (c) 2012 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
# upon. The license for this file, and modifications and additions to the
# file, is the same license as for the pristine package itself (unless the
# license for the pristine package is not an Open Source License, in which
# case the license is the MIT License). An "Open Source License" is a
# license that conforms to the Open Source Definition (Version 1.9)
# published by the Open Source Initiative.

# Please submit bugfixes or comments via http://bugs.opensuse.org/
#


%define sname vacuum
%define rbuild 1680

Name:           %{sname}-im
Summary:        Crossplatform Jabber client written on Qt
License:        GPL-3.0
Group:          Productivity/Networking/Instant Messenger 
Version:        1.1.2
Release:        0
%if 0%{?suse_version} < 1120
BuildRoot:      %{_tmppath}/%{name}-%{version}-build
%endif
Source:         %{sname}-%{version}.tar.bz2
Url:            http://www.vacuum-im.org/
BuildRequires:  cmake >= 2.8
BuildRequires:  fdupes
BuildRequires:  libQtWebKit-devel
BuildRequires:  libqt4-devel
BuildRequires:  openssl-devel
BuildRequires:  update-desktop-files
Recommends:     vacuum-im-plugins-spellchecker

%description
The core program is just a plugin loader - all functionality is made
available via plugins. This enforces modularity and ensures well defined
component interaction via interfaces.

%define libname libvacuumutils1_7

%package -n %{libname}

Summary:        Shared library libvacuumutils for Vacuum-IM
Group:          System/Libraries

%description -n %{libname}
This package includes shared libraris needed to work Vacuum-IM program.

%package devel
Summary:        Development Files for Vacuum-IM
Group:          Development/Libraries/C and C++
Requires:       %{libname} = %{version}
Requires:       %{name} = %{version}

%description devel
This package includes files needed to develop Vacuum-IM modules.

%prep
%setup -q -n %{name}
sed -i 's/\r$//' AUTHORS
sed -i 's/\r$//' COPYING
sed -i 's/\r$//' README
sed -i 's/\r$//' INSTALL
sed -i 's/\r$//' CHANGELOG

%build
%{__mkdir} build
cd build
cmake .. -DCMAKE_BUILD_TYPE=RelWithDebInfo -DVER_STRING="%{rbuild}" -DINSTALL_SDK=1 -DCMAKE_INSTALL_PREFIX=%{_prefix} -DINSTALL_LIB_DIR=%{_lib}
%{__make} %{?_smp_mflags}

%install
pushd build
DESTDIR=%{buildroot} %{make_install}
popd
%{__install} -D -m644 resources/menuicons/shared/mainwindowlogo128.png %{buildroot}%{_datadir}/icons/hicolor/128x128/apps/%{name}.png
%{__install} -D -m644 resources/menuicons/shared/mainwindowlogo96.png %{buildroot}%{_datadir}/icons/hicolor/96x96/apps/%{name}.png
%{__install} -D -m644 resources/menuicons/shared/mainwindowlogo64.png %{buildroot}%{_datadir}/icons/hicolor/64x64/apps/%{name}.png
%{__install} -D -m644 resources/menuicons/shared/mainwindowlogo48.png %{buildroot}%{_datadir}/icons/hicolor/48x48/apps/%{name}.png
%{__install} -D -m644 resources/menuicons/shared/mainwindowlogo32.png %{buildroot}%{_datadir}/icons/hicolor/32x32/apps/%{name}.png
%{__install} -D -m644 resources/menuicons/shared/mainwindowlogo24.png %{buildroot}%{_datadir}/icons/hicolor/24x24/apps/%{name}.png
%{__install} -D -m644 resources/menuicons/shared/mainwindowlogo16.png %{buildroot}%{_datadir}/icons/hicolor/16x16/apps/%{name}.png
sed  "s/Exec=%{sname}/Exec=%{name}/;s/Icon=%{sname}/Icon=%{name}/" %{buildroot}%{_datadir}/applications/%{sname}.desktop > %{buildroot}%{_datadir}/applications/%{name}.desktop
rm -f %{buildroot}%{_datadir}/applications/%{sname}.desktop
mv %{buildroot}%{_datadir}/pixmaps/%{sname}.png %{buildroot}%{_datadir}/pixmaps/%{name}.png
mv %{buildroot}%{_bindir}/%sname %{buildroot}%{_bindir}/%{name}
%suse_update_desktop_file -c %{name} "Vacuum-IM" "Jabber Client" %{name} %{name}.png Network InstantMessaging
#fix: Installed (but unpackaged) file(s) found
rm -rf %{buildroot}%{_datadir}/doc

%fdupes %{buildroot}%{_datadir}

%post -n %{libname} -p /sbin/ldconfig

%postun -n %{libname} -p /sbin/ldconfig

%files
%defattr(-,root,root)
%doc README AUTHORS CHANGELOG COPYING
%{_bindir}/%name
%dir %{_libdir}/%{sname}
%dir %{_libdir}/%{sname}/plugins
%{_libdir}/%{sname}/plugins/*.so
%dir %{_datadir}/%{sname}
%dir %{_datadir}/%{sname}/resources
%{_datadir}/%{sname}/resources/*
%dir %{_datadir}/%{sname}/translations
%{_datadir}/%{sname}/translations/*
%dir %{_datadir}/icons/hicolor
%dir %{_datadir}/icons/hicolor/*
%dir %{_datadir}/icons/hicolor/*/apps
%{_datadir}/icons/hicolor/*/apps/%{name}.png
%{_datadir}/applications/%{name}.desktop
%{_datadir}/pixmaps/%{name}.png

%files -n %{libname}
%defattr(-,root,root)
%{_libdir}/libvacuumutils.so.*

%files devel
%defattr(-,root,root)
%{_libdir}/libvacuumutils.so
%{_includedir}/%{sname}

%changelog
openSUSE Build Service is sponsored by