File swift-im.spec of Package swift-im

# spec file for package swift-im
# Copyright (c) 2016 SUSE LINUX 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

%define _name swift
Name:           swift-im
Version:        3.0
Release:        0
Summary:        XMPP client
License:        GPL-3.0
Group:          Productivity/Networking/Talk/Clients
BuildRequires:  avahi-devel
BuildRequires:  boost-devel
BuildRequires:  desktop-file-utils
BuildRequires:  docbook-dtds
BuildRequires:  hicolor-icon-theme
BuildRequires:  libQt5Core-devel
BuildRequires:  libQt5DBus-devel
BuildRequires:  libQt5Gui-devel
BuildRequires:  libQt5Network-devel
BuildRequires:  libQt5WebKit5-devel
BuildRequires:  libQt5WebKitWidgets-devel
BuildRequires:  libQt5Widgets-devel
BuildRequires:  libexpat-devel
BuildRequires:  libidn-devel
BuildRequires:  libopenssl-devel
BuildRequires:  libqt5-linguist-devel
BuildRequires:  libqt5-qtbase-devel
BuildRequires:  libqt5-qtdeclarative-devel
BuildRequires:  libqt5-qtmultimedia-devel
BuildRequires:  libqt5-qttools
BuildRequires:  libqt5-qtx11extras-devel
BuildRequires:  libxslt
BuildRequires:  python-xml
BuildRequires:  scons
BuildRequires:  zlib-devel
BuildRequires:  libminiupnpc-devel

Swift is an easy to setup and use Jabber/XMPP instant messaging chat

# -------------------------------- swiften ---------------------------

%package -n libSwiften3
Summary:        Cross-platform XMPP client/server library
Group:          System/Libraries

%description -n libSwiften3
Swiften is a robust, high-quality, standards-compliant, cross-platform,
and performant C++ library for implementing XMPP applications.

# ------------------------------ swiften-devel -----------------------

%package -n swiften-devel
Summary:        Cross-platform XMPP client/server library (development files)
Group:          Development/Libraries/C and C++
Requires:       libSwiften3 = %{version}

%description -n swiften-devel
Swiften is a robust, high-quality, standards-compliant, cross-platform,
and performant C++ library for implementing XMPP applications.

%setup -q -n %{_name}-%{version}

# Remove 3rd party libraries
# Following ones are used from distro:
find 3rdParty/Boost/src -delete
find 3rdParty/SCons -delete
find 3rdParty/Expat/src -delete
find 3rdParty/LibIDN -delete
find 3rdParty/Lua -delete
find 3rdParty/ZLib -delete
find 3rdParty/OpenSSL -delete
find 3rdParty/DocBook -delete
# P2P
find 3rdParty/LibMiniUPnPc -delete
find 3rdParty/LibNATPMP -delete
# DNS (they use it on Android)
find 3rdParty/Unbound -delete
find 3rdParty/Ldns -delete
# Windows stuff
find 3rdParty/Snarl -delete
# Only for developers
find 3rdParty/LCov -delete
# Not used by swift yet
find 3rdParty/Breakpad/src -delete
find 3rdParty/SQLite -delete
# They use scons in a way that doesnt allow us to use our CppUnit
# find 3rdParty/CppUnit -delete
# Needed for tests
# find 3rdParty/HippoMocks -delete

echo 'ccflags="%{optflags} -fPIC".split(" ")' >>

scons V=1 Swift Swiften swiften_dll=1 test=none %{?_smp_mflags}

%install SWIFTEN_INSTALLDIR=%{buildroot}%{prefix}
# Drop exec rights. Sent upstream:
chmod 644 Swiften/Network/UnboundDomainNameResolver.*

scons V=1 swiften_dll=1 SWIFTEN_INSTALLDIR=%{buildroot}%{_prefix} SWIFTEN_LIBDIR=%{buildroot}/%{_libdir} %{buildroot}%{_prefix}
install -p -D -m 755 Swift/QtUI/swift-im \

install -p -m 644 -D Swift/resources/logo/logo-icon-32.xpm \
install -p -m 644 -D Swift/resources/logo/logo-icon-128.png \
install -p -m 644 -D Swift/resources/logo/logo-icon-16.png \
install -p -m 644 -D Swift/resources/logo/logo-icon-22.png \
install -p -m 644 -D Swift/resources/logo/logo-icon-24.png \
install -p -m 644 -D Swift/resources/logo/logo-icon-512.png \
install -p -m 644 -D Swift/resources/logo/logo-icon-64.png \

# menu
desktop-file-install \
--dir=%{buildroot}%{_datadir}/applications \

LD_LIBRARY_PATH=./Swiften scons V=1 %{?_smp_mflags} test=unit QA



%post -n libSwiften3 -p /sbin/ldconfig
%postun -n libSwiften3 -p /sbin/ldconfig

%dir %{_datadir}/icons/hicolor/512x512
%dir %{_datadir}/icons/hicolor/512x512/apps


%files -n libSwiften3

%files -n swiften-devel