LogoopenSUSE Build Service > Projects
Sign Up | Log In

View File eiskaltdcpp.spec of Package eiskaltdc (Project filesharing)

#
# This file and all modifications and additions to the pristine
# package are under the same license as the package itself.
#

%bcond_without qt
%bcond_without gtk
%bcond_without cli
%bcond_without daemon

Name:           eiskaltdcpp
Version:        2.2.8
Release:        0
License:        GPL-3.0
Summary:        Cross-platform program that uses the Direct Connect and ADC protocol
Url:            http://code.google.com/p/eiskaltdc
Group:          Productivity/Networking/File-Sharing
Source0:        http://eiskaltdc.googlecode.com/files/%{name}-%{version}.tar.xz
# PATCH-FIX-UPSTREAM eiskaltdcpp-fix-php5-issue.patch -- Fix install issue caused by installer can't resolve /usr/bin/php5 dependence
Patch0:         eiskaltdcpp-fix-php5-issue.patch
BuildRoot:      %{_tmppath}/%{name}-%{version}-build

#core requirements
BuildRequires:  boost-devel
BuildRequires:  cmake
BuildRequires:  fdupes
BuildRequires:  libattr-devel
BuildRequires:  libidn-devel
%if 0%{?suse_version} > 1210
BuildRequires:  lua51-devel
%else
BuildRequires:  lua-devel
%endif
BuildRequires:  openssl-devel
BuildRequires:  pcre-devel
BuildRequires:  pkg-config
BuildRequires:  pkgconfig(bzip2)
BuildRequires:  zlib-devel
%if 0%{?suse_version} > 1210
BuildRequires:  libminiupnpc-devel
%endif
%if 0%{?suse_version}
BuildRequires:  update-desktop-files
%endif
%if 0%{?suse_version} < 1220
BuildRequires:  xz
%endif

#qt requirements
%if %{with qt}
BuildRequires:  aspell
BuildRequires:  aspell-devel
BuildRequires:  libqt4-devel
%endif

#gtk requiresments
%if %{with gtk}
BuildRequires:  libgnome-devel
BuildRequires:  pkgconfig(gtk+-2.0) >= 2.24
BuildRequires:  pkgconfig(libnotify)
%endif

#cli requirements
%if %{with cli}
%endif

#daemon requirements
%if %{with daemon}
BuildRequires:  libxmlrpc-c-devel
%endif

%description
EiskaltDC++ is a cross-platform program that uses the Direct Connect and ADC
protocol. It is compatible with other DC clients, such as the original DC from
Neomodus, DC++ and derivatives. EiskaltDC++ also interoperates with all common
DC hub software. The minimum number of our patches to original DC++ kernel
makes it easy to upgrade to new versions and ensures compatibility with other
clients.

%if %{with qt}
%package qt
Summary:        Qt frontend for %{name}
Group:          Productivity/Networking/File-Sharing
Requires:       %{name} = %{version}

%description qt
EiskaltDC++ is a cross-platform program that uses the Direct Connect and ADC
protocol. It is compatible with other DC clients, such as the original DC from
Neomodus, DC++ and derivatives. EiskaltDC++ also interoperates with all common
DC hub software. The minimum number of our patches to original DC++ kernel
makes it easy to upgrade to new versions and ensures compatibility with other
clients. This is the Qt frontend.
%endif

%if %{with gtk}
%package gtk
Summary:        GTK frontend for %{name}
Group:          Productivity/Networking/File-Sharing
Requires:       %{name} = %{version}

%description gtk
EiskaltDC++ is a cross-platform program that uses the Direct Connect and ADC
protocol. It is compatible with other DC clients, such as the original DC from
Neomodus, DC++ and derivatives. EiskaltDC++ also interoperates with all common
DC hub software. The minimum number of our patches to original DC++ kernel
makes it easy to upgrade to new versions and ensures compatibility with other
clients. This is the GTK frontend.
%endif

%if %{with cli}
%package cli
Summary:        CLI frontend for %{name}
Group:          Productivity/Networking/File-Sharing
Requires:       %{name} = %{version}
Requires:       perl(JSON::RPC)
Requires:       perl(RPC::XML)
Requires:       perl(Term::ShellUI)
Suggests:       %{name}-daemon = %{version}

%description cli
EiskaltDC++ is a cross-platform program that uses the Direct Connect and ADC
protocol. It is compatible with other DC clients, such as the original DC from
Neomodus, DC++ and derivatives. EiskaltDC++ also interoperates with all common
DC hub software. The minimum number of our patches to original DC++ kernel
makes it easy to upgrade to new versions and ensures compatibility with other
clients. This is the CLI frontend to connect to the daemon.
%endif

%if %{with daemon}
%package daemon
Summary:        Daemon for %{name}
Group:          Productivity/Networking/File-Sharing
Requires:       %{name} = %{version}
Suggests:       %{name}-cli = %{version}

%description daemon
EiskaltDC++ is a cross-platform program that uses the Direct Connect and ADC
protocol. It is compatible with other DC clients, such as the original DC from
Neomodus, DC++ and derivatives. EiskaltDC++ also interoperates with all common
DC hub software. The minimum number of our patches to original DC++ kernel
makes it easy to upgrade to new versions and ensures compatibility with other
clients. This is the daemon.
%endif

%prep
%setup -q
%patch0

%build
export CFLAGS="%{optflags}"
export CXXFLAGS="%{optflags}"
mkdir build
pushd build
cmake -DCMAKE_BUILD_TYPE=RelWithDebInfo \
	-DCMAKE_INSTALL_PREFIX=%{_prefix} \
	-DLIBDIR=%{_lib} \
	-DLOCAL_BOOST=OFF \
	-DLUA_SCRIPT=ON \
	-DPERL_REGEX=ON \
	-DUSE_IDNA=ON \
	-DWITH_DHT=ON \
	-DLINK=SHARED \
%if %{with qt}
	-DUSE_QT=ON \
	-DUSE_ASPELL=ON \
	-DFREE_SPACE_BAR_C=ON \
	-DDBUS_NOTIFY=ON \
	-DUSE_JS=ON \
%if 0%{?suse_version} > 1140
	-DUSE_QT_QML=ON \
%else
	-DUSE_QT_QML=OFF \
%endif
	-DUSE_QT_SQLITE=ON \
%else
	-DUSE_QT=OFF \
%endif
%if %{with gtk}
	-DUSE_GTK=ON \
	-DUSE_LIBGNOME2=ON \
	-DUSE_LIBNOTIFY=ON \
%endif
%if %{with daemon}
	-DNO_UI_DAEMON=ON \
	-DXMLRPC_DAEMON=ON \
	-DJSONRPC_DAEMON=ON \
%endif
%if %{with cli}
	-DUSE_CLI_XMLRPC=ON \
	-DUSE_CLI_JSONRPC=ON \
%endif
	-DWITH_EMOTICONS=ON \
	-DWITH_EXAMPLES=ON \
	-DWITH_LUASCRIPTS=ON \
%if 0%{?suse_version} > 1210
	-DUSE_MINIUPNP=ON \
%else
	-DUSE_MINIUPNP=OFF \
%endif
	-DLOCAL_MINIUPNP=OFF \
	-DWITH_SOUNDS=ON \
	-Dlinguas:STRING="*" \
	-DFORCE_XDG=ON \
	-DCREATE_MO=ON ..
make %{?_smp_mflags} VERBOSE=1
popd

%install
pushd build
%{?make_install} %{!?make_install:%makeinstall}
popd

%fdupes -s %{buildroot}

%if %{with gtk}
%find_lang %{name}-gtk
%suse_update_desktop_file %{name}-gtk
%endif

%if %{with qt}
%suse_update_desktop_file %{name}-qt
find %{buildroot} -name "*.qm" | sed 's:'%{buildroot}'::
s:.*/\([a-zA-Z]\{2\}\).qm:%lang(\1) \0:' > %{name}-qt.lang
%endif

%find_lang lib%{name} %{name}.lang

%post -p /sbin/ldconfig

%postun -p /sbin/ldconfig

%files -f %{name}.lang
%defattr(-,root,root,-)
%doc AUTHORS COPYING ChangeLog.txt ChangeLog_ru.txt ChangeLog_uk.txt LICENSE README TODO
%dir %{_datadir}/eiskaltdcpp
%{_libdir}/libeiskaltdcpp.so.2.2
%{_datadir}/eiskaltdcpp/sounds
%{_datadir}/eiskaltdcpp/examples
%{_datadir}/eiskaltdcpp/emoticons
%{_datadir}/eiskaltdcpp/update_geoip
%{_datadir}/eiskaltdcpp/luascripts
%{_datadir}/pixmaps/eiskaltdcpp.png
%{_datadir}/icons/hicolor/*/apps/eiskaltdcpp.png

%if %{with qt}
%files qt -f %{name}-qt.lang
%defattr(-,root,root,-)
%dir %{_datadir}/eiskaltdcpp/qt
%dir %{_datadir}/eiskaltdcpp/qt/ts
%{_datadir}/eiskaltdcpp/qt/icons
%{_datadir}/eiskaltdcpp/qt/qtscripts
%{_datadir}/eiskaltdcpp/qt/resources
%{_mandir}/man1/eiskaltdcpp-qt.1.gz
%{_datadir}/applications/eiskaltdcpp-qt.desktop
%{_bindir}/eiskaltdcpp-qt
%endif

%if %{with gtk}
%files gtk -f %{name}-gtk.lang
%defattr(-,root,root,-)
%{_datadir}/eiskaltdcpp/gtk
%{_mandir}/man1/eiskaltdcpp-gtk.1.gz
%{_datadir}/applications/eiskaltdcpp-gtk.desktop
%{_bindir}/eiskaltdcpp-gtk
%endif

%if %{with cli}
%files cli
%defattr(-,root,root,-)
%{_bindir}/eiskaltdcpp-cli-jsonrpc
%{_bindir}/eiskaltdcpp-cli-xmlrpc
%dir %{_datadir}/eiskaltdcpp/cli
%{_datadir}/eiskaltdcpp/cli/cli-jsonrpc-config.pl
%{_datadir}/eiskaltdcpp/cli/cli-xmlrpc-config.pl
%{_mandir}/man1/eiskaltdcpp-cli-jsonrpc.1.gz
%{_mandir}/man1/eiskaltdcpp-cli-xmlrpc.1.gz
%endif

%if %{with daemon}
%files daemon
%defattr(-,root,root,-)
%{_bindir}/eiskaltdcpp-daemon
%{_mandir}/man1/eiskaltdcpp-daemon.1.gz
%endif

%changelog