File valknut.spec of Package valknut
# norootforbuild
%define qtdir /usr/lib/qt3
Name: valknut
Version: 0.3.23
%define dclib_version 0.3.22
Release: 17.1
Summary: Direct Connect P2P File Sharing Client
Source: http://prdownloads.sourceforge.net/wxdcgui/valknut-%{version}.tar.bz2
Patch1: valknut-fix_desktop_file.patch
Patch2: theme-detection-fix.patch
Patch3: magnet-mod.diff
Patch4: makefiles-mod.diff
Patch5: valknut-define.patch
URL: http://wxdcgui.sourceforge.net/
Group: Productivity/Networking/Other
License: GPL-2.0
BuildRoot: %{_tmppath}/build-%{name}-%{version}
BuildRequires: qt3-devel qt3-devel-tools openssl-devel libxml2-devel
BuildRequires: bzip2 libstdc++-devel gcc gcc-c++ make pkgconfig
BuildRequires: libdc-devel
BuildRequires: autoconf automake libtool update-desktop-files
Obsoletes: dcgui-qt
%description
Valknut is a program that uses the Direct Connect protocol.
It is compatible with other DC clients, such as the original DC from Neomodus,
DC++ and derivatives. Valknut also interoperates with all common DC hub
software.
Valknut is written by Mathias Kuester <mathen at users dot berlios dot de >
and is licensed under the GNU GPL. It is written in C++ and uses the
cross-platform Qt (TM) library for its GUI. Valknut compiles and runs on
Linux, FreeBSD, MacOSX and Windows.
Originally, Valknut was called DCGUI, which unfortunately was very similar to
the name of another Linux DC client. It was then renamed to dcgui-qt to avoid
confusion. However, trademark problems relating to the use of 'Qt' in the name
forced another name change, to the rather unique Valknut. Most occurences of
the old names have been replaced, but in some places, such as where it would
cause too much disruption, the name hasn't been changed.
%prep
%setup -q
%patch -P 1
%patch -P 2 -p2
%patch -P 3 -p1
#%patch4 -p1
%patch -P 5 -p1
sed -i 1i\ '#include <unistd.h>' valknut/dcchat.cpp
sed -i 1i\ '#include <unistd.h>' valknut/dcoptions.cpp
sed -i 1i\ '#include <unistd.h>' valknut/main.cpp
%build
export PATH="%{qtdir}/bin:$PATH"
export QTDIR="%{qtdir}"
#sed -i 's|dcuserslist.cpp|dcuserslist.cpp dcwaitmagnet.cpp|g' Makefile.am
#sed -i 's|dcuserslist.cpp|dcuserslist.cpp dcwaitmagnet.cpp|g' Makefile.in
#sed -i 's|Info.plist|Info.plist dcwaitmagnet.cpp dcwaitmagnet.h|g' Makefile.in
#sed -i 's|dcuserslist.$(OBJEXT)|dcuserslist.$(OBJEXT) dcwaitmagnet.$(OBJEXT)|g' valknut/Makefile.in
#sed -i 's|dcchat.moc.o|dcchat.moc.o dcwaitmagnet.moc.o|g' valknut/Makefile.in
#sed -i 's|dcuserslist.cpp|dcuserslist.cpp dcwaitmagnet.cpp|g' valknut/Makefile.in
export CFLAGS="$CFLAGS -no-pie"
export CXXFLAGS="$CXXFLAGS -no-pie"
%configure \
%if "%{_lib}"=="lib64"
--enable-libsuffix=64 \
%endif
--with-qt-dir="%{qtdir}"
%__make %{?jobs:-j%{jobs}}
%install
export PATH="%{qtdir}/bin:$PATH"
export QTDIR="%{qtdir}"
%makeinstall
%suse_update_desktop_file -r "%{name}" Network P2P
%files
%defattr(-,root,root)
%doc AUTHORS ChangeLog COPYING COPYING.OpenSSL NEWS README TODO
%{_bindir}/valknut
%{_datadir}/valknut
%{_datadir}/applications/%{name}.desktop
#%{_datadir}/icons/*/*/apps/valknut.*
%{_datadir}/icons/hicolor
%{_datadir}/pixmaps/valknut.png
%doc %{_mandir}/man1/valknut.1*
%changelog