File MLDonkey.spec of Package MLDonkey

#
# spec file for package MLDonkey
#
# Copyright (c) 2018 Packman Team <packman@links2linux.de>
# Copyright (c) 2012 Pascal Bleser <pascal.bleser@opensuse.org>
#
# 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.links2linux.org/
#


%define sourcename mldonkey
%define _prova	 0
Name:           MLDonkey
Version:        3.2.1
Release:        0
Summary:        Filesharing client for eDonkey 2000 and other P2P systems
License:        Other License(s), see package, GPL-2.0+
Group:          Productivity/Networking/Other
URL:            http://mldonkey.sourceforge.net/Main_Page
Source:		%{sourcename}-%{version}.tar.bz2
BuildRequires:  autoconf
BuildRequires:  camlp4
BuildRequires:  file-devel
BuildRequires:  gcc-c++
BuildRequires:  gd-devel
BuildRequires:  gtk2-devel >= 2.4.0
BuildRequires:  lablgtk2-devel
BuildRequires:  libXpm-devel
BuildRequires:  libbz2-devel
BuildRequires:  libjpeg-devel
BuildRequires:  libpng-devel
BuildRequires:  librsvg-devel
BuildRequires:  m4
BuildRequires:  ncurses-devel
BuildRequires:  ocaml
BuildRequires:  perl
BuildRequires:  wget
BuildRequires:  zlib-devel
Requires:       camlp4
Requires:       file
Requires:       gd
Requires:       ocaml
Requires:       perl
Requires:       wget
Obsoletes:      MLDonkey-init
Provides:       mldonkey = %{version}

%description
mldonkey is a peer-to-peer filesharing client originally developed for
use with the eDonkey system that also supports Limewire, OpenNap,
AudioGalaxy and other P2P systems. The actual client and the user
interface are completely separated and can thus be executed on
different machines. A web interface is available as well.

%package gui
Summary:        Gtk2 GUI for mldonkey
Group:          Productivity/Networking/Other
Requires:       %{name} = %{version}

%description gui
mldonkey gtk2 GUI for mldonkey.
This is the "new gui 2"

%if "%{_prova}" == "1"
%package init
Summary:        Init to launch mldonkey
Group:          Productivity/Networking/Other
Requires:       %{name} = %{version}
Requires(pre):  pwdutils

%description init
This package contains init to launch mldonkey as a service

%package ed2k_submit
Summary:        This tool gives you an easy way to add a ed2k-link
Group:          Productivity/Networking/Other
Requires:       perl-libwww-perl

%description ed2k_submit
This tool gives you an easy way to add a ed2k-link
(like ed2k://|file|filename.exe|21352658|72b0b287cab7d875ccc1d89ebe910b9g|)
with a single click to your mldonkey download queue.

You need to edit %{_sysconfdir}/sysconfig/mldonkey_submit
%endif

%prep
%setup -q -n %{sourcename}-%{version}

%build
caml_version="$(rpm -q --qf='%{VERSION}\n' ocaml)"

%configure \
    --disable-option-checking \
    --disable-gnutella \
    --disable-gnutella2 \
    --enable-bittorrent \
    --enable-gui=newgui2 \
    --enable-checks \
    --disable-rpath \
    --enable-ocamlver="$caml_version"

make %{?_smp_mflags}
make %{?_smp_mflags} utils

%install
%make_install

# core
install -m 755  distrib/mldonkey_command %{buildroot}%{_bindir}/mldonkey_command
install -m 755  distrib/kill_mldonkey %{buildroot}%{_bindir}/kill_mldonkey
install -m 755  mld_hash %{buildroot}%{_bindir}/mld_hash

%if "%{_prova}" == "1"
# init
install -d -m 755 %{buildroot}%{_initddir}
install -d -m 755 %{buildroot}%{_localstatedir}/lib/mldonkey
install -d -m 755 %{buildroot}%{_localstatedir}/cache/mldonkey
install -d -m 755 %{buildroot}%{_localstatedir}/lib/mldonkey/incoming
install -d -m 755 %{buildroot}%{_sysconfdir}/sysconfig
install -m 755 packages/rpm/mldonkey.init %{buildroot}%{_initddir}/mldonkey
install -m 644 packages/rpm/mldonkey.sysconfig %{buildroot}%{_sysconfdir}/sysconfig/mldonkey

# ed2k_submit
install -d -m 755 %{buildroot}%{_datadir}/services/
install -m 755 distrib/ed2k_submit/mldonkey_submit %{buildroot}%{_bindir}/mldonkey_submit
install -m 644 distrib/ed2k_submit/mldonkey %{buildroot}%{_sysconfdir}/sysconfig/mldonkey_submit
install -m 644 distrib/ed2k_submit/ed2k.protocol  %{buildroot}%{_datadir}/services/ed2k.protocol
%endif

%if "%{_prova}" == "1"
%pre init
useradd mldonkey

%postun init
userdel mldonkey
%endif

%files
%doc CHANGES.md README.md Copying.txt
%{_bindir}/mlnet
%{_bindir}/mldonkey_command
%{_bindir}/kill_mldonkey
%{_bindir}/mlbt
%{_bindir}/mldc
%{_bindir}/mldonkey
%{_bindir}/mlgnut
%{_bindir}/mlslsk
%{_bindir}/mld_hash

%files gui
%{_bindir}/*gui

%if "%{_prova}" == "1"
%files init
%doc Copying.txt
%config(noreplace) %{_sysconfdir}/sysconfig/mldonkey
%config(noreplace) %{_initddir}/mldonkey
%attr(700,mldonkey,mldonkey) %dir %{_localstatedir}/lib/mldonkey/incoming
%attr(700,mldonkey,mldonkey) %dir %{_localstatedir}/cache/mldonkey
%attr(700,mldonkey,mldonkey) %dir %{_localstatedir}/lib/mldonkey

%files ed2k_submit
%doc Copying.txt
%config(noreplace) %{_sysconfdir}/sysconfig/mldonkey_submit
%{_bindir}/mldonkey_submit
%{_datadir}/services/ed2k.protocol
%endif

%changelog
* Fri Mar 07 2025 darkhado@gmail.com
- 3.2.1 release 

* Fri Apr 20 2018 aloisio@gmx.com
- Update to version 3.1.6
  * BT: better diagnostics of wrong udp tracker reply
  * BT/DHT: update public router addresses
  * fix buffer overflows in DNS resolution
  * update default blocklist url (Closes #4)
  * fix build with OCaml 4.02 (closes #6)
  * extend command conditions (pause, resume, priority) (ref #9)
  * Fix compilation errors with gcc5 (closes #12)
    (Christopher Meng)
  * BT: relaxed parsing of bencoded numbers
  * fix build with libminiupnpc 1.9 (closes #13)
  * escape filename based on filesystem, not OS type
  * Fix compilation with OCaml 4.03.0 (Bastien Dejean)
- Dropped mldonkey-fix-ocaml_unterminated_string.patch (merged
  upstream)
- Dropped mldonkey-stdint.patch, mldonkey-caml_is_printable.patch,
  mldonkey-zip.patch and mldonkey-ClientFound.patch
  (relevant code was significantly refactored)
- New source URL
- Spec cleanup
* Wed Jan 18 2017 olaf@aepfle.de
- Fix build with ocaml 4.03
* Tue Dec  1 2015 aloisio@gmx.com
- Added mldonkey-fix-ocaml-unterminated-string.patch to
  address build problem with OCaml 4.02.
* Fri Apr 11 2014 i@margueirte.su
- update to 3.1.5
  * Revert patch #8328 to fix GTK2 gui's compilation (ygrek)
* Thu Aug 23 2012 seife+obs@b1-systems.com
- update to 3.1.3
- remove mldonkey-fix_missing_return_in_non_void_functions.patch,
  instead just remove pentium asm optimization
  * note: the code the compiler complains about is probably
    correct albeit obscure (asm code that puts the return code
    onto the stack), the easiest fix is to disable it.
* Thu Aug 16 2012 seife+obs@b1-systems.com
- fix build for 12.2 (add --disable-option-checking to configure)
* Tue May 29 2012 pascal.bleser@opensuse.org
- update to 3.1.2:
  * minor fixes
* Sat Apr 14 2012 pascal.bleser@opensuse.org
- update to 3.1.1:
  * update options description of allow_local_network
  * DC: show hashing progress in dcinfo
  * DC: fix ownership for downloads by non-admin users
  * less allocations
* Sun Jan  1 2012 pascal.bleser@opensuse.org
- update to 3.1.0:
  * BT/DHT: fix logging in tools/bt_dht_node.ml
  * http: better error reporting
  * BT: better UI for subfile selection
  * do not reload page when toggling subfiles
  * http: fix XSS in error handler
  * BT/DHT: show stats, choose random port
  * options: disable Overnet by default and remove contact.dat from web_infos
  * mail: multiple mail addresses for admin
  * diskinfo: recognize BTRFS
  * BT/DHT: fix logging
  * BT/DHT: make token more robust against broken nodes
  * HTML: mark not saved values in options
  * BT: stop asking users to submit unknown client ids
  * GTK2 GUI: fix too obtrusive splash window
  * BT: open DHT port by UPnP
  * BT: support for partial download
  * partial files are not committed, location in temp dir is shown so that
    users can easily locate downloaded subfiles
  * BT: DHT support
  - new options BT-dht_port, BT-use_trackers, BT-dht_bootstrap_nodes
  - new verbosity level "dht"
* Sun Jan  1 2012 pascal.bleser@opensuse.org
- add mldonkey-link_against_libpng.patch to fix build on >= 12.1, as upstream
  forgot to link against libpng when using libgd
* Sun Mar 13 2011 pascal.bleser@opensuse.org
- update to 3.0.7
* Fri May  7 2010 andrea@links2linux.de
- new upstream version 3.0.2
- enable newgui2
- removed unused buildrequires
* Sat Mar  7 2009 andrea@links2linux.de
- new upstream version 3.0.0
* Wed Feb 18 2009 andrea@linsk2linux.de
- update to version 2.9.7
* Sat Aug  9 2008 andrea@linsk2linux.de
- update to version 2.9.6
* Fri May 23 2008 andrea@linsk2linux.de
- update to version 2.9.5
* Thu Mar 20 2008 andrea@linsk2linux.de
- found how to compile mldonkey-tools, no more required bynaries.
- added package "init" and "ed2k_submit"
* Tue Mar 18 2008 andrea@linsk2linux.de
- update to version 2.9.4
* Sat Dec 29 2007 andrea@linsk2linux.de
- update to version 2.9.2
- mldonkey-tools added for 64 bit too
* Sat Dec  9 2006 henne@links2linux.de
- update to version 2.8.2
- add mldonkey-tools
- put the gtk2 gui into subpackage
* Thu Jun 22 2006 henne@links2linux.de
- update to version 2.7.7
* Thu Apr 13 2006 henne@links2linux.de
- update to version 2.7.5
* Sun Nov 20 2005 henne@links2linux.de
- update to version 2.7.0
- switch to static binary source packages
* Mon May 17 2004 henne@links2linux.de
- update to version 2.5.21
* Mon Feb 23 2004 henne@links2linux.de
- update to version 2.5.12 which has p2p guardian support
* Fri Feb 20 2004 henne@links2linux.de
- dont use mkdir -p in the wrapper script.
* Thu Feb 12 2004 henne@links2linux.de
- update to version 2.5.11
- add utils
- specfile cleanup
- added a wrapper script to work around the problem when
  the binarys resides in a directory where ordinary users have no
  write permissions and the binary wants to write config files
  there.
* Sat Aug 16 2003 henne@links2linux.de
- add desktop file
* Tue Jul  1 2003 henne@links2linux.de
- Update to 2.05-3
* Sat Apr 19 2003 henne@links2linux.de
- update to version 2.04rc1
* Mon Feb 10 2003 henne@links2linux.de
- Fix configure.in to properly report a non existing ocamlopt.
* Fri Jan 31 2003 henne@links2linux.de
- update to 2.02
* Wed Oct 16 2002 henne@links2linux.de
- update -> 2.00 (final release)
* Tue Sep 17 2002 henne@links2linux.de
- initial package
openSUSE Build Service is sponsored by