summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'net-p2p')
-rw-r--r--net-p2p/amule/Manifest1
-rw-r--r--net-p2p/amule/amule-2.3.1.ebuild107
-rw-r--r--net-p2p/amule/files/amule-2.2.6-fallocate.diff23
-rw-r--r--net-p2p/amule/files/amule-2.3.1-gcc47.patch21
-rw-r--r--net-p2p/amule/files/amuled.confd13
-rw-r--r--net-p2p/amule/files/amuled.initd50
-rw-r--r--net-p2p/amule/files/amuleweb.confd28
-rw-r--r--net-p2p/amule/files/amuleweb.initd49
-rw-r--r--net-p2p/amule/metadata.xml13
-rw-r--r--net-p2p/bitcoin-cli/Manifest10
-rw-r--r--net-p2p/bitcoin-cli/bitcoin-cli-0.10.0-r1.ebuild25
-rw-r--r--net-p2p/bitcoin-cli/bitcoin-cli-0.10.1.ebuild25
-rw-r--r--net-p2p/bitcoin-cli/bitcoin-cli-0.10.2.ebuild38
-rw-r--r--net-p2p/bitcoin-cli/bitcoin-cli-0.11.0.ebuild33
-rw-r--r--net-p2p/bitcoin-cli/bitcoin-cli-0.9.3.ebuild55
-rw-r--r--net-p2p/bitcoin-cli/bitcoin-cli-9999.ebuild25
-rw-r--r--net-p2p/bitcoin-cli/metadata.xml16
-rw-r--r--net-p2p/bitcoin-qt/Manifest9
-rw-r--r--net-p2p/bitcoin-qt/bitcoin-qt-0.10.2-r1.ebuild106
-rw-r--r--net-p2p/bitcoin-qt/bitcoin-qt-0.10.2.ebuild112
-rw-r--r--net-p2p/bitcoin-qt/bitcoin-qt-0.11.0.ebuild102
-rw-r--r--net-p2p/bitcoin-qt/bitcoin-qt-9999.ebuild99
-rw-r--r--net-p2p/bitcoin-qt/files/0.8-openssl-101k.patch31
-rw-r--r--net-p2p/bitcoin-qt/files/0.8.2-sys_leveldb.patch183
-rw-r--r--net-p2p/bitcoin-qt/files/0.9-openssl-101k.patch31
-rw-r--r--net-p2p/bitcoin-qt/files/0.9.0-sys_leveldb.patch34
-rw-r--r--net-p2p/bitcoin-qt/files/0.9.x-ljr_noblacklist.patch12
-rw-r--r--net-p2p/bitcoin-qt/files/9999-sys_libsecp256k1.patch80
-rw-r--r--net-p2p/bitcoin-qt/files/9999-syslibs.patch243
-rw-r--r--net-p2p/bitcoin-qt/metadata.xml27
-rw-r--r--net-p2p/bitcoind/Manifest9
-rw-r--r--net-p2p/bitcoind/bitcoind-0.10.2-r1.ebuild79
-rw-r--r--net-p2p/bitcoind/bitcoind-0.10.2.ebuild77
-rw-r--r--net-p2p/bitcoind/bitcoind-0.11.0.ebuild75
-rw-r--r--net-p2p/bitcoind/bitcoind-9999.ebuild72
-rw-r--r--net-p2p/bitcoind/files/0.10.0-openrc-compat.patch24
-rw-r--r--net-p2p/bitcoind/files/0.8-openssl-101k.patch31
-rw-r--r--net-p2p/bitcoind/files/0.8.2-sys_leveldb.patch185
-rw-r--r--net-p2p/bitcoind/files/0.9-openssl-101k.patch31
-rw-r--r--net-p2p/bitcoind/files/0.9.0-sys_leveldb.patch34
-rw-r--r--net-p2p/bitcoind/files/0.9.x-ljr_noblacklist.patch12
-rw-r--r--net-p2p/bitcoind/files/9999-syslibs.patch243
-rw-r--r--net-p2p/bitcoind/files/bitcoin.conf8
-rw-r--r--net-p2p/bitcoind/files/bitcoin.confd10
-rw-r--r--net-p2p/bitcoind/files/bitcoin.initd-r129
-rw-r--r--net-p2p/bitcoind/files/bitcoind.logrotate7
-rw-r--r--net-p2p/bitcoind/files/bitcoind.logrotate-r18
-rw-r--r--net-p2p/bitcoind/files/bitcoind.service30
-rw-r--r--net-p2p/bitcoind/metadata.xml26
-rw-r--r--net-p2p/bitflu/Manifest3
-rw-r--r--net-p2p/bitflu/bitflu-1.50.ebuild75
-rw-r--r--net-p2p/bitflu/bitflu-1.51.ebuild75
-rw-r--r--net-p2p/bitflu/bitflu-1.52.ebuild75
-rw-r--r--net-p2p/bitflu/files/bitflu.config45
-rw-r--r--net-p2p/bitflu/files/bitflu.initd47
-rw-r--r--net-p2p/bitflu/metadata.xml13
-rw-r--r--net-p2p/bittornado/Manifest1
-rw-r--r--net-p2p/bittornado/bittornado-0.3.18-r2.ebuild55
-rw-r--r--net-p2p/bittornado/bittornado-0.3.18-r3.ebuild56
-rw-r--r--net-p2p/bittornado/files/bittornado-0.3.18-wxversion.patch90
-rw-r--r--net-p2p/bittornado/files/bttrack.conf18
-rw-r--r--net-p2p/bittornado/files/bttrack.rc23
-rw-r--r--net-p2p/bittornado/metadata.xml5
-rw-r--r--net-p2p/bittorrent/Manifest1
-rw-r--r--net-p2p/bittorrent/bittorrent-4.4.0-r2.ebuild87
-rw-r--r--net-p2p/bittorrent/bittorrent-4.4.0-r3.ebuild86
-rw-r--r--net-p2p/bittorrent/files/bittorrent-4.4.0-bencode-float.patch75
-rw-r--r--net-p2p/bittorrent/files/bittorrent-4.4.0-fastresume.patch23
-rw-r--r--net-p2p/bittorrent/files/bittorrent-4.4.0-hashlib.patch142
-rw-r--r--net-p2p/bittorrent/files/bittorrent-4.4.0-keyerror.patch15
-rw-r--r--net-p2p/bittorrent/files/bittorrent-4.4.0-no-version-check.patch14
-rw-r--r--net-p2p/bittorrent/files/bittorrent-4.4.0-pkidir.patch13
-rw-r--r--net-p2p/bittorrent/files/bittorrent-4.4.0-pygtk-thread-warnings.patch81
-rw-r--r--net-p2p/bittorrent/files/bittorrent-4.4.0-python26-syntax.patch45
-rw-r--r--net-p2p/bittorrent/files/bittorrent-tracker.confd15
-rw-r--r--net-p2p/bittorrent/files/bittorrent-tracker.initd23
-rw-r--r--net-p2p/bittorrent/files/bittorrent.desktop10
-rw-r--r--net-p2p/bittorrent/metadata.xml9
-rw-r--r--net-p2p/btpd/Manifest1
-rw-r--r--net-p2p/btpd/btpd-0.15.ebuild30
-rw-r--r--net-p2p/btpd/files/confd_btpd5
-rw-r--r--net-p2p/btpd/files/initd_btpd79
-rw-r--r--net-p2p/btpd/metadata.xml10
-rw-r--r--net-p2p/classified-ads/Manifest4
-rw-r--r--net-p2p/classified-ads/classified-ads-0.07.ebuild86
-rw-r--r--net-p2p/classified-ads/classified-ads-0.07_p20150728.ebuild82
-rw-r--r--net-p2p/classified-ads/metadata.xml38
-rw-r--r--net-p2p/createtorrent/Manifest1
-rw-r--r--net-p2p/createtorrent/createtorrent-1.1.4.ebuild29
-rw-r--r--net-p2p/createtorrent/metadata.xml5
-rw-r--r--net-p2p/ctcs/Manifest1
-rw-r--r--net-p2p/ctcs/ctcs-1.4.1.ebuild20
-rw-r--r--net-p2p/ctcs/metadata.xml5
-rw-r--r--net-p2p/ctorrent/Manifest1
-rw-r--r--net-p2p/ctorrent/ctorrent-3.3.2-r2.ebuild32
-rw-r--r--net-p2p/ctorrent/files/ctorrent-3.3.2-negative-ints.patch17
-rw-r--r--net-p2p/ctorrent/files/ctorrent-CVE-2009-1759.patch364
-rw-r--r--net-p2p/ctorrent/metadata.xml8
-rw-r--r--net-p2p/datacoin-hp/datacoin-hp-9999.ebuild123
-rw-r--r--net-p2p/datacoin-hp/files/datacoin-hp-sys_leveldb.patch179
-rw-r--r--net-p2p/datacoin-hp/files/datacoin.conf5
-rw-r--r--net-p2p/datacoin-hp/files/datacoin.confd9
-rw-r--r--net-p2p/datacoin-hp/files/datacoin.initd29
-rw-r--r--net-p2p/datacoin-hp/files/datacoin.logrotate7
-rw-r--r--net-p2p/datacoin-hp/files/datacoin.service30
-rw-r--r--net-p2p/datacoin-hp/metadata.xml18
-rw-r--r--net-p2p/dbhub/Manifest1
-rw-r--r--net-p2p/dbhub/dbhub-0.451-r1.ebuild39
-rw-r--r--net-p2p/dbhub/files/dbhub-fix-buffer-overflows.patch53
-rw-r--r--net-p2p/dbhub/files/dbhub-gentoo.patch25
-rw-r--r--net-p2p/dbhub/files/dbhub-no-dynaloader.patch12
-rw-r--r--net-p2p/dbhub/metadata.xml11
-rw-r--r--net-p2p/dclib/Manifest1
-rw-r--r--net-p2p/dclib/dclib-0.3.23.ebuild39
-rw-r--r--net-p2p/dclib/files/dclib-0.3.23-asneeded.patch16
-rw-r--r--net-p2p/dclib/files/dclib-0.3.23-openssl-1.patch52
-rw-r--r--net-p2p/dclib/metadata.xml8
-rw-r--r--net-p2p/deluge/Manifest2
-rw-r--r--net-p2p/deluge/deluge-1.3.11.ebuild84
-rw-r--r--net-p2p/deluge/deluge-1.3.6.ebuild74
-rw-r--r--net-p2p/deluge/deluge-9999.ebuild77
-rw-r--r--net-p2p/deluge/files/deluge-1.3.5-disable_libtorrent_internal_copy.patch42
-rw-r--r--net-p2p/deluge/files/deluge-1.3.5-rb_libtorrent-disable-python-bindings60
-rw-r--r--net-p2p/deluge/files/deluge-web.service11
-rw-r--r--net-p2p/deluge/files/deluged.conf8
-rw-r--r--net-p2p/deluge/files/deluged.init71
-rw-r--r--net-p2p/deluge/files/deluged.service13
-rw-r--r--net-p2p/deluge/metadata.xml11
-rw-r--r--net-p2p/dogecoin-qt/Manifest1
-rw-r--r--net-p2p/dogecoin-qt/dogecoin-qt-1.6.ebuild145
-rw-r--r--net-p2p/dogecoin-qt/metadata.xml18
-rw-r--r--net-p2p/ed2k_hash/Manifest1
-rw-r--r--net-p2p/ed2k_hash/ed2k_hash-0.4.0-r1.ebuild36
-rw-r--r--net-p2p/ed2k_hash/files/ed2k_64bit.patch12
-rw-r--r--net-p2p/ed2k_hash/metadata.xml8
-rw-r--r--net-p2p/eiskaltdcpp/Manifest1
-rw-r--r--net-p2p/eiskaltdcpp/eiskaltdcpp-2.2.9.ebuild147
-rw-r--r--net-p2p/eiskaltdcpp/eiskaltdcpp-9999.ebuild147
-rw-r--r--net-p2p/eiskaltdcpp/metadata.xml24
-rw-r--r--net-p2p/fms/Manifest2
-rw-r--r--net-p2p/fms/files/fms38
-rw-r--r--net-p2p/fms/files/fms-use-system-libs2.patch22
-rw-r--r--net-p2p/fms/fms-0.3.73.ebuild71
-rw-r--r--net-p2p/fms/fms-0.3.75.ebuild71
-rw-r--r--net-p2p/fms/metadata.xml13
-rw-r--r--net-p2p/freenet/Manifest5
-rw-r--r--net-p2p/freenet/files/0.7.5_p1302-ext.patch22
-rw-r--r--net-p2p/freenet/files/0.7.5_p1321-ext.patch22
-rw-r--r--net-p2p/freenet/files/freenet18
-rw-r--r--net-p2p/freenet/files/freenet-0.7.5_p1384-libraryloader-just-try-loading.patch17
-rw-r--r--net-p2p/freenet/files/freenet-0.7.5_p1384-nativebiginteger-no-nativedoublevalue.patch28
-rw-r--r--net-p2p/freenet/files/freenet-0.7.5_p1389-wrapper.conf49
-rw-r--r--net-p2p/freenet/files/freenet-0.7.5_p1422-wrapper.conf27
-rw-r--r--net-p2p/freenet/files/freenet.old18
-rw-r--r--net-p2p/freenet/files/freenet.service13
-rw-r--r--net-p2p/freenet/files/libraryloader-revert-using-of-absolute-path.patch19
-rw-r--r--net-p2p/freenet/files/run.sh-20090501585
-rw-r--r--net-p2p/freenet/freenet-0.7.5_p1466.ebuild144
-rw-r--r--net-p2p/freenet/freenet-0.7.5_p1467.ebuild144
-rw-r--r--net-p2p/freenet/metadata.xml11
-rw-r--r--net-p2p/gift-ares/Manifest1
-rw-r--r--net-p2p/gift-ares/gift-ares-0.3.0-r1.ebuild39
-rw-r--r--net-p2p/gift-ares/metadata.xml5
-rw-r--r--net-p2p/gift-fasttrack/Manifest1
-rw-r--r--net-p2p/gift-fasttrack/gift-fasttrack-0.8.9-r1.ebuild41
-rw-r--r--net-p2p/gift-fasttrack/metadata.xml5
-rw-r--r--net-p2p/gift-gnutella/Manifest1
-rw-r--r--net-p2p/gift-gnutella/files/cacheupdate.sh73
-rw-r--r--net-p2p/gift-gnutella/gift-gnutella-0.0.11.ebuild47
-rw-r--r--net-p2p/gift-gnutella/metadata.xml8
-rw-r--r--net-p2p/gift-openft/Manifest1
-rw-r--r--net-p2p/gift-openft/gift-openft-0.2.1.6.ebuild48
-rw-r--r--net-p2p/gift-openft/metadata.xml8
-rw-r--r--net-p2p/gift/Manifest1
-rw-r--r--net-p2p/gift/files/gift.confd22
-rw-r--r--net-p2p/gift/files/gift.initd35
-rw-r--r--net-p2p/gift/gift-0.11.8.1-r1.ebuild64
-rw-r--r--net-p2p/gift/metadata.xml14
-rw-r--r--net-p2p/giftcurs/Manifest1
-rw-r--r--net-p2p/giftcurs/giftcurs-0.6.2.ebuild37
-rw-r--r--net-p2p/giftcurs/metadata.xml5
-rw-r--r--net-p2p/gnut/Manifest2
-rw-r--r--net-p2p/gnut/gnut-0.4.28-r1.ebuild28
-rw-r--r--net-p2p/gnut/metadata.xml5
-rw-r--r--net-p2p/gtk-gnutella/Manifest2
-rw-r--r--net-p2p/gtk-gnutella/gtk-gnutella-1.1.1.ebuild86
-rw-r--r--net-p2p/gtk-gnutella/gtk-gnutella-1.1.3.ebuild86
-rw-r--r--net-p2p/gtk-gnutella/metadata.xml11
-rw-r--r--net-p2p/gtorrentviewer/Manifest1
-rw-r--r--net-p2p/gtorrentviewer/files/gtorrentviewer-0.2b-curl-headers.patch12
-rw-r--r--net-p2p/gtorrentviewer/files/gtorrentviewer-0.2b-desktop.patch16
-rw-r--r--net-p2p/gtorrentviewer/files/gtorrentviewer-0.2b-underlinking.patch14
-rw-r--r--net-p2p/gtorrentviewer/gtorrentviewer-0.2b.ebuild46
-rw-r--r--net-p2p/gtorrentviewer/metadata.xml8
-rw-r--r--net-p2p/hx/Manifest1
-rw-r--r--net-p2p/hx/hx-0.4.11.ebuild48
-rw-r--r--net-p2p/hx/metadata.xml10
-rw-r--r--net-p2p/i2p/Manifest1
-rw-r--r--net-p2p/i2p/files/i2p-0.9.18_fix-paths.patch137
-rw-r--r--net-p2p/i2p/files/i2p.initd36
-rw-r--r--net-p2p/i2p/files/i2p.service13
-rw-r--r--net-p2p/i2p/i2p-0.9.18.ebuild97
-rw-r--r--net-p2p/i2p/metadata.xml15
-rw-r--r--net-p2p/imule/Manifest2
-rw-r--r--net-p2p/imule/imule-2.3.2.3-r1.ebuild65
-rw-r--r--net-p2p/imule/imule-2.3.2.3.ebuild51
-rw-r--r--net-p2p/imule/metadata.xml12
-rw-r--r--net-p2p/kmldonkey/Manifest1
-rw-r--r--net-p2p/kmldonkey/kmldonkey-2.0.7.ebuild34
-rw-r--r--net-p2p/kmldonkey/metadata.xml5
-rw-r--r--net-p2p/ktorrent/Manifest1
-rw-r--r--net-p2p/ktorrent/files/ktorrent-4.3.0-mountedstoragecheck.patch25
-rw-r--r--net-p2p/ktorrent/files/ktorrent-4.3.1-ipfilter.patch72
-rw-r--r--net-p2p/ktorrent/files/ktorrent-4.3.1-underlinking.patch21
-rw-r--r--net-p2p/ktorrent/ktorrent-4.3.1-r1.ebuild103
-rw-r--r--net-p2p/ktorrent/metadata.xml23
-rw-r--r--net-p2p/linuxdcpp/Manifest1
-rw-r--r--net-p2p/linuxdcpp/linuxdcpp-1.0.3-r1.ebuild54
-rw-r--r--net-p2p/linuxdcpp/metadata.xml8
-rw-r--r--net-p2p/litecoin-qt/Manifest2
-rw-r--r--net-p2p/litecoin-qt/files/0.9.0-sys_leveldb.patch34
-rw-r--r--net-p2p/litecoin-qt/files/litecoin-sys_leveldb.patch193
-rw-r--r--net-p2p/litecoin-qt/litecoin-qt-0.10.2.2.ebuild143
-rw-r--r--net-p2p/litecoin-qt/litecoin-qt-0.8.7.4.ebuild143
-rw-r--r--net-p2p/litecoin-qt/metadata.xml14
-rw-r--r--net-p2p/litecoind/Manifest2
-rw-r--r--net-p2p/litecoind/files/0.9.0-sys_leveldb.patch34
-rw-r--r--net-p2p/litecoind/files/litecoin-sys_leveldb.patch193
-rw-r--r--net-p2p/litecoind/files/litecoin.conf8
-rw-r--r--net-p2p/litecoind/files/litecoin.confd10
-rw-r--r--net-p2p/litecoind/files/litecoin.initd104
-rw-r--r--net-p2p/litecoind/files/litecoin.initd-r129
-rw-r--r--net-p2p/litecoind/files/litecoin.service30
-rw-r--r--net-p2p/litecoind/files/litecoind.logrotate7
-rw-r--r--net-p2p/litecoind/litecoind-0.10.2.2-r1.ebuild98
-rw-r--r--net-p2p/litecoind/litecoind-0.8.7.4.ebuild123
-rw-r--r--net-p2p/litecoind/metadata.xml15
-rw-r--r--net-p2p/metadata.xml34
-rw-r--r--net-p2p/microdc/Manifest1
-rw-r--r--net-p2p/microdc/metadata.xml5
-rw-r--r--net-p2p/microdc/microdc-0.11.0.ebuild26
-rw-r--r--net-p2p/microdc2/Manifest2
-rw-r--r--net-p2p/microdc2/metadata.xml5
-rw-r--r--net-p2p/microdc2/microdc2-0.15.6-r2.ebuild49
-rw-r--r--net-p2p/mktorrent-borg/Manifest1
-rw-r--r--net-p2p/mktorrent-borg/metadata.xml5
-rw-r--r--net-p2p/mktorrent-borg/mktorrent-borg-0.9.9.ebuild29
-rw-r--r--net-p2p/mktorrent/Manifest1
-rw-r--r--net-p2p/mktorrent/metadata.xml8
-rw-r--r--net-p2p/mktorrent/mktorrent-1.0-r1.ebuild34
-rw-r--r--net-p2p/mldonkey/Manifest2
-rw-r--r--net-p2p/mldonkey/files/2.9.5-execstacks.patch44
-rw-r--r--net-p2p/mldonkey/files/mldonkey.confd-2.839
-rw-r--r--net-p2p/mldonkey/files/mldonkey.initd121
-rw-r--r--net-p2p/mldonkey/files/ocaml4.patch12
-rw-r--r--net-p2p/mldonkey/metadata.xml16
-rw-r--r--net-p2p/mldonkey/mldonkey-3.1.3.ebuild170
-rw-r--r--net-p2p/mldonkey/mldonkey-3.1.5.ebuild171
-rw-r--r--net-p2p/multibit/Manifest1
-rw-r--r--net-p2p/multibit/files/auto-install.xml12
-rwxr-xr-xnet-p2p/multibit/files/multibit3
-rw-r--r--net-p2p/multibit/metadata.xml8
-rw-r--r--net-p2p/multibit/multibit-0.5.18.ebuild36
-rw-r--r--net-p2p/myster/Manifest1
-rw-r--r--net-p2p/myster/metadata.xml8
-rw-r--r--net-p2p/myster/myster-8.0-r1.ebuild27
-rw-r--r--net-p2p/nap/Manifest1
-rw-r--r--net-p2p/nap/metadata.xml5
-rw-r--r--net-p2p/nap/nap-1.5.4-r1.ebuild34
-rw-r--r--net-p2p/ncdc/Manifest3
-rw-r--r--net-p2p/ncdc/metadata.xml16
-rw-r--r--net-p2p/ncdc/ncdc-1.18.1.ebuild30
-rw-r--r--net-p2p/ncdc/ncdc-1.19.1.ebuild40
-rw-r--r--net-p2p/ncdc/ncdc-1.19.ebuild35
-rw-r--r--net-p2p/ncdc/ncdc-9999.ebuild41
-rw-r--r--net-p2p/nicotine+/Manifest1
-rw-r--r--net-p2p/nicotine+/metadata.xml12
-rw-r--r--net-p2p/nicotine+/nicotine+-1.2.16-r1.ebuild51
-rw-r--r--net-p2p/nicotine+/nicotine+-1.2.16.ebuild51
-rw-r--r--net-p2p/opendchub/Manifest1
-rw-r--r--net-p2p/opendchub/files/0.7.14-overflow.patch12
-rw-r--r--net-p2p/opendchub/files/0.7.14-telnet.patch12
-rw-r--r--net-p2p/opendchub/files/opendchub-0.8.2-telnet.patch11
-rw-r--r--net-p2p/opendchub/files/opendchub-gentoo.patch30
-rw-r--r--net-p2p/opendchub/files/opendchub_setup.sh20
-rw-r--r--net-p2p/opendchub/metadata.xml8
-rw-r--r--net-p2p/opendchub/opendchub-0.8.2.ebuild50
-rw-r--r--net-p2p/phex/Manifest1
-rw-r--r--net-p2p/phex/files/0001-Remove-MacOS-GUI-references.patch113
-rw-r--r--net-p2p/phex/files/phex-3.0.0.99.sh7
-rw-r--r--net-p2p/phex/metadata.xml9
-rw-r--r--net-p2p/phex/phex-3.2.0.102-r1.ebuild65
-rw-r--r--net-p2p/phxd/Manifest1
-rw-r--r--net-p2p/phxd/files/80phxd1
-rw-r--r--net-p2p/phxd/metadata.xml9
-rw-r--r--net-p2p/phxd/phxd-0.1.0_pre23092005.ebuild51
-rw-r--r--net-p2p/ppcoin-qt/Manifest1
-rw-r--r--net-p2p/ppcoin-qt/metadata.xml14
-rw-r--r--net-p2p/ppcoin-qt/ppcoin-qt-0.4.0.ebuild138
-rw-r--r--net-p2p/ppcoind/Manifest1
-rw-r--r--net-p2p/ppcoind/files/ppcoin.conf8
-rw-r--r--net-p2p/ppcoind/files/ppcoin.confd10
-rw-r--r--net-p2p/ppcoind/files/ppcoin.initd104
-rw-r--r--net-p2p/ppcoind/files/ppcoin.initd-r129
-rw-r--r--net-p2p/ppcoind/files/ppcoin.service30
-rw-r--r--net-p2p/ppcoind/files/ppcoind.logrotate7
-rw-r--r--net-p2p/ppcoind/metadata.xml14
-rw-r--r--net-p2p/ppcoind/ppcoind-0.4.0.ebuild117
-rw-r--r--net-p2p/primecoin-qt/Manifest1
-rw-r--r--net-p2p/primecoin-qt/files/primecoin-sys_leveldb.patch176
-rw-r--r--net-p2p/primecoin-qt/metadata.xml14
-rw-r--r--net-p2p/primecoin-qt/primecoin-qt-0.1.2-r1.ebuild144
-rw-r--r--net-p2p/primecoind/Manifest1
-rw-r--r--net-p2p/primecoind/files/primecoin-sys_leveldb.patch176
-rw-r--r--net-p2p/primecoind/files/primecoin.conf8
-rw-r--r--net-p2p/primecoind/files/primecoin.confd10
-rw-r--r--net-p2p/primecoind/files/primecoin.initd104
-rw-r--r--net-p2p/primecoind/files/primecoin.initd-r129
-rw-r--r--net-p2p/primecoind/files/primecoin.service30
-rw-r--r--net-p2p/primecoind/files/primecoind.logrotate7
-rw-r--r--net-p2p/primecoind/metadata.xml14
-rw-r--r--net-p2p/primecoind/primecoind-0.1.2-r1.ebuild123
-rw-r--r--net-p2p/pybitmessage/Manifest2
-rw-r--r--net-p2p/pybitmessage/metadata.xml26
-rw-r--r--net-p2p/pybitmessage/pybitmessage-0.4.2.ebuild74
-rw-r--r--net-p2p/pybitmessage/pybitmessage-0.4.3.ebuild74
-rw-r--r--net-p2p/pybitmessage/pybitmessage-9999.ebuild72
-rw-r--r--net-p2p/qbittorrent/Manifest3
-rw-r--r--net-p2p/qbittorrent/metadata.xml16
-rw-r--r--net-p2p/qbittorrent/qbittorrent-3.1.12.ebuild63
-rw-r--r--net-p2p/qbittorrent/qbittorrent-3.1.9.2-r1.ebuild58
-rw-r--r--net-p2p/qbittorrent/qbittorrent-3.2.0.ebuild81
-rw-r--r--net-p2p/qbittorrent/qbittorrent-9999.ebuild81
-rw-r--r--net-p2p/retroshare/Manifest3
-rw-r--r--net-p2p/retroshare/metadata.xml28
-rw-r--r--net-p2p/retroshare/retroshare-0.5.5c.ebuild132
-rw-r--r--net-p2p/retroshare/retroshare-0.6.0_rc1.ebuild150
-rw-r--r--net-p2p/retroshare/retroshare-0.6.0_rc2_pre8551.ebuild150
-rw-r--r--net-p2p/rtorrent/Manifest2
-rw-r--r--net-p2p/rtorrent/files/rtorrent-0.9.1-ncurses.patch10
-rw-r--r--net-p2p/rtorrent/files/rtorrent-0.9.4-tinfo.patch37
-rw-r--r--net-p2p/rtorrent/files/rtorrent.1560
-rw-r--r--net-p2p/rtorrent/files/rtorrentd.conf1
-rw-r--r--net-p2p/rtorrent/files/rtorrentd.init33
-rw-r--r--net-p2p/rtorrent/files/rtorrentd_at.service15
-rw-r--r--net-p2p/rtorrent/metadata.xml13
-rw-r--r--net-p2p/rtorrent/rtorrent-0.9.3.ebuild58
-rw-r--r--net-p2p/rtorrent/rtorrent-0.9.4-r1.ebuild63
-rw-r--r--net-p2p/saku/Manifest1
-rw-r--r--net-p2p/saku/files/saku26
-rw-r--r--net-p2p/saku/files/saku.ini27
-rw-r--r--net-p2p/saku/metadata.xml10
-rw-r--r--net-p2p/saku/saku-3.11.0-r1.ebuild45
-rw-r--r--net-p2p/smet2html/Manifest1
-rw-r--r--net-p2p/smet2html/metadata.xml8
-rw-r--r--net-p2p/smet2html/smet2html-0.1.ebuild30
-rw-r--r--net-p2p/soulseek-qt/Manifest2
-rw-r--r--net-p2p/soulseek-qt/metadata.xml8
-rw-r--r--net-p2p/soulseek-qt/soulseek-qt-20131106-r1.ebuild36
-rw-r--r--net-p2p/syrep/Manifest1
-rw-r--r--net-p2p/syrep/metadata.xml5
-rw-r--r--net-p2p/syrep/syrep-0.9.ebuild41
-rw-r--r--net-p2p/torrentinfo/Manifest1
-rw-r--r--net-p2p/torrentinfo/metadata.xml17
-rw-r--r--net-p2p/torrentinfo/torrentinfo-1.8.6.ebuild26
-rw-r--r--net-p2p/transmission-remote-cli/Manifest2
-rw-r--r--net-p2p/transmission-remote-cli/metadata.xml16
-rw-r--r--net-p2p/transmission-remote-cli/transmission-remote-cli-1.6.3.ebuild32
-rw-r--r--net-p2p/transmission-remote-cli/transmission-remote-cli-1.7.0.ebuild32
-rw-r--r--net-p2p/transmission-remote-gtk/Manifest2
-rw-r--r--net-p2p/transmission-remote-gtk/files/transmission-remote-gtk-1.1-PKG_PROG_PKG_CONFIG.patch16
-rw-r--r--net-p2p/transmission-remote-gtk/metadata.xml14
-rw-r--r--net-p2p/transmission-remote-gtk/transmission-remote-gtk-1.0.ebuild47
-rw-r--r--net-p2p/transmission-remote-gtk/transmission-remote-gtk-1.1.1.ebuild46
-rw-r--r--net-p2p/transmission/Manifest1
-rw-r--r--net-p2p/transmission/files/transmission-2.80-translations-path-fix.patch17
-rw-r--r--net-p2p/transmission/files/transmission-daemon.confd.414
-rw-r--r--net-p2p/transmission/files/transmission-daemon.initd.973
-rw-r--r--net-p2p/transmission/metadata.xml13
-rw-r--r--net-p2p/transmission/transmission-2.84-r1.ebuild161
-rw-r--r--net-p2p/transmission/transmission-2.84.ebuild152
-rw-r--r--net-p2p/tribler/Manifest6
-rw-r--r--net-p2p/tribler/files/tribler-5.9.12-fix-global-declarations.patch22
-rw-r--r--net-p2p/tribler/files/tribler-6.1.0-fix-desktop.patch21
-rw-r--r--net-p2p/tribler/files/tribler-6.2.0-fix-desktop.patch12
-rw-r--r--net-p2p/tribler/files/tribler-fix-desktop.patch18
-rw-r--r--net-p2p/tribler/files/tribler-log2homedir.patch12
-rw-r--r--net-p2p/tribler/metadata.xml18
-rw-r--r--net-p2p/tribler/tribler-6.0.3.ebuild80
-rw-r--r--net-p2p/tribler/tribler-6.3.3-r1.ebuild68
-rw-r--r--net-p2p/tvrss/Manifest1
-rw-r--r--net-p2p/tvrss/metadata.xml8
-rw-r--r--net-p2p/tvrss/tvrss-1.8_beta.ebuild27
-rw-r--r--net-p2p/valknut/Manifest3
-rw-r--r--net-p2p/valknut/files/valknut-0.4.9-gcc47.patch15
-rw-r--r--net-p2p/valknut/metadata.xml8
-rw-r--r--net-p2p/valknut/valknut-0.4.9.ebuild47
-rw-r--r--net-p2p/vuze-coreplugins/Manifest10
-rw-r--r--net-p2p/vuze-coreplugins/metadata.xml9
-rw-r--r--net-p2p/vuze-coreplugins/vuze-coreplugins-4.8.1.2.ebuild63
-rw-r--r--net-p2p/vuze-coreplugins/vuze-coreplugins-5.3.0.0.ebuild52
-rw-r--r--net-p2p/vuze-coreplugins/vuze-coreplugins-5.6.0.0.ebuild52
-rw-r--r--net-p2p/vuze/Manifest4
-rw-r--r--net-p2p/vuze/files/build.xml68
-rw-r--r--net-p2p/vuze/files/vuze-4.1.0.0-pre75
-rw-r--r--net-p2p/vuze/files/vuze-5.3.0.0-disable-osx.patch60
-rw-r--r--net-p2p/vuze/files/vuze-5.3.0.0-disable-shared-plugins.patch33
-rw-r--r--net-p2p/vuze/files/vuze-5.3.0.0-disable-updaters.patch45
-rw-r--r--net-p2p/vuze/files/vuze-5.3.0.0-invalid-characters.patch24
-rw-r--r--net-p2p/vuze/files/vuze-5.3.0.0-java5.patch11
-rw-r--r--net-p2p/vuze/files/vuze-5.3.0.0-remove-classpath.patch10
-rw-r--r--net-p2p/vuze/files/vuze-5.3.0.0-unbundle-commons.patch110
-rw-r--r--net-p2p/vuze/files/vuze-5.3.0.0-unbundle-json.patch42
-rw-r--r--net-p2p/vuze/files/vuze-5.3.0.0-use-jdk-cipher-only.patch41
-rw-r--r--net-p2p/vuze/files/vuze-5.6.0.0-commons-lang-entities.patch51
-rw-r--r--net-p2p/vuze/files/vuze-5.6.0.0-invalid-characters.patch26
-rw-r--r--net-p2p/vuze/files/vuze.desktop9
-rw-r--r--net-p2p/vuze/metadata.xml12
-rw-r--r--net-p2p/vuze/vuze-4.8.1.2-r1.ebuild144
-rw-r--r--net-p2p/vuze/vuze-5.3.0.0.ebuild144
-rw-r--r--net-p2p/vuze/vuze-5.6.0.0.ebuild145
-rw-r--r--net-p2p/wire/Manifest1
-rw-r--r--net-p2p/wire/metadata.xml5
-rw-r--r--net-p2p/wire/wire-1.0.2.ebuild21
-rw-r--r--net-p2p/xnap/Manifest1
-rw-r--r--net-p2p/xnap/metadata.xml13
-rw-r--r--net-p2p/xnap/xnap-2.5-r3.ebuild31
-rw-r--r--net-p2p/yaggui/Manifest1
-rw-r--r--net-p2p/yaggui/files/yaggui.sh19
-rw-r--r--net-p2p/yaggui/metadata.xml9
-rw-r--r--net-p2p/yaggui/yaggui-0.9.2.ebuild44
431 files changed, 17791 insertions, 0 deletions
diff --git a/net-p2p/amule/Manifest b/net-p2p/amule/Manifest
new file mode 100644
index 00000000000..5eee9c15ed5
--- /dev/null
+++ b/net-p2p/amule/Manifest
@@ -0,0 +1 @@
+DIST aMule-2.3.1.tar.bz2 4565232 SHA256 d2eda19c34ec574fa123efb95726c7cc241b093c95d074a5161ee7330dece69d
diff --git a/net-p2p/amule/amule-2.3.1.ebuild b/net-p2p/amule/amule-2.3.1.ebuild
new file mode 100644
index 00000000000..929c74d8eec
--- /dev/null
+++ b/net-p2p/amule/amule-2.3.1.ebuild
@@ -0,0 +1,107 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI="2"
+
+inherit eutils flag-o-matic wxwidgets user
+
+MY_P=${PN/m/M}-${PV}
+S="${WORKDIR}"/${MY_P}
+
+DESCRIPTION="aMule, the all-platform eMule p2p client"
+HOMEPAGE="http://www.amule.org/"
+SRC_URI="mirror://sourceforge/${PN}/${MY_P}.tar.bz2"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="alpha amd64 ppc ppc64 ~sparc x86"
+IUSE="daemon debug geoip nls remote stats unicode upnp +X"
+
+DEPEND=">=dev-libs/crypto++-5
+ >=sys-libs/zlib-1.2.1
+ stats? ( >=media-libs/gd-2.0.26[jpeg] )
+ geoip? ( dev-libs/geoip )
+ upnp? ( >=net-libs/libupnp-1.6.6 )
+ remote? ( >=media-libs/libpng-1.2.0
+ unicode? ( >=media-libs/gd-2.0.26 ) )
+ X? ( >=x11-libs/wxGTK-2.8.12:2.8[X] )
+ !X? ( >=x11-libs/wxGTK-2.8.12:2.8 )
+ !net-p2p/imule"
+RDEPEND="${DEPEND}"
+
+pkg_setup() {
+ if use stats && ! use X; then
+ einfo "Note: You would need both the X and stats USE flags"
+ einfo "to compile aMule Statistics GUI."
+ einfo "I will now compile console versions only."
+ fi
+}
+
+pkg_preinst() {
+ if use daemon || use remote; then
+ enewgroup p2p
+ enewuser p2p -1 -1 /home/p2p p2p
+ fi
+}
+
+src_prepare() {
+ epatch "${FILESDIR}"/${PN}-2.2.6-fallocate.diff
+ # Bug 412371
+ epatch "${FILESDIR}"/${PN}-2.3.1-gcc47.patch
+}
+
+src_configure() {
+ local myconf
+
+ WX_GTK_VER="2.8"
+
+ if use X; then
+ einfo "wxGTK with X support will be used"
+ need-wxwidgets unicode
+ else
+ einfo "wxGTK without X support will be used"
+ need-wxwidgets base-unicode
+ fi
+
+ if use X ; then
+ use stats && myconf="${myconf}
+ --enable-wxcas
+ --enable-alc"
+ use remote && myconf="${myconf}
+ --enable-amule-gui"
+ else
+ myconf="
+ --disable-monolithic
+ --disable-amule-gui
+ --disable-wxcas
+ --disable-alc"
+ fi
+
+ econf \
+ --with-wx-config=${WX_CONFIG} \
+ --enable-amulecmd \
+ $(use_enable debug) \
+ $(use_enable !debug optimize) \
+ $(use_enable daemon amule-daemon) \
+ $(use_enable geoip) \
+ $(use_enable nls) \
+ $(use_enable remote webserver) \
+ $(use_enable stats cas) \
+ $(use_enable stats alcc) \
+ $(use_enable upnp) \
+ ${myconf} || die
+}
+
+src_install() {
+ emake DESTDIR="${D}" install || die
+
+ if use daemon; then
+ newconfd "${FILESDIR}"/amuled.confd amuled
+ newinitd "${FILESDIR}"/amuled.initd amuled
+ fi
+ if use remote; then
+ newconfd "${FILESDIR}"/amuleweb.confd amuleweb
+ newinitd "${FILESDIR}"/amuleweb.initd amuleweb
+ fi
+}
diff --git a/net-p2p/amule/files/amule-2.2.6-fallocate.diff b/net-p2p/amule/files/amule-2.2.6-fallocate.diff
new file mode 100644
index 00000000000..8d1485a6778
--- /dev/null
+++ b/net-p2p/amule/files/amule-2.2.6-fallocate.diff
@@ -0,0 +1,23 @@
+Disable fallocate #562992
+
+This is only a workaround to fix FTBFS, the configure check is wrong and needs to be fixed:
+http://www.amule.org/abugs/view.php?id=1572
+
+--- a/src/ThreadTasks.cpp
++++ b/src/ThreadTasks.cpp
+@@ -506,6 +506,15 @@ void CCompletionTask::OnExit()
+ #include <stdlib.h>
+ #include <errno.h>
+
++// #562992
++#if defined(__alpha__) || defined(__hppa__)
++#undef HAVE_FALLOCATE
++#endif
++
++#if defined(__hppa__)
++#undef HAVE_SYS_FALLOCATE
++#endif
++
+ CAllocateFileTask::CAllocateFileTask(CPartFile *file, bool pause)
+ // GetPrintable is used to improve the readability of the log.
+ : CThreadTask(wxT("Allocating"), file->GetFullName().RemoveExt().GetPrintable(), ETP_High),
diff --git a/net-p2p/amule/files/amule-2.3.1-gcc47.patch b/net-p2p/amule/files/amule-2.3.1-gcc47.patch
new file mode 100644
index 00000000000..e776dda3240
--- /dev/null
+++ b/net-p2p/amule/files/amule-2.3.1-gcc47.patch
@@ -0,0 +1,21 @@
+# http://code.google.com/p/amule/source/detail?r=10772
+diff -ur aMule-2.3.1.orig//src/ObservableQueue.h aMule-2.3.1/src/ObservableQueue.h
+--- aMule-2.3.1.orig//src/ObservableQueue.h 2012-04-22 19:40:05.560084120 +0200
++++ aMule-2.3.1/src/ObservableQueue.h 2012-04-22 19:40:32.479085322 +0200
+@@ -331,14 +331,14 @@
+ template <typename ValueType>
+ void CObservableQueue<ValueType>::ObserverAdded( ObserverType* o )
+ {
+- NotifyObservers( EventType( EventType::STARTING ), o );
++ this->NotifyObservers( EventType( EventType::STARTING ), o );
+ }
+
+
+ template <typename ValueType>
+ void CObservableQueue<ValueType>::ObserverRemoved( ObserverType* o )
+ {
+- NotifyObservers( EventType( EventType::STOPPING ), o );
++ this->NotifyObservers( EventType( EventType::STOPPING ), o );
+ }
+
+ \ No newline at end of file
diff --git a/net-p2p/amule/files/amuled.confd b/net-p2p/amule/files/amuled.confd
new file mode 100644
index 00000000000..c17b21e611e
--- /dev/null
+++ b/net-p2p/amule/files/amuled.confd
@@ -0,0 +1,13 @@
+# Copyright 1999-2005 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+# owner of amuled process (must be existing)
+AMULEUSER="p2p"
+
+# home directory for amuled (must be existing)
+AMULEHOME="/home/p2p"
+
+# log file (/dev/null for nowhere)
+LOG=/var/log/amuled.log
+
diff --git a/net-p2p/amule/files/amuled.initd b/net-p2p/amule/files/amuled.initd
new file mode 100644
index 00000000000..9b83458b380
--- /dev/null
+++ b/net-p2p/amule/files/amuled.initd
@@ -0,0 +1,50 @@
+#!/sbin/runscript
+# Copyright 1999-2005 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+depend() {
+ need net
+}
+
+start() {
+ if ! test -f "${AMULEHOME}/.aMule/amule.conf"; then
+ eerror "You must start and configure amuled before launch it. Sorry."
+ return 1
+ fi
+
+ if pgrep -u ${AMULEUSER} amuled >/dev/null; then
+ eerror "An instance of aMule webserver is already running"
+ return 1
+ fi
+ if [ -e /var/run/amuled.pid ]; then
+ rm /var/run/amuled.pid
+ fi
+
+ ebegin "Starting aMule Daemon"
+ env HOME="${AMULEHOME}" start-stop-daemon --start \
+ --quiet --background \
+ --make-pidfile --pidfile /var/run/amuled.pid \
+ -c ${AMULEUSER} \
+ -x /usr/bin/amuled >${LOG}
+
+ sleep 2
+ if ! pgrep -u ${AMULEUSER} amuled > /dev/null; then
+ eerror "aMule daemon can't be started! Check logfile: ${LOG}"
+ fi
+ eend $?
+}
+
+stop() {
+ ebegin "Stopping aMule daemon -- please wait"
+ start-stop-daemon --oknodo --stop --pidfile /var/run/amuled.pid &>/dev/null
+ eend $?
+}
+
+restart() {
+ svc_stop
+ while `pgrep -u ${AMULEUSER} amuled >/dev/null`; do
+ sleep 1
+ done
+ svc_start
+}
diff --git a/net-p2p/amule/files/amuleweb.confd b/net-p2p/amule/files/amuleweb.confd
new file mode 100644
index 00000000000..5453a4611bf
--- /dev/null
+++ b/net-p2p/amule/files/amuleweb.confd
@@ -0,0 +1,28 @@
+# Copyright 1999-2005 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+# owner of amuleweb process (must be existing)
+AMULEUSER="p2p"
+
+# home directory for amuleweb (from where to read configuration) (must be existing)
+AMULEHOME="/home/p2p"
+
+# log file (/dev/null for nowhere)
+LOG=/var/log/amuleweb.log
+
+# aMule password (note: not your webserver password, but the external
+# connection one)
+AMULEPWD="secret"
+
+# Full (admin) access password for webserver
+WEBPWD="secret2"
+
+# aMule host (this could be a remote host or usually localhost)
+AMULEHOST="localhost"
+
+# aMule external connection port
+AMULEPORT="4712"
+
+# aMuleweb template (default, php-default, chicane)
+TEMPLATE="default"
diff --git a/net-p2p/amule/files/amuleweb.initd b/net-p2p/amule/files/amuleweb.initd
new file mode 100644
index 00000000000..0484780093a
--- /dev/null
+++ b/net-p2p/amule/files/amuleweb.initd
@@ -0,0 +1,49 @@
+#!/sbin/runscript
+# Copyright 1999-2007 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+depend() {
+ need net
+ use amuled
+}
+
+start() {
+ if ! test -f "${AMULEHOME}/.aMule/amule.conf"; then
+ eerror "You must start and configure amuleweb before launch it. Sorry."
+ return 1
+ fi
+
+ if pgrep -u ${AMULEUSER} amuleweb >/dev/null; then
+ eerror "An instance of aMule webserver is already running"
+ return 1
+ fi
+
+ if [ -e /var/run/amuleweb.pid ]; then
+ rm /var/run/amuleweb.pid
+ fi
+
+ OPTIONS="-h ${AMULEHOST} -p ${AMULEPORT} -P ${AMULEPWD} -A ${WEBPWD} -t ${TEMPLATE} -q"
+
+ ebegin "Starting aMule WebServer"
+ env HOME="${AMULEHOME}" start-stop-daemon --start \
+ --quiet -b \
+ --make-pidfile --pidfile /var/run/amuleweb.pid \
+ -c ${AMULEUSER} \
+ -x /usr/bin/amuleweb -- ${OPTIONS} &>${LOG}
+
+ sleep 1
+ if ! pgrep -u ${AMULEUSER} amuleweb > /dev/null; then
+ eerror "aMule daemon can't be started! Check logfile: ${LOG}"
+ eend 1
+ return 1
+ fi
+ eend $?
+}
+
+stop() {
+ ebegin "Stopping aMule WebServer"
+ start-stop-daemon --oknodo --stop --pidfile /var/run/amuleweb.pid &>/dev/null
+ eend $?
+}
+
diff --git a/net-p2p/amule/metadata.xml b/net-p2p/amule/metadata.xml
new file mode 100644
index 00000000000..ffff80acce2
--- /dev/null
+++ b/net-p2p/amule/metadata.xml
@@ -0,0 +1,13 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+ <herd>net-p2p</herd>
+ <use>
+ <flag name="daemon">Enable amule daemon</flag>
+ <flag name="remote">Enable remote controlling of the client</flag>
+ <flag name="stats">Enable statistic reporting</flag>
+ </use>
+ <upstream>
+ <remote-id type="sourceforge">amule</remote-id>
+ </upstream>
+</pkgmetadata>
diff --git a/net-p2p/bitcoin-cli/Manifest b/net-p2p/bitcoin-cli/Manifest
new file mode 100644
index 00000000000..a0ae78b4789
--- /dev/null
+++ b/net-p2p/bitcoin-cli/Manifest
@@ -0,0 +1,10 @@
+DIST bitcoin-0.10.0.ljr20150311.patches.tar.xz 34836 SHA256 353b82a933d234daaaed3f807f940a701646c7c9669867fbf5cdb48a1065312c SHA512 dc2a24f141d591f288e846f29a3263dea463f77dda22b92f91e781a8500c695be8b6f497251b6c960e1acdf43e839a7f0bc06fb7a18cdbda90b3d6a61f21c4af WHIRLPOOL 3b898c529e7967750dabcbb235657c19bab0ce75b6f47017ae7bdc7943acb8001cc19eff2d319e1ad405037ecf0674759a575116b1b0c1f32fde89a98f0052a3
+DIST bitcoin-0.10.1.ljr20150428.patches.tar.xz 34980 SHA256 f3770c478bd541fcc75c1f64664ae810aa67da7535f11859034dcc7067546713 SHA512 edf7c8aa81c8890da61224eddde61cec62058514fa76a50ab25cc7db272f6c656f5c46f8b9468f6059eb7c1be624de834867c0a7c1c2559a5231b763e40c13a2 WHIRLPOOL 2b8d878bf3d599393da177403e2199e63bb2634d14438079b5c8821c07441e26fb8b5cd150281c9923534f474763d9f3c2cab9424ab7a319de059c1b3bb49c4e
+DIST bitcoin-0.11.0.ljr20150711.patches.tar.xz 79740 SHA256 2f9608ee18f10fccaeda239baf82fd74180a562eb92aec72f7959c7211228bbb SHA512 cafa5cf0b7a56894b07e949bb401016c46456f6043da86f54023f930e9836a420c88ca9e94067edcf2150495cb637b1938478332f7f7669394ea90351f3b4623 WHIRLPOOL 1bab46c50b7bc8709359ea98a9a75f4b476dd81540421f6696b4085f4acf8fd3d040e591230df1f83625ada89d0d178040f747ae02f76d1dd73787c86e73dac4
+DIST bitcoin-0.9.3.ljr20141002.patch.xz 23320 SHA256 d0a480e11159d597a36e300398c858b5713de78d4f00295b46aa6612ed4b28cc SHA512 b6f225c1e6fc4b1b0b53084d62ff6a57af3b45ea48064fb790b51a081bd1a2333ad5ebffdd443da47babac76ca7394d3ccb645fb3e5e532252409de32a3cb768 WHIRLPOOL 2cdb0a3e3b8407ef11a9f6a56c47ca51c38eb7adbf1b0ceaf1b7fec00118a75892782f66a4c85e54f43e3a3107d1b4e3c799eb1171dff8eb9db69d162cde650a
+DIST bitcoin-cli-manpage-v0.11.0rc3.1 1609 SHA256 868d35484d12a649c3ceb5797abf915c4110393fb33b34509793ae0717963b9e SHA512 296006670bf64c54c408803244eed9db77fe96d1d3f642fb63442838fb4f086c50518d32f44f642a84757bfdf5f041fa6fc98f1e07d48739e41c1049a19b7666 WHIRLPOOL f63e632cb1ad82b4536cff7a04d55c55e981d6cc8e9cd2199e08a3267e4692dd7e732ccb0e66d08657c428a569046a0abc6fac9eec82ba6b997bd41fc96865a7
+DIST bitcoin-v0.10.0.tgz 5022212 SHA256 ecff92e184fac4a96684085590a67554a27db72d0ac235b7cc054887644c0b70 SHA512 f362a9d4ba405c02b2d01024a61b68f984dd6e441ef2254d05bf65cfe803c8b084bd3b14a76a3472251d96087e450091f95f26a691c248836c6d0b43dece8255 WHIRLPOOL 2185413c6d073b0dcb30001c8fb56301390206680ffc6d705ed99e102e68e5c4c1d08c495c38703631696fa9a4a3784befd71acfbec0e94b164bbbfde76158c3
+DIST bitcoin-v0.10.1.tgz 5053846 SHA256 51bff5ba2372ca53782c5fec3d9b4b4226e94b5ac0b1b4b2b5949b97082af256 SHA512 f89330b93f22ba5f393c9a7a48ce28196be0e16468e5d99c459e889c458cc3a7c3f6e4537996571aa8ccb0ebb2eedf80ad028da136a2e08e2f8631f69ac5f2fc WHIRLPOOL 0cfb182f355151cde75601d2260cc92801e2dc1231ae2fca67610e699bb5f0cae826b09f456ca8afa283730954f11a8b180f43ae5a5297d129093fc0f9f53b4e
+DIST bitcoin-v0.10.2-r1.tgz 5076702 SHA256 9bee2b9fe0c236f9f75bfc05c59df238c9424cbcffe4483db5009c5aaff8881b SHA512 5650dc281c749a6057d2dc29d61909619d680ace8c74c41df1581ef56e98950cb42bf4ea2c37264f00090cfa7762f2539f433c8117228484cd7628d397aa69fa WHIRLPOOL 02c2e74748c7572fa3968fc132d561323e33e6aadc07744bd06567abdddd3c7871afe6b46d30fc3389d92246c705454db708dd05946e93e3a93ad5d3b89a327b
+DIST bitcoin-v0.11.0.tgz 5898627 SHA256 a52cb63e96a13626243c78662ea659c90277728b8f40d27846e82fdf81ce58e3 SHA512 bf1e05e115ecc375bfe9e342bf65db74784926e599a05f42f33b43781775d0469826228876269fcdc8a469bce45cb3dd4513e1f9dda5d36cc40adbb9aaf6f054 WHIRLPOOL ca2f3feb9815ad9bfac0b573bc0a3a7bb55bb7467724d84a6baf6a469983625727bb0fd01722a0be74e2df0a29833aadc152d036819be660270733b57089e9bf
+DIST bitcoin-v0.9.3.tgz 4788997 SHA256 3ed92e8323cb4187cae015457c7c5920a5c658438f01c6c45f0ce3aabf9bd428 SHA512 cf6ff5bc586b0614b4e74e1c18b30e8f443f03db348382492e49c70ec31a0ef3a4d1989b34a8fdce289788c894b48b72b94d2562e497220453b668dc28ce0d66 WHIRLPOOL 6ce18de9a2b24cedd88e110088d0747452f8403b6239df9212b673e4a893e059bdea2640b13b6fde659a866d4a6a3b4fa62dde3adbf957b80104d41c0e4aeb18
diff --git a/net-p2p/bitcoin-cli/bitcoin-cli-0.10.0-r1.ebuild b/net-p2p/bitcoin-cli/bitcoin-cli-0.10.0-r1.ebuild
new file mode 100644
index 00000000000..99db4e09dbc
--- /dev/null
+++ b/net-p2p/bitcoin-cli/bitcoin-cli-0.10.0-r1.ebuild
@@ -0,0 +1,25 @@
+# Copyright 2010-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=5
+
+BITCOINCORE_COMMITHASH="047a89831760ff124740fe9f58411d57ee087078"
+BITCOINCORE_LJR_DATE="20150311"
+BITCOINCORE_IUSE=""
+inherit bitcoincore
+
+DESCRIPTION="Command-line JSON-RPC client specifically designed for talking to Bitcoin Core Daemon"
+LICENSE="MIT"
+SLOT="0"
+KEYWORDS="~amd64 ~arm ~arm64 ~x86 ~amd64-linux ~x86-linux"
+
+src_prepare() {
+ bitcoincore_prepare
+ bitcoincore_autoreconf
+}
+
+src_configure() {
+ bitcoincore_conf \
+ --enable-util-cli
+}
diff --git a/net-p2p/bitcoin-cli/bitcoin-cli-0.10.1.ebuild b/net-p2p/bitcoin-cli/bitcoin-cli-0.10.1.ebuild
new file mode 100644
index 00000000000..d157b6b2aa8
--- /dev/null
+++ b/net-p2p/bitcoin-cli/bitcoin-cli-0.10.1.ebuild
@@ -0,0 +1,25 @@
+# Copyright 2010-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=5
+
+BITCOINCORE_COMMITHASH="d8ac90184254fea3a7f4991fd0529dfbd750aea0"
+BITCOINCORE_LJR_DATE="20150428"
+BITCOINCORE_IUSE=""
+inherit bitcoincore
+
+DESCRIPTION="Command-line JSON-RPC client specifically designed for talking to Bitcoin Core Daemon"
+LICENSE="MIT"
+SLOT="0"
+KEYWORDS="~amd64 ~arm ~arm64 ~x86 ~amd64-linux ~x86-linux"
+
+src_prepare() {
+ bitcoincore_prepare
+ bitcoincore_autoreconf
+}
+
+src_configure() {
+ bitcoincore_conf \
+ --enable-util-cli
+}
diff --git a/net-p2p/bitcoin-cli/bitcoin-cli-0.10.2.ebuild b/net-p2p/bitcoin-cli/bitcoin-cli-0.10.2.ebuild
new file mode 100644
index 00000000000..ce3e7b3b7e9
--- /dev/null
+++ b/net-p2p/bitcoin-cli/bitcoin-cli-0.10.2.ebuild
@@ -0,0 +1,38 @@
+# Copyright 2010-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=5
+
+BITCOINCORE_COMMITHASH="16f45600c8c372a738ffef544292864256382601"
+BITCOINCORE_SRC_SUFFIX="-r1"
+BITCOINCORE_LJR_PV="0.10.1"
+BITCOINCORE_LJR_DATE="20150428"
+BITCOINCORE_IUSE=""
+inherit bash-completion-r1 bitcoincore
+
+DESCRIPTION="Command-line JSON-RPC client specifically designed for talking to Bitcoin Core Daemon"
+LICENSE="MIT"
+SLOT="0"
+KEYWORDS="~amd64 ~arm ~arm64 ~x86 ~amd64-linux ~x86-linux"
+SRC_URI="${SRC_URI}
+ https://raw.githubusercontent.com/bitcoin/bitcoin/v0.11.0rc3/contrib/debian/manpages/bitcoin-cli.1 -> bitcoin-cli-manpage-v0.11.0rc3.1"
+
+src_prepare() {
+ sed -i 's/have bitcoind &&//;s/^\(complete -F _bitcoind \)bitcoind \(bitcoin-cli\)$/\1\2/' contrib/bitcoind.bash-completion
+ cp "${DISTDIR}/bitcoin-cli-manpage-v0.11.0rc3.1" contrib/debian/manpages/bitcoin-cli.1
+ bitcoincore_src_prepare
+}
+
+src_configure() {
+ bitcoincore_conf \
+ --enable-util-cli
+}
+
+src_install() {
+ bitcoincore_src_install
+
+ doman contrib/debian/manpages/bitcoin-cli.1
+
+ newbashcomp contrib/bitcoind.bash-completion ${PN}
+}
diff --git a/net-p2p/bitcoin-cli/bitcoin-cli-0.11.0.ebuild b/net-p2p/bitcoin-cli/bitcoin-cli-0.11.0.ebuild
new file mode 100644
index 00000000000..c1a252c9980
--- /dev/null
+++ b/net-p2p/bitcoin-cli/bitcoin-cli-0.11.0.ebuild
@@ -0,0 +1,33 @@
+# Copyright 2010-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=5
+
+BITCOINCORE_COMMITHASH="d26f951802c762de04fb68e1a112d611929920ba"
+BITCOINCORE_LJR_DATE="20150711"
+BITCOINCORE_IUSE="ljr"
+inherit bash-completion-r1 bitcoincore
+
+DESCRIPTION="Command-line JSON-RPC client specifically designed for talking to Bitcoin Core Daemon"
+LICENSE="MIT"
+SLOT="0"
+KEYWORDS="~amd64 ~arm ~arm64 ~x86 ~amd64-linux ~x86-linux"
+
+src_prepare() {
+ sed -i 's/have bitcoind &&//;s/^\(complete -F _bitcoind \)bitcoind \(bitcoin-cli\)$/\1\2/' contrib/bitcoind.bash-completion
+ bitcoincore_src_prepare
+}
+
+src_configure() {
+ bitcoincore_conf \
+ --enable-util-cli
+}
+
+src_install() {
+ bitcoincore_src_install
+
+ doman contrib/debian/manpages/bitcoin-cli.1
+
+ newbashcomp contrib/bitcoind.bash-completion ${PN}
+}
diff --git a/net-p2p/bitcoin-cli/bitcoin-cli-0.9.3.ebuild b/net-p2p/bitcoin-cli/bitcoin-cli-0.9.3.ebuild
new file mode 100644
index 00000000000..5d8a93ddddd
--- /dev/null
+++ b/net-p2p/bitcoin-cli/bitcoin-cli-0.9.3.ebuild
@@ -0,0 +1,55 @@
+# Copyright 2010-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=4
+
+inherit autotools eutils
+
+MyPV="${PV/_/}"
+MyPN="bitcoin"
+MyP="${MyPN}-${MyPV}"
+LJR_PV="${PV}.ljr20141002"
+LJR_PATCH="bitcoin-${LJR_PV}.patch"
+
+DESCRIPTION="Command-line JSON-RPC client specifically designed for talking to Bitcoin Core Daemon"
+HOMEPAGE="http://bitcoin.org/"
+SRC_URI="https://github.com/${MyPN}/${MyPN}/archive/v${MyPV}.tar.gz -> ${MyPN}-v${PV}.tgz
+ http://luke.dashjr.org/programs/bitcoin/files/bitcoind/luke-jr/0.9.x/${LJR_PV}/${LJR_PATCH}.xz
+"
+
+LICENSE="MIT ISC"
+SLOT="0"
+KEYWORDS="~amd64 ~arm ~x86"
+IUSE=""
+
+RDEPEND="
+ >=dev-libs/boost-1.52.0[threads(+)]
+ dev-libs/openssl:0[-bindist]
+"
+DEPEND="${RDEPEND}"
+
+S="${WORKDIR}/${MyP}"
+
+src_prepare() {
+ epatch "${WORKDIR}/${LJR_PATCH}"
+ rm -r src/leveldb
+ eautoreconf
+}
+
+src_configure() {
+ econf \
+ --disable-ccache \
+ --without-miniupnpc \
+ --disable-tests \
+ --disable-wallet \
+ --without-daemon \
+ --without-gui
+}
+
+src_install() {
+ emake DESTDIR="${D}" install
+
+ dodoc doc/README.md doc/release-notes.md
+ dodoc doc/assets-attribution.md doc/tor.md
+}
diff --git a/net-p2p/bitcoin-cli/bitcoin-cli-9999.ebuild b/net-p2p/bitcoin-cli/bitcoin-cli-9999.ebuild
new file mode 100644
index 00000000000..4904ce462a3
--- /dev/null
+++ b/net-p2p/bitcoin-cli/bitcoin-cli-9999.ebuild
@@ -0,0 +1,25 @@
+# Copyright 2010-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=5
+
+BITCOINCORE_NO_SYSLIBS=1
+BITCOINCORE_IUSE=""
+inherit bitcoincore
+
+DESCRIPTION="Command-line JSON-RPC client specifically designed for talking to Bitcoin Core Daemon"
+LICENSE="MIT"
+SLOT="0"
+KEYWORDS=""
+
+src_prepare() {
+ bitcoincore_prepare
+ sed -i 's/bitcoin-tx//' src/Makefile.am
+ bitcoincore_autoreconf
+}
+
+src_configure() {
+ bitcoincore_conf \
+ --with-utils
+}
diff --git a/net-p2p/bitcoin-cli/metadata.xml b/net-p2p/bitcoin-cli/metadata.xml
new file mode 100644
index 00000000000..c25ea048b4e
--- /dev/null
+++ b/net-p2p/bitcoin-cli/metadata.xml
@@ -0,0 +1,16 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+ <herd>proxy-maintainers</herd>
+ <maintainer>
+ <email>blueness@gentoo.org</email>
+ <name>Anthony G. Basile</name>
+ </maintainer>
+ <maintainer>
+ <email>luke-jr+gentoobugs@utopios.org</email>
+ <name>Luke Dashjr</name>
+ </maintainer>
+ <use>
+ <flag name='ljr'>Enable Luke Dashjr's patches</flag>
+ </use>
+</pkgmetadata>
diff --git a/net-p2p/bitcoin-qt/Manifest b/net-p2p/bitcoin-qt/Manifest
new file mode 100644
index 00000000000..2b26496b593
--- /dev/null
+++ b/net-p2p/bitcoin-qt/Manifest
@@ -0,0 +1,9 @@
+DIST bitcoin-0.10.1.ljr20150428.patches.tar.xz 34980 SHA256 f3770c478bd541fcc75c1f64664ae810aa67da7535f11859034dcc7067546713 SHA512 edf7c8aa81c8890da61224eddde61cec62058514fa76a50ab25cc7db272f6c656f5c46f8b9468f6059eb7c1be624de834867c0a7c1c2559a5231b763e40c13a2 WHIRLPOOL 2b8d878bf3d599393da177403e2199e63bb2634d14438079b5c8821c07441e26fb8b5cd150281c9923534f474763d9f3c2cab9424ab7a319de059c1b3bb49c4e
+DIST bitcoin-0.11.0.ljr20150711.patches.tar.xz 79740 SHA256 2f9608ee18f10fccaeda239baf82fd74180a562eb92aec72f7959c7211228bbb SHA512 cafa5cf0b7a56894b07e949bb401016c46456f6043da86f54023f930e9836a420c88ca9e94067edcf2150495cb637b1938478332f7f7669394ea90351f3b4623 WHIRLPOOL 1bab46c50b7bc8709359ea98a9a75f4b476dd81540421f6696b4085f4acf8fd3d040e591230df1f83625ada89d0d178040f747ae02f76d1dd73787c86e73dac4
+DIST bitcoin-rbf-v0.10.2-r1.patch 26987 SHA256 a5dcd50134fe9872c0460746da2d743864525a775150304473a5588aa6c516e6 SHA512 2e88d185dd8d5845a7286dda130ab6d73328a09f7623387d68437be5e655e9657a1e392e9c6a0004856127738f340a77283206a0a8183f2ee9407ddf43328e7f WHIRLPOOL 39ffca7486964eb25f5de4ccfc4a1aff4078b1a08d907300ea06f51189bdb0c6514dbd9565ce615de6d776bf01faa1dabae5cb0c4628ef8d3dd686f6300c037a
+DIST bitcoin-rbf-v0.10.2.patch 25171 SHA256 2610cca0d758c502b71a13184643fe00c9dcb7a2b258f943f33a4534ec1f6cd5 SHA512 855e5e497a371b1e503ab5a0c1fbdb7cb3c30c318b19c32c220d8e6e0b2ae06ca6e63ac27fcb23b51b01c5573c6ea94417ec9d395174ae4f01ad9a0ed4c28c51 WHIRLPOOL 9e67a1d03eb7e40431623818230f2c94e811402a5da6f36dd950cc8a92cc76797ba770c3586ff88477d74b7ee21c9b93704ccead7b489678911dda1394f34fda
+DIST bitcoin-rbf-v0.11.0rc3.patch 27178 SHA256 976e3007121a69630b74c6106f41ebc48b97476ac647e0872d3aaa08a64ec52f SHA512 dc1c46b731dd78bbcb2e7b066dd74aaf0adf39c672847349ed7ebf00012481d3105cebc753dd3bccbe0c35c49bf9dc1546cc8e4d0cc5509d449115e53e91fcc2 WHIRLPOOL de7bd2c1a45369baeac8e311fcd3f9b37e6ab84b99362bb05a5f3f8d6990ea2ad5f509b389b0962bf679ced9dca70c0825e35ae02d97b389101108d2d80be589
+DIST bitcoin-v0.10.2-r1.tgz 5076702 SHA256 9bee2b9fe0c236f9f75bfc05c59df238c9424cbcffe4483db5009c5aaff8881b SHA512 5650dc281c749a6057d2dc29d61909619d680ace8c74c41df1581ef56e98950cb42bf4ea2c37264f00090cfa7762f2539f433c8117228484cd7628d397aa69fa WHIRLPOOL 02c2e74748c7572fa3968fc132d561323e33e6aadc07744bd06567abdddd3c7871afe6b46d30fc3389d92246c705454db708dd05946e93e3a93ad5d3b89a327b
+DIST bitcoin-v0.10.2.tgz 5053846 SHA256 51bff5ba2372ca53782c5fec3d9b4b4226e94b5ac0b1b4b2b5949b97082af256 SHA512 f89330b93f22ba5f393c9a7a48ce28196be0e16468e5d99c459e889c458cc3a7c3f6e4537996571aa8ccb0ebb2eedf80ad028da136a2e08e2f8631f69ac5f2fc WHIRLPOOL 0cfb182f355151cde75601d2260cc92801e2dc1231ae2fca67610e699bb5f0cae826b09f456ca8afa283730954f11a8b180f43ae5a5297d129093fc0f9f53b4e
+DIST bitcoin-v0.11.0.tgz 5898627 SHA256 a52cb63e96a13626243c78662ea659c90277728b8f40d27846e82fdf81ce58e3 SHA512 bf1e05e115ecc375bfe9e342bf65db74784926e599a05f42f33b43781775d0469826228876269fcdc8a469bce45cb3dd4513e1f9dda5d36cc40adbb9aaf6f054 WHIRLPOOL ca2f3feb9815ad9bfac0b573bc0a3a7bb55bb7467724d84a6baf6a469983625727bb0fd01722a0be74e2df0a29833aadc152d036819be660270733b57089e9bf
+DIST bitcoinxt-v0.10.2.patch 72007 SHA256 f2694f976803dfd8cba11cddd6ee2bdd441737d9b82c9d7550f0f362603223b5 SHA512 6b993859b07d28ed8eac79711c0580d29267c1158838772970fe22e88d68f42f46758494e4430b9470ad529e05b24a936052bbb6747c04b54aa8a95694442747 WHIRLPOOL bbf0904cb06f547976edca2f36f49b1352d4c3e99798b19d45f5c34a74167c8db86017c9fdbaca90f3b7de38ece5f3c527e67e97ccbffdd99abd840f6cd335e4
diff --git a/net-p2p/bitcoin-qt/bitcoin-qt-0.10.2-r1.ebuild b/net-p2p/bitcoin-qt/bitcoin-qt-0.10.2-r1.ebuild
new file mode 100644
index 00000000000..b281629c2fe
--- /dev/null
+++ b/net-p2p/bitcoin-qt/bitcoin-qt-0.10.2-r1.ebuild
@@ -0,0 +1,106 @@
+# Copyright 2010-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=5
+
+BITCOINCORE_COMMITHASH="16f45600c8c372a738ffef544292864256382601"
+BITCOINCORE_SRC_SUFFIX="-r1"
+BITCOINCORE_LJR_PV="0.10.1"
+BITCOINCORE_LJR_DATE="20150428"
+BITCOINCORE_IUSE="1stclassmsg dbus kde ljr +qrcode qt4 qt5 test upnp +wallet xt zeromq"
+BITCOINCORE_POLICY_PATCHES="cpfp dcmp rbf spamfilter"
+LANGS="ach af_ZA ar be_BY bg bs ca ca@valencia ca_ES cmn cs cy da de el_GR en eo es es_CL es_DO es_MX es_UY et eu_ES fa fa_IR fi fr fr_CA gl gu_IN he hi_IN hr hu id_ID it ja ka kk_KZ ko_KR ky la lt lv_LV mn ms_MY nb nl pam pl pt_BR pt_PT ro_RO ru sah sk sl_SI sq sr sv th_TH tr uk ur_PK uz@Cyrl vi vi_VN zh_HK zh_CN zh_TW"
+BITCOINCORE_NEED_LEVELDB=1
+BITCOINCORE_NEED_LIBSECP256K1=1
+inherit bitcoincore eutils fdo-mime gnome2-utils kde4-functions qt4-r2
+
+DESCRIPTION="An end-user Qt GUI for the Bitcoin crypto-currency"
+LICENSE="MIT GPL-3 LGPL-2.1 || ( CC-BY-SA-3.0 LGPL-2.1 )"
+SLOT="0"
+KEYWORDS="~amd64 ~arm ~arm64 ~x86 ~amd64-linux ~x86-linux"
+
+RDEPEND="
+ dev-libs/protobuf
+ qrcode? (
+ media-gfx/qrencode
+ )
+ qt4? ( dev-qt/qtgui:4 )
+ qt5? ( dev-qt/qtgui:5 dev-qt/qtnetwork:5 dev-qt/qtwidgets:5 dev-qt/linguist-tools:5 )
+ dbus? (
+ qt4? ( dev-qt/qtdbus:4 )
+ qt5? ( dev-qt/qtdbus:5 )
+ )
+"
+DEPEND="${RDEPEND}"
+REQUIRED_USE="${REQUIRED_USE} ^^ ( qt4 qt5 )"
+
+src_prepare() {
+ bitcoincore_prepare
+
+ local filt= yeslang= nolang=
+
+ for lan in $LANGS; do
+ if [ ! -e src/qt/locale/bitcoin_$lan.ts ]; then
+ die "Language '$lan' no longer supported. Ebuild needs update."
+ fi
+ done
+
+ for ts in $(ls src/qt/locale/*.ts)
+ do
+ x="${ts/*bitcoin_/}"
+ x="${x/.ts/}"
+ if ! use "linguas_$x"; then
+ nolang="$nolang $x"
+ rm "$ts"
+ filt="$filt\\|$x"
+ else
+ yeslang="$yeslang $x"
+ fi
+ done
+ filt="bitcoin_\\(${filt:2}\\)\\.\(qm\|ts\)"
+ sed "/${filt}/d" -i 'src/qt/bitcoin_locale.qrc'
+ sed "s/locale\/${filt}/bitcoin.qrc/" -i 'src/Makefile.qt.include'
+ einfo "Languages -- Enabled:$yeslang -- Disabled:$nolang"
+
+ bitcoincore_autoreconf
+}
+
+src_configure() {
+ # NOTE: --enable-zmq actually disables it
+ bitcoincore_conf \
+ $(use_with dbus qtdbus) \
+ $(use_with qrcode qrencode) \
+ $(usex 1stclassmsg --enable-first-class-messaging '') \
+ --with-gui=$(usex qt5 qt5 qt4)
+}
+
+src_install() {
+ bitcoincore_src_install
+
+ insinto /usr/share/pixmaps
+ newins "share/pixmaps/bitcoin.ico" "${PN}.ico"
+ make_desktop_entry "${PN} %u" "Bitcoin-Qt" "/usr/share/pixmaps/${PN}.ico" "Qt;Network;P2P;Office;Finance;" "MimeType=x-scheme-handler/bitcoin;\nTerminal=false"
+
+ dodoc doc/assets-attribution.md doc/tor.md
+ doman contrib/debian/manpages/bitcoin-qt.1
+
+ if use kde; then
+ insinto /usr/share/kde4/services
+ doins contrib/debian/bitcoin-qt.protocol
+ fi
+}
+
+update_caches() {
+ gnome2_icon_cache_update
+ fdo-mime_desktop_database_update
+ buildsycoca
+}
+
+pkg_postinst() {
+ update_caches
+}
+
+pkg_postrm() {
+ update_caches
+}
diff --git a/net-p2p/bitcoin-qt/bitcoin-qt-0.10.2.ebuild b/net-p2p/bitcoin-qt/bitcoin-qt-0.10.2.ebuild
new file mode 100644
index 00000000000..39ef0c9a1dd
--- /dev/null
+++ b/net-p2p/bitcoin-qt/bitcoin-qt-0.10.2.ebuild
@@ -0,0 +1,112 @@
+# Copyright 2010-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=5
+
+BITCOINCORE_COMMITHASH="d8ac90184254fea3a7f4991fd0529dfbd750aea0"
+BITCOINCORE_LJR_PV="0.10.1"
+BITCOINCORE_LJR_DATE="20150428"
+BITCOINCORE_IUSE="1stclassmsg dbus kde ljr +qrcode qt4 qt5 test upnp +wallet xt zeromq"
+BITCOINCORE_POLICY_PATCHES="cpfp dcmp rbf spamfilter"
+LANGS="ach af_ZA ar be_BY bg bs ca ca@valencia ca_ES cmn cs cy da de el_GR en eo es es_CL es_DO es_MX es_UY et eu_ES fa fa_IR fi fr fr_CA gl gu_IN he hi_IN hr hu id_ID it ja ka kk_KZ ko_KR ky la lt lv_LV mn ms_MY nb nl pam pl pt_BR pt_PT ro_RO ru sah sk sl_SI sq sr sv th_TH tr uk ur_PK uz@Cyrl vi vi_VN zh_HK zh_CN zh_TW"
+BITCOINCORE_NEED_LEVELDB=1
+BITCOINCORE_NEED_LIBSECP256K1=1
+inherit bitcoincore eutils fdo-mime gnome2-utils kde4-functions qt4-r2
+
+DESCRIPTION="An end-user Qt GUI for the Bitcoin crypto-currency"
+LICENSE="MIT GPL-3 LGPL-2.1 || ( CC-BY-SA-3.0 LGPL-2.1 )"
+SLOT="0"
+KEYWORDS="amd64 arm ~arm64 x86 ~amd64-linux ~x86-linux"
+
+RDEPEND="
+ dev-libs/protobuf
+ qrcode? (
+ media-gfx/qrencode
+ )
+ qt4? ( dev-qt/qtgui:4 )
+ qt5? ( dev-qt/qtgui:5 dev-qt/qtnetwork:5 dev-qt/qtwidgets:5 dev-qt/linguist-tools:5 )
+ dbus? (
+ qt4? ( dev-qt/qtdbus:4 )
+ qt5? ( dev-qt/qtdbus:5 )
+ )
+"
+DEPEND="${RDEPEND}"
+REQUIRED_USE="${REQUIRED_USE} ^^ ( qt4 qt5 )"
+
+src_prepare() {
+ bitcoincore_prepare
+
+ local filt= yeslang= nolang=
+
+ for lan in $LANGS; do
+ if [ ! -e src/qt/locale/bitcoin_$lan.ts ]; then
+ ewarn "Language '$lan' no longer supported. Ebuild needs update."
+ fi
+ done
+
+ for ts in $(ls src/qt/locale/*.ts)
+ do
+ x="${ts/*bitcoin_/}"
+ x="${x/.ts/}"
+ if ! use "linguas_$x"; then
+ nolang="$nolang $x"
+ rm "$ts"
+ filt="$filt\\|$x"
+ else
+ yeslang="$yeslang $x"
+ fi
+ done
+ filt="bitcoin_\\(${filt:2}\\)\\.\(qm\|ts\)"
+ sed "/${filt}/d" -i 'src/qt/bitcoin_locale.qrc'
+ sed "s/locale\/${filt}/bitcoin.qrc/" -i 'src/Makefile.qt.include'
+ einfo "Languages -- Enabled:$yeslang -- Disabled:$nolang"
+
+ if has_version '>=dev-libs/leveldb-1.18-r1'; then
+ # Newer leveldb has changed header location.
+ sed -i \
+ -e '/#include/s:memenv.h:leveldb/helpers/memenv.h:' \
+ src/leveldbwrapper.cpp || die
+ fi
+
+ bitcoincore_autoreconf
+}
+
+src_configure() {
+ # NOTE: --enable-zmq actually disables it
+ bitcoincore_conf \
+ $(use_with dbus qtdbus) \
+ $(use_with qrcode qrencode) \
+ $(usex 1stclassmsg --enable-first-class-messaging '') \
+ --with-gui=$(usex qt5 qt5 qt4)
+}
+
+src_install() {
+ bitcoincore_src_install
+
+ insinto /usr/share/pixmaps
+ newins "share/pixmaps/bitcoin.ico" "${PN}.ico"
+ make_desktop_entry "${PN} %u" "Bitcoin-Qt" "/usr/share/pixmaps/${PN}.ico" "Qt;Network;P2P;Office;Finance;" "MimeType=x-scheme-handler/bitcoin;\nTerminal=false"
+
+ dodoc doc/assets-attribution.md doc/tor.md
+ doman contrib/debian/manpages/bitcoin-qt.1
+
+ if use kde; then
+ insinto /usr/share/kde4/services
+ doins contrib/debian/bitcoin-qt.protocol
+ fi
+}
+
+update_caches() {
+ gnome2_icon_cache_update
+ fdo-mime_desktop_database_update
+ buildsycoca
+}
+
+pkg_postinst() {
+ update_caches
+}
+
+pkg_postrm() {
+ update_caches
+}
diff --git a/net-p2p/bitcoin-qt/bitcoin-qt-0.11.0.ebuild b/net-p2p/bitcoin-qt/bitcoin-qt-0.11.0.ebuild
new file mode 100644
index 00000000000..62d8fa927a1
--- /dev/null
+++ b/net-p2p/bitcoin-qt/bitcoin-qt-0.11.0.ebuild
@@ -0,0 +1,102 @@
+# Copyright 2010-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=5
+
+BITCOINCORE_COMMITHASH="d26f951802c762de04fb68e1a112d611929920ba"
+BITCOINCORE_LJR_DATE="20150711"
+BITCOINCORE_IUSE="dbus kde ljr +qrcode qt4 qt5 test upnp +wallet zeromq"
+BITCOINCORE_POLICY_PATCHES="cltv cpfp rbf spamfilter"
+LANGS="ach af_ZA ar be_BY bg bs ca ca@valencia ca_ES cmn cs cy da de el_GR en eo es es_CL es_DO es_MX es_UY et eu_ES fa fa_IR fi fr fr_CA gl gu_IN he hi_IN hr hu id_ID it ja ka kk_KZ ko_KR ky la lt lv_LV mn ms_MY nb nl pam pl pt_BR pt_PT ro_RO ru sah sk sl_SI sq sr sv th_TH tr uk ur_PK uz@Cyrl vi vi_VN zh_HK zh_CN zh_TW"
+BITCOINCORE_NEED_LEVELDB=1
+BITCOINCORE_NEED_LIBSECP256K1=1
+inherit bitcoincore eutils fdo-mime gnome2-utils kde4-functions qt4-r2
+
+DESCRIPTION="An end-user Qt GUI for the Bitcoin crypto-currency"
+LICENSE="MIT"
+SLOT="0"
+KEYWORDS="~amd64 ~arm ~arm64 ~mips ~ppc ~x86 ~amd64-linux ~x86-linux"
+
+RDEPEND="
+ dev-libs/protobuf
+ qrcode? (
+ media-gfx/qrencode
+ )
+ qt4? ( dev-qt/qtgui:4 )
+ qt5? ( dev-qt/qtgui:5 dev-qt/qtnetwork:5 dev-qt/qtwidgets:5 dev-qt/linguist-tools:5 )
+ dbus? (
+ qt4? ( dev-qt/qtdbus:4 )
+ qt5? ( dev-qt/qtdbus:5 )
+ )
+"
+DEPEND="${RDEPEND}"
+REQUIRED_USE="${REQUIRED_USE} ^^ ( qt4 qt5 )"
+
+src_prepare() {
+ bitcoincore_prepare
+
+ local filt= yeslang= nolang=
+
+ for lan in $LANGS; do
+ if [ ! -e src/qt/locale/bitcoin_$lan.ts ]; then
+ die "Language '$lan' no longer supported. Ebuild needs update."
+ fi
+ done
+
+ for ts in $(ls src/qt/locale/*.ts)
+ do
+ x="${ts/*bitcoin_/}"
+ x="${x/.ts/}"
+ if ! use "linguas_$x"; then
+ nolang="$nolang $x"
+ rm "$ts"
+ filt="$filt\\|$x"
+ else
+ yeslang="$yeslang $x"
+ fi
+ done
+ filt="bitcoin_\\(${filt:2}\\)\\.\(qm\|ts\)"
+ sed "/${filt}/d" -i 'src/qt/bitcoin_locale.qrc'
+ sed "s/locale\/${filt}/bitcoin.qrc/" -i 'src/Makefile.qt.include'
+ einfo "Languages -- Enabled:$yeslang -- Disabled:$nolang"
+
+ bitcoincore_autoreconf
+}
+
+src_configure() {
+ bitcoincore_conf \
+ $(use_with dbus qtdbus) \
+ $(use_with qrcode qrencode) \
+ --with-gui=$(usex qt5 qt5 qt4)
+}
+
+src_install() {
+ bitcoincore_src_install
+
+ insinto /usr/share/pixmaps
+ newins "share/pixmaps/bitcoin.ico" "${PN}.ico"
+ make_desktop_entry "${PN} %u" "Bitcoin-Qt" "/usr/share/pixmaps/${PN}.ico" "Qt;Network;P2P;Office;Finance;" "MimeType=x-scheme-handler/bitcoin;\nTerminal=false"
+
+ dodoc doc/assets-attribution.md doc/bips.md doc/tor.md
+ doman contrib/debian/manpages/bitcoin-qt.1
+
+ if use kde; then
+ insinto /usr/share/kde4/services
+ doins contrib/debian/bitcoin-qt.protocol
+ fi
+}
+
+update_caches() {
+ gnome2_icon_cache_update
+ fdo-mime_desktop_database_update
+ buildsycoca
+}
+
+pkg_postinst() {
+ update_caches
+}
+
+pkg_postrm() {
+ update_caches
+}
diff --git a/net-p2p/bitcoin-qt/bitcoin-qt-9999.ebuild b/net-p2p/bitcoin-qt/bitcoin-qt-9999.ebuild
new file mode 100644
index 00000000000..8fe80587ffa
--- /dev/null
+++ b/net-p2p/bitcoin-qt/bitcoin-qt-9999.ebuild
@@ -0,0 +1,99 @@
+# Copyright 2010-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=5
+
+BITCOINCORE_IUSE="dbus kde +qrcode qt4 qt5 test upnp +wallet"
+LANGS="ach af_ZA ar be_BY bg bs ca ca@valencia ca_ES cmn cs cy da de el_GR en eo es es_CL es_DO es_MX es_UY et eu_ES fa fa_IR fi fr fr_CA gl gu_IN he hi_IN hr hu id_ID it ja ka kk_KZ ko_KR ky la lt lv_LV mn ms_MY nb nl pam pl pt_BR pt_PT ro_RO ru sah sk sl_SI sq sr sv th_TH tr uk ur_PK uz@Cyrl vi vi_VN zh_HK zh_CN zh_TW"
+BITCOINCORE_NEED_LEVELDB=1
+BITCOINCORE_NEED_LIBSECP256K1=1
+inherit bitcoincore eutils fdo-mime gnome2-utils kde4-functions qt4-r2 git-2
+
+DESCRIPTION="An end-user Qt GUI for the Bitcoin crypto-currency"
+LICENSE="MIT"
+SLOT="0"
+KEYWORDS=""
+
+RDEPEND="
+ dev-libs/protobuf
+ qrcode? (
+ media-gfx/qrencode
+ )
+ qt4? ( dev-qt/qtgui:4 )
+ qt5? ( dev-qt/qtgui:5 dev-qt/qtnetwork:5 dev-qt/qtwidgets:5 dev-qt/linguist-tools:5 )
+ dbus? (
+ qt4? ( dev-qt/qtdbus:4 )
+ qt5? ( dev-qt/qtdbus:5 )
+ )
+"
+DEPEND="${RDEPEND}"
+REQUIRED_USE="${REQUIRED_USE} ^^ ( qt4 qt5 )"
+
+src_prepare() {
+ bitcoincore_prepare
+
+ local filt= yeslang= nolang=
+
+ for lan in $LANGS; do
+ if [ ! -e src/qt/locale/bitcoin_$lan.ts ]; then
+ ewarn "Language '$lan' no longer supported. Ebuild needs update."
+ fi
+ done
+
+ for ts in $(ls src/qt/locale/*.ts)
+ do
+ x="${ts/*bitcoin_/}"
+ x="${x/.ts/}"
+ if ! use "linguas_$x"; then
+ nolang="$nolang $x"
+ rm "$ts"
+ filt="$filt\\|$x"
+ else
+ yeslang="$yeslang $x"
+ fi
+ done
+ filt="bitcoin_\\(${filt:2}\\)\\.\(qm\|ts\)"
+ sed "/${filt}/d" -i 'src/qt/bitcoin_locale.qrc'
+ sed "s/locale\/${filt}/bitcoin.qrc/" -i 'src/Makefile.qt.include'
+ einfo "Languages -- Enabled:$yeslang -- Disabled:$nolang"
+
+ bitcoincore_autoreconf
+}
+
+src_configure() {
+ bitcoincore_conf \
+ $(use_with dbus qtdbus) \
+ $(use_with qrcode qrencode) \
+ --with-gui=$(usex qt5 qt5 qt4)
+}
+
+src_install() {
+ bitcoincore_src_install
+
+ insinto /usr/share/pixmaps
+ newins "share/pixmaps/bitcoin.ico" "${PN}.ico"
+ make_desktop_entry "${PN} %u" "Bitcoin-Qt" "/usr/share/pixmaps/${PN}.ico" "Qt;Network;P2P;Office;Finance;" "MimeType=x-scheme-handler/bitcoin;\nTerminal=false"
+
+ dodoc doc/assets-attribution.md doc/bips.md doc/tor.md
+ doman contrib/debian/manpages/bitcoin-qt.1
+
+ if use kde; then
+ insinto /usr/share/kde4/services
+ doins contrib/debian/bitcoin-qt.protocol
+ fi
+}
+
+update_caches() {
+ gnome2_icon_cache_update
+ fdo-mime_desktop_database_update
+ buildsycoca
+}
+
+pkg_postinst() {
+ update_caches
+}
+
+pkg_postrm() {
+ update_caches
+}
diff --git a/net-p2p/bitcoin-qt/files/0.8-openssl-101k.patch b/net-p2p/bitcoin-qt/files/0.8-openssl-101k.patch
new file mode 100644
index 00000000000..5eaaba9a578
--- /dev/null
+++ b/net-p2p/bitcoin-qt/files/0.8-openssl-101k.patch
@@ -0,0 +1,31 @@
+diff --git a/src/key.cpp b/src/key.cpp
+index 75114c6..7fcb17d 100644
+--- a/src/key.cpp
++++ b/src/key.cpp
+@@ -376,11 +376,23 @@ bool CKey::SetCompactSignature(uint256 hash, const std::vector<unsigned char>& v
+
+ bool CKey::Verify(uint256 hash, const std::vector<unsigned char>& vchSig)
+ {
+- // -1 = error, 0 = bad sig, 1 = good
+- if (ECDSA_verify(0, (unsigned char*)&hash, sizeof(hash), &vchSig[0], vchSig.size(), pkey) != 1)
++ if (vchSig.empty())
+ return false;
+
+- return true;
++ // New versions of OpenSSL will reject non-canonical DER signatures. de/re-serialize first.
++ unsigned char *norm_der = NULL;
++ ECDSA_SIG *norm_sig = ECDSA_SIG_new();
++ const unsigned char* sigptr = &vchSig[0];
++ d2i_ECDSA_SIG(&norm_sig, &sigptr, vchSig.size());
++ int derlen = i2d_ECDSA_SIG(norm_sig, &norm_der);
++ ECDSA_SIG_free(norm_sig);
++ if (derlen <= 0)
++ return false;
++
++ // -1 = error, 0 = bad sig, 1 = good
++ bool ret = ECDSA_verify(0, (unsigned char*)&hash, sizeof(hash), norm_der, derlen, pkey) == 1;
++ OPENSSL_free(norm_der);
++ return ret;
+ }
+
+ bool CKey::VerifyCompact(uint256 hash, const std::vector<unsigned char>& vchSig)
diff --git a/net-p2p/bitcoin-qt/files/0.8.2-sys_leveldb.patch b/net-p2p/bitcoin-qt/files/0.8.2-sys_leveldb.patch
new file mode 100644
index 00000000000..92f803f4e4f
--- /dev/null
+++ b/net-p2p/bitcoin-qt/files/0.8.2-sys_leveldb.patch
@@ -0,0 +1,183 @@
+diff --git a/bitcoin-qt.pro b/bitcoin-qt.pro
+index cf80986..520b5df 100644
+--- a/bitcoin-qt.pro
++++ b/bitcoin-qt.pro
+@@ -4,7 +4,7 @@ macx:TARGET = "Bitcoin-Qt"
+ VERSION = 0.8.0
+ INCLUDEPATH += src src/json src/qt
+ QT += network
+-DEFINES += QT_GUI BOOST_THREAD_USE_LIB BOOST_SPIRIT_THREADSAFE
++DEFINES += QT_GUI BOOST_THREAD_USE_LIB BOOST_SPIRIT_THREADSAFE LEVELDB_WITHOUT_MEMENV
+ CONFIG += no_include_pwd
+ CONFIG += thread
+
+@@ -98,25 +98,29 @@ contains(BITCOIN_NEED_QT_PLUGINS, 1) {
+ QTPLUGIN += qcncodecs qjpcodecs qtwcodecs qkrcodecs qtaccessiblewidgets
+ }
+
++contains(USE_SYSTEM_LEVELDB, 1) {
++ LIBS += -lleveldb
++} else {
+ INCLUDEPATH += src/leveldb/include src/leveldb/helpers
+-LIBS += $$PWD/src/leveldb/libleveldb.a $$PWD/src/leveldb/libmemenv.a
++LIBS += $$PWD/src/leveldb/libleveldb.a
+ !win32 {
+ # we use QMAKE_CXXFLAGS_RELEASE even without RELEASE=1 because we use RELEASE to indicate linking preferences not -O preferences
+- genleveldb.commands = cd $$PWD/src/leveldb && CC=$$QMAKE_CC CXX=$$QMAKE_CXX $(MAKE) OPT=\"$$QMAKE_CXXFLAGS $$QMAKE_CXXFLAGS_RELEASE\" libleveldb.a libmemenv.a
++ genleveldb.commands = cd $$PWD/src/leveldb && CC=$$QMAKE_CC CXX=$$QMAKE_CXX $(MAKE) OPT=\"$$QMAKE_CXXFLAGS $$QMAKE_CXXFLAGS_RELEASE\" libleveldb.a
+ } else {
+ # make an educated guess about what the ranlib command is called
+ isEmpty(QMAKE_RANLIB) {
+ QMAKE_RANLIB = $$replace(QMAKE_STRIP, strip, ranlib)
+ }
+ LIBS += -lshlwapi
+- genleveldb.commands = cd $$PWD/src/leveldb && CC=$$QMAKE_CC CXX=$$QMAKE_CXX TARGET_OS=OS_WINDOWS_CROSSCOMPILE $(MAKE) OPT=\"$$QMAKE_CXXFLAGS $$QMAKE_CXXFLAGS_RELEASE\" libleveldb.a libmemenv.a && $$QMAKE_RANLIB $$PWD/src/leveldb/libleveldb.a && $$QMAKE_RANLIB $$PWD/src/leveldb/libmemenv.a
++ genleveldb.commands = cd $$PWD/src/leveldb && CC=$$QMAKE_CC CXX=$$QMAKE_CXX TARGET_OS=OS_WINDOWS_CROSSCOMPILE $(MAKE) OPT=\"$$QMAKE_CXXFLAGS $$QMAKE_CXXFLAGS_RELEASE\" libleveldb.a && $$QMAKE_RANLIB $$PWD/src/leveldb/libleveldb.a
+ }
+ genleveldb.target = $$PWD/src/leveldb/libleveldb.a
+ genleveldb.depends = FORCE
+ PRE_TARGETDEPS += $$PWD/src/leveldb/libleveldb.a
+ QMAKE_EXTRA_TARGETS += genleveldb
++}
+ # Gross ugly hack that depends on qmake internals, unfortunately there is no other way to do it.
+-QMAKE_CLEAN += $$PWD/src/leveldb/libleveldb.a; cd $$PWD/src/leveldb ; $(MAKE) clean
++QMAKE_CLEAN += $$PWD/src/leveldb/libleveldb.a; cd $$PWD/src/leveldb && $(MAKE) clean || true
+
+ # regenerate src/build.h
+ !win32|contains(USE_BUILD_INFO, 1) {
+diff --git a/src/leveldb.cpp b/src/leveldb.cpp
+index b41764f..f71e801 100644
+--- a/src/leveldb.cpp
++++ b/src/leveldb.cpp
+@@ -8,7 +8,9 @@
+ #include <leveldb/env.h>
+ #include <leveldb/cache.h>
+ #include <leveldb/filter_policy.h>
++#ifndef LEVELDB_WITHOUT_MEMENV
+ #include <memenv/memenv.h>
++#endif
+
+ #include <boost/filesystem.hpp>
+
+@@ -42,8 +44,12 @@ CLevelDB::CLevelDB(const boost::filesystem::path &path, size_t nCacheSize, bool
+ options = GetOptions(nCacheSize);
+ options.create_if_missing = true;
+ if (fMemory) {
++#ifndef LEVELDB_WITHOUT_MEMENV
+ penv = leveldb::NewMemEnv(leveldb::Env::Default());
+ options.env = penv;
++#else
++ throw std::runtime_error("CLevelDB(): compiled without memenv support");
++#endif
+ } else {
+ if (fWipe) {
+ printf("Wiping LevelDB in %s\n", path.string().c_str());
+diff --git a/src/makefile.unix b/src/makefile.unix
+index 081edaf..1735b89 100644
+--- a/src/makefile.unix
++++ b/src/makefile.unix
+@@ -104,8 +104,7 @@ xCXXFLAGS=-O2 -pthread -Wall -Wextra -Wformat -Wformat-security -Wno-unused-para
+ # adds some defaults in front. Unfortunately, LDFLAGS=... $(LDFLAGS) does not work.
+ xLDFLAGS=$(LDHARDENING) $(LDFLAGS)
+
+-OBJS= \
+- leveldb/libleveldb.a \
++BASEOBJS := \
+ obj/alert.o \
+ obj/version.o \
+ obj/checkpoints.o \
+@@ -114,7 +113,6 @@ OBJS= \
+ obj/crypter.o \
+ obj/key.o \
+ obj/db.o \
+- obj/init.o \
+ obj/keystore.o \
+ obj/main.o \
+ obj/net.o \
+@@ -134,24 +132,43 @@ OBJS= \
+ obj/hash.o \
+ obj/bloom.o \
+ obj/noui.o \
+- obj/leveldb.o \
+ obj/txdb.o
+
++OBJS := \
++ obj/leveldb.o \
++ obj/init.o \
++ $(BASEOBJS)
++
++TESTOBJS := \
++ obj-test/leveldb.o \
++ $(patsubst test/%.cpp,obj-test/%.o,$(wildcard test/*.cpp)) \
++ $(BASEOBJS)
++
+
+ all: bitcoind
+
+ test check: test_bitcoin FORCE
+ ./test_bitcoin
+
++ifdef USE_SYSTEM_LEVELDB
++ LIBS += -lleveldb
++ TESTLIBS += -lmemenv
++else
+ #
+ # LevelDB support
+ #
+ MAKEOVERRIDES =
+-LIBS += $(CURDIR)/leveldb/libleveldb.a $(CURDIR)/leveldb/libmemenv.a
++LIBS += $(CURDIR)/leveldb/libleveldb.a
++TESTLIBS += $(CURDIR)/leveldb/libmemenv.a
+ DEFS += $(addprefix -I,$(CURDIR)/leveldb/include)
+ DEFS += $(addprefix -I,$(CURDIR)/leveldb/helpers)
+ leveldb/libleveldb.a:
+- @echo "Building LevelDB ..." && cd leveldb && $(MAKE) CC=$(CC) CXX=$(CXX) OPT="$(xCXXFLAGS)" libleveldb.a libmemenv.a && cd ..
++ @echo "Building LevelDB ..." && cd leveldb && $(MAKE) CC=$(CC) CXX=$(CXX) OPT="$(xCXXFLAGS)" libleveldb.a && cd ..
++leveldb/libmemenv.a:
++ @echo "Building LevelDB memenv ..." && cd leveldb && $(MAKE) CC=$(CC) CXX=$(CXX) OPT="$(xCXXFLAGS)" libmemenv.a && cd ..
++OBJS += leveldb/libleveldb.a
++TESTOBJS += leveldb/libmemenv.a
++endif
+
+ # auto-generated dependencies:
+ -include obj/*.P
+@@ -162,26 +179,28 @@ obj/build.h: FORCE
+ version.cpp: obj/build.h
+ DEFS += -DHAVE_BUILD_INFO
+
+-obj/%.o: %.cpp
+- $(CXX) -c $(xCXXFLAGS) -MMD -MF $(@:%.o=%.d) -o $@ $<
++P_TO_D = \
+ @cp $(@:%.o=%.d) $(@:%.o=%.P); \
+- sed -e 's/#.*//' -e 's/^[^:]*: *//' -e 's/ *\\$$//' \
++ sed -e 's/\#.*//' -e 's/^[^:]*: *//' -e 's/ *\\$$//' \
+ -e '/^$$/ d' -e 's/$$/ :/' < $(@:%.o=%.d) >> $(@:%.o=%.P); \
+ rm -f $(@:%.o=%.d)
+
+-bitcoind: $(OBJS:obj/%=obj/%)
+- $(LINK) $(xCXXFLAGS) -o $@ $^ $(xLDFLAGS) $(LIBS)
++obj/%.o: %.cpp
++ $(CXX) -c $(xCXXFLAGS) -DLEVELDB_WITHOUT_MEMENV -MMD -MF $(@:%.o=%.d) -o $@ $<
++ $(P_TO_D)
+
+-TESTOBJS := $(patsubst test/%.cpp,obj-test/%.o,$(wildcard test/*.cpp))
++bitcoind: $(OBJS)
++ $(LINK) $(xCXXFLAGS) -o $@ $^ $(xLDFLAGS) $(LIBS)
+
+ obj-test/%.o: test/%.cpp
+ $(CXX) -c $(TESTDEFS) $(xCXXFLAGS) -MMD -MF $(@:%.o=%.d) -o $@ $<
+- @cp $(@:%.o=%.d) $(@:%.o=%.P); \
+- sed -e 's/#.*//' -e 's/^[^:]*: *//' -e 's/ *\\$$//' \
+- -e '/^$$/ d' -e 's/$$/ :/' < $(@:%.o=%.d) >> $(@:%.o=%.P); \
+- rm -f $(@:%.o=%.d)
++ $(P_TO_D)
++
++obj-test/leveldb.o: leveldb.cpp
++ $(CXX) -c $(TESTDEFS) $(xCXXFLAGS) -MMD -MF $(@:%.o=%.d) -o $@ $<
++ $(P_TO_D)
+
+-test_bitcoin: $(TESTOBJS) $(filter-out obj/init.o,$(OBJS:obj/%=obj/%))
++test_bitcoin: $(TESTOBJS)
+ $(LINK) $(xCXXFLAGS) -o $@ $(LIBPATHS) $^ $(TESTLIBS) $(xLDFLAGS) $(LIBS)
+
+ clean:
diff --git a/net-p2p/bitcoin-qt/files/0.9-openssl-101k.patch b/net-p2p/bitcoin-qt/files/0.9-openssl-101k.patch
new file mode 100644
index 00000000000..80f64887425
--- /dev/null
+++ b/net-p2p/bitcoin-qt/files/0.9-openssl-101k.patch
@@ -0,0 +1,31 @@
+diff --git a/src/key.cpp b/src/key.cpp
+index 5b261bb..a845ba1 100644
+--- a/src/key.cpp
++++ b/src/key.cpp
+@@ -227,10 +227,23 @@ public:
+ }
+
+ bool Verify(const uint256 &hash, const std::vector<unsigned char>& vchSig) {
+- // -1 = error, 0 = bad sig, 1 = good
+- if (ECDSA_verify(0, (unsigned char*)&hash, sizeof(hash), &vchSig[0], vchSig.size(), pkey) != 1)
++ if (vchSig.empty())
+ return false;
+- return true;
++
++ // New versions of OpenSSL will reject non-canonical DER signatures. de/re-serialize first.
++ unsigned char *norm_der = NULL;
++ ECDSA_SIG *norm_sig = ECDSA_SIG_new();
++ const unsigned char* sigptr = &vchSig[0];
++ d2i_ECDSA_SIG(&norm_sig, &sigptr, vchSig.size());
++ int derlen = i2d_ECDSA_SIG(norm_sig, &norm_der);
++ ECDSA_SIG_free(norm_sig);
++ if (derlen <= 0)
++ return false;
++
++ // -1 = error, 0 = bad sig, 1 = good
++ bool ret = ECDSA_verify(0, (unsigned char*)&hash, sizeof(hash), norm_der, derlen, pkey) == 1;
++ OPENSSL_free(norm_der);
++ return ret;
+ }
+
+ bool SignCompact(const uint256 &hash, unsigned char *p64, int &rec) {
diff --git a/net-p2p/bitcoin-qt/files/0.9.0-sys_leveldb.patch b/net-p2p/bitcoin-qt/files/0.9.0-sys_leveldb.patch
new file mode 100644
index 00000000000..60e9f2b2094
--- /dev/null
+++ b/net-p2p/bitcoin-qt/files/0.9.0-sys_leveldb.patch
@@ -0,0 +1,34 @@
+commit c38e0af3e021eb0b2aba846c77b06ca71de06b11 (personal-github/sys_leveldb, sys_leveldb)
+Author: Luke Dashjr <luke-jr+git@utopios.org>
+Date: Mon Sep 9 03:06:17 2013 +0000
+
+ configure: Add unsupported --with-system-leveldb configure flag
+
+diff --git a/configure.ac b/configure.ac
+index 3ed4549..5a5852d 100644
+--- a/configure.ac
++++ b/configure.ac
+@@ -332,10 +332,22 @@ AC_TRY_COMPILE([#include <sys/socket.h>],
+ [ AC_MSG_RESULT(no)]
+ )
+
++dnl Check for leveldb, only if explicitly requested
+ LEVELDB_CPPFLAGS=
+ LIBLEVELDB=
+ LIBMEMENV=
+-AM_CONDITIONAL([EMBEDDED_LEVELDB],[true])
++AC_ARG_WITH([system-leveldb],
++ [AS_HELP_STRING([--with-system-leveldb],
++ [Build with system LevelDB (default is no; DANGEROUS; NOT SUPPORTED)])],
++ [system_leveldb=$withval],
++ [system_leveldb=no]
++)
++if test x$system_leveldb != xno; then
++ LEVELDB_CPPFLAGS=
++ LIBLEVELDB=-lleveldb
++ LIBMEMENV=-lmemenv
++fi
++AM_CONDITIONAL([EMBEDDED_LEVELDB],[test x$system_leveldb = xno])
+ AC_SUBST(LEVELDB_CPPFLAGS)
+ AC_SUBST(LIBLEVELDB)
+ AC_SUBST(LIBMEMENV)
diff --git a/net-p2p/bitcoin-qt/files/0.9.x-ljr_noblacklist.patch b/net-p2p/bitcoin-qt/files/0.9.x-ljr_noblacklist.patch
new file mode 100644
index 00000000000..35194662ecd
--- /dev/null
+++ b/net-p2p/bitcoin-qt/files/0.9.x-ljr_noblacklist.patch
@@ -0,0 +1,12 @@
+diff --git a/src/script.cpp b/src/script.cpp
+index 24bbbad..a60d8b6 100644
+--- a/src/script.cpp
++++ b/src/script.cpp
+@@ -1870,6 +1870,7 @@ bool fIsBareMultisigStd = false;
+
+ const char *CScript::IsBlacklisted() const
+ {
++ return false;
+ if (this->size() >= 7 && this->at(0) == OP_DUP)
+ {
+ // pay-to-pubkeyhash
diff --git a/net-p2p/bitcoin-qt/files/9999-sys_libsecp256k1.patch b/net-p2p/bitcoin-qt/files/9999-sys_libsecp256k1.patch
new file mode 100644
index 00000000000..77ed10675e3
--- /dev/null
+++ b/net-p2p/bitcoin-qt/files/9999-sys_libsecp256k1.patch
@@ -0,0 +1,80 @@
+diff --git a/configure.ac b/configure.ac
+index 6784521..3598bab 100644
+--- a/configure.ac
++++ b/configure.ac
+@@ -634,6 +634,12 @@ AC_ARG_WITH([daemon],
+
+ BITCOIN_QT_INIT
+
++PKG_CHECK_MODULES([libsecp256k1],[libsecp256k1],,[true])
++AC_ARG_WITH([libsecp256k1-verify],[],[use_libsecp256k1=$withval],[use_libsecp256k1=yes])
++if test "x$use_libsecp256k1" = "xyes"; then
++ AC_DEFINE(USE_SECP256K1,1,[USE_SECP256K1])
++fi
++
+ if test x$use_pkgconfig = xyes; then
+
+ if test x"$PKG_CONFIG" = "x"; then
+@@ -869,9 +875,6 @@ PKGCONFIG_LIBDIR_TEMP="$PKG_CONFIG_LIBDIR"
+ unset PKG_CONFIG_LIBDIR
+ PKG_CONFIG_LIBDIR="$PKGCONFIG_LIBDIR_TEMP"
+
+-ac_configure_args="${ac_configure_args} --disable-shared --with-pic"
+-AC_CONFIG_SUBDIRS([src/secp256k1])
+-
+ AC_OUTPUT
+
+ dnl Taken from https://wiki.debian.org/RpathIssue
+diff --git a/src/Makefile.am b/src/Makefile.am
+index 0d45203..3a44a16 100644
+--- a/src/Makefile.am
++++ b/src/Makefile.am
+@@ -1,4 +1,3 @@
+-DIST_SUBDIRS = secp256k1
+ AM_LDFLAGS = $(PTHREAD_CFLAGS) $(LIBTOOL_LDFLAGS)
+
+
+@@ -20,7 +19,7 @@ endif
+ BITCOIN_CONFIG_INCLUDES=-I$(builddir)/config
+ BITCOIN_INCLUDES=-I$(builddir) -I$(builddir)/obj $(BOOST_CPPFLAGS) $(LEVELDB_CPPFLAGS) $(CRYPTO_CFLAGS) $(SSL_CFLAGS)
+
+-BITCOIN_INCLUDES += -I$(srcdir)/secp256k1/include
++BITCOIN_INCLUDES += $(libsecp256k1_CFLAGS)
+
+ LIBBITCOIN_SERVER=libbitcoin_server.a
+ LIBBITCOIN_WALLET=libbitcoin_wallet.a
+@@ -30,10 +29,7 @@ LIBBITCOIN_UTIL=libbitcoin_util.a
+ LIBBITCOIN_CRYPTO=crypto/libbitcoin_crypto.a
+ LIBBITCOIN_UNIVALUE=univalue/libbitcoin_univalue.a
+ LIBBITCOINQT=qt/libbitcoinqt.a
+-LIBSECP256K1=secp256k1/libsecp256k1.la
+-
+-$(LIBSECP256K1): $(wildcard secp256k1/src/*) $(wildcard secp256k1/include/*)
+- $(AM_V_at)$(MAKE) $(AM_MAKEFLAGS) -C $(@D) $(@F)
++LIBSECP256K1=$(libsecp256k1_LIBS)
+
+ # Make is not made aware of per-object dependencies to avoid limiting building parallelization
+ # But to build the less dependent modules first, we manually select their order here:
+@@ -364,7 +360,7 @@ libbitcoinconsensus_la_LDFLAGS = -no-undefined $(RELDFLAGS)
+ libbitcoinconsensus_la_LIBADD = $(CRYPTO_LIBS)
+ libbitcoinconsensus_la_CPPFLAGS = $(CRYPTO_CFLAGS) -I$(builddir)/obj -DBUILD_BITCOIN_INTERNAL
+ if USE_LIBSECP256K1
+-libbitcoinconsensus_la_LIBADD += secp256k1/libsecp256k1.la
++libbitcoinconsensus_la_LIBADD += $(LIBSECP256K1)
+ endif
+ endif
+
+diff --git a/src/Makefile.test.include b/src/Makefile.test.include
+index 5fd2afe..014092a 100644
+--- a/src/Makefile.test.include
++++ b/src/Makefile.test.include
+@@ -104,9 +104,6 @@ bitcoin_test_check: $(TEST_BINARY) FORCE
+ bitcoin_test_clean : FORCE
+ rm -f $(CLEAN_BITCOIN_TEST) $(test_test_bitcoin_OBJECTS) $(TEST_BINARY)
+
+-check-local:
+- $(AM_V_at)$(MAKE) $(AM_MAKEFLAGS) -C secp256k1 check
+-
+ %.json.h: %.json
+ @$(MKDIR_P) $(@D)
+ @echo "namespace json_tests{" > $@
diff --git a/net-p2p/bitcoin-qt/files/9999-syslibs.patch b/net-p2p/bitcoin-qt/files/9999-syslibs.patch
new file mode 100644
index 00000000000..2cdf2ab9837
--- /dev/null
+++ b/net-p2p/bitcoin-qt/files/9999-syslibs.patch
@@ -0,0 +1,243 @@
+diff --git a/build-aux/m4/bitcoin_subdir_to_include.m4 b/build-aux/m4/bitcoin_subdir_to_include.m4
+index 66f106c..5f0a3b1 100644
+--- a/build-aux/m4/bitcoin_subdir_to_include.m4
++++ b/build-aux/m4/bitcoin_subdir_to_include.m4
+@@ -5,7 +5,7 @@ AC_DEFUN([BITCOIN_SUBDIR_TO_INCLUDE],[
+ AC_MSG_RESULT([default])
+ else
+ echo "#include <$2$3.h>" >conftest.cpp
+- newinclpath=`${CXXCPP} ${CPPFLAGS} -M conftest.cpp 2>/dev/null | [ tr -d '\\n\\r\\\\' | sed -e 's/^.*[[:space:]:]\(\/[^[:space:]]*\)]$3[\.h[[:space:]].*$/\1/' -e t -e d`]
++ newinclpath=$(${CXXCPP} ${CPPFLAGS} -M conftest.cpp 2>/dev/null | sed [-E -e ':a' -e '/\\$/!b b' -e N -e 's/\\\n/ /' -e 't a' -e ':b' -e 's/^[^:]*:[[:space:]]*(([^[:space:]\]|\\.)*[[:space:]])*(([^[:space:]\]|\\.)*)]$3\.h[([[:space:]].*)?$/\3/' -e 't' -e d])
+ AC_MSG_RESULT([${newinclpath}])
+ if test "x${newinclpath}" != "x"; then
+ eval "$1=\"\$$1\"' -I${newinclpath}'"
+diff --git a/configure.ac b/configure.ac
+index 37fe47e..14e5c34 100644
+--- a/configure.ac
++++ b/configure.ac
+@@ -170,6 +170,18 @@ AC_ARG_WITH([utils],
+ [build_bitcoin_utils=$withval],
+ [build_bitcoin_utils=yes])
+
++AC_ARG_ENABLE([util-cli],
++ [AS_HELP_STRING([--enable-util-cli],
++ [build bitcoin-cli])],
++ [build_bitcoin_cli=$enableval],
++ [build_bitcoin_cli=$build_bitcoin_utils])
++
++AC_ARG_ENABLE([util-tx],
++ [AS_HELP_STRING([--enable-util-tx],
++ [build bitcoin-tx])],
++ [build_bitcoin_tx=$enableval],
++ [build_bitcoin_tx=$build_bitcoin_utils])
++
+ AC_ARG_WITH([libs],
+ [AS_HELP_STRING([--with-libs],
+ [build libraries (default=yes)])],
+@@ -488,14 +500,65 @@ if test x$use_reduce_exports = xyes; then
+ [AC_MSG_ERROR([Cannot set default symbol visibility. Use --disable-reduce-exports.])])
+ fi
+
++dnl Check for leveldb, only if explicitly requested
+ LEVELDB_CPPFLAGS=
+ LIBLEVELDB=
+ LIBMEMENV=
+-AM_CONDITIONAL([EMBEDDED_LEVELDB],[true])
++AC_ARG_WITH([system-leveldb],
++ [AS_HELP_STRING([--with-system-leveldb],
++ [Build with system LevelDB (default is no; DANGEROUS; NOT SUPPORTED)])],
++ [system_leveldb=$withval],
++ [system_leveldb=no]
++)
++if test x$system_leveldb != xno; then
++ LEVELDB_CPPFLAGS=
++ AC_CHECK_LIB([leveldb],[main],[
++ LIBLEVELDB=-lleveldb
++ ],[
++ AC_MSG_ERROR([leveldb library not found; using --with-system-leveldb is not supported anyway])
++ ])
++ TEMP_LIBS="$LIBS"
++ LIBS="$LIBS $LIBLEVELDB"
++ AC_CHECK_LIB([memenv],[main],[
++ LIBMEMENV=-lmemenv
++ ],[
++ AC_MSG_ERROR([LevelDB's memenv library not found; using --with-system-leveldb is not supported anyway])
++ ])
++ LIBS="$TEMP_LIBS"
++ AC_CHECK_HEADER([leveldb/filter_policy.h],[],[
++ AC_MSG_ERROR([LevelDB headers not found; using --with-system-leveldb is not supported anyway])
++ ])
++ AC_CHECK_HEADER([leveldb/helpers/memenv.h],[
++ AC_MSG_CHECKING([for memenv.h path])
++ BITCOIN_SUBDIR_TO_INCLUDE([LEVELDB_CPPFLAGS],[leveldb/helpers/],[memenv])
++ ],[
++ AC_CHECK_HEADER([memenv.h],[],[
++ AC_MSG_ERROR([LevelDB headers not found; using --with-system-leveldb is not supported anyway])
++ ])
++ ])
++fi
++AM_CONDITIONAL([EMBEDDED_LEVELDB],[test x$system_leveldb = xno])
+ AC_SUBST(LEVELDB_CPPFLAGS)
+ AC_SUBST(LIBLEVELDB)
+ AC_SUBST(LIBMEMENV)
+
++dnl Check for libsecp256k1, only if explicitly requested
++AC_ARG_WITH([system-libsecp256k1],
++ [AS_HELP_STRING([--with-system-libsecp256k1],
++ [Build with system libsecp256k1 (default is no; DANGEROUS; NOT SUPPORTED)])],
++ [system_libsecp256k1=$withval],
++ [system_libsecp256k1=no]
++)
++if test x$system_libsecp256k1 != xno; then
++ PKG_CHECK_MODULES([libsecp256k1],[libsecp256k1],,[true])
++else
++ libsecp256k1_CFLAGS='-I$(srcdir)/secp256k1/include'
++ libsecp256k1_LIBS='secp256k1/libsecp256k1.la'
++fi
++AM_CONDITIONAL([EMBEDDED_LIBSECP256K1],[test x$system_libsecp256k1 = xno])
++AC_SUBST(libsecp256k1_CFLAGS)
++AC_SUBST(libsecp256k1_LIBS)
++
+ if test x$enable_wallet != xno; then
+ dnl Check for libdb_cxx only if wallet enabled
+ BITCOIN_FIND_BDB48
+@@ -515,7 +578,7 @@ BITCOIN_QT_INIT
+ dnl sets $bitcoin_enable_qt, $bitcoin_enable_qt_test, $bitcoin_enable_qt_dbus
+ BITCOIN_QT_CONFIGURE([$use_pkgconfig], [qt4])
+
+-if test x$build_bitcoin_utils$build_bitcoind$bitcoin_enable_qt$use_tests = xnononono; then
++if test x$build_bitcoin_cli$build_bitcoin_tx$build_bitcoind$bitcoin_enable_qt$use_tests = xnonononono; then
+ use_boost=no
+ else
+ use_boost=yes
+@@ -701,9 +764,13 @@ AC_MSG_CHECKING([whether to build bitcoind])
+ AM_CONDITIONAL([BUILD_BITCOIND], [test x$build_bitcoind = xyes])
+ AC_MSG_RESULT($build_bitcoind)
+
+-AC_MSG_CHECKING([whether to build utils (bitcoin-cli bitcoin-tx)])
+-AM_CONDITIONAL([BUILD_BITCOIN_UTILS], [test x$build_bitcoin_utils = xyes])
+-AC_MSG_RESULT($build_bitcoin_utils)
++AC_MSG_CHECKING([whether to build bitcoin-cli])
++AM_CONDITIONAL([BUILD_BITCOIN_CLI], [test x$build_bitcoin_cli = xyes])
++AC_MSG_RESULT($build_bitcoin_cli)
++
++AC_MSG_CHECKING([whether to build bitcoin-tx])
++AM_CONDITIONAL([BUILD_BITCOIN_TX], [test x$build_bitcoin_tx = xyes])
++AC_MSG_RESULT($build_bitcoin_tx)
+
+ AC_MSG_CHECKING([whether to build libraries])
+ AM_CONDITIONAL([BUILD_BITCOIN_LIBS], [test x$build_bitcoin_libs = xyes])
+@@ -826,7 +893,7 @@ else
+ AC_MSG_RESULT([no])
+ fi
+
+-if test x$build_bitcoin_utils$build_bitcoin_libs$build_bitcoind$bitcoin_enable_qt$use_tests = xnonononono; then
++if test x$build_bitcoin_cli$build_bitcoin_tx$build_bitcoin_libs$build_bitcoind$bitcoin_enable_qt$use_tests = xnononononono; then
+ AC_MSG_ERROR([No targets! Please specify at least one of: --with-utils --with-libs --with-daemon --with-gui or --enable-tests])
+ fi
+
+@@ -895,8 +962,10 @@ PKGCONFIG_LIBDIR_TEMP="$PKG_CONFIG_LIBDIR"
+ unset PKG_CONFIG_LIBDIR
+ PKG_CONFIG_LIBDIR="$PKGCONFIG_LIBDIR_TEMP"
+
++if test x$system_libsecp256k1 = xno; then
+ ac_configure_args="${ac_configure_args} --disable-shared --with-pic --with-bignum=no"
+ AC_CONFIG_SUBDIRS([src/secp256k1])
++fi
+
+ AC_OUTPUT
+
+diff --git a/qa/pull-tester/rpc-tests.sh b/qa/pull-tester/rpc-tests.sh
+index 9b31865..5bb187c 100755
+--- a/qa/pull-tester/rpc-tests.sh
++++ b/qa/pull-tester/rpc-tests.sh
+@@ -57,7 +57,7 @@ testScriptsExt=(
+ extArg="-extended"
+ passOn=${@#$extArg}
+
+-if [ "x${ENABLE_BITCOIND}${ENABLE_UTILS}${ENABLE_WALLET}" = "x111" ]; then
++if [ "x${ENABLE_BITCOIND}${ENABLE_CLI}${ENABLE_WALLET}" = "x111" ]; then
+ for (( i = 0; i < ${#testScripts[@]}; i++ ))
+ do
+ if [ -z "$1" ] || [ "${1:0:1}" == "-" ] || [ "$1" == "${testScripts[$i]}" ] || [ "$1.py" == "${testScripts[$i]}" ]
+diff --git a/qa/pull-tester/tests-config.sh.in b/qa/pull-tester/tests-config.sh.in
+index 10f4d33..e0e407d 100755
+--- a/qa/pull-tester/tests-config.sh.in
++++ b/qa/pull-tester/tests-config.sh.in
+@@ -8,7 +8,7 @@ EXEEXT="@EXEEXT@"
+
+ # These will turn into comments if they were disabled when configuring.
+ @ENABLE_WALLET_TRUE@ENABLE_WALLET=1
+-@BUILD_BITCOIN_UTILS_TRUE@ENABLE_UTILS=1
++@BUILD_BITCOIN_CLI_TRUE@ENABLE_CLI=1
+ @BUILD_BITCOIND_TRUE@ENABLE_BITCOIND=1
+
+ REAL_BITCOIND="$BUILDDIR/src/bitcoind${EXEEXT}"
+diff --git a/src/Makefile.am b/src/Makefile.am
+index 1c2f770..4d60ddf 100644
+--- a/src/Makefile.am
++++ b/src/Makefile.am
+@@ -1,4 +1,6 @@
++if EMBEDDED_LIBSECP256K1
+ DIST_SUBDIRS = secp256k1
++endif
+ AM_LDFLAGS = $(PTHREAD_CFLAGS) $(LIBTOOL_LDFLAGS)
+
+
+@@ -20,7 +22,7 @@ endif
+ BITCOIN_CONFIG_INCLUDES=-I$(builddir)/config
+ BITCOIN_INCLUDES=-I$(builddir) -I$(builddir)/obj $(BOOST_CPPFLAGS) $(LEVELDB_CPPFLAGS) $(CRYPTO_CFLAGS) $(SSL_CFLAGS)
+
+-BITCOIN_INCLUDES += -I$(srcdir)/secp256k1/include
++BITCOIN_INCLUDES += $(libsecp256k1_CFLAGS)
+
+ LIBBITCOIN_SERVER=libbitcoin_server.a
+ LIBBITCOIN_WALLET=libbitcoin_wallet.a
+@@ -30,10 +32,16 @@ LIBBITCOIN_UTIL=libbitcoin_util.a
+ LIBBITCOIN_CRYPTO=crypto/libbitcoin_crypto.a
+ LIBBITCOIN_UNIVALUE=univalue/libbitcoin_univalue.a
+ LIBBITCOINQT=qt/libbitcoinqt.a
++if EMBEDDED_LIBSECP256K1
+ LIBSECP256K1=secp256k1/libsecp256k1.la
++else
++LIBSECP256K1=$(libsecp256k1_LIBS)
++endif
+
++if EMBEDDED_LIBSECP256K1
+ $(LIBSECP256K1): $(wildcard secp256k1/src/*) $(wildcard secp256k1/include/*)
+ $(AM_V_at)$(MAKE) $(AM_MAKEFLAGS) -C $(@D) $(@F)
++endif
+
+ # Make is not made aware of per-object dependencies to avoid limiting building parallelization
+ # But to build the less dependent modules first, we manually select their order here:
+@@ -63,8 +71,11 @@ if BUILD_BITCOIND
+ bin_PROGRAMS += bitcoind
+ endif
+
+-if BUILD_BITCOIN_UTILS
+- bin_PROGRAMS += bitcoin-cli bitcoin-tx
++if BUILD_BITCOIN_CLI
++ bin_PROGRAMS += bitcoin-cli
++endif
++if BUILD_BITCOIN_TX
++ bin_PROGRAMS += bitcoin-tx
+ endif
+
+ .PHONY: FORCE
+diff --git a/src/Makefile.test.include b/src/Makefile.test.include
+index 0997148..14b4deb 100644
+--- a/src/Makefile.test.include
++++ b/src/Makefile.test.include
+@@ -111,10 +111,12 @@ bitcoin_test_check: $(TEST_BINARY) FORCE
+ bitcoin_test_clean : FORCE
+ rm -f $(CLEAN_BITCOIN_TEST) $(test_test_bitcoin_OBJECTS) $(TEST_BINARY)
+
++if EMBEDDED_LIBSECP256K1
+ check-local:
+ @echo "Running test/bitcoin-util-test.py..."
+ $(AM_V_at)srcdir=$(srcdir) PYTHONPATH=$(builddir)/test $(srcdir)/test/bitcoin-util-test.py
+ $(AM_V_at)$(MAKE) $(AM_MAKEFLAGS) -C secp256k1 check
++endif
+
+ %.json.h: %.json
+ @$(MKDIR_P) $(@D)
diff --git a/net-p2p/bitcoin-qt/metadata.xml b/net-p2p/bitcoin-qt/metadata.xml
new file mode 100644
index 00000000000..fd52a326286
--- /dev/null
+++ b/net-p2p/bitcoin-qt/metadata.xml
@@ -0,0 +1,27 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+ <herd>proxy-maintainers</herd>
+ <maintainer>
+ <email>blueness@gentoo.org</email>
+ <name>Anthony G. Basile</name>
+ </maintainer>
+ <maintainer>
+ <email>luke-jr+gentoobugs@utopios.org</email>
+ <name>Luke Dashjr</name>
+ </maintainer>
+ <use>
+ <flag name='1stclassmsg'>Enable first-class Bitcoin message tools</flag>
+ <flag name='bitcoin_policy_cltv'>Check LockTime Verify policy: Your node will recognise and assist OP_CHECKLOCKTIMEVERIFY (BIP65) transactions</flag>
+ <flag name='bitcoin_policy_cpfp'>Child-Pays-For-Parent policy: If you mine, you will give consideration to child transaction fees to pay for their parents</flag>
+ <flag name='bitcoin_policy_dcmp'>Data Carrier Multi-Push policy: Your node will assist transactions with multiple pushes in their data carrier (if any)</flag>
+ <flag name='bitcoin_policy_rbf'>Replace By Fee policy: Your node will preferentially mine and relay transactions paying the highest fee, regardless of receive order</flag>
+ <flag name='bitcoin_policy_spamfilter'>Enhanced spam filter policy: Notorious spammers will not be assisted by your node</flag>
+ <flag name='ljr'>Enable Luke Dashjr's patches</flag>
+ <flag name='qrcode'>Enable generation of QR Codes for receiving payments</flag>
+ <flag name='upnp'>Enable Universal Plug and Play</flag>
+ <flag name='wallet'>Enable wallet support</flag>
+ <flag name='xt'>Enable Mike Hearn's Bitcoin XT patches</flag>
+ <flag name='zeromq'>Report blocks and transactions via zeromq</flag>
+ </use>
+</pkgmetadata>
diff --git a/net-p2p/bitcoind/Manifest b/net-p2p/bitcoind/Manifest
new file mode 100644
index 00000000000..2b26496b593
--- /dev/null
+++ b/net-p2p/bitcoind/Manifest
@@ -0,0 +1,9 @@
+DIST bitcoin-0.10.1.ljr20150428.patches.tar.xz 34980 SHA256 f3770c478bd541fcc75c1f64664ae810aa67da7535f11859034dcc7067546713 SHA512 edf7c8aa81c8890da61224eddde61cec62058514fa76a50ab25cc7db272f6c656f5c46f8b9468f6059eb7c1be624de834867c0a7c1c2559a5231b763e40c13a2 WHIRLPOOL 2b8d878bf3d599393da177403e2199e63bb2634d14438079b5c8821c07441e26fb8b5cd150281c9923534f474763d9f3c2cab9424ab7a319de059c1b3bb49c4e
+DIST bitcoin-0.11.0.ljr20150711.patches.tar.xz 79740 SHA256 2f9608ee18f10fccaeda239baf82fd74180a562eb92aec72f7959c7211228bbb SHA512 cafa5cf0b7a56894b07e949bb401016c46456f6043da86f54023f930e9836a420c88ca9e94067edcf2150495cb637b1938478332f7f7669394ea90351f3b4623 WHIRLPOOL 1bab46c50b7bc8709359ea98a9a75f4b476dd81540421f6696b4085f4acf8fd3d040e591230df1f83625ada89d0d178040f747ae02f76d1dd73787c86e73dac4
+DIST bitcoin-rbf-v0.10.2-r1.patch 26987 SHA256 a5dcd50134fe9872c0460746da2d743864525a775150304473a5588aa6c516e6 SHA512 2e88d185dd8d5845a7286dda130ab6d73328a09f7623387d68437be5e655e9657a1e392e9c6a0004856127738f340a77283206a0a8183f2ee9407ddf43328e7f WHIRLPOOL 39ffca7486964eb25f5de4ccfc4a1aff4078b1a08d907300ea06f51189bdb0c6514dbd9565ce615de6d776bf01faa1dabae5cb0c4628ef8d3dd686f6300c037a
+DIST bitcoin-rbf-v0.10.2.patch 25171 SHA256 2610cca0d758c502b71a13184643fe00c9dcb7a2b258f943f33a4534ec1f6cd5 SHA512 855e5e497a371b1e503ab5a0c1fbdb7cb3c30c318b19c32c220d8e6e0b2ae06ca6e63ac27fcb23b51b01c5573c6ea94417ec9d395174ae4f01ad9a0ed4c28c51 WHIRLPOOL 9e67a1d03eb7e40431623818230f2c94e811402a5da6f36dd950cc8a92cc76797ba770c3586ff88477d74b7ee21c9b93704ccead7b489678911dda1394f34fda
+DIST bitcoin-rbf-v0.11.0rc3.patch 27178 SHA256 976e3007121a69630b74c6106f41ebc48b97476ac647e0872d3aaa08a64ec52f SHA512 dc1c46b731dd78bbcb2e7b066dd74aaf0adf39c672847349ed7ebf00012481d3105cebc753dd3bccbe0c35c49bf9dc1546cc8e4d0cc5509d449115e53e91fcc2 WHIRLPOOL de7bd2c1a45369baeac8e311fcd3f9b37e6ab84b99362bb05a5f3f8d6990ea2ad5f509b389b0962bf679ced9dca70c0825e35ae02d97b389101108d2d80be589
+DIST bitcoin-v0.10.2-r1.tgz 5076702 SHA256 9bee2b9fe0c236f9f75bfc05c59df238c9424cbcffe4483db5009c5aaff8881b SHA512 5650dc281c749a6057d2dc29d61909619d680ace8c74c41df1581ef56e98950cb42bf4ea2c37264f00090cfa7762f2539f433c8117228484cd7628d397aa69fa WHIRLPOOL 02c2e74748c7572fa3968fc132d561323e33e6aadc07744bd06567abdddd3c7871afe6b46d30fc3389d92246c705454db708dd05946e93e3a93ad5d3b89a327b
+DIST bitcoin-v0.10.2.tgz 5053846 SHA256 51bff5ba2372ca53782c5fec3d9b4b4226e94b5ac0b1b4b2b5949b97082af256 SHA512 f89330b93f22ba5f393c9a7a48ce28196be0e16468e5d99c459e889c458cc3a7c3f6e4537996571aa8ccb0ebb2eedf80ad028da136a2e08e2f8631f69ac5f2fc WHIRLPOOL 0cfb182f355151cde75601d2260cc92801e2dc1231ae2fca67610e699bb5f0cae826b09f456ca8afa283730954f11a8b180f43ae5a5297d129093fc0f9f53b4e
+DIST bitcoin-v0.11.0.tgz 5898627 SHA256 a52cb63e96a13626243c78662ea659c90277728b8f40d27846e82fdf81ce58e3 SHA512 bf1e05e115ecc375bfe9e342bf65db74784926e599a05f42f33b43781775d0469826228876269fcdc8a469bce45cb3dd4513e1f9dda5d36cc40adbb9aaf6f054 WHIRLPOOL ca2f3feb9815ad9bfac0b573bc0a3a7bb55bb7467724d84a6baf6a469983625727bb0fd01722a0be74e2df0a29833aadc152d036819be660270733b57089e9bf
+DIST bitcoinxt-v0.10.2.patch 72007 SHA256 f2694f976803dfd8cba11cddd6ee2bdd441737d9b82c9d7550f0f362603223b5 SHA512 6b993859b07d28ed8eac79711c0580d29267c1158838772970fe22e88d68f42f46758494e4430b9470ad529e05b24a936052bbb6747c04b54aa8a95694442747 WHIRLPOOL bbf0904cb06f547976edca2f36f49b1352d4c3e99798b19d45f5c34a74167c8db86017c9fdbaca90f3b7de38ece5f3c527e67e97ccbffdd99abd840f6cd335e4
diff --git a/net-p2p/bitcoind/bitcoind-0.10.2-r1.ebuild b/net-p2p/bitcoind/bitcoind-0.10.2-r1.ebuild
new file mode 100644
index 00000000000..dcac723e3ef
--- /dev/null
+++ b/net-p2p/bitcoind/bitcoind-0.10.2-r1.ebuild
@@ -0,0 +1,79 @@
+# Copyright 2010-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=5
+
+BITCOINCORE_COMMITHASH="16f45600c8c372a738ffef544292864256382601"
+BITCOINCORE_SRC_SUFFIX="-r1"
+BITCOINCORE_LJR_PV="0.10.1"
+BITCOINCORE_LJR_DATE="20150428"
+BITCOINCORE_IUSE="examples ljr logrotate test upnp +wallet xt zeromq"
+BITCOINCORE_POLICY_PATCHES="cpfp dcmp rbf spamfilter"
+BITCOINCORE_NEED_LEVELDB=1
+BITCOINCORE_NEED_LIBSECP256K1=1
+inherit bash-completion-r1 bitcoincore user systemd
+
+DESCRIPTION="Original Bitcoin crypto-currency wallet for automated services"
+LICENSE="MIT"
+SLOT="0"
+KEYWORDS="~amd64 ~arm ~arm64 ~x86 ~amd64-linux ~x86-linux"
+
+RDEPEND="
+ logrotate? (
+ app-admin/logrotate
+ )
+"
+DEPEND="${RDEPEND}"
+
+pkg_setup() {
+ local UG='bitcoin'
+ enewgroup "${UG}"
+ enewuser "${UG}" -1 -1 /var/lib/bitcoin "${UG}"
+}
+
+src_prepare() {
+ sed -i 's/have bitcoind &&//;s/^\(complete -F _bitcoind bitcoind\) bitcoin-cli$/\1/' contrib/${PN}.bash-completion
+ epatch "${FILESDIR}/0.10.0-openrc-compat.patch"
+ bitcoincore_src_prepare
+}
+
+src_configure() {
+ # NOTE: --enable-zmq actually disables it
+ bitcoincore_conf \
+ --with-daemon
+}
+
+src_install() {
+ bitcoincore_src_install
+
+ insinto /etc/bitcoin
+ newins "${FILESDIR}/bitcoin.conf" bitcoin.conf
+ fowners bitcoin:bitcoin /etc/bitcoin/bitcoin.conf
+ fperms 600 /etc/bitcoin/bitcoin.conf
+
+ newconfd "contrib/init/bitcoind.openrcconf" ${PN}
+ newinitd "contrib/init/bitcoind.openrc" ${PN}
+ systemd_dounit "${FILESDIR}/bitcoind.service"
+
+ keepdir /var/lib/bitcoin/.bitcoin
+ fperms 700 /var/lib/bitcoin
+ fowners bitcoin:bitcoin /var/lib/bitcoin/
+ fowners bitcoin:bitcoin /var/lib/bitcoin/.bitcoin
+ dosym /etc/bitcoin/bitcoin.conf /var/lib/bitcoin/.bitcoin/bitcoin.conf
+
+ dodoc doc/assets-attribution.md doc/tor.md
+ doman contrib/debian/manpages/{bitcoind.1,bitcoin.conf.5}
+
+ newbashcomp contrib/${PN}.bash-completion ${PN}
+
+ if use examples; then
+ docinto examples
+ dodoc -r contrib/{bitrpc,qos,spendfrom,tidy_datadir.sh}
+ fi
+
+ if use logrotate; then
+ insinto /etc/logrotate.d
+ newins "${FILESDIR}/bitcoind.logrotate-r1" bitcoind
+ fi
+}
diff --git a/net-p2p/bitcoind/bitcoind-0.10.2.ebuild b/net-p2p/bitcoind/bitcoind-0.10.2.ebuild
new file mode 100644
index 00000000000..90f110d072a
--- /dev/null
+++ b/net-p2p/bitcoind/bitcoind-0.10.2.ebuild
@@ -0,0 +1,77 @@
+# Copyright 2010-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=5
+
+BITCOINCORE_COMMITHASH="d8ac90184254fea3a7f4991fd0529dfbd750aea0"
+BITCOINCORE_LJR_PV="0.10.1"
+BITCOINCORE_LJR_DATE="20150428"
+BITCOINCORE_IUSE="examples ljr logrotate test upnp +wallet xt zeromq"
+BITCOINCORE_POLICY_PATCHES="cpfp dcmp rbf spamfilter"
+BITCOINCORE_NEED_LEVELDB=1
+BITCOINCORE_NEED_LIBSECP256K1=1
+inherit bash-completion-r1 bitcoincore user systemd
+
+DESCRIPTION="Original Bitcoin crypto-currency wallet for automated services"
+LICENSE="MIT"
+SLOT="0"
+KEYWORDS="amd64 arm ~arm64 x86 ~amd64-linux ~x86-linux"
+
+RDEPEND="
+ logrotate? (
+ app-admin/logrotate
+ )
+"
+DEPEND="${RDEPEND}"
+
+pkg_setup() {
+ local UG='bitcoin'
+ enewgroup "${UG}"
+ enewuser "${UG}" -1 -1 /var/lib/bitcoin "${UG}"
+}
+
+src_prepare() {
+ epatch "${FILESDIR}/0.10.0-openrc-compat.patch"
+ bitcoincore_src_prepare
+}
+
+src_configure() {
+ # NOTE: --enable-zmq actually disables it
+ bitcoincore_conf \
+ --with-daemon
+}
+
+src_install() {
+ bitcoincore_src_install
+
+ insinto /etc/bitcoin
+ newins "${FILESDIR}/bitcoin.conf" bitcoin.conf
+ fowners bitcoin:bitcoin /etc/bitcoin/bitcoin.conf
+ fperms 600 /etc/bitcoin/bitcoin.conf
+
+ newconfd "contrib/init/bitcoind.openrcconf" ${PN}
+ newinitd "contrib/init/bitcoind.openrc" ${PN}
+ systemd_dounit "${FILESDIR}/bitcoind.service"
+
+ keepdir /var/lib/bitcoin/.bitcoin
+ fperms 700 /var/lib/bitcoin
+ fowners bitcoin:bitcoin /var/lib/bitcoin/
+ fowners bitcoin:bitcoin /var/lib/bitcoin/.bitcoin
+ dosym /etc/bitcoin/bitcoin.conf /var/lib/bitcoin/.bitcoin/bitcoin.conf
+
+ dodoc doc/assets-attribution.md doc/tor.md
+ doman contrib/debian/manpages/{bitcoind.1,bitcoin.conf.5}
+
+ newbashcomp contrib/${PN}.bash-completion ${PN}
+
+ if use examples; then
+ docinto examples
+ dodoc -r contrib/{bitrpc,qos,spendfrom,tidy_datadir.sh}
+ fi
+
+ if use logrotate; then
+ insinto /etc/logrotate.d
+ newins "${FILESDIR}/bitcoind.logrotate-r1" bitcoind
+ fi
+}
diff --git a/net-p2p/bitcoind/bitcoind-0.11.0.ebuild b/net-p2p/bitcoind/bitcoind-0.11.0.ebuild
new file mode 100644
index 00000000000..616e33c5d2d
--- /dev/null
+++ b/net-p2p/bitcoind/bitcoind-0.11.0.ebuild
@@ -0,0 +1,75 @@
+# Copyright 2010-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=5
+
+BITCOINCORE_COMMITHASH="d26f951802c762de04fb68e1a112d611929920ba"
+BITCOINCORE_LJR_DATE="20150711"
+BITCOINCORE_IUSE="examples ljr logrotate test upnp +wallet zeromq"
+BITCOINCORE_POLICY_PATCHES="cltv cpfp rbf spamfilter"
+BITCOINCORE_NEED_LEVELDB=1
+BITCOINCORE_NEED_LIBSECP256K1=1
+inherit bash-completion-r1 bitcoincore user systemd
+
+DESCRIPTION="Original Bitcoin crypto-currency wallet for automated services"
+LICENSE="MIT"
+SLOT="0"
+KEYWORDS="~amd64 ~arm ~arm64 ~mips ~ppc ~x86 ~amd64-linux ~x86-linux"
+
+RDEPEND="
+ logrotate? (
+ app-admin/logrotate
+ )
+"
+DEPEND="${RDEPEND}"
+
+pkg_setup() {
+ local UG='bitcoin'
+ enewgroup "${UG}"
+ enewuser "${UG}" -1 -1 /var/lib/bitcoin "${UG}"
+}
+
+src_prepare() {
+ sed -i 's/have bitcoind &&//;s/^\(complete -F _bitcoind bitcoind\) bitcoin-cli$/\1/' contrib/${PN}.bash-completion
+ bitcoincore_src_prepare
+}
+
+src_configure() {
+ bitcoincore_conf \
+ --with-daemon
+}
+
+src_install() {
+ bitcoincore_src_install
+
+ insinto /etc/bitcoin
+ newins "${FILESDIR}/bitcoin.conf" bitcoin.conf
+ fowners bitcoin:bitcoin /etc/bitcoin/bitcoin.conf
+ fperms 600 /etc/bitcoin/bitcoin.conf
+
+ newconfd "contrib/init/bitcoind.openrcconf" ${PN}
+ newinitd "contrib/init/bitcoind.openrc" ${PN}
+ systemd_dounit "${FILESDIR}/bitcoind.service"
+
+ keepdir /var/lib/bitcoin/.bitcoin
+ fperms 700 /var/lib/bitcoin
+ fowners bitcoin:bitcoin /var/lib/bitcoin/
+ fowners bitcoin:bitcoin /var/lib/bitcoin/.bitcoin
+ dosym /etc/bitcoin/bitcoin.conf /var/lib/bitcoin/.bitcoin/bitcoin.conf
+
+ dodoc doc/assets-attribution.md doc/bips.md doc/tor.md
+ doman contrib/debian/manpages/{bitcoind.1,bitcoin.conf.5}
+
+ newbashcomp contrib/${PN}.bash-completion ${PN}
+
+ if use examples; then
+ docinto examples
+ dodoc -r contrib/{bitrpc,qos,spendfrom,tidy_datadir.sh}
+ fi
+
+ if use logrotate; then
+ insinto /etc/logrotate.d
+ newins "${FILESDIR}/bitcoind.logrotate-r1" bitcoind
+ fi
+}
diff --git a/net-p2p/bitcoind/bitcoind-9999.ebuild b/net-p2p/bitcoind/bitcoind-9999.ebuild
new file mode 100644
index 00000000000..5c38561fd52
--- /dev/null
+++ b/net-p2p/bitcoind/bitcoind-9999.ebuild
@@ -0,0 +1,72 @@
+# Copyright 2010-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=5
+
+BITCOINCORE_IUSE="examples logrotate test upnp +wallet"
+BITCOINCORE_NEED_LEVELDB=1
+BITCOINCORE_NEED_LIBSECP256K1=1
+inherit bash-completion-r1 bitcoincore user systemd
+
+DESCRIPTION="Original Bitcoin crypto-currency wallet for automated services"
+LICENSE="MIT"
+SLOT="0"
+KEYWORDS=""
+
+RDEPEND="
+ logrotate? (
+ app-admin/logrotate
+ )
+"
+DEPEND="${RDEPEND}"
+
+pkg_setup() {
+ local UG='bitcoin'
+ enewgroup "${UG}"
+ enewuser "${UG}" -1 -1 /var/lib/bitcoin "${UG}"
+}
+
+src_prepare() {
+ sed -i 's/have bitcoind &&//;s/^\(complete -F _bitcoind bitcoind\) bitcoin-cli$/\1/' contrib/${PN}.bash-completion
+ bitcoincore_src_prepare
+}
+
+src_configure() {
+ bitcoincore_conf \
+ --with-daemon
+}
+
+src_install() {
+ bitcoincore_src_install
+
+ insinto /etc/bitcoin
+ newins "${FILESDIR}/bitcoin.conf" bitcoin.conf
+ fowners bitcoin:bitcoin /etc/bitcoin/bitcoin.conf
+ fperms 600 /etc/bitcoin/bitcoin.conf
+
+ newconfd "contrib/init/bitcoind.openrcconf" ${PN}
+ newinitd "contrib/init/bitcoind.openrc" ${PN}
+ systemd_dounit "${FILESDIR}/bitcoind.service"
+
+ keepdir /var/lib/bitcoin/.bitcoin
+ fperms 700 /var/lib/bitcoin
+ fowners bitcoin:bitcoin /var/lib/bitcoin/
+ fowners bitcoin:bitcoin /var/lib/bitcoin/.bitcoin
+ dosym /etc/bitcoin/bitcoin.conf /var/lib/bitcoin/.bitcoin/bitcoin.conf
+
+ dodoc doc/assets-attribution.md doc/bips.md doc/tor.md
+ doman contrib/debian/manpages/{bitcoind.1,bitcoin.conf.5}
+
+ newbashcomp contrib/${PN}.bash-completion ${PN}
+
+ if use examples; then
+ docinto examples
+ dodoc -r contrib/{bitrpc,qos,spendfrom,tidy_datadir.sh}
+ fi
+
+ if use logrotate; then
+ insinto /etc/logrotate.d
+ newins "${FILESDIR}/bitcoind.logrotate-r1" bitcoind
+ fi
+}
diff --git a/net-p2p/bitcoind/files/0.10.0-openrc-compat.patch b/net-p2p/bitcoind/files/0.10.0-openrc-compat.patch
new file mode 100644
index 00000000000..a7c31d680ba
--- /dev/null
+++ b/net-p2p/bitcoind/files/0.10.0-openrc-compat.patch
@@ -0,0 +1,24 @@
+--- contrib/init/bitcoind.openrc 2015-03-03 09:37:59.919728713 +0000
++++ contrib/init/bitcoind.openrc 2015-03-03 09:38:08.109757531 +0000
+@@ -12,9 +12,11 @@
+ BITCOIND_PIDDIR=${BITCOIND_PIDDIR:-/var/run/bitcoind}
+ BITCOIND_PIDFILE=${BITCOIND_PIDFILE:-${BITCOIND_PIDDIR}/bitcoind.pid}
+ BITCOIND_DATADIR=${BITCOIND_DATADIR:-${BITCOIND_DEFAULT_DATADIR}}
+-BITCOIND_USER=${BITCOIND_USER:-bitcoin}
++BITCOIND_USER=${BITCOIND_USER:-${BITCOIN_USER:-bitcoin}}
+ BITCOIND_GROUP=${BITCOIND_GROUP:-bitcoin}
+ BITCOIND_BIN=${BITCOIND_BIN:-/usr/bin/bitcoind}
++BITCOIND_NICE=${BITCOIND_NICE:-${NICELEVEL:-0}}
++BITCOIND_OPTS="${BITCOIND_OPTS:-${BITCOIN_OPTS}}"
+
+ name="Bitcoin Core Daemon"
+ description="Bitcoin crypto-currency p2p network daemon"
+@@ -28,7 +30,7 @@
+
+ required_files="${BITCOIND_CONFIGFILE}"
+ start_stop_daemon_args="-u ${BITCOIND_USER} \
+- -N ${BITCOIND_NICE:-0} -w 2000"
++ -N ${BITCOIND_NICE} -w 2000"
+ pidfile="${BITCOIND_PIDFILE}"
+ retry=60
+
diff --git a/net-p2p/bitcoind/files/0.8-openssl-101k.patch b/net-p2p/bitcoind/files/0.8-openssl-101k.patch
new file mode 100644
index 00000000000..5eaaba9a578
--- /dev/null
+++ b/net-p2p/bitcoind/files/0.8-openssl-101k.patch
@@ -0,0 +1,31 @@
+diff --git a/src/key.cpp b/src/key.cpp
+index 75114c6..7fcb17d 100644
+--- a/src/key.cpp
++++ b/src/key.cpp
+@@ -376,11 +376,23 @@ bool CKey::SetCompactSignature(uint256 hash, const std::vector<unsigned char>& v
+
+ bool CKey::Verify(uint256 hash, const std::vector<unsigned char>& vchSig)
+ {
+- // -1 = error, 0 = bad sig, 1 = good
+- if (ECDSA_verify(0, (unsigned char*)&hash, sizeof(hash), &vchSig[0], vchSig.size(), pkey) != 1)
++ if (vchSig.empty())
+ return false;
+
+- return true;
++ // New versions of OpenSSL will reject non-canonical DER signatures. de/re-serialize first.
++ unsigned char *norm_der = NULL;
++ ECDSA_SIG *norm_sig = ECDSA_SIG_new();
++ const unsigned char* sigptr = &vchSig[0];
++ d2i_ECDSA_SIG(&norm_sig, &sigptr, vchSig.size());
++ int derlen = i2d_ECDSA_SIG(norm_sig, &norm_der);
++ ECDSA_SIG_free(norm_sig);
++ if (derlen <= 0)
++ return false;
++
++ // -1 = error, 0 = bad sig, 1 = good
++ bool ret = ECDSA_verify(0, (unsigned char*)&hash, sizeof(hash), norm_der, derlen, pkey) == 1;
++ OPENSSL_free(norm_der);
++ return ret;
+ }
+
+ bool CKey::VerifyCompact(uint256 hash, const std::vector<unsigned char>& vchSig)
diff --git a/net-p2p/bitcoind/files/0.8.2-sys_leveldb.patch b/net-p2p/bitcoind/files/0.8.2-sys_leveldb.patch
new file mode 100644
index 00000000000..2b9ab1a6d67
--- /dev/null
+++ b/net-p2p/bitcoind/files/0.8.2-sys_leveldb.patch
@@ -0,0 +1,185 @@
+diff --git a/bitcoin-qt.pro b/bitcoin-qt.pro
+index cf80986..520b5df 100644
+--- a/bitcoin-qt.pro
++++ b/bitcoin-qt.pro
+@@ -4,7 +4,7 @@ macx:TARGET = "Bitcoin-Qt"
+ VERSION = 0.8.0
+ INCLUDEPATH += src src/json src/qt
+ QT += network
+-DEFINES += QT_GUI BOOST_THREAD_USE_LIB BOOST_SPIRIT_THREADSAFE
++DEFINES += QT_GUI BOOST_THREAD_USE_LIB BOOST_SPIRIT_THREADSAFE LEVELDB_WITHOUT_MEMENV
+ CONFIG += no_include_pwd
+ CONFIG += thread
+
+@@ -98,25 +98,29 @@ contains(BITCOIN_NEED_QT_PLUGINS, 1) {
+ QTPLUGIN += qcncodecs qjpcodecs qtwcodecs qkrcodecs qtaccessiblewidgets
+ }
+
++contains(USE_SYSTEM_LEVELDB, 1) {
++ LIBS += -lleveldb
++} else {
+ INCLUDEPATH += src/leveldb/include src/leveldb/helpers
+-LIBS += $$PWD/src/leveldb/libleveldb.a $$PWD/src/leveldb/libmemenv.a
++LIBS += $$PWD/src/leveldb/libleveldb.a
+ !win32 {
+ # we use QMAKE_CXXFLAGS_RELEASE even without RELEASE=1 because we use RELEASE to indicate linking preferences not -O preferences
+- genleveldb.commands = cd $$PWD/src/leveldb && CC=$$QMAKE_CC CXX=$$QMAKE_CXX $(MAKE) OPT=\"$$QMAKE_CXXFLAGS $$QMAKE_CXXFLAGS_RELEASE\" libleveldb.a libmemenv.a
++ genleveldb.commands = cd $$PWD/src/leveldb && CC=$$QMAKE_CC CXX=$$QMAKE_CXX $(MAKE) OPT=\"$$QMAKE_CXXFLAGS $$QMAKE_CXXFLAGS_RELEASE\" libleveldb.a
+ } else {
+ # make an educated guess about what the ranlib command is called
+ isEmpty(QMAKE_RANLIB) {
+ QMAKE_RANLIB = $$replace(QMAKE_STRIP, strip, ranlib)
+ }
+ LIBS += -lshlwapi
+- genleveldb.commands = cd $$PWD/src/leveldb && CC=$$QMAKE_CC CXX=$$QMAKE_CXX TARGET_OS=OS_WINDOWS_CROSSCOMPILE $(MAKE) OPT=\"$$QMAKE_CXXFLAGS $$QMAKE_CXXFLAGS_RELEASE\" libleveldb.a libmemenv.a && $$QMAKE_RANLIB $$PWD/src/leveldb/libleveldb.a && $$QMAKE_RANLIB $$PWD/src/leveldb/libmemenv.a
++ genleveldb.commands = cd $$PWD/src/leveldb && CC=$$QMAKE_CC CXX=$$QMAKE_CXX TARGET_OS=OS_WINDOWS_CROSSCOMPILE $(MAKE) OPT=\"$$QMAKE_CXXFLAGS $$QMAKE_CXXFLAGS_RELEASE\" libleveldb.a && $$QMAKE_RANLIB $$PWD/src/leveldb/libleveldb.a
+ }
+ genleveldb.target = $$PWD/src/leveldb/libleveldb.a
+ genleveldb.depends = FORCE
+ PRE_TARGETDEPS += $$PWD/src/leveldb/libleveldb.a
+ QMAKE_EXTRA_TARGETS += genleveldb
++}
+ # Gross ugly hack that depends on qmake internals, unfortunately there is no other way to do it.
+-QMAKE_CLEAN += $$PWD/src/leveldb/libleveldb.a; cd $$PWD/src/leveldb ; $(MAKE) clean
++QMAKE_CLEAN += $$PWD/src/leveldb/libleveldb.a; cd $$PWD/src/leveldb && $(MAKE) clean || true
+
+ # regenerate src/build.h
+ !win32|contains(USE_BUILD_INFO, 1) {
+diff --git a/src/leveldb.cpp b/src/leveldb.cpp
+index b41764f..30c524d 100644
+--- a/src/leveldb.cpp
++++ b/src/leveldb.cpp
+@@ -8,7 +8,9 @@
+ #include <leveldb/env.h>
+ #include <leveldb/cache.h>
+ #include <leveldb/filter_policy.h>
+-#include <memenv/memenv.h>
++#ifndef LEVELDB_WITHOUT_MEMENV
++#include <memenv.h>
++#endif
+
+ #include <boost/filesystem.hpp>
+
+@@ -42,8 +44,12 @@ CLevelDB::CLevelDB(const boost::filesystem::path &path, size_t nCacheSize, bool
+ options = GetOptions(nCacheSize);
+ options.create_if_missing = true;
+ if (fMemory) {
++#ifndef LEVELDB_WITHOUT_MEMENV
+ penv = leveldb::NewMemEnv(leveldb::Env::Default());
+ options.env = penv;
++#else
++ throw std::runtime_error("CLevelDB(): compiled without memenv support");
++#endif
+ } else {
+ if (fWipe) {
+ printf("Wiping LevelDB in %s\n", path.string().c_str());
+diff --git a/src/makefile.unix b/src/makefile.unix
+index 081edaf..27f2199 100644
+--- a/src/makefile.unix
++++ b/src/makefile.unix
+@@ -104,8 +104,7 @@ xCXXFLAGS=-O2 -pthread -Wall -Wextra -Wformat -Wformat-security -Wno-unused-para
+ # adds some defaults in front. Unfortunately, LDFLAGS=... $(LDFLAGS) does not work.
+ xLDFLAGS=$(LDHARDENING) $(LDFLAGS)
+
+-OBJS= \
+- leveldb/libleveldb.a \
++BASEOBJS := \
+ obj/alert.o \
+ obj/version.o \
+ obj/checkpoints.o \
+@@ -114,7 +113,6 @@ OBJS= \
+ obj/crypter.o \
+ obj/key.o \
+ obj/db.o \
+- obj/init.o \
+ obj/keystore.o \
+ obj/main.o \
+ obj/net.o \
+@@ -134,24 +132,43 @@ OBJS= \
+ obj/hash.o \
+ obj/bloom.o \
+ obj/noui.o \
+- obj/leveldb.o \
+ obj/txdb.o
+
++OBJS := \
++ obj/leveldb.o \
++ obj/init.o \
++ $(BASEOBJS)
++
++TESTOBJS := \
++ obj-test/leveldb.o \
++ $(patsubst test/%.cpp,obj-test/%.o,$(wildcard test/*.cpp)) \
++ $(BASEOBJS)
++
+
+ all: bitcoind
+
+ test check: test_bitcoin FORCE
+ ./test_bitcoin
+
++ifdef USE_SYSTEM_LEVELDB
++ LIBS += -lleveldb
++ TESTLIBS += -lmemenv
++else
+ #
+ # LevelDB support
+ #
+ MAKEOVERRIDES =
+-LIBS += $(CURDIR)/leveldb/libleveldb.a $(CURDIR)/leveldb/libmemenv.a
++LIBS += $(CURDIR)/leveldb/libleveldb.a
++TESTLIBS += $(CURDIR)/leveldb/libmemenv.a
+ DEFS += $(addprefix -I,$(CURDIR)/leveldb/include)
+-DEFS += $(addprefix -I,$(CURDIR)/leveldb/helpers)
++DEFS += $(addprefix -I,$(CURDIR)/leveldb/helpers/memenv)
+ leveldb/libleveldb.a:
+- @echo "Building LevelDB ..." && cd leveldb && $(MAKE) CC=$(CC) CXX=$(CXX) OPT="$(xCXXFLAGS)" libleveldb.a libmemenv.a && cd ..
++ @echo "Building LevelDB ..." && cd leveldb && $(MAKE) CC=$(CC) CXX=$(CXX) OPT="$(xCXXFLAGS)" libleveldb.a && cd ..
++leveldb/libmemenv.a:
++ @echo "Building LevelDB memenv ..." && cd leveldb && $(MAKE) CC=$(CC) CXX=$(CXX) OPT="$(xCXXFLAGS)" libmemenv.a && cd ..
++OBJS += leveldb/libleveldb.a
++TESTOBJS += leveldb/libmemenv.a
++endif
+
+ # auto-generated dependencies:
+ -include obj/*.P
+@@ -162,26 +179,28 @@ obj/build.h: FORCE
+ version.cpp: obj/build.h
+ DEFS += -DHAVE_BUILD_INFO
+
+-obj/%.o: %.cpp
+- $(CXX) -c $(xCXXFLAGS) -MMD -MF $(@:%.o=%.d) -o $@ $<
++P_TO_D = \
+ @cp $(@:%.o=%.d) $(@:%.o=%.P); \
+- sed -e 's/#.*//' -e 's/^[^:]*: *//' -e 's/ *\\$$//' \
++ sed -e 's/\#.*//' -e 's/^[^:]*: *//' -e 's/ *\\$$//' \
+ -e '/^$$/ d' -e 's/$$/ :/' < $(@:%.o=%.d) >> $(@:%.o=%.P); \
+ rm -f $(@:%.o=%.d)
+
+-bitcoind: $(OBJS:obj/%=obj/%)
+- $(LINK) $(xCXXFLAGS) -o $@ $^ $(xLDFLAGS) $(LIBS)
++obj/%.o: %.cpp
++ $(CXX) -c $(xCXXFLAGS) -DLEVELDB_WITHOUT_MEMENV -MMD -MF $(@:%.o=%.d) -o $@ $<
++ $(P_TO_D)
+
+-TESTOBJS := $(patsubst test/%.cpp,obj-test/%.o,$(wildcard test/*.cpp))
++bitcoind: $(OBJS)
++ $(LINK) $(xCXXFLAGS) -o $@ $^ $(xLDFLAGS) $(LIBS)
+
+ obj-test/%.o: test/%.cpp
+ $(CXX) -c $(TESTDEFS) $(xCXXFLAGS) -MMD -MF $(@:%.o=%.d) -o $@ $<
+- @cp $(@:%.o=%.d) $(@:%.o=%.P); \
+- sed -e 's/#.*//' -e 's/^[^:]*: *//' -e 's/ *\\$$//' \
+- -e '/^$$/ d' -e 's/$$/ :/' < $(@:%.o=%.d) >> $(@:%.o=%.P); \
+- rm -f $(@:%.o=%.d)
++ $(P_TO_D)
++
++obj-test/leveldb.o: leveldb.cpp
++ $(CXX) -c $(TESTDEFS) $(xCXXFLAGS) -MMD -MF $(@:%.o=%.d) -o $@ $<
++ $(P_TO_D)
+
+-test_bitcoin: $(TESTOBJS) $(filter-out obj/init.o,$(OBJS:obj/%=obj/%))
++test_bitcoin: $(TESTOBJS)
+ $(LINK) $(xCXXFLAGS) -o $@ $(LIBPATHS) $^ $(TESTLIBS) $(xLDFLAGS) $(LIBS)
+
+ clean:
diff --git a/net-p2p/bitcoind/files/0.9-openssl-101k.patch b/net-p2p/bitcoind/files/0.9-openssl-101k.patch
new file mode 100644
index 00000000000..80f64887425
--- /dev/null
+++ b/net-p2p/bitcoind/files/0.9-openssl-101k.patch
@@ -0,0 +1,31 @@
+diff --git a/src/key.cpp b/src/key.cpp
+index 5b261bb..a845ba1 100644
+--- a/src/key.cpp
++++ b/src/key.cpp
+@@ -227,10 +227,23 @@ public:
+ }
+
+ bool Verify(const uint256 &hash, const std::vector<unsigned char>& vchSig) {
+- // -1 = error, 0 = bad sig, 1 = good
+- if (ECDSA_verify(0, (unsigned char*)&hash, sizeof(hash), &vchSig[0], vchSig.size(), pkey) != 1)
++ if (vchSig.empty())
+ return false;
+- return true;
++
++ // New versions of OpenSSL will reject non-canonical DER signatures. de/re-serialize first.
++ unsigned char *norm_der = NULL;
++ ECDSA_SIG *norm_sig = ECDSA_SIG_new();
++ const unsigned char* sigptr = &vchSig[0];
++ d2i_ECDSA_SIG(&norm_sig, &sigptr, vchSig.size());
++ int derlen = i2d_ECDSA_SIG(norm_sig, &norm_der);
++ ECDSA_SIG_free(norm_sig);
++ if (derlen <= 0)
++ return false;
++
++ // -1 = error, 0 = bad sig, 1 = good
++ bool ret = ECDSA_verify(0, (unsigned char*)&hash, sizeof(hash), norm_der, derlen, pkey) == 1;
++ OPENSSL_free(norm_der);
++ return ret;
+ }
+
+ bool SignCompact(const uint256 &hash, unsigned char *p64, int &rec) {
diff --git a/net-p2p/bitcoind/files/0.9.0-sys_leveldb.patch b/net-p2p/bitcoind/files/0.9.0-sys_leveldb.patch
new file mode 100644
index 00000000000..60e9f2b2094
--- /dev/null
+++ b/net-p2p/bitcoind/files/0.9.0-sys_leveldb.patch
@@ -0,0 +1,34 @@
+commit c38e0af3e021eb0b2aba846c77b06ca71de06b11 (personal-github/sys_leveldb, sys_leveldb)
+Author: Luke Dashjr <luke-jr+git@utopios.org>
+Date: Mon Sep 9 03:06:17 2013 +0000
+
+ configure: Add unsupported --with-system-leveldb configure flag
+
+diff --git a/configure.ac b/configure.ac
+index 3ed4549..5a5852d 100644
+--- a/configure.ac
++++ b/configure.ac
+@@ -332,10 +332,22 @@ AC_TRY_COMPILE([#include <sys/socket.h>],
+ [ AC_MSG_RESULT(no)]
+ )
+
++dnl Check for leveldb, only if explicitly requested
+ LEVELDB_CPPFLAGS=
+ LIBLEVELDB=
+ LIBMEMENV=
+-AM_CONDITIONAL([EMBEDDED_LEVELDB],[true])
++AC_ARG_WITH([system-leveldb],
++ [AS_HELP_STRING([--with-system-leveldb],
++ [Build with system LevelDB (default is no; DANGEROUS; NOT SUPPORTED)])],
++ [system_leveldb=$withval],
++ [system_leveldb=no]
++)
++if test x$system_leveldb != xno; then
++ LEVELDB_CPPFLAGS=
++ LIBLEVELDB=-lleveldb
++ LIBMEMENV=-lmemenv
++fi
++AM_CONDITIONAL([EMBEDDED_LEVELDB],[test x$system_leveldb = xno])
+ AC_SUBST(LEVELDB_CPPFLAGS)
+ AC_SUBST(LIBLEVELDB)
+ AC_SUBST(LIBMEMENV)
diff --git a/net-p2p/bitcoind/files/0.9.x-ljr_noblacklist.patch b/net-p2p/bitcoind/files/0.9.x-ljr_noblacklist.patch
new file mode 100644
index 00000000000..35194662ecd
--- /dev/null
+++ b/net-p2p/bitcoind/files/0.9.x-ljr_noblacklist.patch
@@ -0,0 +1,12 @@
+diff --git a/src/script.cpp b/src/script.cpp
+index 24bbbad..a60d8b6 100644
+--- a/src/script.cpp
++++ b/src/script.cpp
+@@ -1870,6 +1870,7 @@ bool fIsBareMultisigStd = false;
+
+ const char *CScript::IsBlacklisted() const
+ {
++ return false;
+ if (this->size() >= 7 && this->at(0) == OP_DUP)
+ {
+ // pay-to-pubkeyhash
diff --git a/net-p2p/bitcoind/files/9999-syslibs.patch b/net-p2p/bitcoind/files/9999-syslibs.patch
new file mode 100644
index 00000000000..2cdf2ab9837
--- /dev/null
+++ b/net-p2p/bitcoind/files/9999-syslibs.patch
@@ -0,0 +1,243 @@
+diff --git a/build-aux/m4/bitcoin_subdir_to_include.m4 b/build-aux/m4/bitcoin_subdir_to_include.m4
+index 66f106c..5f0a3b1 100644
+--- a/build-aux/m4/bitcoin_subdir_to_include.m4
++++ b/build-aux/m4/bitcoin_subdir_to_include.m4
+@@ -5,7 +5,7 @@ AC_DEFUN([BITCOIN_SUBDIR_TO_INCLUDE],[
+ AC_MSG_RESULT([default])
+ else
+ echo "#include <$2$3.h>" >conftest.cpp
+- newinclpath=`${CXXCPP} ${CPPFLAGS} -M conftest.cpp 2>/dev/null | [ tr -d '\\n\\r\\\\' | sed -e 's/^.*[[:space:]:]\(\/[^[:space:]]*\)]$3[\.h[[:space:]].*$/\1/' -e t -e d`]
++ newinclpath=$(${CXXCPP} ${CPPFLAGS} -M conftest.cpp 2>/dev/null | sed [-E -e ':a' -e '/\\$/!b b' -e N -e 's/\\\n/ /' -e 't a' -e ':b' -e 's/^[^:]*:[[:space:]]*(([^[:space:]\]|\\.)*[[:space:]])*(([^[:space:]\]|\\.)*)]$3\.h[([[:space:]].*)?$/\3/' -e 't' -e d])
+ AC_MSG_RESULT([${newinclpath}])
+ if test "x${newinclpath}" != "x"; then
+ eval "$1=\"\$$1\"' -I${newinclpath}'"
+diff --git a/configure.ac b/configure.ac
+index 37fe47e..14e5c34 100644
+--- a/configure.ac
++++ b/configure.ac
+@@ -170,6 +170,18 @@ AC_ARG_WITH([utils],
+ [build_bitcoin_utils=$withval],
+ [build_bitcoin_utils=yes])
+
++AC_ARG_ENABLE([util-cli],
++ [AS_HELP_STRING([--enable-util-cli],
++ [build bitcoin-cli])],
++ [build_bitcoin_cli=$enableval],
++ [build_bitcoin_cli=$build_bitcoin_utils])
++
++AC_ARG_ENABLE([util-tx],
++ [AS_HELP_STRING([--enable-util-tx],
++ [build bitcoin-tx])],
++ [build_bitcoin_tx=$enableval],
++ [build_bitcoin_tx=$build_bitcoin_utils])
++
+ AC_ARG_WITH([libs],
+ [AS_HELP_STRING([--with-libs],
+ [build libraries (default=yes)])],
+@@ -488,14 +500,65 @@ if test x$use_reduce_exports = xyes; then
+ [AC_MSG_ERROR([Cannot set default symbol visibility. Use --disable-reduce-exports.])])
+ fi
+
++dnl Check for leveldb, only if explicitly requested
+ LEVELDB_CPPFLAGS=
+ LIBLEVELDB=
+ LIBMEMENV=
+-AM_CONDITIONAL([EMBEDDED_LEVELDB],[true])
++AC_ARG_WITH([system-leveldb],
++ [AS_HELP_STRING([--with-system-leveldb],
++ [Build with system LevelDB (default is no; DANGEROUS; NOT SUPPORTED)])],
++ [system_leveldb=$withval],
++ [system_leveldb=no]
++)
++if test x$system_leveldb != xno; then
++ LEVELDB_CPPFLAGS=
++ AC_CHECK_LIB([leveldb],[main],[
++ LIBLEVELDB=-lleveldb
++ ],[
++ AC_MSG_ERROR([leveldb library not found; using --with-system-leveldb is not supported anyway])
++ ])
++ TEMP_LIBS="$LIBS"
++ LIBS="$LIBS $LIBLEVELDB"
++ AC_CHECK_LIB([memenv],[main],[
++ LIBMEMENV=-lmemenv
++ ],[
++ AC_MSG_ERROR([LevelDB's memenv library not found; using --with-system-leveldb is not supported anyway])
++ ])
++ LIBS="$TEMP_LIBS"
++ AC_CHECK_HEADER([leveldb/filter_policy.h],[],[
++ AC_MSG_ERROR([LevelDB headers not found; using --with-system-leveldb is not supported anyway])
++ ])
++ AC_CHECK_HEADER([leveldb/helpers/memenv.h],[
++ AC_MSG_CHECKING([for memenv.h path])
++ BITCOIN_SUBDIR_TO_INCLUDE([LEVELDB_CPPFLAGS],[leveldb/helpers/],[memenv])
++ ],[
++ AC_CHECK_HEADER([memenv.h],[],[
++ AC_MSG_ERROR([LevelDB headers not found; using --with-system-leveldb is not supported anyway])
++ ])
++ ])
++fi
++AM_CONDITIONAL([EMBEDDED_LEVELDB],[test x$system_leveldb = xno])
+ AC_SUBST(LEVELDB_CPPFLAGS)
+ AC_SUBST(LIBLEVELDB)
+ AC_SUBST(LIBMEMENV)
+
++dnl Check for libsecp256k1, only if explicitly requested
++AC_ARG_WITH([system-libsecp256k1],
++ [AS_HELP_STRING([--with-system-libsecp256k1],
++ [Build with system libsecp256k1 (default is no; DANGEROUS; NOT SUPPORTED)])],
++ [system_libsecp256k1=$withval],
++ [system_libsecp256k1=no]
++)
++if test x$system_libsecp256k1 != xno; then
++ PKG_CHECK_MODULES([libsecp256k1],[libsecp256k1],,[true])
++else
++ libsecp256k1_CFLAGS='-I$(srcdir)/secp256k1/include'
++ libsecp256k1_LIBS='secp256k1/libsecp256k1.la'
++fi
++AM_CONDITIONAL([EMBEDDED_LIBSECP256K1],[test x$system_libsecp256k1 = xno])
++AC_SUBST(libsecp256k1_CFLAGS)
++AC_SUBST(libsecp256k1_LIBS)
++
+ if test x$enable_wallet != xno; then
+ dnl Check for libdb_cxx only if wallet enabled
+ BITCOIN_FIND_BDB48
+@@ -515,7 +578,7 @@ BITCOIN_QT_INIT
+ dnl sets $bitcoin_enable_qt, $bitcoin_enable_qt_test, $bitcoin_enable_qt_dbus
+ BITCOIN_QT_CONFIGURE([$use_pkgconfig], [qt4])
+
+-if test x$build_bitcoin_utils$build_bitcoind$bitcoin_enable_qt$use_tests = xnononono; then
++if test x$build_bitcoin_cli$build_bitcoin_tx$build_bitcoind$bitcoin_enable_qt$use_tests = xnonononono; then
+ use_boost=no
+ else
+ use_boost=yes
+@@ -701,9 +764,13 @@ AC_MSG_CHECKING([whether to build bitcoind])
+ AM_CONDITIONAL([BUILD_BITCOIND], [test x$build_bitcoind = xyes])
+ AC_MSG_RESULT($build_bitcoind)
+
+-AC_MSG_CHECKING([whether to build utils (bitcoin-cli bitcoin-tx)])
+-AM_CONDITIONAL([BUILD_BITCOIN_UTILS], [test x$build_bitcoin_utils = xyes])
+-AC_MSG_RESULT($build_bitcoin_utils)
++AC_MSG_CHECKING([whether to build bitcoin-cli])
++AM_CONDITIONAL([BUILD_BITCOIN_CLI], [test x$build_bitcoin_cli = xyes])
++AC_MSG_RESULT($build_bitcoin_cli)
++
++AC_MSG_CHECKING([whether to build bitcoin-tx])
++AM_CONDITIONAL([BUILD_BITCOIN_TX], [test x$build_bitcoin_tx = xyes])
++AC_MSG_RESULT($build_bitcoin_tx)
+
+ AC_MSG_CHECKING([whether to build libraries])
+ AM_CONDITIONAL([BUILD_BITCOIN_LIBS], [test x$build_bitcoin_libs = xyes])
+@@ -826,7 +893,7 @@ else
+ AC_MSG_RESULT([no])
+ fi
+
+-if test x$build_bitcoin_utils$build_bitcoin_libs$build_bitcoind$bitcoin_enable_qt$use_tests = xnonononono; then
++if test x$build_bitcoin_cli$build_bitcoin_tx$build_bitcoin_libs$build_bitcoind$bitcoin_enable_qt$use_tests = xnononononono; then
+ AC_MSG_ERROR([No targets! Please specify at least one of: --with-utils --with-libs --with-daemon --with-gui or --enable-tests])
+ fi
+
+@@ -895,8 +962,10 @@ PKGCONFIG_LIBDIR_TEMP="$PKG_CONFIG_LIBDIR"
+ unset PKG_CONFIG_LIBDIR
+ PKG_CONFIG_LIBDIR="$PKGCONFIG_LIBDIR_TEMP"
+
++if test x$system_libsecp256k1 = xno; then
+ ac_configure_args="${ac_configure_args} --disable-shared --with-pic --with-bignum=no"
+ AC_CONFIG_SUBDIRS([src/secp256k1])
++fi
+
+ AC_OUTPUT
+
+diff --git a/qa/pull-tester/rpc-tests.sh b/qa/pull-tester/rpc-tests.sh
+index 9b31865..5bb187c 100755
+--- a/qa/pull-tester/rpc-tests.sh
++++ b/qa/pull-tester/rpc-tests.sh
+@@ -57,7 +57,7 @@ testScriptsExt=(
+ extArg="-extended"
+ passOn=${@#$extArg}
+
+-if [ "x${ENABLE_BITCOIND}${ENABLE_UTILS}${ENABLE_WALLET}" = "x111" ]; then
++if [ "x${ENABLE_BITCOIND}${ENABLE_CLI}${ENABLE_WALLET}" = "x111" ]; then
+ for (( i = 0; i < ${#testScripts[@]}; i++ ))
+ do
+ if [ -z "$1" ] || [ "${1:0:1}" == "-" ] || [ "$1" == "${testScripts[$i]}" ] || [ "$1.py" == "${testScripts[$i]}" ]
+diff --git a/qa/pull-tester/tests-config.sh.in b/qa/pull-tester/tests-config.sh.in
+index 10f4d33..e0e407d 100755
+--- a/qa/pull-tester/tests-config.sh.in
++++ b/qa/pull-tester/tests-config.sh.in
+@@ -8,7 +8,7 @@ EXEEXT="@EXEEXT@"
+
+ # These will turn into comments if they were disabled when configuring.
+ @ENABLE_WALLET_TRUE@ENABLE_WALLET=1
+-@BUILD_BITCOIN_UTILS_TRUE@ENABLE_UTILS=1
++@BUILD_BITCOIN_CLI_TRUE@ENABLE_CLI=1
+ @BUILD_BITCOIND_TRUE@ENABLE_BITCOIND=1
+
+ REAL_BITCOIND="$BUILDDIR/src/bitcoind${EXEEXT}"
+diff --git a/src/Makefile.am b/src/Makefile.am
+index 1c2f770..4d60ddf 100644
+--- a/src/Makefile.am
++++ b/src/Makefile.am
+@@ -1,4 +1,6 @@
++if EMBEDDED_LIBSECP256K1
+ DIST_SUBDIRS = secp256k1
++endif
+ AM_LDFLAGS = $(PTHREAD_CFLAGS) $(LIBTOOL_LDFLAGS)
+
+
+@@ -20,7 +22,7 @@ endif
+ BITCOIN_CONFIG_INCLUDES=-I$(builddir)/config
+ BITCOIN_INCLUDES=-I$(builddir) -I$(builddir)/obj $(BOOST_CPPFLAGS) $(LEVELDB_CPPFLAGS) $(CRYPTO_CFLAGS) $(SSL_CFLAGS)
+
+-BITCOIN_INCLUDES += -I$(srcdir)/secp256k1/include
++BITCOIN_INCLUDES += $(libsecp256k1_CFLAGS)
+
+ LIBBITCOIN_SERVER=libbitcoin_server.a
+ LIBBITCOIN_WALLET=libbitcoin_wallet.a
+@@ -30,10 +32,16 @@ LIBBITCOIN_UTIL=libbitcoin_util.a
+ LIBBITCOIN_CRYPTO=crypto/libbitcoin_crypto.a
+ LIBBITCOIN_UNIVALUE=univalue/libbitcoin_univalue.a
+ LIBBITCOINQT=qt/libbitcoinqt.a
++if EMBEDDED_LIBSECP256K1
+ LIBSECP256K1=secp256k1/libsecp256k1.la
++else
++LIBSECP256K1=$(libsecp256k1_LIBS)
++endif
+
++if EMBEDDED_LIBSECP256K1
+ $(LIBSECP256K1): $(wildcard secp256k1/src/*) $(wildcard secp256k1/include/*)
+ $(AM_V_at)$(MAKE) $(AM_MAKEFLAGS) -C $(@D) $(@F)
++endif
+
+ # Make is not made aware of per-object dependencies to avoid limiting building parallelization
+ # But to build the less dependent modules first, we manually select their order here:
+@@ -63,8 +71,11 @@ if BUILD_BITCOIND
+ bin_PROGRAMS += bitcoind
+ endif
+
+-if BUILD_BITCOIN_UTILS
+- bin_PROGRAMS += bitcoin-cli bitcoin-tx
++if BUILD_BITCOIN_CLI
++ bin_PROGRAMS += bitcoin-cli
++endif
++if BUILD_BITCOIN_TX
++ bin_PROGRAMS += bitcoin-tx
+ endif
+
+ .PHONY: FORCE
+diff --git a/src/Makefile.test.include b/src/Makefile.test.include
+index 0997148..14b4deb 100644
+--- a/src/Makefile.test.include
++++ b/src/Makefile.test.include
+@@ -111,10 +111,12 @@ bitcoin_test_check: $(TEST_BINARY) FORCE
+ bitcoin_test_clean : FORCE
+ rm -f $(CLEAN_BITCOIN_TEST) $(test_test_bitcoin_OBJECTS) $(TEST_BINARY)
+
++if EMBEDDED_LIBSECP256K1
+ check-local:
+ @echo "Running test/bitcoin-util-test.py..."
+ $(AM_V_at)srcdir=$(srcdir) PYTHONPATH=$(builddir)/test $(srcdir)/test/bitcoin-util-test.py
+ $(AM_V_at)$(MAKE) $(AM_MAKEFLAGS) -C secp256k1 check
++endif
+
+ %.json.h: %.json
+ @$(MKDIR_P) $(@D)
diff --git a/net-p2p/bitcoind/files/bitcoin.conf b/net-p2p/bitcoind/files/bitcoin.conf
new file mode 100644
index 00000000000..c6a55f3d913
--- /dev/null
+++ b/net-p2p/bitcoind/files/bitcoin.conf
@@ -0,0 +1,8 @@
+# http://www.bitcoin.org/smf/index.php?topic=644.0
+#rpcuser=
+#rpcpassword=
+
+
+
+
+
diff --git a/net-p2p/bitcoind/files/bitcoin.confd b/net-p2p/bitcoind/files/bitcoin.confd
new file mode 100644
index 00000000000..7c0868c3f53
--- /dev/null
+++ b/net-p2p/bitcoind/files/bitcoin.confd
@@ -0,0 +1,10 @@
+# Config file for /etc/init.d/bitcoin
+
+# owner of bitcoind process (don't change, must be existing)
+BITCOIN_USER="bitcoin"
+
+# See http://www.bitcoin.org/smf/index.php?topic=1063
+BITCOIN_OPTS="${BITCOIN_OPTS}"
+
+# nice level
+NICELEVEL="19"
diff --git a/net-p2p/bitcoind/files/bitcoin.initd-r1 b/net-p2p/bitcoind/files/bitcoin.initd-r1
new file mode 100644
index 00000000000..79ae6afec2e
--- /dev/null
+++ b/net-p2p/bitcoind/files/bitcoin.initd-r1
@@ -0,0 +1,29 @@
+#!/sbin/runscript
+# Copyright 1999-2014 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+vardir="/var/lib/bitcoin"
+conffile="${vardir}/.bitcoin/bitcoin.conf"
+bitcoind_user="${BITCOIN_USER:-nobody:nobody}"
+
+description="Bitcoin crypto-currency wallet for automated services"
+pidfile="/run/${SVCNAME}.pid"
+command="/usr/bin/bitcoind"
+command_args="${BITCOIN_OPTS}"
+command_background="true"
+start_stop_daemon_args="-u ${bitcoind_user} -e HOME=${vardir} -N ${NICELEVEL:-0} -w 2000"
+
+depend() {
+ need net
+}
+
+start_pre() {
+ checkpath -f -o ${bitcoind_user} -m 0400 ${conffile} || return 1
+
+ if ! grep -q '^rpcpassword=' "${conffile}"; then
+ eerror "Please edit `readlink -f ${conffile}`"
+ eerror "There must be at least a line assigning rpcpassword=something-secure"
+ return 1
+ fi
+}
diff --git a/net-p2p/bitcoind/files/bitcoind.logrotate b/net-p2p/bitcoind/files/bitcoind.logrotate
new file mode 100644
index 00000000000..36d8dc2b134
--- /dev/null
+++ b/net-p2p/bitcoind/files/bitcoind.logrotate
@@ -0,0 +1,7 @@
+/var/lib/bitcoin/.bitcoin/debug.log {
+ weekly
+ sharedscripts
+ postrotate
+ killall -HUP bitcoind
+ endscript
+}
diff --git a/net-p2p/bitcoind/files/bitcoind.logrotate-r1 b/net-p2p/bitcoind/files/bitcoind.logrotate-r1
new file mode 100644
index 00000000000..f9a4702720a
--- /dev/null
+++ b/net-p2p/bitcoind/files/bitcoind.logrotate-r1
@@ -0,0 +1,8 @@
+/var/lib/bitcoin/.bitcoin/debug.log {
+ missingok
+ weekly
+ sharedscripts
+ postrotate
+ killall -HUP bitcoind
+ endscript
+}
diff --git a/net-p2p/bitcoind/files/bitcoind.service b/net-p2p/bitcoind/files/bitcoind.service
new file mode 100644
index 00000000000..97747009294
--- /dev/null
+++ b/net-p2p/bitcoind/files/bitcoind.service
@@ -0,0 +1,30 @@
+# It's not recommended to modify this file in-place, because it will be
+# overwritten during package upgrades. If you want to customize, the
+# best way is to create file
+# "/etc/systemd/system/bitcoind.service.d/*.conf"
+# containing your changes
+
+# For example, if you want to change some daemon and/or unit options,
+# create a file named
+# "/etc/systemd/system/bitcoind.service.d/myopts.conf"
+# containing:
+# [Service]
+# Environment="BITCOIN_OPTS=-debug -logtimestamps"
+# Nice=10
+# This will override the setting appearing below.
+
+# Note that almost all daemon options could be specified in
+# /etc/bitcoin/bitcoin.conf
+
+[Unit]
+Description=Bitcoin Daemon
+After=network.target
+
+[Service]
+User=bitcoin
+Environment=BITCOIN_OPTS=
+ExecStart=/usr/bin/bitcoind -daemon=0 $BITCOIN_OPTS
+ExecReload=/bin/kill -HUP $MAINPID
+
+[Install]
+WantedBy=multi-user.target
diff --git a/net-p2p/bitcoind/metadata.xml b/net-p2p/bitcoind/metadata.xml
new file mode 100644
index 00000000000..288a5b53290
--- /dev/null
+++ b/net-p2p/bitcoind/metadata.xml
@@ -0,0 +1,26 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+ <herd>proxy-maintainers</herd>
+ <maintainer>
+ <email>blueness@gentoo.org</email>
+ <name>Anthony G. Basile</name>
+ </maintainer>
+ <maintainer>
+ <email>luke-jr+gentoobugs@utopios.org</email>
+ <name>Luke Dashjr</name>
+ </maintainer>
+ <use>
+ <flag name='bitcoin_policy_cltv'>Check LockTime Verify policy: Your node will recognise and assist OP_CHECKLOCKTIMEVERIFY (BIP65) transactions</flag>
+ <flag name='bitcoin_policy_cpfp'>Child-Pays-For-Parent policy: If you mine, you will give consideration to child transaction fees to pay for their parents</flag>
+ <flag name='bitcoin_policy_dcmp'>Data Carrier Multi-Push policy: Your node will assist transactions with multiple pushes in their data carrier (if any)</flag>
+ <flag name='bitcoin_policy_rbf'>Replace By Fee policy: Your node will preferentially mine and relay transactions paying the highest fee, regardless of receive order</flag>
+ <flag name='bitcoin_policy_spamfilter'>Enhanced spam filter policy: Notorious spammers will not be assisted by your node</flag>
+ <flag name='ljr'>Enable Luke Dashjr's patches</flag>
+ <flag name='logrotate'>Use app-admin/logrotate for rotating logs</flag>
+ <flag name='upnp'>Enable Universal Plug and Play</flag>
+ <flag name='wallet'>Enable wallet support</flag>
+ <flag name='xt'>Enable Mike Hearn's Bitcoin XT patches</flag>
+ <flag name='zeromq'>Report blocks and transactions via zeromq</flag>
+ </use>
+</pkgmetadata>
diff --git a/net-p2p/bitflu/Manifest b/net-p2p/bitflu/Manifest
new file mode 100644
index 00000000000..a6c48ed58ea
--- /dev/null
+++ b/net-p2p/bitflu/Manifest
@@ -0,0 +1,3 @@
+DIST bitflu-1.50.tgz 161614 SHA256 2ab4756467161105e7756c964a9006d17702104c6996a39e7a17d1bc69d00f07 SHA512 58b79b5b0b2c83ec1526b6edbfdc36d46a932634c28a14ed0520f45a4aaac3a6f5d355bb83b996a4e97b6f985ee59fa2169eb2bff5fa4cf8a5b8403a68ad49bb WHIRLPOOL e925c554a89d819bccd8d96c9d78e7faa8e64196d2bf46016c08aaf953e1970bd8e34b7c4e82c39f1410849e85236a4e1dcb2e8594b7ab8b1e493b8612dcb45c
+DIST bitflu-1.51.tgz 161963 SHA256 7b7c360e9818892bec21cc9cf6ef2ea95e0affff8ca6afb58fa18f788d998dd5 SHA512 60520a1017ca9acf38c74da6daf693258335dbb717dc647d2da0319b025ed216df33e79ec3934579b2b931a66cae2db31e6039e035ea8a529a0773df37d19afe WHIRLPOOL 8ff2220d232ac0b079920bd449a9024d59f807802b9d68456fdba43a91484a4980f0aa90e00164ace65a7066b7d582df2ececd2535061fbb3f3c650353e88201
+DIST bitflu-1.52.tgz 162308 SHA256 3df39ffc285204bd15eab4a5bc1bf2767c0003b7ed1b96f22e4772f228436787 SHA512 fff6d253b57e43a2e5a917e508a864304c19d5c12e965abb74905bee1ecea10f79a3f3b7d7d0c8112bedabe2d42288171397bd03136a1f37c439039971659ebe WHIRLPOOL 878e7090c6759c8533cf94bc1685bf2ef4cb2735a4dcf607890afb4c2090396efe1e91936695286e878f72fb3872b551a16764cd47da19898eeeb861eedf8c88
diff --git a/net-p2p/bitflu/bitflu-1.50.ebuild b/net-p2p/bitflu/bitflu-1.50.ebuild
new file mode 100644
index 00000000000..7977e673e97
--- /dev/null
+++ b/net-p2p/bitflu/bitflu-1.50.ebuild
@@ -0,0 +1,75 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=4
+
+inherit user
+
+DESCRIPTION="BitTorrent client, written in Perl and is designed to run as a daemon"
+HOMEPAGE="http://bitflu.workaround.ch"
+SRC_URI="http://bitflu.workaround.ch/bitflu/${P}.tgz"
+
+LICENSE="Artistic-2 GPL-2"
+SLOT="0"
+KEYWORDS="amd64 x86"
+IUSE=""
+
+DEPEND="
+ dev-perl/Danga-Socket
+ dev-perl/Sys-Syscall"
+RDEPEND="${DEPEND}"
+
+pkg_setup() {
+ enewgroup bitflu
+ enewuser bitflu -1 -1 /var/lib/bitflu bitflu
+}
+
+src_compile() { :; }
+
+PLUGINS="/usr/lib/bitflu"
+HOMEDIR="/var/lib/bitflu"
+CONFDIR="/etc/bitflu"
+LOGDIR="/var/log/bitflu"
+
+src_install() {
+ # executable daemon
+ dosbin bitflu.pl
+
+ # plugins
+ insinto "${PLUGINS}"
+ doins -r plugins
+
+ # working dir
+ dodir "${HOMEDIR}"
+ fowners bitflu:bitflu "${HOMEDIR}"
+ fperms 775 "${HOMEDIR}"
+
+ # config file
+ insinto "${CONFDIR}"
+ fowners bitflu:bitflu "${CONFDIR}"
+ fperms 775 "${CONFDIR}"
+ doins "${FILESDIR}"/bitflu.config
+ fowners bitflu:bitflu "${CONFDIR}"/bitflu.config
+ fperms 664 "${CONFDIR}"/bitflu.config
+
+ # log file
+ dodir "${LOGDIR}"
+ fowners bitflu:bitflu "${LOGDIR}"
+ fperms 775 "${LOGDIR}"
+
+ # docs
+ dodoc bitflu.config.example ChangeLog.txt CONTRIBUTING README_IPv6.txt \
+ README.txt Documentation/bitflu-internals.txt
+
+ newinitd "${FILESDIR}"/bitflu.initd bitflu
+}
+
+pkg_postinst() {
+ ewarn "Note: At startup, or at the user's request, ${PN} (re)reads its"
+ ewarn "configuration file and overwrites it with its own sanitized"
+ ewarn "version. A backup is created in the configuration directory,"
+ ewarn "/etc/${PN}, but that file will subseqently be overwritten if"
+ ewarn "a further backup is made. You may want to keep your own backup."
+ ewarn "A prestine example with comments may be found in /usr/share/doc/${P}."
+}
diff --git a/net-p2p/bitflu/bitflu-1.51.ebuild b/net-p2p/bitflu/bitflu-1.51.ebuild
new file mode 100644
index 00000000000..a10446781ca
--- /dev/null
+++ b/net-p2p/bitflu/bitflu-1.51.ebuild
@@ -0,0 +1,75 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=5
+
+inherit user
+
+DESCRIPTION="BitTorrent client, written in Perl and is designed to run as a daemon"
+HOMEPAGE="http://bitflu.workaround.ch"
+SRC_URI="http://bitflu.workaround.ch/bitflu/${P}.tgz"
+
+LICENSE="Artistic-2 GPL-2"
+SLOT="0"
+KEYWORDS="~amd64 ~x86"
+IUSE=""
+
+DEPEND="
+ dev-perl/Danga-Socket
+ dev-perl/Sys-Syscall"
+RDEPEND="${DEPEND}"
+
+pkg_setup() {
+ enewgroup bitflu
+ enewuser bitflu -1 -1 /var/lib/bitflu bitflu
+}
+
+src_compile() { :; }
+
+PLUGINS="/usr/lib/bitflu"
+HOMEDIR="/var/lib/bitflu"
+CONFDIR="/etc/bitflu"
+LOGDIR="/var/log/bitflu"
+
+src_install() {
+ # executable daemon
+ dosbin bitflu.pl
+
+ # plugins
+ insinto "${PLUGINS}"
+ doins -r plugins
+
+ # working dir
+ dodir "${HOMEDIR}"
+ fowners bitflu:bitflu "${HOMEDIR}"
+ fperms 775 "${HOMEDIR}"
+
+ # config file
+ insinto "${CONFDIR}"
+ fowners bitflu:bitflu "${CONFDIR}"
+ fperms 775 "${CONFDIR}"
+ doins "${FILESDIR}"/bitflu.config
+ fowners bitflu:bitflu "${CONFDIR}"/bitflu.config
+ fperms 664 "${CONFDIR}"/bitflu.config
+
+ # log file
+ dodir "${LOGDIR}"
+ fowners bitflu:bitflu "${LOGDIR}"
+ fperms 775 "${LOGDIR}"
+
+ # docs
+ dodoc bitflu.config.example ChangeLog.txt CONTRIBUTING README_IPv6.txt \
+ README.txt Documentation/bitflu-internals.txt
+
+ newinitd "${FILESDIR}"/bitflu.initd bitflu
+}
+
+pkg_postinst() {
+ ewarn "Note: At startup, or at the user's request, ${PN} (re)reads its"
+ ewarn "configuration file and overwrites it with its own sanitized"
+ ewarn "version. A backup is created in the configuration directory,"
+ ewarn "/etc/${PN}, but that file will subseqently be overwritten if"
+ ewarn "a further backup is made. You may want to keep your own backup."
+ ewarn "A prestine example with comments may be found in /usr/share/doc/${P}."
+}
diff --git a/net-p2p/bitflu/bitflu-1.52.ebuild b/net-p2p/bitflu/bitflu-1.52.ebuild
new file mode 100644
index 00000000000..a10446781ca
--- /dev/null
+++ b/net-p2p/bitflu/bitflu-1.52.ebuild
@@ -0,0 +1,75 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=5
+
+inherit user
+
+DESCRIPTION="BitTorrent client, written in Perl and is designed to run as a daemon"
+HOMEPAGE="http://bitflu.workaround.ch"
+SRC_URI="http://bitflu.workaround.ch/bitflu/${P}.tgz"
+
+LICENSE="Artistic-2 GPL-2"
+SLOT="0"
+KEYWORDS="~amd64 ~x86"
+IUSE=""
+
+DEPEND="
+ dev-perl/Danga-Socket
+ dev-perl/Sys-Syscall"
+RDEPEND="${DEPEND}"
+
+pkg_setup() {
+ enewgroup bitflu
+ enewuser bitflu -1 -1 /var/lib/bitflu bitflu
+}
+
+src_compile() { :; }
+
+PLUGINS="/usr/lib/bitflu"
+HOMEDIR="/var/lib/bitflu"
+CONFDIR="/etc/bitflu"
+LOGDIR="/var/log/bitflu"
+
+src_install() {
+ # executable daemon
+ dosbin bitflu.pl
+
+ # plugins
+ insinto "${PLUGINS}"
+ doins -r plugins
+
+ # working dir
+ dodir "${HOMEDIR}"
+ fowners bitflu:bitflu "${HOMEDIR}"
+ fperms 775 "${HOMEDIR}"
+
+ # config file
+ insinto "${CONFDIR}"
+ fowners bitflu:bitflu "${CONFDIR}"
+ fperms 775 "${CONFDIR}"
+ doins "${FILESDIR}"/bitflu.config
+ fowners bitflu:bitflu "${CONFDIR}"/bitflu.config
+ fperms 664 "${CONFDIR}"/bitflu.config
+
+ # log file
+ dodir "${LOGDIR}"
+ fowners bitflu:bitflu "${LOGDIR}"
+ fperms 775 "${LOGDIR}"
+
+ # docs
+ dodoc bitflu.config.example ChangeLog.txt CONTRIBUTING README_IPv6.txt \
+ README.txt Documentation/bitflu-internals.txt
+
+ newinitd "${FILESDIR}"/bitflu.initd bitflu
+}
+
+pkg_postinst() {
+ ewarn "Note: At startup, or at the user's request, ${PN} (re)reads its"
+ ewarn "configuration file and overwrites it with its own sanitized"
+ ewarn "version. A backup is created in the configuration directory,"
+ ewarn "/etc/${PN}, but that file will subseqently be overwritten if"
+ ewarn "a further backup is made. You may want to keep your own backup."
+ ewarn "A prestine example with comments may be found in /usr/share/doc/${P}."
+}
diff --git a/net-p2p/bitflu/files/bitflu.config b/net-p2p/bitflu/files/bitflu.config
new file mode 100644
index 00000000000..760a9eb350c
--- /dev/null
+++ b/net-p2p/bitflu/files/bitflu.config
@@ -0,0 +1,45 @@
+# Written by Bitflu::Configuration@2835 on Thu Jun 30 07:53:38 2011
+autocancel = 1.5
+autocommit = 1
+autoload_dir = /var/lib/bitflu/autoload
+autoload_scan = 300
+chdir =
+checkversion = 1309395241
+completed_downloads = /var/lib/bitflu/seeding
+downspeed = 0
+history = 1
+http_autoloadtorrent = 1
+http_maxthreads = 10
+incomplete_downloads = /var/lib/bitflu/unfinished
+ipv6 = 1
+kademlia_idseed = 0
+logfile = /var/log/bitflu/bitflu.log
+loglevel = 5
+min_free_mb = 0
+pidfile = /var/run/bitflu/bitflu.pid
+plugindir = /usr/lib/bitflu/plugins
+pluginexclude =
+renice = 8
+storage = StorageVFS
+telnet_bind = 127.0.0.1
+telnet_maxhist = 20
+telnet_port = 4001
+telnet_view = type,name=25,hash,peers,pieces,bytes,percent,ratio,up,down,eta,note
+torrent_bind = 0
+torrent_gcpriority = 5
+torrent_importdir = /var/lib/bitflu/import
+torrent_maxpeers = 80
+torrent_maxreq = 6
+torrent_port = 6688
+torrent_totalpeers = 400
+torrent_tracker_autoudp = 1
+torrent_tracker_udpport = 6689
+torrent_trackerblacklist =
+torrent_upslots = 10
+unshared_downloads = /var/lib/bitflu/removed
+upspeed = 35
+vfs_use_fallocate = 0
+webgui_bind = 127.0.0.1
+webgui_port = 4081
+workdir = /var/lib/bitflu
+# EOF #
diff --git a/net-p2p/bitflu/files/bitflu.initd b/net-p2p/bitflu/files/bitflu.initd
new file mode 100644
index 00000000000..41a1696b0b7
--- /dev/null
+++ b/net-p2p/bitflu/files/bitflu.initd
@@ -0,0 +1,47 @@
+#!/sbin/runscript
+# Copyright 1999-2011 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+DAEMON=/usr/sbin/bitflu.pl
+PIDDIR=/var/run/bitflu
+PIDFILE=${PIDDIR}/bitflu.pid
+CONFFILE=/etc/bitflu/bitflu.config
+
+depend() {
+ need net
+}
+
+checkconfig() {
+ if [ ! -f ${CONFFILE} ]; then
+ eerror "No config file ${CONFFILE}"
+ return 1
+ fi
+
+ if [ ! -d ${PIDDIR} ] && ! mkdir -p ${PIDDIR}; then
+ eerror "Failed to create ${PIDDIR}"
+ return 1
+ fi
+
+ chown bitflu:bitflu ${PIDDIR}
+}
+
+start() {
+ checkconfig || return 1
+ ebegin "Starting bitflu"
+ start-stop-daemon --start --pidfile "${PIDFILE}" --user bitflu:bitflu \
+ --exec "${DAEMON}" -- --config="${CONFFILE}" --daemon -q >/dev/null 2>&1
+ eend $?
+}
+
+stop() {
+ ebegin "Stoping bitflu"
+ start-stop-daemon --stop --pidfile "${PIDFILE}" --exec "${DAEMON}"
+ eend $?
+}
+
+restart() {
+ svc_stop
+ sleep 2
+ svc_start
+}
diff --git a/net-p2p/bitflu/metadata.xml b/net-p2p/bitflu/metadata.xml
new file mode 100644
index 00000000000..3ae07452f61
--- /dev/null
+++ b/net-p2p/bitflu/metadata.xml
@@ -0,0 +1,13 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+ <maintainer>
+ <email>blueness@gentoo.org</email>
+ <name>Anthony G. Basile</name>
+ </maintainer>
+ <longdescription lang="en">
+ Bitflu is a free BitTorrent client. The client was written in Perl and
+ is designed to run as a daemon (7x24h , like mlnet) on Linux, *BSD and
+ maybe even OSX.
+ </longdescription>
+</pkgmetadata>
diff --git a/net-p2p/bittornado/Manifest b/net-p2p/bittornado/Manifest
new file mode 100644
index 00000000000..ffeba603f01
--- /dev/null
+++ b/net-p2p/bittornado/Manifest
@@ -0,0 +1 @@
+DIST BitTornado-0.3.18.tar.gz 189227 SHA256 d9e6ad0bf5b2e9820bab809c5a4fcd94e844a57f396ac51547fe47dbe255d9e0 SHA512 61a55726d93ddb245e18e47f41dea982b8faa7d3296c3a7221d00e0fe71db772613c3ee113bb7df18390807dda8c77859ed7159a03535446ca417a1344e3c0d6 WHIRLPOOL f3393b5907a86c590e7d760760f11e8b671d90c9c8ff14d783904fce688243bd06abf46f6938fc9992f44653198eba99b062c1f19836cb4502ca9569e6b0c598
diff --git a/net-p2p/bittornado/bittornado-0.3.18-r2.ebuild b/net-p2p/bittornado/bittornado-0.3.18-r2.ebuild
new file mode 100644
index 00000000000..18a43a7d40d
--- /dev/null
+++ b/net-p2p/bittornado/bittornado-0.3.18-r2.ebuild
@@ -0,0 +1,55 @@
+# Copyright 1999-2012 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+# note: wxGTK interface has been removed wrt #391685. this ebuild is only for
+# cmdline tools as is.
+
+EAPI=3
+PYTHON_DEPEND=2
+
+inherit distutils eutils
+
+MY_PN=BitTornado
+MY_P=${MY_PN}-${PV}
+
+DESCRIPTION="TheShad0w's experimental BitTorrent client"
+HOMEPAGE="http://www.bittornado.com/"
+SRC_URI="http://download2.bittornado.com/download/${MY_P}.tar.gz"
+LICENSE="MIT"
+SLOT="0"
+
+KEYWORDS="alpha amd64 ppc ppc64 ~sparc x86 ~x86-fbsd ~x86-freebsd ~amd64-linux ~x86-linux ~x86-solaris"
+IUSE=""
+
+RDEPEND="dev-python/pycrypto"
+DEPEND="${RDEPEND}
+ app-arch/unzip
+ >=sys-apps/sed-4.0.5"
+
+S=${WORKDIR}/${MY_PN}-CVS
+PIXMAPLOC=/usr/share/pixmaps/bittornado
+
+pkg_setup() {
+ python_set_active_version 2
+ python_pkg_setup
+}
+
+src_prepare() {
+ # fixes wrong icons path
+ sed -i "s:os.path.abspath(os.path.dirname(os.path.realpath(sys.argv\[0\]))):\"${PIXMAPLOC}/\":" btdownloadgui.py
+ # Needs wxpython-2.6 only, bug #201247
+ epatch "${FILESDIR}"/${P}-wxversion.patch
+
+ python_convert_shebangs -r 2 .
+}
+
+src_install() {
+ distutils_src_install
+
+ # get rid of any reference to the not-installed gui version
+ rm "${ED}"/usr/bin/*gui.py
+
+ newconfd "${FILESDIR}"/bttrack.conf bttrack
+ newinitd "${FILESDIR}"/bttrack.rc bttrack
+}
diff --git a/net-p2p/bittornado/bittornado-0.3.18-r3.ebuild b/net-p2p/bittornado/bittornado-0.3.18-r3.ebuild
new file mode 100644
index 00000000000..78b6ee50e3d
--- /dev/null
+++ b/net-p2p/bittornado/bittornado-0.3.18-r3.ebuild
@@ -0,0 +1,56 @@
+# Copyright 1999-2014 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+# note: wxGTK interface has been removed wrt #391685. this ebuild is only for
+# cmdline tools as is.
+
+EAPI=5
+
+PYTHON_COMPAT=( python2_7 )
+
+inherit distutils-r1 eutils
+
+MY_PN=BitTornado
+MY_P=${MY_PN}-${PV}
+
+DESCRIPTION="TheShad0w's experimental BitTorrent client"
+HOMEPAGE="http://www.bittornado.com/"
+SRC_URI="http://download2.bittornado.com/download/${MY_P}.tar.gz"
+LICENSE="MIT"
+SLOT="0"
+
+KEYWORDS="~alpha ~amd64 ~ppc ~ppc64 ~sparc ~x86 ~x86-fbsd ~x86-freebsd ~amd64-linux ~x86-linux ~x86-solaris"
+IUSE=""
+
+RDEPEND="dev-python/pycrypto[${PYTHON_USEDEP}]"
+DEPEND="${RDEPEND}
+ app-arch/unzip
+ >=sys-apps/sed-4.0.5"
+
+S=${WORKDIR}/${MY_PN}-CVS
+PIXMAPLOC=/usr/share/pixmaps/bittornado
+
+python_prepare_all() {
+ # fixes wrong icons path
+ sed -i "s:os.path.abspath(os.path.dirname(os.path.realpath(sys.argv\[0\]))):\"${PIXMAPLOC}/\":" btdownloadgui.py
+ # Needs wxpython-2.6 only, bug #201247
+ epatch "${FILESDIR}"/${P}-wxversion.patch
+
+ distutils-r1_python_prepare_all
+}
+
+python_install() {
+ distutils-r1_python_install
+
+ # get rid of any reference to the not-installed gui version
+ rm "${ED%/}"/usr/bin/*gui.py || die
+ rm "${ED%/}$(python_get_scriptdir)"/*gui.py || die
+}
+
+python_install_all() {
+ distutils-r1_python_install_all
+
+ newconfd "${FILESDIR}"/bttrack.conf bttrack
+ newinitd "${FILESDIR}"/bttrack.rc bttrack
+}
diff --git a/net-p2p/bittornado/files/bittornado-0.3.18-wxversion.patch b/net-p2p/bittornado/files/bittornado-0.3.18-wxversion.patch
new file mode 100644
index 00000000000..35739630348
--- /dev/null
+++ b/net-p2p/bittornado/files/bittornado-0.3.18-wxversion.patch
@@ -0,0 +1,90 @@
+diff -Naur BitTornado-CVS-orig/btcompletedirgui.py BitTornado-CVS/btcompletedirgui.py
+--- BitTornado-CVS-orig/btcompletedirgui.py 2006-12-23 12:20:52.000000000 -0600
++++ BitTornado-CVS/btcompletedirgui.py 2007-12-04 11:09:36.000000000 -0600
+@@ -19,12 +19,16 @@
+ import sys
+ from os import getcwd
+ from os.path import join
++
+ try:
+- from wxPython.wx import *
+-except:
+- print 'wxPython is either not installed or has not been installed properly.'
++ import wxversion
++ wxversion.select("2.6")
++except Exception, e:
++ print >> sys.stderr, "%s: wxPython 2.6 not installed." %e
+ sys.exit(1)
+
++from wxPython.wx import *
++
+ try:
+ True
+ except:
+diff -Naur BitTornado-CVS-orig/btdownloadgui.py BitTornado-CVS/btdownloadgui.py
+--- BitTornado-CVS-orig/btdownloadgui.py 2007-12-04 11:06:58.000000000 -0600
++++ BitTornado-CVS/btdownloadgui.py 2007-12-04 11:10:36.000000000 -0600
+@@ -18,10 +18,13 @@
+ assert version >= '2', "Install Python 2.0 or greater"
+
+ try:
+- from wxPython.wx import *
+-except:
+- print 'wxPython is either not installed or has not been installed properly.'
+- exit(1)
++ import wxversion
++ wxversion.select("2.6")
++except Exception, e:
++ print >> sys.stderr, "%s: wxPython 2.6 not installed." %e
++ sys.exit(1)
++
++from wxPython.wx import *
+ from BitTornado.download_bt1 import BT1Download, defaults, parse_params, get_usage, get_response
+ from BitTornado.RawServer import RawServer, UPnP_ERROR
+ from random import seed
+diff -Naur BitTornado-CVS-orig/btmaketorrentgui.py BitTornado-CVS/btmaketorrentgui.py
+--- BitTornado-CVS-orig/btmaketorrentgui.py 2006-12-23 12:20:56.000000000 -0600
++++ BitTornado-CVS/btmaketorrentgui.py 2007-12-04 11:11:30.000000000 -0600
+@@ -21,12 +21,16 @@
+ import sys
+ from os import getcwd
+ from os.path import join, isdir
++
+ try:
+- from wxPython.wx import *
+-except:
+- print 'wxPython is either not installed or has not been installed properly.'
++ import wxversion
++ wxversion.select("2.6")
++except Exception, e:
++ print >> sys.stderr, "%s: wxPython 2.6 not installed." %e
+ sys.exit(1)
+
++from wxPython.wx import *
++
+ try:
+ True
+ except:
+diff -Naur BitTornado-CVS-orig/bt-t-make.py BitTornado-CVS/bt-t-make.py
+--- BitTornado-CVS-orig/bt-t-make.py 2006-12-23 12:20:52.000000000 -0600
++++ BitTornado-CVS/bt-t-make.py 2007-12-04 11:14:35.000000000 -0600
+@@ -22,12 +22,16 @@
+ from os import getcwd, listdir
+ from os.path import join, isdir
+ from traceback import print_exc
++
+ try:
+- from wxPython.wx import *
+-except:
+- print 'wxPython is either not installed or has not been installed properly.'
++ import wxversion
++ wxversion.select("2.6")
++except Exception, e:
++ print >> sys.stderr, "%s: wxPython 2.6 not installed." %e
+ sys.exit(1)
+
++from wxPython.wx import *
++
+ try:
+ True
+ except:
diff --git a/net-p2p/bittornado/files/bttrack.conf b/net-p2p/bittornado/files/bttrack.conf
new file mode 100644
index 00000000000..dc86cc1bceb
--- /dev/null
+++ b/net-p2p/bittornado/files/bttrack.conf
@@ -0,0 +1,18 @@
+# /etc/conf.d/bttrack
+# Copyright 1999-2004 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+# Change this to this to the port you would like to connect to for the tracker.
+# It is accessible at http://localhost:PORT/ from any web browser.
+PORT=8082
+
+# where to store recent downloader info
+DFILE=/usr/share/bittorrent/tracker.dfile
+
+# path to favicon.ico which many popular web browsers can use
+FAVICON=/usr/share/bittorrent/favicon.ico
+
+# Connection logs are sent to stdout by default, so they should be sent to a
+# file when using this script.
+LOGFILE=/var/log/bttrack.log
diff --git a/net-p2p/bittornado/files/bttrack.rc b/net-p2p/bittornado/files/bttrack.rc
new file mode 100644
index 00000000000..d08110fe215
--- /dev/null
+++ b/net-p2p/bittornado/files/bttrack.rc
@@ -0,0 +1,23 @@
+#!/sbin/runscript
+# Copyright 1999-2004 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+depend() {
+ need net
+}
+
+start() {
+ ebegin "Starting bttrack"
+ start-stop-daemon --start --quiet --background --make-pidfile \
+ --pidfile /var/run/bttrack.pid \
+ --exec /usr/bin/bttrack.py -- --port ${PORT} \
+ --dfile ${DFILE} --favicon ${FAVICON} --logfile ${LOGFILE}
+ eend $?
+}
+
+stop() {
+ ebegin "Stopping bttrack"
+ start-stop-daemon --stop --quiet --pidfile /var/run/bttrack.pid
+ eend $?
+}
diff --git a/net-p2p/bittornado/metadata.xml b/net-p2p/bittornado/metadata.xml
new file mode 100644
index 00000000000..aa0f3664825
--- /dev/null
+++ b/net-p2p/bittornado/metadata.xml
@@ -0,0 +1,5 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+<herd>net-p2p</herd>
+</pkgmetadata>
diff --git a/net-p2p/bittorrent/Manifest b/net-p2p/bittorrent/Manifest
new file mode 100644
index 00000000000..693530b88e0
--- /dev/null
+++ b/net-p2p/bittorrent/Manifest
@@ -0,0 +1 @@
+DIST BitTorrent-4.4.0.tar.gz 1255281 SHA256 1c9338ed384240258b5733a814670e2dee8ca2fb65babf3f0ca07978707301e0 SHA512 04ac6690fe11225c182c10dd3e7a84b53d84fd795efdc8a8d502835bc1c728a95c6cb12cc42173aadc483eff39bfaaba3df418fc86114c240748631e91d6ddd8 WHIRLPOOL 99e38f8da90e9eadaa0e3d14cc4bf102964443e951da98a423383d5d428b253a736bbee4ed6c4475e8a0ba5456f515e28346c1ea2328b5ed8c642cf50a13b15c
diff --git a/net-p2p/bittorrent/bittorrent-4.4.0-r2.ebuild b/net-p2p/bittorrent/bittorrent-4.4.0-r2.ebuild
new file mode 100644
index 00000000000..bda46fcecfa
--- /dev/null
+++ b/net-p2p/bittorrent/bittorrent-4.4.0-r2.ebuild
@@ -0,0 +1,87 @@
+# Copyright 1999-2012 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI="3"
+
+PYTHON_DEPEND="2:2.5"
+PYTHON_USE_WITH="threads"
+
+# Maintainer note:
+# keep this package at 4.4.0.
+# 5.x - requires wxpython-2.6 which we don't carry
+# 6.x - binary-only non-free crap
+# Fedora has also frozen bittorrent at 4.4.0 and is a good source of patches
+# http://pkgs.fedoraproject.org/gitweb/?p=bittorrent.git
+
+inherit distutils eutils fdo-mime python
+
+MY_P="${P/bittorrent/BitTorrent}"
+
+DESCRIPTION="Tool for distributing files via a distributed network of nodes"
+HOMEPAGE="http://www.bittorrent.com/"
+SRC_URI="http://www.bittorrent.com/dl/${MY_P}.tar.gz"
+
+LICENSE="BitTorrent"
+SLOT="0"
+KEYWORDS="alpha amd64 arm hppa ia64 ppc ppc64 s390 sh sparc x86 ~x86-fbsd ~amd64-linux ~x86-linux ~ppc-macos ~x86-solaris"
+IUSE="aqua gtk"
+
+RDEPEND=">=dev-python/pycrypto-2.0
+ gtk? ( >=x11-libs/gtk+-2.6:2
+ >=dev-python/pygtk-2.6:2 )"
+DEPEND="${RDEPEND}"
+# dev-python/dnspython"
+
+S=${WORKDIR}/${MY_P}
+
+DOCS="README.txt TRACKERLESS.txt"
+PYTHON_MODNAME="BitTorrent khashmir"
+
+pkg_setup() {
+ python_set_active_version 2
+ python_pkg_setup
+}
+
+src_prepare() {
+ distutils_src_prepare
+
+ epatch "${FILESDIR}"/${P}-no-version-check.patch
+ epatch "${FILESDIR}"/${P}-pkidir.patch
+ epatch "${FILESDIR}"/${P}-fastresume.patch
+ epatch "${FILESDIR}"/${P}-pygtk-thread-warnings.patch
+ epatch "${FILESDIR}"/${P}-python26-syntax.patch
+ epatch "${FILESDIR}"/${P}-bencode-float.patch
+ epatch "${FILESDIR}"/${P}-keyerror.patch
+ epatch "${FILESDIR}"/${P}-hashlib.patch
+
+ # fix doc path #109743
+ sed -i -e "/dp.*appdir/ s:appdir:'${PF}':" BitTorrent/platform.py
+}
+
+src_install() {
+ distutils_src_install
+
+ if use gtk; then
+ doicon images/bittorrent.ico
+ domenu "${FILESDIR}"/${PN}.desktop
+ elif use !aqua; then
+ rm -f "${ED}"usr/bin/{bit,make}torrent
+ fi
+
+ insinto /etc/pki/bittorrent/
+ doins public.key
+
+ newinitd "${FILESDIR}"/bittorrent-tracker.initd bittorrent-tracker
+ newconfd "${FILESDIR}"/bittorrent-tracker.confd bittorrent-tracker
+}
+
+pkg_postinst() {
+ distutils_pkg_postinst
+ use gtk && fdo-mime_desktop_database_update
+}
+
+pkg_postrm() {
+ distutils_pkg_postrm
+ use gtk && fdo-mime_desktop_database_update
+}
diff --git a/net-p2p/bittorrent/bittorrent-4.4.0-r3.ebuild b/net-p2p/bittorrent/bittorrent-4.4.0-r3.ebuild
new file mode 100644
index 00000000000..2652019e5e4
--- /dev/null
+++ b/net-p2p/bittorrent/bittorrent-4.4.0-r3.ebuild
@@ -0,0 +1,86 @@
+# Copyright 1999-2014 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=5
+
+PYTHON_COMPAT=( python2_7 )
+PYTHON_REQ_USE='threads'
+
+# Maintainer note:
+# keep this package at 4.4.0.
+# 5.x - requires wxpython-2.6 which we don't carry
+# 6.x - binary-only non-free crap
+# Fedora has also frozen bittorrent at 4.4.0 and is a good source of patches
+# http://pkgs.fedoraproject.org/gitweb/?p=bittorrent.git
+
+inherit distutils-r1 eutils fdo-mime
+
+MY_P="${P/bittorrent/BitTorrent}"
+
+DESCRIPTION="Tool for distributing files via a distributed network of nodes"
+HOMEPAGE="http://www.bittorrent.com/"
+SRC_URI="http://www.bittorrent.com/dl/${MY_P}.tar.gz"
+
+LICENSE="BitTorrent"
+SLOT="0"
+KEYWORDS="~alpha ~amd64 ~arm ~hppa ~ia64 ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86 ~x86-fbsd ~amd64-linux ~x86-linux ~ppc-macos ~x86-solaris"
+IUSE="aqua gtk"
+
+RDEPEND=">=dev-python/pycrypto-2.0[${PYTHON_USEDEP}]
+ gtk? ( >=x11-libs/gtk+-2.6:2
+ >=dev-python/pygtk-2.6:2[${PYTHON_USEDEP}] )"
+DEPEND="${RDEPEND}"
+# dev-python/dnspython"
+
+S=${WORKDIR}/${MY_P}
+
+DOCS=( credits.txt credits-l10n.txt README.txt TRACKERLESS.txt )
+
+python_prepare_all() {
+ epatch "${FILESDIR}"/${P}-no-version-check.patch
+ epatch "${FILESDIR}"/${P}-pkidir.patch
+ epatch "${FILESDIR}"/${P}-fastresume.patch
+ epatch "${FILESDIR}"/${P}-pygtk-thread-warnings.patch
+ epatch "${FILESDIR}"/${P}-python26-syntax.patch
+ epatch "${FILESDIR}"/${P}-bencode-float.patch
+ epatch "${FILESDIR}"/${P}-keyerror.patch
+ epatch "${FILESDIR}"/${P}-hashlib.patch
+
+ # fix doc path #109743
+ sed -i -e "/dp.*appdir/ s:appdir:'${PF}':" BitTorrent/platform.py || die
+
+ distutils-r1_python_prepare_all
+}
+
+python_install() {
+ distutils-r1_python_install
+
+ if ! use gtk && ! use aqua; then
+ rm -f "${ED}"usr/bn/{bit,make}torrent || die
+ rm -f "${D}$(python_get_scriptdir)"/{bit,make}torrent || die
+ fi
+}
+
+python_install_all() {
+ distutils-r1_python_install_all
+
+ if use gtk; then
+ doicon images/bittorrent.ico
+ domenu "${FILESDIR}"/${PN}.desktop
+ fi
+
+ insinto /etc/pki/bittorrent/
+ doins public.key
+
+ newinitd "${FILESDIR}"/bittorrent-tracker.initd bittorrent-tracker
+ newconfd "${FILESDIR}"/bittorrent-tracker.confd bittorrent-tracker
+}
+
+pkg_postinst() {
+ use gtk && fdo-mime_desktop_database_update
+}
+
+pkg_postrm() {
+ use gtk && fdo-mime_desktop_database_update
+}
diff --git a/net-p2p/bittorrent/files/bittorrent-4.4.0-bencode-float.patch b/net-p2p/bittorrent/files/bittorrent-4.4.0-bencode-float.patch
new file mode 100644
index 00000000000..c14a7b668c2
--- /dev/null
+++ b/net-p2p/bittorrent/files/bittorrent-4.4.0-bencode-float.patch
@@ -0,0 +1,75 @@
+Add bencode support for floating point values.
+
+https://bugzilla.redhat.com/451496
+
+--- a/BitTorrent/bencode.py
++++ b/BitTorrent/bencode.py
+@@ -14,6 +14,8 @@ from BitTorrent.obsoletepythonsupport import *
+
+ from BitTorrent import BTFailure
+
++import string
++
+ def decode_int(x, f):
+ f += 1
+ newf = x.index('e', f)
+@@ -25,6 +27,23 @@ def decode_int(x, f):
+ raise ValueError
+ return (n, newf+1)
+
++def assert_finite(n):
++ """Raises ValueError if n is NaN or infinite."""
++
++ valid_chars = '0123456789.-+eE'
++ if repr(n).translate(string.maketrans('',''), valid_chars) != '':
++ raise ValueError('encountered NaN or infinite')
++
++def decode_float(x, f):
++ f += 1
++ newf = x.index('e', f)
++ try:
++ n = float(x[f:newf].replace('E', 'e'))
++ assert_finite(n)
++ except (OverflowError, ValueError):
++ raise ValueError('encountered NaN or infinite')
++ return (n, newf+1)
++
+ def decode_string(x, f):
+ colon = x.index(':', f)
+ n = int(x[f:colon])
+@@ -55,6 +74,7 @@ decode_func = {}
+ decode_func['l'] = decode_list
+ decode_func['d'] = decode_dict
+ decode_func['i'] = decode_int
++decode_func['f'] = decode_float
+ decode_func['0'] = decode_string
+ decode_func['1'] = decode_string
+ decode_func['2'] = decode_string
+@@ -75,7 +95,7 @@ def bdecode(x):
+ raise BTFailure, _("invalid bencoded value (data after valid prefix)")
+ return r
+
+-from types import StringType, IntType, LongType, DictType, ListType, TupleType
++from types import StringType, IntType, LongType, DictType, ListType, TupleType, FloatType
+
+
+ class Bencached(object):
+@@ -91,6 +111,10 @@ def encode_bencached(x,r):
+ def encode_int(x, r):
+ r.extend(('i', str(x), 'e'))
+
++def encode_float(x, r):
++ assert_finite(x)
++ r.extend(('f', repr(x).replace('e', 'E'), 'e'))
++
+ def encode_bool(x, r):
+ if x:
+ encode_int(1, r)
+@@ -119,6 +143,7 @@ encode_func = {}
+ encode_func[Bencached] = encode_bencached
+ encode_func[IntType] = encode_int
+ encode_func[LongType] = encode_int
++encode_func[FloatType] = encode_float
+ encode_func[StringType] = encode_string
+ encode_func[ListType] = encode_list
+ encode_func[TupleType] = encode_list
diff --git a/net-p2p/bittorrent/files/bittorrent-4.4.0-fastresume.patch b/net-p2p/bittorrent/files/bittorrent-4.4.0-fastresume.patch
new file mode 100644
index 00000000000..b282afde170
--- /dev/null
+++ b/net-p2p/bittorrent/files/bittorrent-4.4.0-fastresume.patch
@@ -0,0 +1,23 @@
+"Could not load fastresume data: invalid literal for int() with base 10: '1300250602.1'
+Will perform full hash check."
+
+--- a/BitTorrent/Storage.py
++++ b/BitTorrent/Storage.py
+@@ -213,7 +213,7 @@ class Storage(object):
+ resumefile.write(str(amount_done) + '\n')
+ for x, x, filename in self.ranges:
+ resumefile.write(str(os.path.getsize(filename)) + ' ' +
+- str(os.path.getmtime(filename)) + '\n')
++ str(int(os.path.getmtime(filename))) + '\n')
+
+ def check_fastresume(self, resumefile, return_filelist=False,
+ piece_size=None, numpieces=None, allfiles=None):
+@@ -237,7 +237,7 @@ class Storage(object):
+ else:
+ raise BTFailure(_("Another program appears to have moved, renamed, or deleted the file, "
+ "or %s may have crashed last time it was run.") % app_name)
+- if fsize > 0 and mtime != os.path.getmtime(filename):
++ if fsize > 0 and mtime != int(os.path.getmtime(filename)):
+ raise BTFailure(_("Another program appears to have modified the file, "
+ "or %s may have crashed last time it was run.") % app_name)
+ if size != fsize:
diff --git a/net-p2p/bittorrent/files/bittorrent-4.4.0-hashlib.patch b/net-p2p/bittorrent/files/bittorrent-4.4.0-hashlib.patch
new file mode 100644
index 00000000000..28bfaa76a90
--- /dev/null
+++ b/net-p2p/bittorrent/files/bittorrent-4.4.0-hashlib.patch
@@ -0,0 +1,142 @@
+DeprecationWarning: the sha module is deprecated; use the hashlib module instead
+
+--- a/BitTorrent/ConvertedMetainfo.py
++++ b/BitTorrent/ConvertedMetainfo.py
+@@ -15,7 +15,10 @@ from __future__ import generators
+
+ import os
+ import sys
+-from sha import sha
++try:
++ from hashlib import sha1 as sha
++except ImportError:
++ from sha import sha
+
+ from BitTorrent.obsoletepythonsupport import *
+
+--- a/BitTorrent/NewVersion.py
++++ b/BitTorrent/NewVersion.py
+@@ -15,7 +15,10 @@ import sys
+ import zurllib
+ import pickle
+ import threading
+-from sha import sha
++try:
++ from hashlib import sha1 as sha
++except ImportError:
++ from sha import sha
+
+ DEBUG = False
+
+--- a/BitTorrent/PeerID.py
++++ b/BitTorrent/PeerID.py
+@@ -11,7 +11,10 @@
+ # Written by Matt Chisholm
+
+ import os
+-from sha import sha
++try:
++ from hashlib import sha1 as sha
++except ImportError:
++ from sha import sha
+ from time import time
+ try:
+ getpid = os.getpid
+--- a/BitTorrent/StorageWrapper.py
++++ b/BitTorrent/StorageWrapper.py
+@@ -12,7 +12,10 @@
+
+ from __future__ import division
+
+-from sha import sha
++try:
++ from hashlib import sha1 as sha
++except ImportError:
++ from sha import sha
+ from array import array
+ from binascii import b2a_hex
+
+--- a/BitTorrent/download.py
++++ b/BitTorrent/download.py
+@@ -19,7 +19,10 @@ import sys
+ import threading
+ import errno
+ import gc
+-from sha import sha
++try:
++ from hashlib import sha1 as sha
++except ImportError:
++ from sha import sha
+ from socket import error as socketerror
+ from random import seed
+ from time import time
+--- a/BitTorrent/makemetafile.py
++++ b/BitTorrent/makemetafile.py
+@@ -16,7 +16,10 @@ from __future__ import division
+
+ import os
+ import sys
+-from sha import sha
++try:
++ from hashlib import sha1 as sha
++except ImportError:
++ from sha import sha
+ from time import time
+ from threading import Event
+
+--- a/BitTorrent/parsedir.py
++++ b/BitTorrent/parsedir.py
+@@ -11,7 +11,10 @@
+ # Written by John Hoffman and Uoti Urpala
+
+ import os
+-from sha import sha
++try:
++ from hashlib import sha1 as sha
++except ImportError:
++ from sha import sha
+
+ from BitTorrent.bencode import bencode, bdecode
+ from BitTorrent.btformats import check_message
+--- a/khashmir/khash.py
++++ b/khashmir/khash.py
+@@ -8,7 +8,10 @@
+ # for the specific language governing rights and limitations under the
+ # License.
+
+-from sha import sha
++try:
++ from hashlib import sha1 as sha
++except ImportError:
++ from sha import sha
+ from random import randint
+
+ #this is ugly, hopefully os.entropy will be in 2.4
+--- a/khashmir/khashmir.py
++++ b/khashmir/khashmir.py
+@@ -13,7 +13,10 @@ from socket import gethostbyname
+
+ from BitTorrent.platform import bttime as time
+
+-from sha import sha
++try:
++ from hashlib import sha1 as sha
++except ImportError:
++ from sha import sha
+ import re
+ from BitTorrent.defaultargs import common_options, rare_options
+ from BitTorrent.RawServer_magic import RawServer
+--- a/khashmir/utkhashmir.py
++++ b/khashmir/utkhashmir.py
+@@ -13,7 +13,10 @@ from actions import *
+ from khash import newID
+ from krpc import KRPCProtocolError, KRPCFailSilently
+ from cache import Cache
+-from sha import sha
++try:
++ from hashlib import sha1 as sha
++except ImportError:
++ from sha import sha
+ from util import *
+ from threading import Thread
+ from socket import gethostbyname
diff --git a/net-p2p/bittorrent/files/bittorrent-4.4.0-keyerror.patch b/net-p2p/bittorrent/files/bittorrent-4.4.0-keyerror.patch
new file mode 100644
index 00000000000..c2730d1d004
--- /dev/null
+++ b/net-p2p/bittorrent/files/bittorrent-4.4.0-keyerror.patch
@@ -0,0 +1,15 @@
+Fix bug with error: KeyError: <type 'float'>
+
+https://bugzilla.redhat.com/451496
+
+--- a/BitTorrent/track.py
++++ b/BitTorrent/track.py
+@@ -107,6 +107,8 @@ defaults = [
+ _("scrape access allowed (can be none, specific or full)")),
+ ('max_give', 200,
+ _("maximum number of peers to give with any one request")),
++ ('max_incomplete', 100,
++ _("max number of outgoing incomplete connections")),
+ ('twisted', -1,
+ _("Use Twisted network libraries for network connections. 1 means use twisted, 0 means do not use twisted, -1 means autodetect, and prefer twisted")),
+ ('pid', '/var/run/bittorrent-tracker.pid',
diff --git a/net-p2p/bittorrent/files/bittorrent-4.4.0-no-version-check.patch b/net-p2p/bittorrent/files/bittorrent-4.4.0-no-version-check.patch
new file mode 100644
index 00000000000..b0c20fde497
--- /dev/null
+++ b/net-p2p/bittorrent/files/bittorrent-4.4.0-no-version-check.patch
@@ -0,0 +1,14 @@
+Disable check for new versions.
+
+--- a/BitTorrent/NewVersion.py
++++ b/BitTorrent/NewVersion.py
+@@ -128,6 +128,9 @@ class Updater(object):
+
+
+ def get(self):
++ self.debug('Skipping version check')
++ return
++
+ try:
+ self.get_available()
+ except BTFailure, e:
diff --git a/net-p2p/bittorrent/files/bittorrent-4.4.0-pkidir.patch b/net-p2p/bittorrent/files/bittorrent-4.4.0-pkidir.patch
new file mode 100644
index 00000000000..98f9f81c177
--- /dev/null
+++ b/net-p2p/bittorrent/files/bittorrent-4.4.0-pkidir.patch
@@ -0,0 +1,13 @@
+Install public key in standard place.
+
+--- a/BitTorrent/NewVersion.py
++++ b/BitTorrent/NewVersion.py
+@@ -163,7 +163,7 @@ class Updater(object):
+ self.threadwrap(self.errorfunc, WARNING, '\n'.join(terrors))
+
+ if torrentfile and signature:
+- public_key_file = open(os.path.join(doc_root, 'public.key'), 'rb')
++ public_key_file = open('/etc/pki/bittorrent/public.key', 'rb')
+ public_key = pickle.load(public_key_file)
+ h = sha(torrentfile).digest()
+ if public_key.verify(h, signature):
diff --git a/net-p2p/bittorrent/files/bittorrent-4.4.0-pygtk-thread-warnings.patch b/net-p2p/bittorrent/files/bittorrent-4.4.0-pygtk-thread-warnings.patch
new file mode 100644
index 00000000000..c4a232622de
--- /dev/null
+++ b/net-p2p/bittorrent/files/bittorrent-4.4.0-pygtk-thread-warnings.patch
@@ -0,0 +1,81 @@
+GtkDeprecationWarning: gtk.threads_leave is deprecated, use gtk.gdk.threads_leave instead
+
+--- a/BitTorrent/GUI.py
++++ b/BitTorrent/GUI.py
+@@ -25,9 +25,9 @@ from BitTorrent import app_name, FAQ_URL, languages, language_names
+ from BitTorrent.platform import image_root, read_language_file, write_language_file
+
+ def lock_wrap(function, *args):
+- gtk.threads_enter()
++ gtk.gdk.threads_enter()
+ function(*args)
+- gtk.threads_leave()
++ gtk.gdk.threads_leave()
+
+ def gtk_wrap(function, *args):
+ gobject.idle_add(lock_wrap, function, *args)
+@@ -377,10 +377,10 @@ class AutoScrollingWindow(ScrolledWindow):
+
+ def scroll_and_wait(self, amount, lock_held):
+ if not lock_held:
+- gtk.threads_enter()
++ gtk.gdk.threads_enter()
+ self.scroll_by(0, amount)
+ if not lock_held:
+- gtk.threads_leave()
++ gtk.gdk.threads_leave()
+ if self.vscrolltimeout is not None:
+ gobject.source_remove(self.vscrolltimeout)
+ self.vscrolltimeout = gobject.timeout_add(100, self.scroll_and_wait, amount, False)
+--- a/bittorrent.py
++++ b/bittorrent.py
+@@ -2742,7 +2742,7 @@ class DownloadInfoFrame(object):
+ if self.config['start_minimized']:
+ self.mainwindow.iconify()
+
+- gtk.threads_enter()
++ gtk.gdk.threads_enter()
+
+ self.mainwindow.set_border_width(0)
+
+@@ -2942,7 +2942,7 @@ class DownloadInfoFrame(object):
+
+ self.nag()
+
+- gtk.threads_leave()
++ gtk.gdk.threads_leave()
+
+ def window_event(self, widget, event, *args):
+ if event.changed_mask == gtk.gdk.WINDOW_STATE_ICONIFIED:
+@@ -3758,14 +3758,14 @@ class MainLoop:
+ self.mainwindow = None
+ self.started = 0
+
+- gtk.threads_init()
++ gtk.gdk.threads_init()
+
+ def set_mainwindow(self, mainwindow):
+ self.mainwindow = mainwindow
+
+ def run(self):
+ self.mainwindow.traythread.start()
+- gtk.threads_enter()
++ gtk.gdk.threads_enter()
+
+ if self.mainwindow:
+ self.mainwindow.ssbutton.set_paused(self.mainwindow.config['pause'])
+@@ -3777,12 +3777,12 @@ class MainLoop:
+ self.started = 1
+ gtk.main()
+ except KeyboardInterrupt:
+- gtk.threads_leave()
++ gtk.gdk.threads_leave()
+ if self.mainwindow:
+ self.mainwindow.torrentqueue.set_done()
+ raise
+
+- gtk.threads_leave()
++ gtk.gdk.threads_leave()
+
+ def quit(self):
+ if self.mainwindow:
diff --git a/net-p2p/bittorrent/files/bittorrent-4.4.0-python26-syntax.patch b/net-p2p/bittorrent/files/bittorrent-4.4.0-python26-syntax.patch
new file mode 100644
index 00000000000..1ad8751528f
--- /dev/null
+++ b/net-p2p/bittorrent/files/bittorrent-4.4.0-python26-syntax.patch
@@ -0,0 +1,45 @@
+Fix syntax errors with python 2.6.
+
+https://bugs.gentoo.org/265784
+
+--- a/khashmir/inserter.py
++++ b/khashmir/inserter.py
+@@ -28,7 +28,6 @@ def d(n):
+ done = done+1
+
+ if __name__=="__main__":
+- global done
+ host, port = sys.argv[1:]
+ x = UTKhashmir("", 22038, "/tmp/cgcgcgc")
+ x.addContact(host, int(port))
+--- a/khashmir/test_krpc.py
++++ b/khashmir/test_krpc.py
+@@ -44,20 +44,20 @@ class KRPCTests(TestCase):
+ self.r = RawServer(Event(), d)
+
+ addr = ('127.0.0.1', 1180)
+- self.as = self.r.create_udpsocket(addr[1], addr[0], True)
++ self.asock = self.r.create_udpsocket(addr[1], addr[0], True)
+ self.af = Receiver(addr)
+- self.a = hostbroker(self.af, addr, self.as, self.r.add_task)
+- self.r.start_listening_udp(self.as, self.a)
++ self.a = hostbroker(self.af, addr, self.asock, self.r.add_task)
++ self.r.start_listening_udp(self.asock, self.a)
+
+ addr = ('127.0.0.1', 1181)
+- self.bs = self.r.create_udpsocket(addr[1], addr[0], True)
++ self.bsock = self.r.create_udpsocket(addr[1], addr[0], True)
+ self.bf = Receiver(addr)
+- self.b = hostbroker(self.bf, addr, self.bs, self.r.add_task)
+- self.r.start_listening_udp(self.bs, self.b)
++ self.b = hostbroker(self.bf, addr, self.bsock, self.r.add_task)
++ self.r.start_listening_udp(self.bsock, self.b)
+
+ def tearDown(self):
+- self.as.close()
+- self.bs.close()
++ self.asock.close()
++ self.bsock.close()
+
+ def testSimpleMessage(self):
+ self.noisy = 0
diff --git a/net-p2p/bittorrent/files/bittorrent-tracker.confd b/net-p2p/bittorrent/files/bittorrent-tracker.confd
new file mode 100644
index 00000000000..71e29cb861c
--- /dev/null
+++ b/net-p2p/bittorrent/files/bittorrent-tracker.confd
@@ -0,0 +1,15 @@
+# /etc/conf.d/bittorrent-tracker: config file for /etc/init.d/bittorrent-tracker
+
+# Change this to this to the port you would like to connect to for the tracker.
+# It is accessible at http://localhost:PORT/ from any web browser.
+PORT=8082
+
+# where to store recent downloader info
+DFILE=/usr/share/bittorrent/tracker.dfile
+
+# path to favicon.ico which many popular web browsers can use
+FAVICON=/usr/share/pixmaps/bittorrent.ico
+
+# Connection logs are sent to stdout by default, so they should be sent to a
+# file when using this script.
+LOGFILE=/var/log/bttrack.log
diff --git a/net-p2p/bittorrent/files/bittorrent-tracker.initd b/net-p2p/bittorrent/files/bittorrent-tracker.initd
new file mode 100644
index 00000000000..49de33bb912
--- /dev/null
+++ b/net-p2p/bittorrent/files/bittorrent-tracker.initd
@@ -0,0 +1,23 @@
+#!/sbin/runscript
+# Copyright 1999-2006 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+depend() {
+ need net
+}
+
+start() {
+ ebegin "Starting bttrack"
+ start-stop-daemon --start --quiet --background --make-pidfile \
+ --pidfile /var/run/bttrack.pid \
+ --exec /usr/bin/bittorrent-tracker -- --port ${PORT} \
+ --dfile ${DFILE} --favicon ${FAVICON} --logfile ${LOGFILE}
+ eend $?
+}
+
+stop() {
+ ebegin "Stopping bttrack"
+ start-stop-daemon --stop --quiet --pidfile /var/run/bttrack.pid
+ eend $?
+}
diff --git a/net-p2p/bittorrent/files/bittorrent.desktop b/net-p2p/bittorrent/files/bittorrent.desktop
new file mode 100644
index 00000000000..a6a5312d439
--- /dev/null
+++ b/net-p2p/bittorrent/files/bittorrent.desktop
@@ -0,0 +1,10 @@
+[Desktop Entry]
+Name=BitTorrent File Transfer
+Comment=Distributed download of files from the Internet
+Exec=bittorrent
+Icon=/usr/share/pixmaps/bittorrent.ico
+Terminal=false
+Type=Application
+StartupNotify=true
+Categories=Network;FileTransfer;P2P;
+MimeType=application/x-bittorrent;
diff --git a/net-p2p/bittorrent/metadata.xml b/net-p2p/bittorrent/metadata.xml
new file mode 100644
index 00000000000..2a0f322b939
--- /dev/null
+++ b/net-p2p/bittorrent/metadata.xml
@@ -0,0 +1,9 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+ <herd>net-p2p</herd>
+ <maintainer>
+ <email>rhill@gentoo.org</email>
+ <name>Ryan Hill</name>
+ </maintainer>
+</pkgmetadata>
diff --git a/net-p2p/btpd/Manifest b/net-p2p/btpd/Manifest
new file mode 100644
index 00000000000..ae5aca141e5
--- /dev/null
+++ b/net-p2p/btpd/Manifest
@@ -0,0 +1 @@
+DIST btpd-0.15.tar.gz 144706 SHA256 c2229244c3cb370ac95560e2e9ff7f5d094612ee2b2a1e36237ec7f27707db9d
diff --git a/net-p2p/btpd/btpd-0.15.ebuild b/net-p2p/btpd/btpd-0.15.ebuild
new file mode 100644
index 00000000000..13c60546bdf
--- /dev/null
+++ b/net-p2p/btpd/btpd-0.15.ebuild
@@ -0,0 +1,30 @@
+# Copyright 1999-2012 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+DESCRIPTION="BitTorrent client consisting of a daemon and client"
+HOMEPAGE="http://www.murmeldjur.se/btpd/"
+SRC_URI="http://www.murmeldjur.se/btpd/${P}.tar.gz http://people.su.se/~rnyberg/btpd/${P}.tar.gz"
+
+LICENSE="BSD"
+SLOT="0"
+KEYWORDS="~amd64 ~x86"
+IUSE=""
+
+RDEPEND="net-misc/curl
+ dev-libs/openssl"
+DEPEND="${RDEPEND}"
+
+# for the init.d script; this should probably be fixed not to require
+# this so that it can work on G/FBSD too.
+RDEPEND="${RDEPEND}
+ virtual/shadow"
+
+src_install() {
+ emake DESTDIR="${D}" install || die "emake install failed"
+
+ newinitd "${FILESDIR}/initd_btpd" btpd || die
+ newconfd "${FILESDIR}/confd_btpd" btpd || die
+
+ dodoc CHANGES COPYRIGHT README || die
+}
diff --git a/net-p2p/btpd/files/confd_btpd b/net-p2p/btpd/files/confd_btpd
new file mode 100644
index 00000000000..a7318f64d09
--- /dev/null
+++ b/net-p2p/btpd/files/confd_btpd
@@ -0,0 +1,5 @@
+# owner of btpd process (must be existing)
+#BTPDUSER="p2p"
+
+# Extra arguments for btpd
+#BTPDEXTRARGS="-p 43729"
diff --git a/net-p2p/btpd/files/initd_btpd b/net-p2p/btpd/files/initd_btpd
new file mode 100644
index 00000000000..02505e95252
--- /dev/null
+++ b/net-p2p/btpd/files/initd_btpd
@@ -0,0 +1,79 @@
+#!/sbin/runscript
+# Copyright 1999-2006 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+BTPDUSERHOME=`getent passwd ${BTPDUSER} | cut -d : -f 6`
+BTPDHOME=${BTPDUSERHOME}/.btpd
+BTPDSTARTUPLOG=${BTPDHOME}/startup.log
+
+depend() {
+ need net
+}
+
+checkconfig() {
+ if [ -z ${BTPDUSER} ]; then
+
+ eerror "Must edit /etc/conf.d/btpd first."
+ return 1
+
+ elif [ -z "`getent passwd ${BTPDUSER}`" ]; then
+
+ eerror "Check /etc/conf.d/btpd's \${BTPDUSER}. '${BTPDUSER}' doesn't exist."
+ return 1
+ fi
+}
+
+start() {
+
+ ebegin "Starting BitTorrent Protocol Daemon"
+ checkconfig || return 1
+
+ if pgrep -u ${BTPDUSER} btpd >/dev/null; then
+ eerror "An instance of btpd is already running"
+ return 1
+ else
+ su ${BTPDUSER} -c "btpd ${BTPDEXTRARGS}"
+
+ sleep 2
+
+ if ! pgrep -u ${BTPDUSER} btpd > /dev/null; then
+ eerror "BitTorrent Protocol Daemon couldn't be started ! Check logfile: ${BTPDSTARTUPLOG}"
+ return 1
+ fi
+ fi
+
+ eend $?
+}
+
+stop() {
+ checkconfig || return 1
+
+ local retries=0
+
+ ebegin "Stopping BitTorrent Protocol Daemon"
+ while [ -n "`pgrep -u ${BTPDUSER} btpd`" ] && [ ${retries} -lt 4 ]; do
+ if test ${retries} -eq 0; then
+ su ${BTPDUSER} -c "btcli kill"
+ else
+ kill -9 "`pgrep -u ${BTPDUSER} btpd`"
+ fi
+
+ sleep 1
+ retries=$(( $retries + 1 ))
+ done
+
+ if [ ${retries} -lt 4 ]; then
+ return 0
+ else
+ eerror "Unable to stop btpd"
+ return 1
+ fi
+
+ eend $?
+}
+
+restart() {
+ svc_stop
+ sleep 3
+ svc_start
+}
diff --git a/net-p2p/btpd/metadata.xml b/net-p2p/btpd/metadata.xml
new file mode 100644
index 00000000000..5050ab75173
--- /dev/null
+++ b/net-p2p/btpd/metadata.xml
@@ -0,0 +1,10 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+ <herd>net-p2p</herd>
+ <herd>proxy-maintainers</herd>
+ <maintainer>
+ <email>ricardo.cordeiro@iscte.pt</email>
+ <name> Ricardo Cordeiro</name>
+ </maintainer>
+</pkgmetadata>
diff --git a/net-p2p/classified-ads/Manifest b/net-p2p/classified-ads/Manifest
new file mode 100644
index 00000000000..8cf07eb8b18
--- /dev/null
+++ b/net-p2p/classified-ads/Manifest
@@ -0,0 +1,4 @@
+DIST classified-ads-0.07.tar.gz 2194177 SHA256 882874da2d1610d64c952969222b9295bab59b519de8a7da69790805fecca394 SHA512 a42e9604ce922968b0d7f345d623b250dae39fad2f43648b996ab10f3e7941ec3de95e89d94f4ec28bba882cf2bd38ea28aac88885522a7375926aee3c5d0843 WHIRLPOOL a797387e0f8537ab5366c55554c8909d656436122c3cbf2b35c7c8cc989a8cf76c3f0d6d39a99ac54e0b7cbcd8063dd1a4ec3a99b320f243338081f665f3b933
+DIST classified-ads-0.07_p20150728.tar.gz 2197413 SHA256 e8d488b6c44b198bf1150c7a33ae698887cfb345cb4473d91a5949abeb846d95 SHA512 1cb42252ab695e90212d05144255a66b0d8dc63d8d010b5781e470a4c5e9cdf9c4dce1b9e44cba83d5fb2fef99e3d46fd5cc1b9880db69c9c163475b7e4349fc WHIRLPOOL 458d3947f00709c633d652b753b7801496479f610da0d249e8e2f5f7ddecb341fb885184c027b453aa2f9db7998a74fcbd60bbb9d0bb5765b7b7e45bcdcfc2c0
+DIST classified-ads-graphics-0.07.tar.gz 340476 SHA256 12bd4f581f82c4c805bbf19cc794f7462f9ec0e71358fbc1628fd872169295e2 SHA512 c59f65f37a8e4dddb753dbcdec835e946d9de021c5273319b3cd95ef1c3343715ce4b87d76b2d96264acc791a6cced32967521c74978131bd76fbcfc37bb344d WHIRLPOOL 2535170cdc4cc1d4ad2e204e85b546089b3aa404e4cee0e2ab9d094d6cda869043f24fba29d6f68b37f450ff947c13f02336e63b3236b404cbae528f801cc1ad
+DIST classified-ads-graphics-0.07_p20150728.tar.gz 340476 SHA256 12bd4f581f82c4c805bbf19cc794f7462f9ec0e71358fbc1628fd872169295e2 SHA512 c59f65f37a8e4dddb753dbcdec835e946d9de021c5273319b3cd95ef1c3343715ce4b87d76b2d96264acc791a6cced32967521c74978131bd76fbcfc37bb344d WHIRLPOOL 2535170cdc4cc1d4ad2e204e85b546089b3aa404e4cee0e2ab9d094d6cda869043f24fba29d6f68b37f450ff947c13f02336e63b3236b404cbae528f801cc1ad
diff --git a/net-p2p/classified-ads/classified-ads-0.07.ebuild b/net-p2p/classified-ads/classified-ads-0.07.ebuild
new file mode 100644
index 00000000000..31a937f74a6
--- /dev/null
+++ b/net-p2p/classified-ads/classified-ads-0.07.ebuild
@@ -0,0 +1,86 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=5
+PLOCALES="en fi sv"
+PLOCALE_BACKUP="en"
+inherit qt4-r2
+
+DESCRIPTION="Program for displaying classified advertisement items"
+HOMEPAGE="http://katiska.org/classified-ads/"
+SRC_URI="https://github.com/operatornormal/classified-ads/archive/${PV}.tar.gz \
+ -> classified-ads-${PV}.tar.gz \
+ https://github.com/operatornormal/classified-ads/blob/graphics/preprocessed.tar.gz?raw=true \
+ -> classified-ads-graphics-${PV}.tar.gz"
+
+LICENSE="LGPL-2.1"
+SLOT="0"
+KEYWORDS="~amd64 ~x86"
+
+IUSE="debug doc test"
+
+DEPEND="dev-libs/openssl:0
+ dev-libs/qjson
+ >=net-libs/libnatpmp-20130911
+ <=net-libs/libnatpmp-20140401-r1
+ >=net-libs/miniupnpc-1.8
+ sys-apps/file
+ dev-qt/qtgui:4[debug?]
+ test? ( dev-libs/libgcrypt:0
+ dev-qt/qttest:4
+ sys-devel/gdb:0 )
+ doc? ( app-doc/doxygen[dot] )"
+RDEPEND="dev-libs/openssl:0
+ dev-libs/qjson
+ >=net-libs/libnatpmp-20130911
+ <=net-libs/libnatpmp-20140401-r1
+ >=net-libs/miniupnpc-1.8
+ sys-apps/file
+ dev-qt/qtgui:4[debug?]"
+
+src_prepare() {
+ # preprocessed graphics are unpacked into wrong directory
+ # so lets move them into correct location:
+ mv ../ui/* ui/ || die
+ # then just run qmake
+ qt4-r2_src_prepare
+}
+
+src_compile() {
+ qt4-r2_src_compile
+ if use doc; then
+ cd doc || die
+ doxygen || die
+ fi
+}
+
+src_test() {
+ cd test || die "test suite missing"
+ qmake || die "test suite configure failed"
+ make
+
+ if [ -e $HOME/.classified_ads/sqlite_db ]; then
+ mv $HOME/.classified_ads/sqlite_db $HOME/.classified_ads/sqlite_db.backup \
+ || die "datafile backup failed"
+ fi
+ ./testca
+ result=$?
+ rm $HOME/.classified_ads/sqlite_db || true
+
+ if [ -e $HOME/.classified_ads/sqlite_db.backup ]; then
+ mv $HOME/.classified_ads/sqlite_db.backup $HOME/.classified_ads/sqlite_db \
+ || die "datafile restore failed"
+ fi
+
+ if [ $result != "0" ]; then
+ die "test failed with code $result"
+ fi
+
+ return $result
+}
+
+src_install() {
+ emake install INSTALL_ROOT="${D}"
+ use doc && dodoc -r doc/doxygen.generated/html/
+}
diff --git a/net-p2p/classified-ads/classified-ads-0.07_p20150728.ebuild b/net-p2p/classified-ads/classified-ads-0.07_p20150728.ebuild
new file mode 100644
index 00000000000..eaf67d4ad29
--- /dev/null
+++ b/net-p2p/classified-ads/classified-ads-0.07_p20150728.ebuild
@@ -0,0 +1,82 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=5
+PLOCALES="en fi sv"
+PLOCALE_BACKUP="en"
+inherit qt4-r2 vcs-snapshot
+
+COMMIT_ID="dd2017f3be9d5d68d5fb85af2d626424b3e712e0"
+DESCRIPTION="Program for displaying classified advertisement items"
+HOMEPAGE="http://katiska.org/classified-ads/"
+SRC_URI="https://github.com/operatornormal/classified-ads/archive/${COMMIT_ID}.tar.gz -> ${P}.tar.gz \
+ https://github.com/operatornormal/classified-ads/blob/graphics/preprocessed.tar.gz?raw=true \
+ -> classified-ads-graphics-${PV}.tar.gz"
+
+LICENSE="LGPL-2.1"
+SLOT="0"
+KEYWORDS="~amd64 ~x86"
+
+IUSE="debug doc test"
+
+RDEPEND="dev-libs/openssl:0
+ dev-libs/qjson
+ >=net-libs/libnatpmp-20130911
+ <=net-libs/libnatpmp-20140401-r1
+ >=net-libs/miniupnpc-1.8
+ sys-apps/file
+ dev-qt/qtgui:4[debug?]"
+
+DEPEND="${RDEPEND}
+ dev-qt/qttest:4
+ sys-devel/gdb:0
+ doc? ( app-doc/doxygen[dot] )
+ test? ( dev-libs/libgcrypt:0 )
+ "
+
+src_prepare() {
+ # preprocessed graphics are unpacked into wrong directory
+ # so lets move them into correct location:
+ mv ../classified-ads-graphics-${PV}/* ui/ || die
+ # then just run qmake
+ qt4-r2_src_prepare
+}
+
+src_compile() {
+ qt4-r2_src_compile
+ if use doc; then
+ cd doc || die
+ doxygen || die
+ fi
+}
+
+src_test() {
+ cd test || die "test suite missing"
+ qmake || die "test suite configure failed"
+ emake
+
+ if [ -e $HOME/.classified_ads/sqlite_db ]; then
+ mv $HOME/.classified_ads/sqlite_db $HOME/.classified_ads/sqlite_db.backup \
+ || die "datafile backup failed"
+ fi
+ ./testca
+ result=$?
+ rm $HOME/.classified_ads/sqlite_db || true
+
+ if [ -e $HOME/.classified_ads/sqlite_db.backup ]; then
+ mv $HOME/.classified_ads/sqlite_db.backup $HOME/.classified_ads/sqlite_db \
+ || die "datafile restore failed"
+ fi
+
+ if [ $result != "0" ]; then
+ die "test failed with code $result"
+ fi
+
+ return $result
+}
+
+src_install() {
+ emake install INSTALL_ROOT="${D}"
+ use doc && dodoc -r doc/doxygen.generated/html/
+}
diff --git a/net-p2p/classified-ads/metadata.xml b/net-p2p/classified-ads/metadata.xml
new file mode 100644
index 00000000000..ee823cc1d09
--- /dev/null
+++ b/net-p2p/classified-ads/metadata.xml
@@ -0,0 +1,38 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+ <herd>proxy-maintainers</herd>
+ <maintainer>
+ <email>idella4@gentoo.org</email>
+ </maintainer>
+ <maintainer>
+ <email>antti.jarvinen@katiska.org</email>
+ <name>Antti Järvinen</name>
+ <description>proxy maintainer</description>
+ </maintainer>
+ <longdescription lang="en">
+ Classified ads is an attempt to re-produce parts of the functionality
+ that went away when Usenet news ceased to exist. This attempt tries to
+ fix the problem of disappearing news-servers so that there is no servers
+ required and no service-providers needed for any operation ;
+ data storage is implemented inside client applications that
+ users are running. Features of the program currently include:
+
+ * Posting of ads online. Ads have a category ; there are some
+ pre-defined categories but more can be invented just by typing
+ over the suggested categories.
+ * Replying to ads either in public or privately to operator.
+ * (Small-sized) binary attachments to posts.
+ * Providing basic data of operators - data that operator may enter
+ himself, or leave blank.
+ * Basic searching of content based on words.
+ </longdescription>
+ <upstream>
+ <maintainer status="active">
+ <email>antti.jarvinen@katiska.org</email>
+ </maintainer>
+ <changelog>https://github.com/operatornormal/classified-ads/commits/master</changelog>
+ <bugs-to>https://github.com/operatornormal/classified-ads/issues</bugs-to>
+ <remote-id type="github">operatornormal/classified-ads</remote-id>
+ </upstream>
+</pkgmetadata>
diff --git a/net-p2p/createtorrent/Manifest b/net-p2p/createtorrent/Manifest
new file mode 100644
index 00000000000..a36c3794de2
--- /dev/null
+++ b/net-p2p/createtorrent/Manifest
@@ -0,0 +1 @@
+DIST createtorrent-1.1.4.tar.gz 80605 SHA256 5bb8ae4cc450406afe06609ed4d29a3531ab1a65f519668c5fdbc2eab0b922af SHA512 d15c6d38e90a2941c578396fafaaa1778d5ce597681e0db89189b5c6719e8b69202dd6bb9dd2c279ef939eef8a74dd8e7ca3f0c224a5a4eaa277c3fd9543c24f WHIRLPOOL c7e52a689a4db24df2e92f4b5892d4505f92a7006c5709d8d2654b9ddf8b2258f97a0ff5f97e30cd51f6e7e9b6ee78fdfd0c1be0e394a6670d56c62964c088bd
diff --git a/net-p2p/createtorrent/createtorrent-1.1.4.ebuild b/net-p2p/createtorrent/createtorrent-1.1.4.ebuild
new file mode 100644
index 00000000000..a13e47b312d
--- /dev/null
+++ b/net-p2p/createtorrent/createtorrent-1.1.4.ebuild
@@ -0,0 +1,29 @@
+# Copyright 1999-2014 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+inherit autotools eutils
+
+DESCRIPTION="Create BitTorrent files easily"
+HOMEPAGE="http://www.createtorrent.com/"
+SRC_URI="http://www.createtorrent.com/${P}.tar.gz"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="amd64 ~ppc ~ppc64 ~x86"
+IUSE=""
+
+RDEPEND="dev-libs/openssl"
+DEPEND="${RDEPEND}"
+
+src_unpack() {
+ unpack ${A}
+ cd "${S}"
+ sed -i "s:[[]ssl[]]:[crypto]:" configure.in || die "sed failed..."
+ eautoreconf
+}
+
+src_install() {
+ emake DESTDIR="${D}" install || die "emake install failed."
+ dodoc AUTHORS ChangeLog NEWS README
+}
diff --git a/net-p2p/createtorrent/metadata.xml b/net-p2p/createtorrent/metadata.xml
new file mode 100644
index 00000000000..aa0f3664825
--- /dev/null
+++ b/net-p2p/createtorrent/metadata.xml
@@ -0,0 +1,5 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+<herd>net-p2p</herd>
+</pkgmetadata>
diff --git a/net-p2p/ctcs/Manifest b/net-p2p/ctcs/Manifest
new file mode 100644
index 00000000000..cd67210a507
--- /dev/null
+++ b/net-p2p/ctcs/Manifest
@@ -0,0 +1 @@
+DIST ctcs-1.4.1.tar.gz 27384 SHA256 9614e88d07c6b128677d4d2638a4a05ae00812ec5157ae0788012abed3172355
diff --git a/net-p2p/ctcs/ctcs-1.4.1.ebuild b/net-p2p/ctcs/ctcs-1.4.1.ebuild
new file mode 100644
index 00000000000..5816d820be0
--- /dev/null
+++ b/net-p2p/ctcs/ctcs-1.4.1.ebuild
@@ -0,0 +1,20 @@
+# Copyright 1999-2013 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+DESCRIPTION="interface for monitoring and managing Enhanced CTorrent clients"
+HOMEPAGE="http://www.rahul.net/dholmes/ctorrent/ctcs.html"
+SRC_URI="http://www.rahul.net/dholmes/ctorrent/${P}.tar.gz"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="amd64 ppc x86"
+IUSE=""
+
+RDEPEND="dev-lang/perl
+ >=net-p2p/ctorrent-3.3.1"
+
+src_install() {
+ dobin ctcs || die
+ dodoc readme.txt
+}
diff --git a/net-p2p/ctcs/metadata.xml b/net-p2p/ctcs/metadata.xml
new file mode 100644
index 00000000000..aa0f3664825
--- /dev/null
+++ b/net-p2p/ctcs/metadata.xml
@@ -0,0 +1,5 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+<herd>net-p2p</herd>
+</pkgmetadata>
diff --git a/net-p2p/ctorrent/Manifest b/net-p2p/ctorrent/Manifest
new file mode 100644
index 00000000000..65fb60f7669
--- /dev/null
+++ b/net-p2p/ctorrent/Manifest
@@ -0,0 +1 @@
+DIST ctorrent-dnh3.3.2.tar.gz 219053 SHA256 c87366c91475931f75b924119580abd06a7b3cb3f00fef47346552cab1e24863 SHA512 e59b2b899b8603e42a5754d5ce65f661b135b8e107140e0472af379b2b06ee2985239ed0ebf19dcaef788e617b99eac35ad32ad2d10352e2fcf5a6dc084d27dd WHIRLPOOL e89518e8fccd27e91027b954e0a25367536ebab1d91a959d51229a6779cdd0649154536df61316b88c4d9f236af90e0638d81df5c56d8230a4081a35604dc910
diff --git a/net-p2p/ctorrent/ctorrent-3.3.2-r2.ebuild b/net-p2p/ctorrent/ctorrent-3.3.2-r2.ebuild
new file mode 100644
index 00000000000..751caa55c09
--- /dev/null
+++ b/net-p2p/ctorrent/ctorrent-3.3.2-r2.ebuild
@@ -0,0 +1,32 @@
+# Copyright 1999-2014 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI="2"
+
+inherit eutils
+
+MY_P="${PN}-dnh${PV}"
+
+DESCRIPTION="Enhanced CTorrent is a BitTorrent console client written in C and C++"
+HOMEPAGE="http://www.rahul.net/dholmes/ctorrent/"
+SRC_URI="mirror://sourceforge/dtorrent/${MY_P}.tar.gz"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="amd64 arm ppc ~s390 ~sh ~sparc x86 ~x86-fbsd"
+IUSE=""
+
+S=${WORKDIR}/${MY_P}
+
+DEPEND="dev-libs/openssl"
+
+src_prepare() {
+ epatch "${FILESDIR}"/${PN}-CVE-2009-1759.patch
+ epatch "${FILESDIR}"/${P}-negative-ints.patch
+}
+
+src_install() {
+ emake DESTDIR="${D}" install || die
+ dodoc AUTHORS ChangeLog README-DNH.TXT README NEWS
+}
diff --git a/net-p2p/ctorrent/files/ctorrent-3.3.2-negative-ints.patch b/net-p2p/ctorrent/files/ctorrent-3.3.2-negative-ints.patch
new file mode 100644
index 00000000000..c3f98c713d0
--- /dev/null
+++ b/net-p2p/ctorrent/files/ctorrent-3.3.2-negative-ints.patch
@@ -0,0 +1,17 @@
+allow negative integers ... should fix random "error, initial meta info failed"
+
+https://sourceforge.net/tracker/?func=detail&aid=3159066&group_id=202532&atid=981959
+
+--- ctorrent-dnh3.3.2/bencode.cpp
++++ ctorrent-dnh3.3.2/bencode.cpp
+@@ -44,6 +44,10 @@
+ p++; len--;
+ }
+
++ if( *p == '-'){
++ p++; len--;
++ }
++
+ for(psave = p; len && isdigit(*p); p++,len--) ;
+
+ if(!len || MAX_INT_SIZ < (p - psave) || *p != endchar) return 0;
diff --git a/net-p2p/ctorrent/files/ctorrent-CVE-2009-1759.patch b/net-p2p/ctorrent/files/ctorrent-CVE-2009-1759.patch
new file mode 100644
index 00000000000..196703099f6
--- /dev/null
+++ b/net-p2p/ctorrent/files/ctorrent-CVE-2009-1759.patch
@@ -0,0 +1,364 @@
+Patch for CVE-2009-1759.
+Source: Upstream SVN, rev 302 from the drorrent-3 branch.
+
+Index: bencode.h
+===================================================================
+--- bencode.h (revision 300)
++++ bencode.h (revision 302)
+@@ -25,7 +25,7 @@
+ size_t decode_list(const char *b,size_t len,const char *keylist);
+ size_t decode_rev(const char *b,size_t len,const char *keylist);
+ size_t decode_query(const char *b,size_t len,const char *keylist,const char **ps,size_t *pi,int64_t *pl,int method);
+-size_t decode_list2path(const char *b, size_t n, char *pathname);
++size_t decode_list2path(const char *b, size_t n, char *pathname, size_t maxlen);
+ size_t bencode_buf(const char *str,size_t len,FILE *fp);
+ size_t bencode_str(const char *str, FILE *fp);
+ size_t bencode_int(const uint64_t integer, FILE *fp);
+Index: bencode.cpp
+===================================================================
+--- bencode.cpp (revision 300)
++++ bencode.cpp (revision 302)
+@@ -233,22 +233,28 @@
+ return bencode_end_dict_list(fp);
+ }
+
+-size_t decode_list2path(const char *b, size_t n, char *pathname)
++size_t decode_list2path(const char *b, size_t n, char *pathname, size_t maxlen)
+ {
+ const char *pb = b;
+ const char *s = (char *) 0;
++ const char *endmax = pathname + maxlen - 1;
+ size_t r,q;
+
+ if( 'l' != *pb ) return 0;
+ pb++;
+ n--;
+ if( !n ) return 0;
+- for(; n;){
++ while( n && pathname < endmax ){
+ if(!(r = buf_str(pb, n, &s, &q)) ) return 0;
++ if( q >= maxlen ) return 0;
+ memcpy(pathname, s, q);
+ pathname += q;
+- pb += r; n -= r;
+- if( 'e' != *pb ){*pathname = PATH_SP, pathname++;} else break;
++ maxlen -= q;
++ pb += r;
++ n -= r;
++ if( 'e' == *pb ) break;
++ if( pathname >= endmax ) return 0;
++ *pathname++ = PATH_SP;
+ }
+ *pathname = '\0';
+ return (pb - b + 1);
+Index: btfiles.cpp
+===================================================================
+--- btfiles.cpp (revision 300)
++++ btfiles.cpp (revision 302)
+@@ -449,7 +449,8 @@
+ return 0;
+ }
+
+-int btFiles::BuildFromMI(const char *metabuf, const size_t metabuf_len, const char *saveas)
++int btFiles::BuildFromMI(const char *metabuf, const size_t metabuf_len,
++ const char *saveas, unsigned char exam_only)
+ {
+ char path[MAXPATHLEN];
+ const char *s, *p;
+@@ -458,11 +459,19 @@
+ int f_warned = 0;
+
+ if( !decode_query(metabuf, metabuf_len, "info|name", &s, &q, (int64_t*)0,
+- QUERY_STR) || MAXPATHLEN <= q )
++ QUERY_STR) || MAXPATHLEN <= q ){
++ errno = EINVAL;
+ return -1;
++ }
+
+ memcpy(path, s, q);
+ path[q] = '\0';
++ if( !exam_only &&
++ (PATH_SP == path[0] || '/' == path[0] || 0==strncmp("..", path, 2)) ){
++ CONSOLE.Warning(1, "error, unsafe path \"%s\" in torrent data", path);
++ errno = EINVAL;
++ return -1;
++ }
+
+ r = decode_query(metabuf, metabuf_len, "info|files", (const char**)0, &q,
+ (int64_t*)0, QUERY_POS);
+@@ -471,21 +480,31 @@
+ BTFILE *pbf_last = (BTFILE*) 0;
+ BTFILE *pbf = (BTFILE*) 0;
+ size_t dl;
++ unsigned long nfiles = 0;
++
+ if( decode_query(metabuf,metabuf_len,"info|length",
+- (const char**) 0,(size_t*) 0,(int64_t*) 0,QUERY_LONG) )
++ (const char**) 0,(size_t*) 0,(int64_t*) 0,QUERY_LONG) ){
++ errno = EINVAL;
+ return -1;
++ }
+
+ if( saveas ){
+ m_directory = new char[strlen(saveas) + 1];
+ #ifndef WINDOWS
+- if(!m_directory) return -1;
++ if( !m_directory ){
++ errno = ENOMEM;
++ return -1;
++ }
+ #endif
+ strcpy(m_directory,saveas);
+ }else{
+ int f_conv;
+ char *tmpfn = new char[strlen(path)*2+5];
+ #ifndef WINDOWS
+- if( !tmpfn ) return -1;
++ if( !tmpfn ){
++ errno = ENOMEM;
++ return -1;
++ }
+ #endif
+ if( f_conv = ConvertFilename(tmpfn, path, strlen(path)*2+5) ){
+ if( arg_flg_convert_filenames ){
+@@ -493,6 +512,7 @@
+ #ifndef WINDOWS
+ if( !m_directory ){
+ delete []tmpfn;
++ errno = ENOMEM;
+ return -1;
+ }
+ #endif
+@@ -507,7 +527,10 @@
+ if( !f_conv || !arg_flg_convert_filenames ){
+ m_directory = new char[strlen(path) + 1];
+ #ifndef WINDOWS
+- if( !m_directory ) return -1;
++ if( !m_directory ){
++ errno = ENOMEM;
++ return -1;
++ }
+ #endif
+ strcpy(m_directory,path);
+ }
+@@ -517,24 +540,50 @@
+ p = metabuf + r + 1;
+ q--;
+ for(; q && 'e' != *p; p += dl, q -= dl){
+- if(!(dl = decode_dict(p, q, (const char*) 0)) ) return -1;
+- if( !decode_query(p, dl, "length", (const char**) 0,
+- (size_t*) 0,&t,QUERY_LONG) ) return -1;
++ if( !(dl = decode_dict(p, q, (const char*) 0)) ||
++ !decode_query(p, dl, "length", (const char**) 0, (size_t*) 0, &t,
++ QUERY_LONG) ){
++ errno = EINVAL;
++ return -1;
++ }
+ pbf = _new_bfnode();
+ #ifndef WINDOWS
+- if( !pbf ) return -1;
++ if( !pbf ){
++ errno = ENOMEM;
++ return -1;
++ }
+ #endif
++ nfiles++;
+ pbf->bf_length = t;
+ m_total_files_length += t;
+ r = decode_query(p, dl, "path", (const char **)0, &n, (int64_t*)0,
+ QUERY_POS);
+- if( !r ) return -1;
+- if(!decode_list2path(p + r, n, path)) return -1;
++ if( !r || !decode_list2path(p + r, n, path, sizeof(path)) ){
++ CONSOLE.Warning(1,
++ "error, invalid path in torrent data for file %lu at offset %llu",
++ nfiles, m_total_files_length - t);
++ delete pbf;
++ errno = EINVAL;
++ return -1;
++ }
++ if( !exam_only &&
++ (PATH_SP == path[0] || '/' == path[0] || 0==strncmp("..", path, 2)) ){
++ CONSOLE.Warning(1,
++ "error, unsafe path \"%s\" in torrent data for file %lu",
++ path, nfiles);
++ delete pbf;
++ errno = EINVAL;
++ return -1;
++ }
+
++
+ int f_conv;
+ char *tmpfn = new char[strlen(path)*2+5];
+ #ifndef WINDOWS
+- if( !tmpfn ) return -1;
++ if( !tmpfn ){
++ errno = ENOMEM;
++ return -1;
++ }
+ #endif
+ if( f_conv = ConvertFilename(tmpfn, path, strlen(path)*2+5) ){
+ if( arg_flg_convert_filenames ){
+@@ -542,6 +591,7 @@
+ #ifndef WINDOWS
+ if( !pbf->bf_filename ){
+ delete []tmpfn;
++ errno = ENOMEM;
+ return -1;
+ }
+ #endif
+@@ -556,7 +606,10 @@
+ if( !f_conv || !arg_flg_convert_filenames ){
+ pbf->bf_filename = new char[strlen(path) + 1];
+ #ifndef WINDOWS
+- if( !pbf->bf_filename ) return -1;
++ if( !pbf->bf_filename ){
++ errno = ENOMEM;
++ return -1;
++ }
+ #endif
+ strcpy(pbf->bf_filename, path);
+ }
+@@ -564,30 +617,42 @@
+ pbf_last = pbf;
+ }
+ }else{
+- if( !decode_query(metabuf,metabuf_len,"info|length",
+- (const char**) 0,(size_t*) 0,&t,QUERY_LONG) )
++ if( !decode_query(metabuf,metabuf_len, "info|length",
++ (const char**)0, (size_t*) 0, &t, QUERY_LONG) ){
++ errno = EINVAL;
+ return -1;
++ }
+ m_btfhead = _new_bfnode();
+ #ifndef WINDOWS
+- if( !m_btfhead) return -1;
++ if( !m_btfhead ){
++ errno = ENOMEM;
++ return -1;
++ }
+ #endif
+ m_btfhead->bf_length = m_total_files_length = t;
+ if( saveas ){
+ m_btfhead->bf_filename = new char[strlen(saveas) + 1];
+ #ifndef WINDOWS
+- if(!m_btfhead->bf_filename ) return -1;
++ if( !m_btfhead->bf_filename ){
++ errno = ENOMEM;
++ return -1;
++ }
+ #endif
+ strcpy(m_btfhead->bf_filename, saveas);
+ }else if( arg_flg_convert_filenames ){
+ char *tmpfn = new char[strlen(path)*2+5];
+ #ifndef WINDOWS
+- if( !tmpfn ) return -1;
++ if( !tmpfn ){
++ errno = ENOMEM;
++ return -1;
++ }
+ #endif
+ ConvertFilename(tmpfn, path, strlen(path)*2+5);
+ m_btfhead->bf_filename = new char[strlen(tmpfn) + 1];
+ #ifndef WINDOWS
+ if( !m_btfhead->bf_filename ){
+ delete []tmpfn;
++ errno = ENOMEM;
+ return -1;
+ }
+ #endif
+@@ -596,7 +661,10 @@
+ }else{
+ m_btfhead->bf_filename = new char[strlen(path) + 1];
+ #ifndef WINDOWS
+- if(!m_btfhead->bf_filename ) return -1;
++ if( !m_btfhead->bf_filename ){
++ errno = ENOMEM;
++ return -1;
++ }
+ #endif
+ strcpy(m_btfhead->bf_filename, path);
+ }
+@@ -694,6 +762,32 @@
+ size_t btFiles::FillMetaInfo(FILE* fp)
+ {
+ BTFILE *p;
++ const char *refname, *s;
++ char path[MAXPATHLEN];
++
++ refname = m_directory ? m_directory : m_btfhead->bf_filename;
++ while( (s = strchr(refname, PATH_SP)) && *(s + 1) ){
++ refname = s + 1;
++ }
++ if( m_directory && '.' == *refname ){
++ char dir[MAXPATHLEN];
++ if( getcwd(dir, sizeof(dir)) && 0==chdir(m_directory) ){
++ if( getcwd(path, sizeof(path)) ){
++ refname = path;
++ while( (s = strchr(refname, PATH_SP)) && *(s + 1) ){
++ refname = s + 1;
++ }
++ }
++ chdir(dir);
++ }
++ }
++ if( '/' == *refname || '\0' == *refname || '.' == *refname ){
++ CONSOLE.Warning(1, "error, inappropriate file or directory name \"%s\"",
++ m_directory ? m_directory : m_btfhead->bf_filename);
++ errno = EINVAL;
++ return 0;
++ }
++
+ if( m_directory ){
+ // multi files
+ if( bencode_str("files", fp) != 1 ) return 0;
+@@ -715,16 +809,15 @@
+ if(bencode_end_dict_list(fp) != 1 ) return 0;
+
+ if(bencode_str("name", fp) != 1) return 0;
+- return bencode_str(m_directory, fp);
+-
++ return bencode_str(refname, fp);
+ }else{
+ if( bencode_str("length", fp) != 1 ) return 0;
+ if( bencode_int(m_btfhead->bf_length, fp) != 1) return 0;
+
+ if( bencode_str("name", fp) != 1 ) return 0;
+- return bencode_str(m_btfhead->bf_filename, fp);
++ return bencode_str(refname, fp);
+ }
+- return 1;
++ return 0;
+ }
+
+
+Index: btcontent.cpp
+===================================================================
+--- btcontent.cpp (revision 300)
++++ btcontent.cpp (revision 302)
+@@ -357,7 +357,11 @@
+
+ cfg_req_queue_length = (m_piece_length / cfg_req_slice_size) * 2 - 1;
+
+- if( m_btfiles.BuildFromMI(b, flen, saveas) < 0 ) ERR_RETURN();
++ if( m_btfiles.BuildFromMI(b, flen, saveas, arg_flg_exam_only) < 0 ){
++ if( EINVAL == errno )
++ CONSOLE.Warning(1, "Torrent metainfo file data is invalid or unusable.");
++ ERR_RETURN();
++ }
+
+ delete []b;
+ b = (char *)0;
+Index: btfiles.h
+===================================================================
+--- btfiles.h (revision 300)
++++ btfiles.h (revision 302)
+@@ -61,7 +61,7 @@
+
+ int BuildFromFS(const char *pathname);
+ int BuildFromMI(const char *metabuf, const size_t metabuf_len,
+- const char *saveas);
++ const char *saveas, unsigned char exam_only);
+
+ char *GetDataName() const;
+ uint64_t GetTotalLength() const { return m_total_files_length; }
diff --git a/net-p2p/ctorrent/metadata.xml b/net-p2p/ctorrent/metadata.xml
new file mode 100644
index 00000000000..41020ae5888
--- /dev/null
+++ b/net-p2p/ctorrent/metadata.xml
@@ -0,0 +1,8 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+ <herd>net-p2p</herd>
+ <upstream>
+ <remote-id type="sourceforge">dtorrent</remote-id>
+ </upstream>
+</pkgmetadata>
diff --git a/net-p2p/datacoin-hp/datacoin-hp-9999.ebuild b/net-p2p/datacoin-hp/datacoin-hp-9999.ebuild
new file mode 100644
index 00000000000..a69cbe83ae6
--- /dev/null
+++ b/net-p2p/datacoin-hp/datacoin-hp-9999.ebuild
@@ -0,0 +1,123 @@
+# Copyright 1999-2014 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=5
+
+DB_VER="4.8"
+
+inherit bash-completion-r1 git-2 eutils db-use systemd user
+
+MyPV="${PV/_/-}"
+MyPN="${PN/-hp/d}"
+MyP="primecoin-${MyPV}"
+
+DESCRIPTION="High-performance version of datacoin (primecoin-hp fork)"
+HOMEPAGE="https://github.com/foo1inge/datacoin-hp"
+EGIT_REPO_URI="https://github.com/foo1inge/${PN}.git"
+
+LICENSE="MIT"
+SLOT="0"
+KEYWORDS=""
+IUSE="examples upnp ipv6 examples logrotate hardened"
+
+RDEPEND="
+ dev-libs/boost[threads(+)]
+ dev-libs/openssl:0[-bindist]
+ upnp? (
+ net-libs/miniupnpc
+ )
+ sys-libs/db:$(db_ver_to_slot "${DB_VER}")[cxx]
+ <=dev-libs/leveldb-1.12.0[-snappy]
+"
+DEPEND="${RDEPEND}
+ >=app-shells/bash-4.1
+ sys-apps/sed
+ net-p2p/bitcoind
+"
+
+S="${WORKDIR}/${MyP}-linux/src"
+
+src_prepare() {
+ epatch "${FILESDIR}"/${PN}-sys_leveldb.patch
+ rm -r src/leveldd
+
+ if has_version '>=dev-libs/boost-1.52'; then
+ sed -i 's/\(-l db_cxx\)/-l boost_chrono$(BOOST_LIB_SUFFIX) \1/' src/makefile.unix
+ fi
+}
+
+pkg_setup() {
+ local UG="${PN}"
+ enewgroup "${UG}"
+ enewuser "${UG}" -1 -1 /var/lib/datacoin "${UG}"
+}
+
+src_configure() {
+ OPTS=()
+
+ OPTS+=("DEBUGFLAGS=")
+ OPTS+=("CXXFLAGS=${CXXFLAGS}")
+ OPTS+=("LDFLAGS=${LDFLAGS}")
+
+ if use upnp; then
+ OPTS+=("USE_UPNP=1")
+ else
+ OPTS+=("USE_UPNP=")
+ fi
+
+ use ipv6 || OPTS+=("USE_IPV6=0")
+
+ use hardened || OPTS+=("PIE=1")
+
+ OPTS+=("USE_SYSTEM_LEVELDB=1")
+ OPTS+=("BDB_INCLUDE_PATH=$(db_includedir "${DB_VER}")")
+ OPTS+=("BDB_LIB_SUFFIX=-${DB_VER}")
+
+ cd src || die
+ emake CC="$(tc-getCC)" CXX="$(tc-getCXX)" -f makefile.unix "${OPTS[@]}" ${MyPN}
+}
+
+#Tests are broken with and without our primecoin-sys_leveldb.patch.
+#When tests work, make sure to inherit toolchain-funcs
+#src_test() {
+# cd src || die
+# emake CC="$(tc-getCC)" CXX="$(tc-getCXX)" -f makefile.unix "${OPTS[@]}" test_primecoin
+# ./test_primecoin || die 'Tests failed'
+#}
+
+src_install() {
+ dobin src/${MyPN}
+
+ insinto /etc/datacoin
+ doins "${FILESDIR}/datacoin.conf"
+ fowners ${PN}:${PN} /etc/datacoin/datacoin.conf
+ fperms 600 /etc/datacoin/datacoin.conf
+
+ newconfd "${FILESDIR}/datacoin.confd" ${PN}
+ newinitd "${FILESDIR}/datacoin.initd" ${PN}
+ systemd_dounit "${FILESDIR}/datacoin.service"
+
+ keepdir /var/lib/datacoin/.datacoin
+ fperms 700 /var/lib/datacoin
+ fowners ${PN}:${PN} /var/lib/datacoin/
+ fowners ${PN}:${PN} /var/lib/datacoin/.datacoin
+ dosym /etc/datacoin/datacoin.conf /var/lib/datacoin/.datacoin/datacoin.conf
+
+ dodoc doc/README.md doc/release-notes.md
+ newman contrib/debian/manpages/bitcoind.1 ${MyPN}.1
+ newman contrib/debian/manpages/bitcoin.conf.5 datacoin.conf.5
+
+ sed -i -e 's/bitcoin/datacoin-hp/g' contrib/bitcoind.bash-completion
+ newbashcomp contrib/bitcoind.bash-completion ${PN}.bash-completion
+
+ if use examples; then
+ docinto examples
+ dodoc -r contrib/{bitrpc,pyminer,spendfrom,tidy_datadir.sh,wallettools}
+ fi
+
+ if use logrotate; then
+ insinto /etc/logrotate.d
+ newins "${FILESDIR}/datacoind.logrotate" ${MyPN}
+ fi
+}
diff --git a/net-p2p/datacoin-hp/files/datacoin-hp-sys_leveldb.patch b/net-p2p/datacoin-hp/files/datacoin-hp-sys_leveldb.patch
new file mode 100644
index 00000000000..2f85d6a1199
--- /dev/null
+++ b/net-p2p/datacoin-hp/files/datacoin-hp-sys_leveldb.patch
@@ -0,0 +1,179 @@
+diff --git a/datacoin-qt.pro b/datacoin-qt.pro
+index f531607..df0ecc4 100644
+--- a/datacoin-qt.pro
++++ b/datacoin-qt.pro
+@@ -4,7 +4,7 @@ macx:TARGET = "Datacoin-Qt"
+ VERSION = 0.8.3
+ INCLUDEPATH += src src/json src/qt
+ QT += network
+-DEFINES += QT_GUI BOOST_THREAD_USE_LIB BOOST_SPIRIT_THREADSAFE
++DEFINES += QT_GUI BOOST_THREAD_USE_LIB BOOST_SPIRIT_THREADSAFE LEVELDB_WITHOUT_MEMENV
+ CONFIG += no_include_pwd
+ CONFIG += thread
+
+@@ -104,25 +104,29 @@ contains(BITCOIN_NEED_QT_PLUGINS, 1) {
+ QTPLUGIN += qcncodecs qjpcodecs qtwcodecs qkrcodecs qtaccessiblewidgets
+ }
+
++contains(USE_SYSTEM_LEVELDB, 1) {
++ LIBS += -lleveldb
++} else {
+ INCLUDEPATH += src/leveldb/include src/leveldb/helpers
+-LIBS += $$PWD/src/leveldb/libleveldb.a $$PWD/src/leveldb/libmemenv.a
++LIBS += $$PWD/src/leveldb/libleveldb.a
+ !win32 {
+ # we use QMAKE_CXXFLAGS_RELEASE even without RELEASE=1 because we use RELEASE to indicate linking preferences not -O preferences
+- genleveldb.commands = cd $$PWD/src/leveldb && CC=$$QMAKE_CC CXX=$$QMAKE_CXX $(MAKE) OPT=\"$$QMAKE_CXXFLAGS $$QMAKE_CXXFLAGS_RELEASE\" libleveldb.a libmemenv.a
++ genleveldb.commands = cd $$PWD/src/leveldb && CC=$$QMAKE_CC CXX=$$QMAKE_CXX $(MAKE) OPT=\"$$QMAKE_CXXFLAGS $$QMAKE_CXXFLAGS_RELEASE\" libleveldb.a
+ } else {
+ # make an educated guess about what the ranlib command is called
+ isEmpty(QMAKE_RANLIB) {
+ QMAKE_RANLIB = $$replace(QMAKE_STRIP, strip, ranlib)
+ }
+ LIBS += -lshlwapi
+- genleveldb.commands = cd $$PWD/src/leveldb && CC=$$QMAKE_CC CXX=$$QMAKE_CXX TARGET_OS=OS_WINDOWS_CROSSCOMPILE $(MAKE) OPT=\"$$QMAKE_CXXFLAGS $$QMAKE_CXXFLAGS_RELEASE\" libleveldb.a libmemenv.a && $$QMAKE_RANLIB $$PWD/src/leveldb/libleveldb.a && $$QMAKE_RANLIB $$PWD/src/leveldb/libmemenv.a
++ genleveldb.commands = cd $$PWD/src/leveldb && CC=$$QMAKE_CC CXX=$$QMAKE_CXX TARGET_OS=OS_WINDOWS_CROSSCOMPILE $(MAKE) OPT=\"$$QMAKE_CXXFLAGS $$QMAKE_CXXFLAGS_RELEASE\" libleveldb.a && $$QMAKE_RANLIB $$PWD/src/leveldb/libleveldb.a
+ }
+ genleveldb.target = $$PWD/src/leveldb/libleveldb.a
+ genleveldb.depends = FORCE
+ PRE_TARGETDEPS += $$PWD/src/leveldb/libleveldb.a
+ QMAKE_EXTRA_TARGETS += genleveldb
++}
+ # Gross ugly hack that depends on qmake internals, unfortunately there is no other way to do it.
+-QMAKE_CLEAN += $$PWD/src/leveldb/libleveldb.a; cd $$PWD/src/leveldb ; $(MAKE) clean
++QMAKE_CLEAN += $$PWD/src/leveldb/libleveldb.a; cd $$PWD/src/leveldb && $(MAKE) clean || true
+
+ # regenerate src/build.h
+ !win32|contains(USE_BUILD_INFO, 1) {
+diff --git a/src/leveldb.cpp b/src/leveldb.cpp
+index e66f851..2856d70 100644
+--- a/src/leveldb.cpp
++++ b/src/leveldb.cpp
+@@ -8,7 +8,9 @@
+ #include <leveldb/env.h>
+ #include <leveldb/cache.h>
+ #include <leveldb/filter_policy.h>
+-#include <memenv/memenv.h>
++#ifndef LEVELDB_WITHOUT_MEMENV
++#include <memenv.h>
++#endif
+
+ #include <boost/filesystem.hpp>
+
+@@ -43,8 +45,12 @@ CLevelDB::CLevelDB(const boost::filesystem::path &path, size_t nCacheSize, bool
+ options = GetOptions(nCacheSize);
+ options.create_if_missing = true;
+ if (fMemory) {
++#ifndef LEVELDB_WITHOUT_MEMENV
+ penv = leveldb::NewMemEnv(leveldb::Env::Default());
+ options.env = penv;
++#else
++ throw std::runtime_error("CLevelDB(): compiled without memenv support");
++#endif
+ } else {
+ if (fWipe) {
+ printf("Wiping LevelDB in %s\n", path.string().c_str());
+diff --git a/src/makefile.unix b/src/makefile.unix
+index 359ac3d..ec1e075 100644
+--- a/src/makefile.unix
++++ b/src/makefile.unix
+@@ -120,8 +120,7 @@ xCXXFLAGS=-O2 -pthread -Wall -Wextra -Wformat -Wformat-security -Wno-unused-para
+ # adds some defaults in front. Unfortunately, LDFLAGS=... $(LDFLAGS) does not work.
+ xLDFLAGS=$(LDHARDENING) $(LDFLAGS)
+
+-OBJS= \
+- leveldb/libleveldb.a \
++BASEOBJS := \
+ obj/alert.o \
+ obj/version.o \
+ obj/checkpoints.o \
+@@ -130,7 +129,6 @@ OBJS= \
+ obj/crypter.o \
+ obj/key.o \
+ obj/db.o \
+- obj/init.o \
+ obj/keystore.o \
+ obj/main.o \
+ obj/net.o \
+@@ -150,25 +148,44 @@ OBJS= \
+ obj/hash.o \
+ obj/bloom.o \
+ obj/noui.o \
+- obj/leveldb.o \
+ obj/txdb.o \
+ obj/prime.o \
+ obj/checkpointsync.o
+
++OBJS := \
++ obj/leveldb.o \
++ obj/init.o \
++ $(BASEOBJS)
++
++TESTOBJS := \
++ obj-test/leveldb.o \
++ $(patsubst test/%.cpp,obj-test/%.o,$(wildcard test/*.cpp)) \
++ $(BASEOBJS)
++
+ all: datacoind
+
+ test check: test_primecoin FORCE
+ ./test_primecoin
+
++ifdef USE_SYSTEM_LEVELDB
++ LIBS += -lleveldb
++ TESTLIBS += -lmemenv
++else
+ #
+ # LevelDB support
+ #
+ MAKEOVERRIDES =
+-LIBS += $(CURDIR)/leveldb/libleveldb.a $(CURDIR)/leveldb/libmemenv.a
++LIBS += $(CURDIR)/leveldb/libleveldb.a
++TESTLIBS += $(CURDIR)/leveldb/libmemenv.a
+ DEFS += $(addprefix -I,$(CURDIR)/leveldb/include)
+ DEFS += $(addprefix -I,$(CURDIR)/leveldb/helpers)
+ leveldb/libleveldb.a:
+- @echo "Building LevelDB ..." && cd leveldb && $(MAKE) CC=$(CC) CXX=$(CXX) OPT="$(xCXXFLAGS)" libleveldb.a libmemenv.a && cd ..
++ @echo "Building LevelDB ..." && cd leveldb && $(MAKE) CC=$(CC) CXX=$(CXX) OPT="$(xCXXFLAGS)" libleveldb.a && cd ..
++leveldb/libmemenv.a:
++ @echo "Building LevelDB memenv ..." && cd leveldb && $(MAKE) CC=$(CC) CXX=$(CXX) OPT="$(xCXXFLAGS)" libmemenv.a && cd ..
++OBJS += leveldb/libleveldb.a
++TESTOBJS += leveldb/libmemenv.a
++endif
+
+ # auto-generated dependencies:
+ -include obj/*.P
+@@ -179,24 +196,22 @@ obj/build.h: FORCE
+ version.cpp: obj/build.h
+ DEFS += -DHAVE_BUILD_INFO
+
+-obj/%.o: %.cpp
+- $(CXX) -c $(xCXXFLAGS) -MMD -MF $(@:%.o=%.d) -o $@ $<
++P_TO_D = \
+ @cp $(@:%.o=%.d) $(@:%.o=%.P); \
+- sed -e 's/#.*//' -e 's/^[^:]*: *//' -e 's/ *\\$$//' \
++ sed -e 's/\#.*//' -e 's/^[^:]*: *//' -e 's/ *\\$$//' \
+ -e '/^$$/ d' -e 's/$$/ :/' < $(@:%.o=%.d) >> $(@:%.o=%.P); \
+ rm -f $(@:%.o=%.d)
+
+-datacoind: $(OBJS:obj/%=obj/%)
+- $(LINK) $(xCXXFLAGS) -o $@ $^ $(xLDFLAGS) $(LIBS)
++obj/%.o: %.cpp
++ $(CXX) -c $(xCXXFLAGS) -DLEVELDB_WITHOUT_MEMENV -MMD -MF $(@:%.o=%.d) -o $@ $<
++ $(P_TO_D)
+
+-TESTOBJS := $(patsubst test/%.cpp,obj-test/%.o,$(wildcard test/*.cpp))
++datacoind: $(OBJS)
++ $(LINK) $(xCXXFLAGS) -o $@ $^ $(xLDFLAGS) $(LIBS)
+
+ obj-test/%.o: test/%.cpp
+- $(CXX) -c $(TESTDEFS) $(xCXXFLAGS) -MMD -MF $(@:%.o=%.d) -o $@ $<
+- @cp $(@:%.o=%.d) $(@:%.o=%.P); \
+- sed -e 's/#.*//' -e 's/^[^:]*: *//' -e 's/ *\\$$//' \
+- -e '/^$$/ d' -e 's/$$/ :/' < $(@:%.o=%.d) >> $(@:%.o=%.P); \
+- rm -f $(@:%.o=%.d)
++ $(CXX) -c $(xCXXFLAGS) -DLEVELDB_WITHOUT_MEMENV -MMD -MF $(@:%.o=%.d) -o $@ $<
++ $(P_TO_D)
+
+ test_primecoin: $(TESTOBJS) $(filter-out obj/init.o,$(OBJS:obj/%=obj/%))
+ $(LINK) $(xCXXFLAGS) -o $@ $(LIBPATHS) $^ $(TESTLIBS) $(xLDFLAGS) $(LIBS)
diff --git a/net-p2p/datacoin-hp/files/datacoin.conf b/net-p2p/datacoin-hp/files/datacoin.conf
new file mode 100644
index 00000000000..65c9767ea57
--- /dev/null
+++ b/net-p2p/datacoin-hp/files/datacoin.conf
@@ -0,0 +1,5 @@
+# see https://en.bitcoin.it/wiki/Running_Bitcoin#Bitcoin.conf_Configuration_File
+#
+
+#rpcuser=
+#rpcpassword=
diff --git a/net-p2p/datacoin-hp/files/datacoin.confd b/net-p2p/datacoin-hp/files/datacoin.confd
new file mode 100644
index 00000000000..95939b8b19a
--- /dev/null
+++ b/net-p2p/datacoin-hp/files/datacoin.confd
@@ -0,0 +1,9 @@
+# Config file for /etc/init.d/datacoind
+
+# owner of datacoind process (don't change, must be existing)
+DATACOIN_USER="datacoin-hp"
+
+DATACOIN_OPTS="${DATACOIN_OPTS}"
+
+# nice level
+NICELEVEL="19"
diff --git a/net-p2p/datacoin-hp/files/datacoin.initd b/net-p2p/datacoin-hp/files/datacoin.initd
new file mode 100644
index 00000000000..7a1f414ab9c
--- /dev/null
+++ b/net-p2p/datacoin-hp/files/datacoin.initd
@@ -0,0 +1,29 @@
+#!/sbin/runscript
+# Copyright 1999-2014 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+vardir="/var/lib/datacoin"
+conffile="${vardir}/.datacoin/datacoin.conf"
+datacoind_user="${DATACOIN_USER:-nobody:nobody}"
+
+description="Bitcoin crypto-currency wallet for automated services"
+pidfile="/run/${SVCNAME}.pid"
+command="/usr/bin/datacoind"
+command_args="${DATACOIN_OPTS}"
+command_background="true"
+start_stop_daemon_args="-u ${datacoind_user} -e HOME=${vardir} -N ${NICELEVEL:-0} -w 2000"
+
+depend() {
+ need net
+}
+
+start_pre() {
+ checkpath -f -o ${datacoind_user} -m 0400 ${conffile} || return 1
+
+ if ! grep -q '^rpcpassword=' "${conffile}"; then
+ eerror "Please edit `readlink -f ${conffile}`"
+ eerror "There must be at least a line assigning rpcpassword=something-secure"
+ return 1
+ fi
+}
diff --git a/net-p2p/datacoin-hp/files/datacoin.logrotate b/net-p2p/datacoin-hp/files/datacoin.logrotate
new file mode 100644
index 00000000000..910bafe7de1
--- /dev/null
+++ b/net-p2p/datacoin-hp/files/datacoin.logrotate
@@ -0,0 +1,7 @@
+/var/lib/datacoin/.datacoin/debug.log {
+ weekly
+ sharedscripts
+ postrotate
+ killall -HUP datacoind
+ endscript
+}
diff --git a/net-p2p/datacoin-hp/files/datacoin.service b/net-p2p/datacoin-hp/files/datacoin.service
new file mode 100644
index 00000000000..e0cb83190a1
--- /dev/null
+++ b/net-p2p/datacoin-hp/files/datacoin.service
@@ -0,0 +1,30 @@
+# It's not recommended to modify this file in-place, because it will be
+# overwritten during package upgrades. If you want to customize, the
+# best way is to create file
+# "/etc/systemd/system/datacoind.service.d/*.conf"
+# containing your changes
+
+# For example, if you want to change some daemon and/or unit options,
+# create a file named
+# "/etc/systemd/system/datacoind.service.d/myopts.conf"
+# containing:
+# [Service]
+# Environment="DATACOIN_OPTS=-debug -logtimestamps"
+# Nice=10
+# This will override the setting appearing below.
+
+# Note that almost all daemon options could be specified in
+# /etc/primecoin/datacoin.conf
+
+[Unit]
+Description=Datacoin Daemon
+After=network.target
+
+[Service]
+User=datacoin
+Environment=DATACOIN_OPTS=
+ExecStart=/usr/bin/datacoind -daemon=0 $DATACOIN_OPTS
+ExecReload=/bin/kill -HUP $MAINPID
+
+[Install]
+WantedBy=multi-user.target
diff --git a/net-p2p/datacoin-hp/metadata.xml b/net-p2p/datacoin-hp/metadata.xml
new file mode 100644
index 00000000000..0fb5c9c60a3
--- /dev/null
+++ b/net-p2p/datacoin-hp/metadata.xml
@@ -0,0 +1,18 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+ <maintainer>
+ <email>email@missionaccomplish.com</email>
+ <name>Fernando V.</name>
+ </maintainer>
+ <maintainer>
+ <email>blueness@gentoo.org</email>
+ <name>Anthony G. Basile</name>
+ </maintainer>
+ <use>
+ <flag name="logrotate">Use app-admin/logrotate for rotating logs</flag>
+ </use>
+ <upstream>
+ <remote-id type="github">foo1inge/datacoin-hp</remote-id>
+ </upstream>
+</pkgmetadata>
diff --git a/net-p2p/dbhub/Manifest b/net-p2p/dbhub/Manifest
new file mode 100644
index 00000000000..0ab94ff9727
--- /dev/null
+++ b/net-p2p/dbhub/Manifest
@@ -0,0 +1 @@
+DIST dbhub-0.451.tbz2 239911 SHA256 941b384d11c181ed270d546f0867dc517693d05fdcdacb14b0b7c682022663b8
diff --git a/net-p2p/dbhub/dbhub-0.451-r1.ebuild b/net-p2p/dbhub/dbhub-0.451-r1.ebuild
new file mode 100644
index 00000000000..9b7009cd96e
--- /dev/null
+++ b/net-p2p/dbhub/dbhub-0.451-r1.ebuild
@@ -0,0 +1,39 @@
+# Copyright 1999-2011 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=2
+inherit autotools eutils
+
+DESCRIPTION="Hub software for Direct Connect, fork of opendchub"
+HOMEPAGE="http://www.dbhub.org"
+SRC_URI="mirror://sourceforge/${PN}/${P}.tbz2"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="~amd64 ~ppc ~ppc64 ~x86"
+IUSE="debug perl nls switch_user"
+
+DEPEND="perl? ( dev-lang/perl )
+ switch_user? ( sys-libs/libcap )"
+
+RDEPEND="${DEPEND}"
+
+src_prepare() {
+ epatch "${FILESDIR}"/${PN}-gentoo.patch \
+ "${FILESDIR}"/${PN}-no-dynaloader.patch \
+ "${FILESDIR}"/${PN}-fix-buffer-overflows.patch
+ eautoreconf
+}
+
+src_configure() {
+ econf \
+ $(use_enable nls) \
+ $(use_enable perl) \
+ $(use_enable switch_user) \
+ $(use_enable debug)
+}
+
+src_install() {
+ emake DESTDIR="${D}" install || die
+}
diff --git a/net-p2p/dbhub/files/dbhub-fix-buffer-overflows.patch b/net-p2p/dbhub/files/dbhub-fix-buffer-overflows.patch
new file mode 100644
index 00000000000..8c4395d75d0
--- /dev/null
+++ b/net-p2p/dbhub/files/dbhub-fix-buffer-overflows.patch
@@ -0,0 +1,53 @@
+From 6d52acedf13eba875ab064d1a3b6a0ac3afb24f3 Mon Sep 17 00:00:00 2001
+From: Stanislav Ochotnicky <sochotnicky@gentoo.org>
+Date: Wed, 19 Jan 2011 21:06:05 +0100
+Subject: [PATCH] Fix buffer overflows
+
+---
+ src/commands.c | 2 +-
+ src/main.c | 2 +-
+ src/main.h | 2 +-
+ 3 files changed, 3 insertions(+), 3 deletions(-)
+
+diff --git a/src/commands.c b/src/commands.c
+index f66ad68..e0bc6a8 100644
+--- a/src/commands.c
++++ b/src/commands.c
+@@ -313,7 +313,7 @@ void chat(char *buf, struct user_t *user)
+ char kg2user[51];
+ char largestring[501];
+ char msgl[801];
+- char bigstring[1001];
++ char bigstring[4096];
+ char tempstring[151];
+ char nick[51];
+ char phrase[51];
+diff --git a/src/main.c b/src/main.c
+index dec3ef8..85dad68 100644
+--- a/src/main.c
++++ b/src/main.c
+@@ -506,7 +506,7 @@ void alarm_signal(int z){
+ void alarm_handler(void)
+ {
+ struct sock_t *human_user;
+- char sometxt[151];
++ char sometxt[250];
+ char somerec[21];
+ char showrec[251];
+ char recpath[MAX_FDP_LEN+1];
+diff --git a/src/main.h b/src/main.h
+index 886312e..da1ead5 100644
+--- a/src/main.h
++++ b/src/main.h
+@@ -430,7 +430,7 @@ int brokensr; /* 1 means share record was broken */
+ char recordshstr[120];
+ char recordusstr[120];
+
+-char clocknick[21];
++char clocknick[50];
+
+ //DB// Pointers that count various things and display them in !ui command to admins/owners
+ long long blocked_pm;
+--
+1.7.3.4
+
diff --git a/net-p2p/dbhub/files/dbhub-gentoo.patch b/net-p2p/dbhub/files/dbhub-gentoo.patch
new file mode 100644
index 00000000000..6e992cdb012
--- /dev/null
+++ b/net-p2p/dbhub/files/dbhub-gentoo.patch
@@ -0,0 +1,25 @@
+--- configure.ac
++++ configure.ac
+@@ -115,7 +115,7 @@
+ AC_MSG_CHECKING([Perl LD Objs])
+ AC_MSG_RESULT([$perl_ldd])
+ CPPFLAGS="$CPPFLAGS $perl_ccflags"
+- LDFLAGS="$LDFLAGS $perl_ld"
++ LIBS="$LIBS $perl_ld"
+ MISSING_PERL_HEADERS=""
+ AC_CHECK_HEADERS([EXTERN.h perl.h],,HAVE_PERL="false"; MISSING_PERL_HEADERS="$ac_header $MISSING_PERL_HEADERS",[[#if HAVE_EXTERN_H
+ #include <EXTERN.h>
+@@ -141,13 +141,6 @@
+
+ AM_CONDITIONAL([BNLS],[test "$want_nls" = "yes"])
+
+-dnl Check if config directory exists.
+-if test ! -d $HOME/.dbhub; then
+- echo "creating config directory: $HOME/.dbhub"
+- mkdir $HOME/.dbhub
+- chmod 700 $HOME/.dbhub;
+-fi
+-
+ AC_OUTPUT(Makefile src/Makefile)
+
+ echo -e "\n\e@<:@1m-------------------------------------------------\e@<:@0m"
diff --git a/net-p2p/dbhub/files/dbhub-no-dynaloader.patch b/net-p2p/dbhub/files/dbhub-no-dynaloader.patch
new file mode 100644
index 00000000000..493b83a2943
--- /dev/null
+++ b/net-p2p/dbhub/files/dbhub-no-dynaloader.patch
@@ -0,0 +1,12 @@
+http://bugs.gentoo.org/276928
+
+--- configure.ac
++++ configure.ac
+@@ -122,7 +122,6 @@
+ #endif
+ ]])
+ AC_CHECK_LIB([perl],[perl_run],,LIBPERL_MISSING="true";HAVE_PERL="false")
+- AC_CHECK_FILE("$perl_loader", [AC_SUBST(perl_ldd) HAVE_DYNLOAD="yes"], HAVE_DYNLOAD="no";HAVE_PERL="false")
+ else
+ HAVE_PERL="false"
+ fi
diff --git a/net-p2p/dbhub/metadata.xml b/net-p2p/dbhub/metadata.xml
new file mode 100644
index 00000000000..b801d162835
--- /dev/null
+++ b/net-p2p/dbhub/metadata.xml
@@ -0,0 +1,11 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+ <herd>net-p2p</herd>
+ <use>
+ <flag name="switch_user">Enable support for switching user</flag>
+ </use>
+ <upstream>
+ <remote-id type="sourceforge">dbhub</remote-id>
+ </upstream>
+</pkgmetadata>
diff --git a/net-p2p/dclib/Manifest b/net-p2p/dclib/Manifest
new file mode 100644
index 00000000000..cf90b79247f
--- /dev/null
+++ b/net-p2p/dclib/Manifest
@@ -0,0 +1 @@
+DIST dclib-0.3.23.tar.bz2 517251 SHA256 757b67cb1158a93fd826ef358ec094f59ba9dca0dde94a1d7325833f222e4dd0
diff --git a/net-p2p/dclib/dclib-0.3.23.ebuild b/net-p2p/dclib/dclib-0.3.23.ebuild
new file mode 100644
index 00000000000..3945a73501a
--- /dev/null
+++ b/net-p2p/dclib/dclib-0.3.23.ebuild
@@ -0,0 +1,39 @@
+# Copyright 1999-2010 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=2
+inherit autotools eutils
+
+DESCRIPTION="DirectConnect client library"
+HOMEPAGE="http://sourceforge.net/projects/wxdcgui"
+SRC_URI="mirror://sourceforge/wxdcgui/${P}.tar.bz2"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="amd64 hppa ppc ppc64 x86"
+IUSE="socks5 ssl"
+
+DEPEND="app-arch/bzip2
+ sys-libs/zlib
+ dev-libs/libxml2
+ socks5? ( net-proxy/dante )
+ ssl? ( dev-libs/openssl )"
+
+src_prepare() {
+ epatch "${FILESDIR}"/${P}-asneeded.patch \
+ "${FILESDIR}"/${P}-openssl-1.patch
+ eautoreconf
+}
+
+src_configure() {
+ econf \
+ --disable-dependency-tracking \
+ $(use_enable socks5 socks) \
+ $(use_enable ssl)
+}
+
+src_install() {
+ emake DESTDIR="${D}" install || die
+ dodoc AUTHORS ChangeLog NEWS README TODO
+}
diff --git a/net-p2p/dclib/files/dclib-0.3.23-asneeded.patch b/net-p2p/dclib/files/dclib-0.3.23-asneeded.patch
new file mode 100644
index 00000000000..d3634c424c2
--- /dev/null
+++ b/net-p2p/dclib/files/dclib-0.3.23-asneeded.patch
@@ -0,0 +1,16 @@
+Changing order allows ACX_PHTREAD to find -lthread
+before trying to use -pthread
+
+http://bugs.gentoo.org/show_bug.cgi?id=282426
+
+--- m4/acx_pthread.m4
++++ m4/acx_pthread.m4
+@@ -123,7 +123,7 @@
+ # which indicates that we try without any flags at all, and "pthread-config"
+ # which is a program returning the flags for the Pth emulation library.
+
+-acx_pthread_flags="pthreads none -Kthread -kthread lthread -pthread -pthreads -mthreads pthread --thread-safe -mt pthread-config"
++acx_pthread_flags="pthreads none -Kthread -kthread lthread pthread -pthread -pthreads -mthreads --thread-safe -mt pthread-config"
+
+ # The ordering *is* (sometimes) important. Some notes on the
+ # individual items follow:
diff --git a/net-p2p/dclib/files/dclib-0.3.23-openssl-1.patch b/net-p2p/dclib/files/dclib-0.3.23-openssl-1.patch
new file mode 100644
index 00000000000..f8b4a4bc2af
--- /dev/null
+++ b/net-p2p/dclib/files/dclib-0.3.23-openssl-1.patch
@@ -0,0 +1,52 @@
+http://bugs.gentoo.org/330291
+
+--- dclib/core/cssl.cpp
++++ dclib/core/cssl.cpp
+@@ -86,7 +86,11 @@
+ /** */
+ SSL_CTX * CSSL::InitClientCTX()
+ {
++ #if OPENSSL_VERSION_NUMBER >= 0x10000000L
++ const SSL_METHOD *method;
++ #else
+ SSL_METHOD *method;
++ #endif
+ SSL_CTX *ctx = NULL;
+
+ method = SSLv23_client_method(); /* Create new client-method instance */
+@@ -109,7 +113,11 @@
+ /** */
+ SSL_CTX * CSSL::InitServerCTX()
+ {
++ #if OPENSSL_VERSION_NUMBER >= 0x10000000L
++ const SSL_METHOD *method;
++ #else
+ SSL_METHOD *method;
++ #endif
+ SSL_CTX *ctx = NULL;
+
+ method = SSLv23_server_method(); /* Create new client-method instance */
+@@ -130,7 +138,11 @@
+ /** */
+ SSL_CTX * CSSL::NewTLSv1ClientCTX()
+ {
++ #if OPENSSL_VERSION_NUMBER >= 0x10000000L
++ const SSL_METHOD * method = TLSv1_client_method();
++ #else
+ SSL_METHOD * method = TLSv1_client_method();
++ #endif
+ SSL_CTX * ctx = NULL;
+
+ if ( method != NULL )
+@@ -149,7 +161,11 @@
+ /** */
+ SSL_CTX * CSSL::NewTLSv1ServerCTX()
+ {
++ #if OPENSSL_VERSION_NUMBER >= 0x10000000L
++ const SSL_METHOD * method = TLSv1_server_method();
++ #else
+ SSL_METHOD * method = TLSv1_server_method();
++ #endif
+ SSL_CTX * ctx = NULL;
+
+ if ( method != NULL )
diff --git a/net-p2p/dclib/metadata.xml b/net-p2p/dclib/metadata.xml
new file mode 100644
index 00000000000..b6e0d287755
--- /dev/null
+++ b/net-p2p/dclib/metadata.xml
@@ -0,0 +1,8 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+ <herd>net-p2p</herd>
+ <upstream>
+ <remote-id type="sourceforge">wxdcgui</remote-id>
+ </upstream>
+</pkgmetadata>
diff --git a/net-p2p/deluge/Manifest b/net-p2p/deluge/Manifest
new file mode 100644
index 00000000000..2fb82ca2e51
--- /dev/null
+++ b/net-p2p/deluge/Manifest
@@ -0,0 +1,2 @@
+DIST deluge-1.3.11.tar.bz2 1792459 SHA256 83e1f41b8a2a6e7ba86a54474692d4686db509b75441173d9603447f9e0ec898 SHA512 d56c03f3c687cdee65f8d7f26728a46cae1fd665c49313bd2b91243d26df0f5b2292048fd542333cbc538383eb53cd961bc3427230f9081317268735df367272 WHIRLPOOL 52820837a24ef3d4917a1b018fa30c8ec662a6c2366cb848fb984b716175bad63131e7cc4eea7688405e380102cf0ebb5ae4b58dcd7c90fd7dde9dcc9dada444
+DIST deluge-1.3.6.tar.bz2 1725202 SHA256 756a025d88752f39133aa34d8fc96d4ce216113919488d60098ee41f860a1f60 SHA512 22a8308c139e95190b3832ee9547e7c84a56cf1cc6f18ecebaf7af7997d73efe41664fd875e7e1753eb0b1e616f12e5e54f5fb2790261753b85f5512b8882e12 WHIRLPOOL f43a5ae5a94fc49cb76ee3561b18b9aeaff759c72a77d629170f4294e63c90f883e346eb0a5c75c0d13683fdf1848b07af2bfcd6432253cd40642735e50d10e1
diff --git a/net-p2p/deluge/deluge-1.3.11.ebuild b/net-p2p/deluge/deluge-1.3.11.ebuild
new file mode 100644
index 00000000000..d42c92d8b4e
--- /dev/null
+++ b/net-p2p/deluge/deluge-1.3.11.ebuild
@@ -0,0 +1,84 @@
+# Copyright 1999-2014 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI="5"
+
+PYTHON_COMPAT=( python2_7 )
+DISTUTILS_SINGLE_IMPL=1
+inherit distutils-r1 eutils systemd
+
+DESCRIPTION="BitTorrent client with a client/server model"
+HOMEPAGE="http://deluge-torrent.org/"
+
+if [[ ${PV} == 9999 ]]; then
+ inherit git-2
+ EGIT_REPO_URI="git://deluge-torrent.org/${PN}.git
+ http://git.deluge-torrent.org/${PN}"
+ SRC_URI=""
+ KEYWORDS=""
+else
+ SRC_URI="http://download.deluge-torrent.org/source/${P}.tar.bz2"
+ KEYWORDS="~amd64 ~arm ~ppc ~sparc ~x86"
+fi
+
+LICENSE="GPL-2"
+SLOT="0"
+IUSE="geoip gtk libnotify setproctitle sound webinterface"
+
+DEPEND=">=net-libs/rb_libtorrent-0.14.9[python]
+ dev-util/intltool"
+RDEPEND=">=net-libs/rb_libtorrent-0.14.9[python]
+ dev-python/chardet[${PYTHON_USEDEP}]
+ dev-python/pyopenssl[${PYTHON_USEDEP}]
+ dev-python/pyxdg[${PYTHON_USEDEP}]
+ >=dev-python/twisted-core-8.1[${PYTHON_USEDEP}]
+ >=dev-python/twisted-web-8.1[${PYTHON_USEDEP}]
+ geoip? ( dev-libs/geoip )
+ gtk? (
+ sound? ( dev-python/pygame[${PYTHON_USEDEP}] )
+ dev-python/pygobject:2[${PYTHON_USEDEP}]
+ >=dev-python/pygtk-2.12[${PYTHON_USEDEP}]
+ gnome-base/librsvg
+ libnotify? ( dev-python/notify-python[${PYTHON_USEDEP}] )
+ )
+ setproctitle? ( dev-python/setproctitle[${PYTHON_USEDEP}] )
+ webinterface? ( dev-python/mako[${PYTHON_USEDEP}] )"
+
+python_prepare_all() {
+ local PATCHES=(
+ "${FILESDIR}"/${PN}-1.3.5-disable_libtorrent_internal_copy.patch
+ )
+
+ distutils-r1_python_prepare_all
+}
+
+_distutils-r1_create_setup_cfg() {
+ # bug 531370: deluge has its own plugin system. No need to relocate its egg info files.
+ # Override this call from the distutils-r1 eclass.
+ # This does not respect the distutils-r1 API. DONOT copy this example.
+ :
+}
+
+python_install_all() {
+ distutils-r1_python_install_all
+ newinitd "${FILESDIR}"/deluged.init deluged
+ newconfd "${FILESDIR}"/deluged.conf deluged
+ systemd_dounit "${FILESDIR}"/deluged.service
+ systemd_dounit "${FILESDIR}"/deluge-web.service
+}
+
+pkg_postinst() {
+ elog
+ elog "If after upgrading it doesn't work, please remove the"
+ elog "'~/.config/deluge' directory and try again, but make a backup"
+ elog "first!"
+ elog
+ elog "To start the daemon either run 'deluged' as user"
+ elog "or modify /etc/conf.d/deluged and run"
+ elog "/etc/init.d/deluged start as root"
+ elog "You can still use deluge the old way"
+ elog
+ elog "For more information look at http://dev.deluge-torrent.org/wiki/Faq"
+ elog
+}
diff --git a/net-p2p/deluge/deluge-1.3.6.ebuild b/net-p2p/deluge/deluge-1.3.6.ebuild
new file mode 100644
index 00000000000..dd87373482e
--- /dev/null
+++ b/net-p2p/deluge/deluge-1.3.6.ebuild
@@ -0,0 +1,74 @@
+# Copyright 1999-2014 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI="3"
+PYTHON_DEPEND="2:2.5"
+
+inherit distutils eutils python systemd
+
+DESCRIPTION="BitTorrent client with a client/server model"
+HOMEPAGE="http://deluge-torrent.org/"
+SRC_URI="http://download.deluge-torrent.org/source/${P}.tar.bz2"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="amd64 ~arm ~ppc ~sparc x86"
+IUSE="geoip gtk libnotify setproctitle sound webinterface"
+
+DEPEND=">=net-libs/rb_libtorrent-0.14.9[python]
+ dev-python/setuptools
+ dev-util/intltool"
+RDEPEND="${DEPEND}
+ dev-python/chardet
+ dev-python/pyopenssl
+ dev-python/pyxdg
+ || ( dev-lang/python:2.7 dev-lang/python:2.6 dev-python/simplejson )
+ >=dev-python/twisted-core-8.1
+ >=dev-python/twisted-web-8.1
+ geoip? ( dev-libs/geoip )
+ gtk? (
+ sound? ( dev-python/pygame )
+ dev-python/pygobject:2
+ >=dev-python/pygtk-2.12
+ gnome-base/librsvg
+ libnotify? ( dev-python/notify-python )
+ )
+ setproctitle? ( dev-python/setproctitle )
+ webinterface? ( dev-python/mako )"
+
+pkg_setup() {
+ python_set_active_version 2
+ python_pkg_setup
+}
+
+src_prepare() {
+ distutils_src_prepare
+ python_convert_shebangs -r 2 .
+ epatch "${FILESDIR}/${PN}-1.3.5-disable_libtorrent_internal_copy.patch"
+
+}
+
+src_install() {
+ distutils_src_install
+ newinitd "${FILESDIR}"/deluged.init deluged
+ newconfd "${FILESDIR}"/deluged.conf deluged
+ systemd_dounit "${FILESDIR}"/deluged.service
+ systemd_dounit "${FILESDIR}"/deluge-web.service
+}
+
+pkg_postinst() {
+ distutils_pkg_postinst
+ elog
+ elog "If after upgrading it doesn't work, please remove the"
+ elog "'~/.config/deluge' directory and try again, but make a backup"
+ elog "first!"
+ elog
+ elog "To start the daemon either run 'deluged' as user"
+ elog "or modify /etc/conf.d/deluged and run"
+ elog "/etc/init.d/deluged start as root"
+ elog "You can still use deluge the old way"
+ elog
+ elog "For more information look at http://dev.deluge-torrent.org/wiki/Faq"
+ elog
+}
diff --git a/net-p2p/deluge/deluge-9999.ebuild b/net-p2p/deluge/deluge-9999.ebuild
new file mode 100644
index 00000000000..7aa1cdb941f
--- /dev/null
+++ b/net-p2p/deluge/deluge-9999.ebuild
@@ -0,0 +1,77 @@
+# Copyright 1999-2014 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI="5"
+
+PYTHON_COMPAT=( python2_7 )
+DISTUTILS_SINGLE_IMPL=1
+inherit distutils-r1 eutils systemd
+
+DESCRIPTION="BitTorrent client with a client/server model"
+HOMEPAGE="http://deluge-torrent.org/"
+
+if [[ ${PV} == 9999 ]]; then
+ inherit git-2
+ EGIT_REPO_URI="git://deluge-torrent.org/${PN}.git
+ http://git.deluge-torrent.org/${PN}"
+ SRC_URI=""
+ KEYWORDS=""
+else
+ SRC_URI="http://download.deluge-torrent.org/source/${P}.tar.bz2"
+ KEYWORDS="~amd64 ~arm ~ppc ~sparc ~x86"
+fi
+
+LICENSE="GPL-2"
+SLOT="0"
+IUSE="geoip gtk libnotify setproctitle sound webinterface"
+
+DEPEND=">=net-libs/rb_libtorrent-0.14.9[python]
+ dev-util/intltool"
+RDEPEND=">=net-libs/rb_libtorrent-0.14.9[python]
+ dev-python/chardet
+ dev-python/pyopenssl
+ dev-python/pyxdg
+ >=dev-python/twisted-core-8.1
+ >=dev-python/twisted-web-8.1
+ geoip? ( dev-libs/geoip )
+ gtk? (
+ sound? ( dev-python/pygame )
+ dev-python/pygobject:2
+ >=dev-python/pygtk-2.12
+ gnome-base/librsvg
+ libnotify? ( dev-python/notify-python )
+ )
+ setproctitle? ( dev-python/setproctitle )
+ webinterface? ( dev-python/mako )"
+
+python_prepare_all() {
+ local PATCHES=(
+ "${FILESDIR}"/${PN}-1.3.5-disable_libtorrent_internal_copy.patch
+ )
+
+ distutils-r1_python_prepare_all
+}
+
+python_install_all() {
+ distutils-r1_python_install_all
+ newinitd "${FILESDIR}"/deluged.init deluged
+ newconfd "${FILESDIR}"/deluged.conf deluged
+ systemd_dounit "${FILESDIR}"/deluged.service
+ systemd_dounit "${FILESDIR}"/deluge-web.service
+}
+
+pkg_postinst() {
+ elog
+ elog "If after upgrading it doesn't work, please remove the"
+ elog "'~/.config/deluge' directory and try again, but make a backup"
+ elog "first!"
+ elog
+ elog "To start the daemon either run 'deluged' as user"
+ elog "or modify /etc/conf.d/deluged and run"
+ elog "/etc/init.d/deluged start as root"
+ elog "You can still use deluge the old way"
+ elog
+ elog "For more information look at http://dev.deluge-torrent.org/wiki/Faq"
+ elog
+}
diff --git a/net-p2p/deluge/files/deluge-1.3.5-disable_libtorrent_internal_copy.patch b/net-p2p/deluge/files/deluge-1.3.5-disable_libtorrent_internal_copy.patch
new file mode 100644
index 00000000000..235b7f7c243
--- /dev/null
+++ b/net-p2p/deluge/files/deluge-1.3.5-disable_libtorrent_internal_copy.patch
@@ -0,0 +1,42 @@
+--- setup.py
++++ setup.py
+@@ -205,38 +205,7 @@
+
+ _ext_modules = []
+
+-# Check for a system libtorrent and if found, then do not build the libtorrent extension
+-build_libtorrent = True
+-try:
+- from deluge._libtorrent import lt
+-except ImportError:
+- build_libtorrent = True
+-else:
+- build_libtorrent = False
+-
+-if build_libtorrent:
+- got_libtorrent = False
+- if not os.path.exists("libtorrent"):
+- import subprocess
+- if subprocess.call(['./get_libtorrent.sh']) > 0:
+- got_libtorrent = False
+- else:
+- got_libtorrent = True
+- else:
+- got_libtorrent = True
+-
+- if got_libtorrent:
+- # There isn't a system libtorrent library, so let's build the one included with deluge
+- libtorrent = Extension(
+- 'libtorrent',
+- extra_compile_args = _extra_compile_args,
+- include_dirs = _include_dirs,
+- libraries = _libraries,
+- library_dirs = _library_dirs,
+- sources = _sources
+- )
+-
+- _ext_modules = [libtorrent]
++import deluge._libtorrent
+
+ desktop_data = 'deluge/data/share/applications/deluge.desktop'
+
diff --git a/net-p2p/deluge/files/deluge-1.3.5-rb_libtorrent-disable-python-bindings b/net-p2p/deluge/files/deluge-1.3.5-rb_libtorrent-disable-python-bindings
new file mode 100644
index 00000000000..301019e04ae
--- /dev/null
+++ b/net-p2p/deluge/files/deluge-1.3.5-rb_libtorrent-disable-python-bindings
@@ -0,0 +1,60 @@
+https://bugs.gentoo.org/show_bug.cgi?id=437356
+
+From 37ea2854a21e50debdf7bc953a3411e5934b74d9 Mon Sep 17 00:00:00 2001
+From: Calum Lind <calumlind+deluge@gmail.com>
+Date: Thu, 27 Sep 2012 16:53:22 +0000
+Subject: Fix 2160 : Disable use of python bindings for libtorrent extensions and replace with session flag
+
+The fixes a GIL issue causing libtorrent segfault. https://code.google.com/p/libtorrent/issues/detail?id=369
+
+Note: The ut_pex plugin (Peer Exchange) will now always be enabled.
+---
+diff --git a/deluge/core/core.py b/deluge/core/core.py
+index 4bda811..4ca3d96 100644
+--- a/deluge/core/core.py
++++ b/deluge/core/core.py
+@@ -84,7 +84,10 @@ class Core(component.Component):
+ while len(version) < 4:
+ version.append(0)
+
+- self.session = lt.session(lt.fingerprint("DE", *version), flags=0)
++ # Note: All libtorrent python bindings to set plugins/extensions need to be disabled
++ # due to GIL issue. https://code.google.com/p/libtorrent/issues/detail?id=369
++ # Setting session flags to 1 enables all libtorrent default plugins
++ self.session = lt.session(lt.fingerprint("DE", *version), flags=1)
+
+ # Load the session state if available
+ self.__load_session_state()
+@@ -103,9 +106,11 @@ class Core(component.Component):
+ self.session.set_settings(self.settings)
+
+ # Load metadata extension
+- self.session.add_extension(lt.create_metadata_plugin)
+- self.session.add_extension(lt.create_ut_metadata_plugin)
+- self.session.add_extension(lt.create_smart_ban_plugin)
++ # Note: All libtorrent python bindings to set plugins/extensions need to be disabled
++ # due to GIL issue. https://code.google.com/p/libtorrent/issues/detail?id=369
++ # self.session.add_extension(lt.create_metadata_plugin)
++ # self.session.add_extension(lt.create_ut_metadata_plugin)
++ # self.session.add_extension(lt.create_smart_ban_plugin)
+
+ # Create the components
+ self.eventmanager = EventManager()
+diff --git a/deluge/core/preferencesmanager.py b/deluge/core/preferencesmanager.py
+index 40070bb..2a5cb1b 100644
+--- a/deluge/core/preferencesmanager.py
++++ b/deluge/core/preferencesmanager.py
+@@ -338,7 +338,10 @@ class PreferencesManager(component.Component):
+ def _on_set_utpex(self, key, value):
+ log.debug("utpex value set to %s", value)
+ if value:
+- self.session.add_extension(lt.create_ut_pex_plugin)
++ # Note: All libtorrent python bindings to set plugins/extensions need to be disabled
++ # due to GIL issue. https://code.google.com/p/libtorrent/issues/detail?id=369
++ #self.session.add_extension(lt.create_ut_pex_plugin)
++ pass
+
+ def _on_set_encryption(self, key, value):
+ log.debug("encryption value %s set to %s..", key, value)
+--
+cgit v0.9.0.2
diff --git a/net-p2p/deluge/files/deluge-web.service b/net-p2p/deluge/files/deluge-web.service
new file mode 100644
index 00000000000..426401a95e0
--- /dev/null
+++ b/net-p2p/deluge/files/deluge-web.service
@@ -0,0 +1,11 @@
+[Unit]
+Description=Deluge WebUI
+After=deluged.service
+
+[Service]
+User=deluge
+ExecStart=/usr/bin/deluge-web
+
+[Install]
+WantedBy=multi-user.target
+
diff --git a/net-p2p/deluge/files/deluged.conf b/net-p2p/deluge/files/deluged.conf
new file mode 100644
index 00000000000..0918f45fc7f
--- /dev/null
+++ b/net-p2p/deluge/files/deluged.conf
@@ -0,0 +1,8 @@
+# /etc/conf.d/deluged
+# Change this to the user you want to run deluged as.
+# You may specify a group too, after a colon
+DELUGED_USER=""
+# DELUGED_OPTS="-p 58846"
+DELUGEUI_START="false"
+DELUGEUI_OPTS="-u web"
+
diff --git a/net-p2p/deluge/files/deluged.init b/net-p2p/deluge/files/deluged.init
new file mode 100644
index 00000000000..e60945df155
--- /dev/null
+++ b/net-p2p/deluge/files/deluged.init
@@ -0,0 +1,71 @@
+#!/sbin/runscript
+# Copyright 1999-2013 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License, v2 or later
+# $Id$
+
+depend() {
+ need net
+}
+
+checkconfig() {
+ if [ "${DELUGED_USER}" = "" ] ; then
+ eerror "Please edit /etc/conf.d/deluged"
+ eerror "You have to specify a user to run deluged as, as we will not run it as root!"
+ eerror "Modify DELUGED_USER to your needs (you can also add a group, after a colon)"
+ return 1
+ fi
+ if ! getent passwd "${DELUGED_USER%:*}" >/dev/null ; then
+ eerror "Please edit /etc/conf.d/deluged"
+ eerror "Your user has to exist!"
+ return 1
+ fi
+ if [ "${DELUGED_USER%:*}" = "${DELUGED_USER}" ] ; then
+ return 0
+ else
+ if ! getent group "${DELUGED_USER#*:}" >/dev/null ; then
+ eerror "Please edit /etc/conf.d/deluged"
+ eerror "Your group has to exist too!"
+ return 1
+ fi
+ fi
+ return 0
+}
+
+start() {
+ checkconfig || return $?
+ if [ "${DELUGED_HOME}" = "" ] ; then
+ DELUGED_USER_HOME=$(getent passwd "${DELUGED_USER%:*}" | cut -d ':' -f 6)
+ else
+ DELUGED_USER_HOME=${DELUGED_HOME}
+ fi
+ ebegin "Starting Deluged"
+ start-stop-daemon --start --user "${DELUGED_USER%:*}" \
+ --name deluged --pidfile /var/run/deluged.pid --background --make-pidfile \
+ --exec /usr/bin/deluged -e HOME="${DELUGED_USER_HOME}" -- --do-not-daemonize "${DELUGED_OPTS}"
+ eend $?
+
+
+ if [ "${DELUGEUI_START}" = "true" ] ; then
+ ebegin "Starting Deluge"
+ start-stop-daemon --start --background --pidfile \
+ /var/run/deluge.pid --make-pidfile \
+ --exec /usr/bin/deluge --user "${DELUGED_USER%:*}" \
+ -e HOME="${DELUGED_USER_HOME}" -- ${DELUGEUI_OPTS}
+ eend $?
+ fi
+}
+
+stop() {
+ ebegin "Stopping Deluged"
+ start-stop-daemon --stop --user "${DELUGED_USER%:*}" \
+ --name deluged --pidfile /var/run/deluged.pid
+ eend $?
+
+
+ if [ "${DELUGEUI_START}" = "true" ] ; then
+ ebegin "Stopping Deluge"
+ start-stop-daemon --stop --user "${DELUGED_USER%:*}" \
+ --name deluge --pidfile /var/run/deluge.pid
+ eend $?
+ fi
+}
diff --git a/net-p2p/deluge/files/deluged.service b/net-p2p/deluge/files/deluged.service
new file mode 100644
index 00000000000..74876b008cc
--- /dev/null
+++ b/net-p2p/deluge/files/deluged.service
@@ -0,0 +1,13 @@
+[Unit]
+Description=Deluge BitTorrent client
+After=network.target local-fs.target
+Wants=local-fs.target
+
+[Service]
+EnvironmentFile=/etc/conf.d/deluged
+User=deluge
+Group=deluge
+ExecStart=/usr/bin/deluged -d -p $DELUGED_PORT $DELUGED_OPTIONS
+
+[Install]
+WantedBy=multi-user.target
diff --git a/net-p2p/deluge/metadata.xml b/net-p2p/deluge/metadata.xml
new file mode 100644
index 00000000000..169929587be
--- /dev/null
+++ b/net-p2p/deluge/metadata.xml
@@ -0,0 +1,11 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+<herd>net-p2p</herd>
+<use>
+ <flag name='setproctitle'>Install dependencies needed for beautifying
+ the process name</flag>
+ <flag name='webinterface'>Install dependencies needed for the web
+ interface</flag>
+</use>
+</pkgmetadata>
diff --git a/net-p2p/dogecoin-qt/Manifest b/net-p2p/dogecoin-qt/Manifest
new file mode 100644
index 00000000000..4a14f09b5e7
--- /dev/null
+++ b/net-p2p/dogecoin-qt/Manifest
@@ -0,0 +1 @@
+DIST dogecoin-1.6.tar.gz 3405829 SHA256 cab04d7a33de1b429440bfa98506d4a64417a70bddcb9a33342b38837edf54fd SHA512 dd40d96f87aa787af3ae7da38ec33c94bdc15b1176c2468c3a7408778b3b0e64f2c2bdafa3a85e72ef02fe4b9f931cbe7dec33b1da3bc867978d747f31662621 WHIRLPOOL 9721725f24d712caeab03b863115b9f3d553951cdf48885a3cdc4899f5e5a5eec5a7c1c63c22b5bf7ff93c73cc90b15f8b9c1f4318d8737c1cfa4f7e5aafd1ae
diff --git a/net-p2p/dogecoin-qt/dogecoin-qt-1.6.ebuild b/net-p2p/dogecoin-qt/dogecoin-qt-1.6.ebuild
new file mode 100644
index 00000000000..56c901ef1f9
--- /dev/null
+++ b/net-p2p/dogecoin-qt/dogecoin-qt-1.6.ebuild
@@ -0,0 +1,145 @@
+# Copyright 1999-2014 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=5
+
+DB_VER="4.8"
+
+LANGS="af_ZA ar bg bs ca ca_ES cs cy da de el_GR en eo es es_CL et eu_ES fa fa_IR fi fr fr_CA gu_IN he hi_IN hr hu it ja la lt lv_LV nb nl pl pt_BR pt_PT ro_RO ru sk sr sv th_TH tr uk zh_CN zh_TW"
+inherit db-use eutils fdo-mime gnome2-utils kde4-functions qt4-r2
+
+MyPV="${PV/_/-}"
+MyPN="dogecoin"
+MyP="${MyPN}-${MyPV}"
+
+DESCRIPTION="P2P Internet currency favored by Shiba Inus worldwide"
+HOMEPAGE="https://dogecoin.com/"
+SRC_URI="https://github.com/${MyPN}/${MyPN}/archive/${MyPV}.tar.gz -> ${MyP}.tar.gz"
+
+LICENSE="MIT ISC GPL-3 LGPL-2.1 public-domain || ( CC-BY-SA-3.0 LGPL-2.1 )"
+SLOT="0"
+KEYWORDS="~amd64 ~x86"
+IUSE="dbus ipv6 kde +qrcode upnp"
+
+RDEPEND="
+ dev-libs/boost[threads(+)]
+ dev-libs/openssl:0[-bindist]
+ qrcode? (
+ media-gfx/qrencode
+ )
+ upnp? (
+ net-libs/miniupnpc
+ )
+ sys-libs/db:$(db_ver_to_slot "${DB_VER}")[cxx]
+ <=dev-libs/leveldb-1.12.0[-snappy]
+ dev-qt/qtgui:4
+ dbus? (
+ dev-qt/qtdbus:4
+ )
+"
+DEPEND="${RDEPEND}
+ >=app-shells/bash-4.1
+"
+
+DOCS="doc/README.md doc/release-notes.md"
+
+S="${WORKDIR}/${MyP}"
+
+src_prepare() {
+# epatch "${FILESDIR}"/${MyPN}-sys_leveldb.patch
+# rm -r src/leveldb || die
+
+ sed 's/BDB_INCLUDE_PATH=.*//' -i 'dogecoin-qt.pro' || die
+
+ cd src || die
+
+ local filt= yeslang= nolang=
+
+ #for lan in $LANGS; do
+ # if [ ! -e qt/locale/bitcoin_$lan.ts ]; then
+ # ewarn "Language '$lan' no longer supported. Ebuild needs update."
+ # fi
+ #done
+
+ for ts in $(ls qt/locale/*.ts)
+ do
+ x="${ts/*bitcoin_/}"
+ x="${x/.ts/}"
+ if ! use "linguas_$x"; then
+ nolang="$nolang $x"
+ rm "$ts"
+ filt="$filt\\|$x"
+ else
+ yeslang="$yeslang $x"
+ fi
+ done
+
+ filt="bitcoin_\\(${filt:2}\\)\\.\(qm\|ts\)"
+ sed "/${filt}/d" -i 'qt/bitcoin.qrc' || die
+ einfo "Languages -- Enabled:$yeslang -- Disabled:$nolang"
+}
+
+src_configure() {
+ OPTS=()
+
+ use dbus && OPTS+=("USE_DBUS=1")
+ if use upnp; then
+ OPTS+=("USE_UPNP=1")
+ else
+ OPTS+=("USE_UPNP=-")
+ fi
+
+ use qrcode && OPTS+=("USE_QRCODE=1")
+ use ipv6 || OPTS+=("USE_IPV6=-")
+
+ OPTS+=("USE_SYSTEM_LEVELDB=1")
+ OPTS+=("BDB_INCLUDE_PATH=$(db_includedir "${DB_VER}")")
+ OPTS+=("BDB_LIB_SUFFIX=-${DB_VER}")
+
+ if has_version '>=dev-libs/boost-1.52'; then
+ OPTS+=("LIBS+=-lboost_chrono\$\$BOOST_LIB_SUFFIX")
+ fi
+
+ #The litecoin codebase is mostly taken from bitcoin-qt
+ eqmake4 dogecoin-qt.pro "${OPTS[@]}" || die
+}
+
+#Tests are broken with and without our litecoin-sys_leveldb.patch
+#src_test() {
+# cd src || die
+# emake -f makefile.unix "${OPTS[@]}" test_litecoin
+# ./test_litecoin || die 'Tests failed'
+#}
+
+src_install() {
+# qt4-r2_src_install
+
+ dobin ${PN}
+
+ insinto /usr/share/pixmaps
+ newins "share/pixmaps/bitcoin.ico" "${PN}.ico"
+
+ make_desktop_entry "${PN} %u" "Dogecoin-Qt" "/usr/share/pixmaps/${PN}.ico" "Qt;Network;P2P;Office;Finance;" "MimeType=x-scheme-handler/dogecoin;\nTerminal=false"
+
+# newman contrib/debian/manpages/bitcoin-qt.1 ${PN}.1
+
+# if use kde; then
+# insinto /usr/share/kde4/services
+# newins contrib/debian/bitcoin-qt.protocol ${PN}.protocol
+# fi
+}
+
+update_caches() {
+ gnome2_icon_cache_update
+ fdo-mime_desktop_database_update
+ buildsycoca
+}
+
+pkg_postinst() {
+ update_caches
+}
+
+pkg_postrm() {
+ update_caches
+}
diff --git a/net-p2p/dogecoin-qt/metadata.xml b/net-p2p/dogecoin-qt/metadata.xml
new file mode 100644
index 00000000000..0439a5a398a
--- /dev/null
+++ b/net-p2p/dogecoin-qt/metadata.xml
@@ -0,0 +1,18 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+ <maintainer>
+ <email>sdamashek@gentoo.org</email>
+ <name>Samuel Damashek</name>
+ </maintainer>
+ <longdescription lang="en">
+ This is a client for the Dogecoin cryptocurrency.
+ Dogecoin is a scrypt-based alternative to Bitcoin.
+ </longdescription>
+ <use>
+ <flag name="qrcode">Enable generation of QR Codes for receiving payments</flag>
+ </use>
+ <upstream>
+ <remote-id type="github">dogecoin/dogecoin</remote-id>
+ </upstream>
+</pkgmetadata>
diff --git a/net-p2p/ed2k_hash/Manifest b/net-p2p/ed2k_hash/Manifest
new file mode 100644
index 00000000000..e52f53d1715
--- /dev/null
+++ b/net-p2p/ed2k_hash/Manifest
@@ -0,0 +1 @@
+DIST ed2k_hash-0.4.0.tar.gz 113158 SHA256 554b2d9fb3ce668312341f43bafc95cf985059d83bf5e82f92547610c7f2bf18 SHA512 f924c6b39bf82fe0d4e68decb5ae9fb5ce2999e8b1d3083ba97c178f3f716634603982962947cecb2ef20de56672b10e833d104bae9627ae180ba629c9e1b4c6 WHIRLPOOL e65036d632a6dfed746c851c76727fe43ae3fbb7818a0ec2d26d0190279b9a119c2854158124c5bc493ada9421acc0bfcf9229ab3f016e291ac9f8f0c7264481
diff --git a/net-p2p/ed2k_hash/ed2k_hash-0.4.0-r1.ebuild b/net-p2p/ed2k_hash/ed2k_hash-0.4.0-r1.ebuild
new file mode 100644
index 00000000000..666a7b1de82
--- /dev/null
+++ b/net-p2p/ed2k_hash/ed2k_hash-0.4.0-r1.ebuild
@@ -0,0 +1,36 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=5
+inherit flag-o-matic eutils
+
+DESCRIPTION="Tool for generating eDonkey2000 links"
+HOMEPAGE="http://ed2k-tools.sourceforge.net/ed2k_hash.shtml"
+RESTRICT="mirror"
+SRC_URI="mirror://sourceforge/ed2k-tools/${P}.tar.gz"
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="amd64 ppc ~sparc x86"
+IUSE="fltk"
+DEPEND="fltk? ( x11-libs/fltk:1 )"
+
+src_prepare() {
+ epatch "${FILESDIR}/ed2k_64bit.patch"
+}
+
+src_configure() {
+ if use fltk; then
+ append-ldflags "$(fltk-config --ldflags)"
+ export CPPFLAGS="$(fltk-config --cxxflags)"
+ else
+ export ac_cv_lib_fltk_main='no'
+ fi
+
+ econf --disable-dependency-tracking
+}
+
+src_install() {
+ emake install DESTDIR="${D}" mydocdir=/usr/share/doc/${PF}/html
+ dodoc AUTHORS INSTALL README TODO
+}
diff --git a/net-p2p/ed2k_hash/files/ed2k_64bit.patch b/net-p2p/ed2k_hash/files/ed2k_64bit.patch
new file mode 100644
index 00000000000..7425bb0c03f
--- /dev/null
+++ b/net-p2p/ed2k_hash/files/ed2k_64bit.patch
@@ -0,0 +1,12 @@
+--- ed2k_hash-0.4.0/work/ed2k_hash-0.4.0/ed2k_hash/md4.h 2002-09-04 18:24:37.000000000 +0100
++++ ed2k_hash-0.4.0_orig/work/ed2k_hash-0.4.0/ed2k_hash/md4.h 2004-09-02 21:13:49.900613616 +0100
+@@ -66,7 +66,8 @@
+ typedef unsigned short int UINT2;
+
+ /* UINT4 defines a four byte word */
+-typedef unsigned long int UINT4;
++/* unsigned long int on 64bit is 8 bits */
++typedef unsigned int UINT4;
+
+ /* PROTO_LIST is defined depending on how PROTOTYPES is defined above.
+ If using PROTOTYPES, then PROTO_LIST returns the list, otherwise it
diff --git a/net-p2p/ed2k_hash/metadata.xml b/net-p2p/ed2k_hash/metadata.xml
new file mode 100644
index 00000000000..d3e5908971f
--- /dev/null
+++ b/net-p2p/ed2k_hash/metadata.xml
@@ -0,0 +1,8 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+ <herd>net-p2p</herd>
+ <upstream>
+ <remote-id type="sourceforge">ed2k-tools</remote-id>
+ </upstream>
+</pkgmetadata>
diff --git a/net-p2p/eiskaltdcpp/Manifest b/net-p2p/eiskaltdcpp/Manifest
new file mode 100644
index 00000000000..a9d1493487f
--- /dev/null
+++ b/net-p2p/eiskaltdcpp/Manifest
@@ -0,0 +1 @@
+DIST eiskaltdcpp-2.2.9.tar.xz 2327732 SHA256 3d9170645450f9cb0a605278b8646fec2110b9637910d86fd27cf245cbe24eaf SHA512 0de95d3dcfb860f262073497e8dacc6bb4371d72a13f23bf7981e96203d7361a2e078b45826c12a81cc8fbe8423ee231232e2874a02bcef76f96b516cb7e301c WHIRLPOOL a1ab51ef32a96cb6af5b6988068f93cade26def068509f269eb95a934e07adfddf850e85d1c48eb5fb3ba75cff97d5e4bf6843a4375c099dcb2658be983c008f
diff --git a/net-p2p/eiskaltdcpp/eiskaltdcpp-2.2.9.ebuild b/net-p2p/eiskaltdcpp/eiskaltdcpp-2.2.9.ebuild
new file mode 100644
index 00000000000..10ce22e7977
--- /dev/null
+++ b/net-p2p/eiskaltdcpp/eiskaltdcpp-2.2.9.ebuild
@@ -0,0 +1,147 @@
+# Copyright 1999-2014 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI="5"
+
+PLOCALES="be bg cs de el en es fr hu it pl pt_BR ru sk sr@latin uk"
+
+inherit cmake-utils eutils l10n fdo-mime gnome2-utils
+[[ ${PV} = *9999* ]] && inherit git-r3
+
+DESCRIPTION="Qt based client for DirectConnect and ADC protocols, based on DC++ library"
+HOMEPAGE="https://code.google.com/p/eiskaltdc/"
+
+LICENSE="GPL-2 GPL-3"
+SLOT="0"
+IUSE="cli daemon dbus +dht +emoticons examples -gtk idn -javascript json libcanberra libnotify lua +minimal pcre +qt4 sound spell sqlite upnp -xmlrpc"
+
+REQUIRED_USE="
+ cli? ( ^^ ( json xmlrpc ) )
+ emoticons? ( || ( gtk qt4 ) )
+ dbus? ( qt4 )
+ javascript? ( qt4 )
+ json? ( !xmlrpc )
+ libcanberra? ( gtk )
+ libnotify? ( gtk )
+ spell? ( qt4 )
+ sound? ( || ( gtk qt4 ) )
+ sqlite? ( qt4 )
+"
+
+if [[ ${PV} != *9999* ]]; then
+ SRC_URI="https://eiskaltdc.googlecode.com/files/${P}.tar.xz"
+ KEYWORDS="amd64 x86"
+else
+ EGIT_REPO_URI="https://github.com/${PN}/${PN}.git"
+ KEYWORDS=""
+fi
+
+RDEPEND="
+ app-arch/bzip2
+ >=dev-libs/boost-1.38:=
+ >=dev-libs/openssl-0.9.8
+ sys-apps/attr
+ sys-libs/zlib
+ virtual/libiconv
+ virtual/libintl
+ idn? ( net-dns/libidn )
+ lua? ( >=dev-lang/lua-5.1 )
+ pcre? ( >=dev-libs/libpcre-4.2 )
+ upnp? ( >=net-libs/miniupnpc-1.6 )
+ cli? (
+ >=dev-lang/perl-5.10
+ virtual/perl-Getopt-Long
+ dev-perl/Data-Dump
+ dev-perl/Term-ShellUI
+ json? ( dev-perl/JSON-RPC )
+ xmlrpc? ( dev-perl/RPC-XML )
+ )
+ daemon? ( xmlrpc? ( >=dev-libs/xmlrpc-c-1.19.0[abyss,cxx] ) )
+ gtk? (
+ x11-libs/pango
+ x11-libs/gtk+:3
+ >=dev-libs/glib-2.24:2
+ x11-themes/hicolor-icon-theme
+ libcanberra? ( media-libs/libcanberra )
+ libnotify? ( >=x11-libs/libnotify-0.4.1 )
+ )
+ qt4? (
+ >=dev-qt/qtcore-4.6.0:4
+ >=dev-qt/qtgui-4.6.0:4
+ dbus? ( >=dev-qt/qtdbus-4.6.0:4 )
+ javascript? (
+ dev-qt/qtscript:4
+ x11-libs/qtscriptgenerator
+ )
+ spell? ( app-text/aspell )
+ sqlite? ( dev-qt/qtsql:4[sqlite] )
+ )
+"
+DEPEND="${RDEPEND}
+ sys-devel/gettext
+ virtual/pkgconfig
+"
+DOCS=( AUTHORS ChangeLog.txt )
+
+pkg_pretend() {
+ if [[ ${MERGE_TYPE} != binary ]]; then
+ [[ $(gcc-major-version) -lt 4 ]] || \
+ ( [[ $(gcc-major-version) -eq 4 && $(gcc-minor-version) -le 4 ]] ) \
+ && die "Sorry, but gcc-4.4 and earlier won't work."
+ fi
+}
+
+src_prepare() {
+ l10n_find_plocales_changes 'eiskaltdcpp-qt/translations' '' '.ts'
+
+ epatch_user
+}
+
+src_configure() {
+ local mycmakeargs=(
+ -DLIB_INSTALL_DIR="$(get_libdir)"
+ -Dlinguas="$(l10n_get_locales)"
+ -DLOCAL_MINIUPNP=OFF
+ -DUSE_GTK=OFF
+ -DUSE_LIBGNOME2=OFF
+ "$(use cli && cmake-utils_use json USE_CLI_JSONRPC)"
+ "$(use cli && cmake-utils_use xmlrpc USE_CLI_XMLRPC)"
+ "$(cmake-utils_use daemon NO_UI_DAEMON)"
+ "$(use daemon && cmake-utils_use json JSONRPC_DAEMON)"
+ "$(use daemon && cmake-utils_use xmlrpc XMLRPC_DAEMON)"
+ "$(cmake-utils_use dbus DBUS_NOTIFY)"
+ "$(cmake-utils_use dht WITH_DHT)"
+ "$(cmake-utils_use emoticons WITH_EMOTICONS)"
+ "$(cmake-utils_use examples WITH_EXAMPLES)"
+ "$(cmake-utils_use gtk USE_GTK3)"
+ "$(cmake-utils_use idn USE_IDNA)"
+ "$(cmake-utils_use javascript USE_JS)"
+ "$(cmake-utils_use libcanberra LIBCANBERRA)"
+ "$(cmake-utils_use libnotify USE_LIBNOTIFY)"
+ "$(cmake-utils_use lua LUA_SCRIPT)"
+ "$(cmake-utils_use lua WITH_LUASCRIPTS)"
+ "$(cmake-utils_use !minimal WITH_DEV_FILES)"
+ "$(cmake-utils_use pcre PERL_REGEX)"
+ "$(cmake-utils_use qt4 USE_QT)"
+ "$(cmake-utils_use sound WITH_SOUNDS)"
+ "$(cmake-utils_use spell USE_ASPELL)"
+ "$(cmake-utils_use sqlite USE_QT_SQLITE)"
+ "$(cmake-utils_use upnp USE_MINIUPNP)"
+ )
+ cmake-utils_src_configure
+}
+
+pkg_preinst() {
+ gnome2_icon_savelist
+}
+
+pkg_postinst() {
+ fdo-mime_desktop_database_update
+ gnome2_icon_cache_update
+}
+
+pkg_postrm() {
+ fdo-mime_desktop_database_update
+ gnome2_icon_cache_update
+}
diff --git a/net-p2p/eiskaltdcpp/eiskaltdcpp-9999.ebuild b/net-p2p/eiskaltdcpp/eiskaltdcpp-9999.ebuild
new file mode 100644
index 00000000000..74906046697
--- /dev/null
+++ b/net-p2p/eiskaltdcpp/eiskaltdcpp-9999.ebuild
@@ -0,0 +1,147 @@
+# Copyright 1999-2014 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI="5"
+
+PLOCALES="be bg cs de el en es fr hu it pl pt_BR ru sk sr@latin sv_SE uk vi zh_CN"
+
+inherit cmake-utils eutils l10n fdo-mime gnome2-utils
+[[ ${PV} = *9999* ]] && inherit git-r3
+
+DESCRIPTION="Qt based client for DirectConnect and ADC protocols, based on DC++ library"
+HOMEPAGE="https://code.google.com/p/eiskaltdc/"
+
+LICENSE="GPL-2 GPL-3"
+SLOT="0"
+IUSE="cli daemon dbus +dht +emoticons examples -gtk idn -javascript json libcanberra libnotify lua +minimal pcre +qt4 sound spell sqlite upnp -xmlrpc"
+
+REQUIRED_USE="
+ cli? ( ^^ ( json xmlrpc ) )
+ emoticons? ( || ( gtk qt4 ) )
+ dbus? ( qt4 )
+ javascript? ( qt4 )
+ json? ( !xmlrpc )
+ libcanberra? ( gtk )
+ libnotify? ( gtk )
+ spell? ( qt4 )
+ sound? ( || ( gtk qt4 ) )
+ sqlite? ( qt4 )
+"
+
+if [[ ${PV} != *9999* ]]; then
+ SRC_URI="https://eiskaltdc.googlecode.com/files/${P}.tar.xz"
+ KEYWORDS="~amd64 ~x86"
+else
+ EGIT_REPO_URI="https://github.com/${PN}/${PN}.git"
+ KEYWORDS=""
+fi
+
+RDEPEND="
+ app-arch/bzip2
+ >=dev-libs/boost-1.38:=
+ >=dev-libs/openssl-0.9.8
+ sys-apps/attr
+ sys-libs/zlib
+ virtual/libiconv
+ virtual/libintl
+ idn? ( net-dns/libidn )
+ lua? ( >=dev-lang/lua-5.1 )
+ pcre? ( >=dev-libs/libpcre-4.2 )
+ upnp? ( >=net-libs/miniupnpc-1.6 )
+ cli? (
+ >=dev-lang/perl-5.10
+ virtual/perl-Getopt-Long
+ dev-perl/Data-Dump
+ dev-perl/Term-ShellUI
+ json? ( dev-perl/JSON-RPC )
+ xmlrpc? ( dev-perl/RPC-XML )
+ )
+ daemon? ( xmlrpc? ( >=dev-libs/xmlrpc-c-1.19.0[abyss,cxx] ) )
+ gtk? (
+ x11-libs/pango
+ x11-libs/gtk+:3
+ >=dev-libs/glib-2.24:2
+ x11-themes/hicolor-icon-theme
+ libcanberra? ( media-libs/libcanberra )
+ libnotify? ( >=x11-libs/libnotify-0.4.1 )
+ )
+ qt4? (
+ >=dev-qt/qtcore-4.6.0:4
+ >=dev-qt/qtgui-4.6.0:4
+ dbus? ( >=dev-qt/qtdbus-4.6.0:4 )
+ javascript? (
+ dev-qt/qtscript:4
+ x11-libs/qtscriptgenerator
+ )
+ spell? ( app-text/aspell )
+ sqlite? ( dev-qt/qtsql:4[sqlite] )
+ )
+"
+DEPEND="${RDEPEND}
+ sys-devel/gettext
+ virtual/pkgconfig
+"
+DOCS=( AUTHORS ChangeLog.txt )
+
+pkg_pretend() {
+ if [[ ${MERGE_TYPE} != binary ]]; then
+ [[ $(gcc-major-version) -lt 4 ]] || \
+ ( [[ $(gcc-major-version) -eq 4 && $(gcc-minor-version) -le 4 ]] ) \
+ && die "Sorry, but gcc-4.4 and earlier won't work."
+ fi
+}
+
+src_prepare() {
+ l10n_find_plocales_changes 'eiskaltdcpp-qt/translations' '' '.ts'
+
+ epatch_user
+}
+
+src_configure() {
+ local mycmakeargs=(
+ -DLIB_INSTALL_DIR="$(get_libdir)"
+ -Dlinguas="$(l10n_get_locales)"
+ -DLOCAL_MINIUPNP=OFF
+ -DUSE_GTK=OFF
+ -DUSE_LIBGNOME2=OFF
+ "$(use cli && cmake-utils_use json USE_CLI_JSONRPC)"
+ "$(use cli && cmake-utils_use xmlrpc USE_CLI_XMLRPC)"
+ "$(cmake-utils_use daemon NO_UI_DAEMON)"
+ "$(use daemon && cmake-utils_use json JSONRPC_DAEMON)"
+ "$(use daemon && cmake-utils_use xmlrpc XMLRPC_DAEMON)"
+ "$(cmake-utils_use dbus DBUS_NOTIFY)"
+ "$(cmake-utils_use dht WITH_DHT)"
+ "$(cmake-utils_use emoticons WITH_EMOTICONS)"
+ "$(cmake-utils_use examples WITH_EXAMPLES)"
+ "$(cmake-utils_use gtk USE_GTK3)"
+ "$(cmake-utils_use idn USE_IDNA)"
+ "$(cmake-utils_use javascript USE_JS)"
+ "$(cmake-utils_use libcanberra LIBCANBERRA)"
+ "$(cmake-utils_use libnotify USE_LIBNOTIFY)"
+ "$(cmake-utils_use lua LUA_SCRIPT)"
+ "$(cmake-utils_use lua WITH_LUASCRIPTS)"
+ "$(cmake-utils_use !minimal WITH_DEV_FILES)"
+ "$(cmake-utils_use pcre PERL_REGEX)"
+ "$(cmake-utils_use qt4 USE_QT)"
+ "$(cmake-utils_use sound WITH_SOUNDS)"
+ "$(cmake-utils_use spell USE_ASPELL)"
+ "$(cmake-utils_use sqlite USE_QT_SQLITE)"
+ "$(cmake-utils_use upnp USE_MINIUPNP)"
+ )
+ cmake-utils_src_configure
+}
+
+pkg_preinst() {
+ gnome2_icon_savelist
+}
+
+pkg_postinst() {
+ fdo-mime_desktop_database_update
+ gnome2_icon_cache_update
+}
+
+pkg_postrm() {
+ fdo-mime_desktop_database_update
+ gnome2_icon_cache_update
+}
diff --git a/net-p2p/eiskaltdcpp/metadata.xml b/net-p2p/eiskaltdcpp/metadata.xml
new file mode 100644
index 00000000000..22fd8fd7bb0
--- /dev/null
+++ b/net-p2p/eiskaltdcpp/metadata.xml
@@ -0,0 +1,24 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+<herd>proxy-maintainers</herd>
+<maintainer>
+ <email>nikoli@gmx.us</email>
+ <name>Nikoli</name>
+</maintainer>
+<longdescription lang="en">
+ EiskaltDC++ is a multi-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.
+</longdescription>
+<use>
+ <flag name="cli">Enable sample cli based on readline</flag>
+ <flag name="daemon">Enable eiskaltdcpp-daemon</flag>
+ <flag name="dht">Enable DHT (distributed hash table) support for libeiskaltdcpp</flag>
+ <flag name="emoticons">Install emoticon packs</flag>
+ <flag name="json">Enable JSON for cli and daemon</flag>
+ <flag name="libcanberra">Enable sound notifications support over libcanberra in EiskaltDC++ Gtk</flag>
+ <flag name="minimal">Don't install headers</flag>
+</use>
+</pkgmetadata>
diff --git a/net-p2p/fms/Manifest b/net-p2p/fms/Manifest
new file mode 100644
index 00000000000..1886ec79ae7
--- /dev/null
+++ b/net-p2p/fms/Manifest
@@ -0,0 +1,2 @@
+DIST fms-src-0.3.73.zip 3519550 SHA256 f20985efa71c77c843f7cd16e437414ba2810c5a69d7917456e2a2e6e551a6e5 SHA512 457a6808e85dce8ac3cc31ac465eeb6e271294b6aac9436a12adb21f1dacc5ef8726c558dd6734a7418cff1ce92c172062e0eb5b4642e29a83235cccc9198d2c WHIRLPOOL 8fd8a4b59b003df5b3b91f9d9dde134b3832fb572a772e3129889c56c5c9be10040161cff8fcb1b6183ebe156b9b340bef2481d43519044a8cb54ed0887624a4
+DIST fms-src-0.3.75.zip 3691556 SHA256 1fe5e84aba572143fe95ffb384177e150d5cd4dff2930462b9df24b59c03d85e SHA512 ce5754c0f15c18c0e9692bb840119576ffa9eca05ca38060a0778fc170a614d394ffcc06274bcdc4db5659d176f00e993904a76099382e7eea5685c3a83d3cd8 WHIRLPOOL 405198eff290d8b55e5b5c164fbbd845c086ed76d6d17efa24ab630c109d09b83c8a956b45d6613672b08a19101275a6a8375ba06065e6d9e9b20e1da6c759af
diff --git a/net-p2p/fms/files/fms b/net-p2p/fms/files/fms
new file mode 100644
index 00000000000..8def4b0eba6
--- /dev/null
+++ b/net-p2p/fms/files/fms
@@ -0,0 +1,38 @@
+#!/sbin/runscript
+# Copyright 1999-2008 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+# Check for OpenRC/Baselayout 2 - see bug #270646
+is_openrc() {
+ [ -f /lib/librc.so -o -f /etc/init.d/sysfs -o -f /lib/rc/version ]
+}
+
+start() {
+ ebegin "Starting FMS"
+ if is_openrc; then
+ start-stop-daemon -S -u freenet:freenet -d /var/freenet/fms -b -x /usr/bin/fms
+ eend $?
+ else
+ cd /var/freenet/fms
+ su -s /bin/sh -c "fms --daemon" freenet
+ eend $?
+ fi
+}
+
+stop() {
+ ebegin "Stopping FMS"
+ if is_openrc; then
+ start-stop-daemon -K -u freenet:freenet -d /var/freenet/fms /usr/bin/fms
+ eend $?
+ else
+ pkill -u freenet -f "fms --daemon"
+ eend 0
+ fi
+ if [[ $RC_CMD == "restart" ]]; then
+ ebegin "Waiting a few seconds to be sure FMS is ready for restart"
+ sleep 10
+ #give fms time to stop and release the nntp port
+ fi
+}
+
diff --git a/net-p2p/fms/files/fms-use-system-libs2.patch b/net-p2p/fms/files/fms-use-system-libs2.patch
new file mode 100644
index 00000000000..39e62e34179
--- /dev/null
+++ b/net-p2p/fms/files/fms-use-system-libs2.patch
@@ -0,0 +1,22 @@
+--- CMakeLists.txt 2012-03-04 13:01:24.000000000 +0100
++++ CMakeLists.txt.new 2012-03-08 22:14:27.000000000 +0100
+@@ -353,9 +353,16 @@
+ ENDIF(AUDIO_CAPTCHA)
+
+ IF(FROST_SUPPORT)
+- ADD_SUBDIRECTORY(libs/polarssl)
+- TARGET_LINK_LIBRARIES(fms polarssl)
+- INCLUDE_DIRECTORIES(libs/polarssl/include)
++
++ FIND_LIBRARY(POLARSSL_LIBRARY NAMES polarssl libpolarssl)
++
++ IF(POLARSSL_LIBRARY)
++ TARGET_LINK_LIBRARIES(fms ${POLARSSL_LIBRARY})
++ ELSE(POLARSSL_LIBRARY)
++ ADD_SUBDIRECTORY(libs/polarssl)
++ TARGET_LINK_LIBRARIES(fms polarssl)
++ INCLUDE_DIRECTORIES(libs/polarssl/include)
++ ENDIF(POLARSSL_LIBRARY)
+
+ ADD_DEFINITIONS(-DFROST_SUPPORT)
+
diff --git a/net-p2p/fms/fms-0.3.73.ebuild b/net-p2p/fms/fms-0.3.73.ebuild
new file mode 100644
index 00000000000..4db60f324d8
--- /dev/null
+++ b/net-p2p/fms/fms-0.3.73.ebuild
@@ -0,0 +1,71 @@
+# Copyright 1999-2014 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI="5"
+
+inherit eutils cmake-utils user
+
+DESCRIPTION="A spam-resistant message board application for Freenet"
+HOMEPAGE="http://freenetproject.org/tools.html"
+SRC_URI="mirror://gentoo/${PN}-src-${PV}.zip"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="~amd64 ~x86"
+IUSE="frost"
+
+RDEPEND="virtual/libiconv
+ frost? ( net-libs/polarssl )
+ >=dev-libs/poco-1.4.3_p1
+ >=dev-db/sqlite-3.6.15"
+DEPEND="${RDEPEND}
+ app-arch/unzip"
+
+S=${WORKDIR}
+
+pkg_setup() {
+ enewgroup freenet
+ enewuser freenet -1 -1 /var/freenet freenet
+}
+
+src_prepare() {
+ edos2unix src/http/pages/showfilepage.cpp
+ epatch "${FILESDIR}"/${PN}-use-system-libs2.patch
+}
+
+src_configure() {
+ local mycmakeargs="-DI_HAVE_READ_THE_README=ON \
+ -DUSE_BUNDLED_SQLITE=OFF \
+ -DDO_CHARSET_CONVERSION=ON \
+ $(cmake-utils_use frost FROST_SUPPORT)"
+ cmake-utils_src_configure
+}
+
+src_install() {
+ insinto /var/freenet/fms
+ dobin "${CMAKE_BUILD_DIR}"/fms || die
+ doins *.htm || die "doinstall failed"
+ doins -r fonts images styles translations || die
+ fperms -R o-rwx /var/freenet/fms/ /usr/bin/fms
+ fowners -R freenet:freenet /var/freenet/fms/ /usr/bin/fms
+ doinitd "${FILESDIR}/fms" || die "installing init.d file failed"
+ dodoc readme.txt || die "installing doc failed"
+}
+
+pkg_postinst() {
+ if ! has_version 'net-p2p/freenet' ; then
+ ewarn "FMS needs a freenet node to up-/download #ssages."
+ ewarn "Please make sure to have a node you can connect to"
+ ewarn "or install net-p2p/freenet to get FMS working."
+ fi
+ elog "By default, the FMS NNTP server will listen on port 1119,"
+ elog "and the web configuration interface will be running at"
+ elog "http://localhost:8080. For more information, read"
+ elog "${ROOT}usr/share/doc/${PF}/readme.txt.bz2"
+ if use frost; then
+ elog " "
+ elog "You need to enable frost on the config page"
+ elog "and restart fms for frost support."
+ fi
+}
diff --git a/net-p2p/fms/fms-0.3.75.ebuild b/net-p2p/fms/fms-0.3.75.ebuild
new file mode 100644
index 00000000000..c3014c21a68
--- /dev/null
+++ b/net-p2p/fms/fms-0.3.75.ebuild
@@ -0,0 +1,71 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI="5"
+
+inherit eutils cmake-utils user
+
+DESCRIPTION="A spam-resistant message board application for Freenet"
+HOMEPAGE="http://freenetproject.org/tools.html"
+SRC_URI="mirror://gentoo/${PN}-src-${PV}.zip"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="~amd64 ~x86"
+IUSE="frost"
+
+RDEPEND="virtual/libiconv
+ frost? ( net-libs/polarssl )
+ >=dev-libs/poco-1.4.3_p1
+ >=dev-db/sqlite-3.6.15"
+DEPEND="${RDEPEND}
+ app-arch/unzip"
+
+S=${WORKDIR}
+
+pkg_setup() {
+ enewgroup freenet
+ enewuser freenet -1 -1 /var/freenet freenet
+}
+
+src_prepare() {
+ edos2unix src/http/pages/showfilepage.cpp
+ epatch "${FILESDIR}"/${PN}-use-system-libs2.patch
+}
+
+src_configure() {
+ local mycmakeargs="-DI_HAVE_READ_THE_README=ON \
+ -DUSE_BUNDLED_SQLITE=OFF \
+ -DDO_CHARSET_CONVERSION=ON \
+ $(cmake-utils_use frost FROST_SUPPORT)"
+ cmake-utils_src_configure
+}
+
+src_install() {
+ insinto /var/freenet/fms
+ dobin "${CMAKE_BUILD_DIR}"/fms || die
+ doins *.htm || die "doinstall failed"
+ doins -r fonts images styles translations || die
+ fperms -R o-rwx /var/freenet/fms/ /usr/bin/fms
+ fowners -R freenet:freenet /var/freenet/fms/ /usr/bin/fms
+ doinitd "${FILESDIR}/fms" || die "installing init.d file failed"
+ dodoc readme.txt || die "installing doc failed"
+}
+
+pkg_postinst() {
+ if ! has_version 'net-p2p/freenet' ; then
+ ewarn "FMS needs a freenet node to up-/download #ssages."
+ ewarn "Please make sure to have a node you can connect to"
+ ewarn "or install net-p2p/freenet to get FMS working."
+ fi
+ elog "By default, the FMS NNTP server will listen on port 1119,"
+ elog "and the web configuration interface will be running at"
+ elog "http://localhost:8080. For more information, read"
+ elog "${ROOT}usr/share/doc/${PF}/readme.txt.bz2"
+ if use frost; then
+ elog " "
+ elog "You need to enable frost on the config page"
+ elog "and restart fms for frost support."
+ fi
+}
diff --git a/net-p2p/fms/metadata.xml b/net-p2p/fms/metadata.xml
new file mode 100644
index 00000000000..6c6e72a6d9f
--- /dev/null
+++ b/net-p2p/fms/metadata.xml
@@ -0,0 +1,13 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+ <maintainer>
+ <email>tommy@gentoo.org</email>
+ <name>Thomas Sachau (Tommy[D])</name>
+ </maintainer>
+ <herd>net-p2p</herd>
+ <use>
+ <flag name='frost'>Add support for frost boards</flag>
+ </use>
+</pkgmetadata>
+
diff --git a/net-p2p/freenet/Manifest b/net-p2p/freenet/Manifest
new file mode 100644
index 00000000000..f0a9d430882
--- /dev/null
+++ b/net-p2p/freenet/Manifest
@@ -0,0 +1,5 @@
+DIST freenet-0.7.5_p1466.zip 4713492 SHA256 561819f7ca186bbc171d3123ad23f5692ab9d90a6237986a0ee4f16edde44d40 SHA512 0406eaae3c456e24db83886d2b619d5f063efb1cb313017e95437214e7a73bd48190c4128f22a9b4d919dc03acdd45bd2d20f51d35552c3777ca14644e26ec03 WHIRLPOOL f0f5778c939997f0fd2db58e5f78d6d32c95ee1768aff19d68f5b057c0623faafb712574db30a39524510cabf49138d920a9fb7e55232111dc3e8ddba3ea93b5
+DIST freenet-0.7.5_p1467.zip 4715115 SHA256 1547ffea356c35a03ce62a35d9fa601b45beee1d8f78e17116e09461a4d0e27f SHA512 419651183b804f66735d2d5aa78ba571373a140f7da53c05499462caf8fe774edcaa2ad34b04b94340a0064b6f334a2d53c4d1c25f4c02e1b79940f62e8878cd WHIRLPOOL ebb23f738bcf10e66d364b3be5621a1d8e5b52862919ef8f1892624a1993a2b361a1b1cc57a342699fd55303920ddc795f11502eef25d26c9deff753d11df2c5
+DIST freenet-ant-1.7.1.jar 1327167 SHA256 634e0b616d65d611419920e8b379b7b66399e44f520baa772147ed73743433b1 SHA512 2c84378d995fed0630169fffab020bde89c3edb7b3bc1e14e2251ed71be684dc2520fdeed8bae382de362984e25a31dcd59326ef8735f8066166c1e8d98ca408 WHIRLPOOL 667be2b1581c5fd847907b63522a0f83c595a6b8f1805d714e978a5cb0f05de4804153c89605618adf5c3b097a7019e7d7e9de0bf0987c7b1adb0dbc54e0f055
+DIST seednodes-20140810.fref.bz2 11566 SHA256 51650b15395b0b57a01c2a917854007021bc5d3284b6eb3d3c167e8d0fa5bf58 SHA512 9d999f57cafd26ef7e5e0768d07dca18d923c82da0b9da447ad78a0ec8cfe087168c3fc17e776e8120e68149d7839cabf03e7a18086a32f11f7348d1d64768e1 WHIRLPOOL 90035bef3351681cc0bcb97bcd98431eeb2566c9c39ccf4eadf5c555f494a1faeb687569881501c88f54270db91139408c820fe6f541aab3c695277a2ec04df0
+DIST seednodes-20150427.fref.bz2 12926 SHA256 6f2a50e8dbfdf81840b11bcb64bf37587efd08afe521709d0071f9dbc4366812 SHA512 821b204fac745b7baad23dd0fd0effc956f7a2013ac96e76daa3475113b254dd332c87a306cc78e80a806800b052d04ce35d2007c1afced2cc180e327cf0ebb5 WHIRLPOOL 3ae7880e8b1bad93b2ca2f47c2bd384bce4ead13f665c8c9fbee5fbf5d211e135a5c89ad2dd05b47cade4e03fd33780cf11aa6989da019ca22adb74e1e8a3e61
diff --git a/net-p2p/freenet/files/0.7.5_p1302-ext.patch b/net-p2p/freenet/files/0.7.5_p1302-ext.patch
new file mode 100644
index 00000000000..035b4e638cc
--- /dev/null
+++ b/net-p2p/freenet/files/0.7.5_p1302-ext.patch
@@ -0,0 +1,22 @@
+--- src/freenet/node/NodeStarter.java 2010-11-10 21:46:10.000000000 +0100
++++ src/freenet/node/NodeStarter.java.new 2010-11-10 21:50:12.000000000 +0100
+@@ -49,8 +49,8 @@
+ public static final String extRevisionNumber;
+
+ static {
+- extBuildNumber = ExtVersion.extBuildNumber();
+- extRevisionNumber = ExtVersion.extRevisionNumber();
++ extBuildNumber = RECOMMENDED_EXT_BUILD_NUMBER;
++ extRevisionNumber = "";
+ }
+
+ private FreenetFilePersistentConfig cfg;
+@@ -86,7 +86,7 @@
+ return Integer.valueOf(-1);
+ }
+
+- String builtWithMessage = "freenet.jar built with freenet-ext.jar Build #" + ExtVersion.buildNumber + " r" + ExtVersion.cvsRevision+" running with ext build "+extBuildNumber+" r" + extRevisionNumber;
++ String builtWithMessage = "freenet.jar built with freenet-ext.jar Build #" + extBuildNumber + " running with ext build "+extBuildNumber;
+ Logger.normal(this, builtWithMessage);
+ System.out.println(builtWithMessage);
+
diff --git a/net-p2p/freenet/files/0.7.5_p1321-ext.patch b/net-p2p/freenet/files/0.7.5_p1321-ext.patch
new file mode 100644
index 00000000000..1d2ba8f140f
--- /dev/null
+++ b/net-p2p/freenet/files/0.7.5_p1321-ext.patch
@@ -0,0 +1,22 @@
+--- src/freenet/node/NodeStarter.java 2010-11-10 21:46:10.000000000 +0100
++++ src/freenet/node/NodeStarter.java.new 2010-11-10 21:50:12.000000000 +0100
+@@ -49,8 +49,8 @@
+ public static final String extRevisionNumber;
+
+ static {
+- extBuildNumber = ExtVersion.extBuildNumber();
+- extRevisionNumber = ExtVersion.extRevisionNumber();
++ extBuildNumber = 29;
++ extRevisionNumber = "";
+ }
+
+ private FreenetFilePersistentConfig cfg;
+@@ -86,7 +86,7 @@
+ return Integer.valueOf(-1);
+ }
+
+- String builtWithMessage = "freenet.jar built with freenet-ext.jar Build #" + ExtVersion.buildNumber + " r" + ExtVersion.cvsRevision+" running with ext build "+extBuildNumber+" r" + extRevisionNumber;
++ String builtWithMessage = "freenet.jar built with freenet-ext.jar Build #" + extBuildNumber + " running with ext build "+extBuildNumber;
+ Logger.normal(this, builtWithMessage);
+ System.out.println(builtWithMessage);
+
diff --git a/net-p2p/freenet/files/freenet b/net-p2p/freenet/files/freenet
new file mode 100644
index 00000000000..f276ee4ea0f
--- /dev/null
+++ b/net-p2p/freenet/files/freenet
@@ -0,0 +1,18 @@
+#!/sbin/runscript
+# Copyright 1999-2004 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+start() {
+ start-stop-daemon --start --chuid freenet --exec /bin/sh /var/freenet/run.sh start 2>/dev/null
+ eend 0
+}
+
+status() {
+ start-stop-daemon --start --chuid freenet --exec /bin/sh /var/freenet/run.sh status 2>/dev/null
+ eend 0
+}
+
+stop() {
+ start-stop-daemon --start --chuid freenet --exec /bin/sh /var/freenet/run.sh stop 2>/dev/null
+ eend 0
+}
diff --git a/net-p2p/freenet/files/freenet-0.7.5_p1384-libraryloader-just-try-loading.patch b/net-p2p/freenet/files/freenet-0.7.5_p1384-libraryloader-just-try-loading.patch
new file mode 100644
index 00000000000..ffe9354dc84
--- /dev/null
+++ b/net-p2p/freenet/files/freenet-0.7.5_p1384-libraryloader-just-try-loading.patch
@@ -0,0 +1,17 @@
+--- freenet-0.7.5_p1384/src/freenet/support/LibraryLoader.java.orig 2011-07-29 17:32:37.000000000 +0200
++++ freenet-0.7.5_p1384/src/freenet/support/LibraryLoader.java 2011-07-29 17:35:02.000000000 +0200
+@@ -48,12 +48,11 @@
+ final String libraryNameWithPrefixAndArchAndSuffix = libraryNameWithPrefixAndArch + prefix;
+ String resourceName = path + libraryNameWithPrefixAndArchAndSuffix;
+
+- File nativeLib = new File((System.getProperty("java.library.path")) + "/lib" + libraryName + prefix);
+- if (nativeLib.exists()) {
++ try {
+ System.out.println("Attempting to load the NativeThread library ["+libraryName+']');
+ System.loadLibrary(libraryName);
+ success = true;
+- } else {
++ } catch(UnsatisfiedLinkError ule) {
+ try {
+ // Get the resource
+ URL resource = LibraryLoader.class.getResource(resourceName);
diff --git a/net-p2p/freenet/files/freenet-0.7.5_p1384-nativebiginteger-no-nativedoublevalue.patch b/net-p2p/freenet/files/freenet-0.7.5_p1384-nativebiginteger-no-nativedoublevalue.patch
new file mode 100644
index 00000000000..5300fb19623
--- /dev/null
+++ b/net-p2p/freenet/files/freenet-0.7.5_p1384-nativebiginteger-no-nativedoublevalue.patch
@@ -0,0 +1,28 @@
+--- freenet-0.7.5_p1384/src/net/i2p/util/NativeBigInteger.java.orig 2011-07-29 16:48:36.000000000 +0200
++++ freenet-0.7.5_p1384/src/net/i2p/util/NativeBigInteger.java 2011-07-29 16:50:20.000000000 +0200
+@@ -193,12 +193,6 @@
+ */
+ public native static byte[] nativeModPow(byte base[], byte exponent[], byte modulus[]);
+
+- /**
+- * Converts a BigInteger byte-array to a 'double'
+- * @param ba Big endian twos complement representation of the BigInteger to convert to a double
+- * @return The plain double-value represented by 'ba'
+- */
+- public native static double nativeDoubleValue(byte ba[]);
+ private byte[] cachedBa = null;
+
+ /**
+@@ -286,11 +280,7 @@
+
+ @Override
+ public double doubleValue() {
+- // TODO Recent tests show that Java version is quicker. Maybe drop?
+- if(_nativeOk)
+- return nativeDoubleValue(toByteArray());
+- else
+- return super.doubleValue();
++ return super.doubleValue();
+ }
+
+ /**
diff --git a/net-p2p/freenet/files/freenet-0.7.5_p1389-wrapper.conf b/net-p2p/freenet/files/freenet-0.7.5_p1389-wrapper.conf
new file mode 100644
index 00000000000..066f6247429
--- /dev/null
+++ b/net-p2p/freenet/files/freenet-0.7.5_p1389-wrapper.conf
@@ -0,0 +1,49 @@
+wrapper.java.command=java
+wrapper.working.dir=/var/freenet/
+wrapper.java.mainclass=freenet.node.NodeStarter
+wrapper.java.library.path.1=/usr/lib
+wrapper.java.initmemory=60
+wrapper.java.maxmemory=128
+wrapper.java.additional.1=-Dnetworkaddress.cache.ttl=0
+wrapper.java.additional.2=-Dnetworkaddress.cache.negative.ttl=0
+wrapper.java.additional.3=-enableassertions:freenet
+# You might want to set the following line if you have changed java.maxmemory
+wrapper.java.additional.4=-XX:MaxPermSize=256M
+
+wrapper.app.parameter.1=freenet.ini
+wrapper.console.format=PM
+wrapper.console.loglevel=INFO
+wrapper.logfile=wrapper.log
+wrapper.logfile.format=LPTM
+wrapper.logfile.loglevel=INFO
+wrapper.logfile.maxsize=2M
+wrapper.logfile.maxfiles=3
+wrapper.syslog.loglevel=NONE
+wrapper.console.title=Freenet 0.7
+wrapper.jvm_exit.timeout=120
+wrapper.restart.reload_configuration=TRUE
+wrapper.filter.trigger.1=java.lang.OutOfMemoryError
+wrapper.filter.action.1=RESTART
+
+# Name of the service
+wrapper.ntservice.name=freenet-darknet
+
+# Display name of the service
+wrapper.ntservice.displayname=Freenet 0.7 darknet
+
+# Description of the service
+wrapper.ntservice.description=The Free Network Project daemon
+
+# Service dependencies. Add dependencies as needed starting from 1
+wrapper.ntservice.dependency.1=
+
+# Mode in which the service is installed. AUTO_START or DEMAND_START
+wrapper.ntservice.starttype=AUTO_START
+
+# Allow the service to interact with the desktop.
+wrapper.ntservice.interactive=false
+
+wrapper.ntservice.process_priority=BELOW_NORMAL
+
+# Start services with a different user than SYSTEM
+# SEE http://wrapper.tanukisoftware.org/doc/english/prop-ntservice-account.html BEFORE PROCEEDING !
diff --git a/net-p2p/freenet/files/freenet-0.7.5_p1422-wrapper.conf b/net-p2p/freenet/files/freenet-0.7.5_p1422-wrapper.conf
new file mode 100644
index 00000000000..a8176aaadb7
--- /dev/null
+++ b/net-p2p/freenet/files/freenet-0.7.5_p1422-wrapper.conf
@@ -0,0 +1,27 @@
+wrapper.java.command=java
+wrapper.working.dir=/var/freenet/
+wrapper.java.mainclass=freenet.node.NodeStarter
+wrapper.java.library.path.1=/usr/lib
+wrapper.java.initmemory=60
+wrapper.java.maxmemory=256
+wrapper.java.additional.1=-Dnetworkaddress.cache.ttl=0
+wrapper.java.additional.2=-Dnetworkaddress.cache.negative.ttl=0
+wrapper.java.additional.3=-enableassertions:freenet
+# You might want to set the following line if you have changed java.maxmemory
+wrapper.java.additional.4=-XX:MaxPermSize=256M
+
+wrapper.app.parameter.1=freenet.ini
+wrapper.console.format=PM
+wrapper.console.loglevel=INFO
+wrapper.logfile=wrapper.log
+wrapper.logfile.format=LPTM
+wrapper.logfile.loglevel=INFO
+wrapper.logfile.maxsize=2M
+wrapper.logfile.maxfiles=3
+wrapper.syslog.loglevel=NONE
+wrapper.console.title=Freenet 0.7
+wrapper.jvm_exit.timeout=120
+wrapper.restart.reload_configuration=TRUE
+wrapper.filter.trigger.1=java.lang.OutOfMemoryError
+wrapper.filter.action.1=RESTART
+
diff --git a/net-p2p/freenet/files/freenet.old b/net-p2p/freenet/files/freenet.old
new file mode 100644
index 00000000000..d0df97e471b
--- /dev/null
+++ b/net-p2p/freenet/files/freenet.old
@@ -0,0 +1,18 @@
+#!/sbin/runscript
+# Copyright 1999-2004 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+start() {
+ start-stop-daemon --start --chuid freenet --exec /var/freenet/run.sh start 2>/dev/null
+ eend 0
+}
+
+status() {
+ start-stop-daemon --start --chuid freenet --exec /var/freenet/run.sh status 2>/dev/null
+ eend 0
+}
+
+stop() {
+ start-stop-daemon --start --chuid freenet --exec /var/freenet/run.sh stop 2>/dev/null
+ eend 0
+}
diff --git a/net-p2p/freenet/files/freenet.service b/net-p2p/freenet/files/freenet.service
new file mode 100644
index 00000000000..17df1373dc3
--- /dev/null
+++ b/net-p2p/freenet/files/freenet.service
@@ -0,0 +1,13 @@
+[Unit]
+Description=An encrypted network without censorship and monitoring.
+After=network.target
+
+[Service]
+User=freenet
+Type=forking
+ExecStart=/var/freenet/run.sh start
+ExecStop=/var/freenet/run.sh stop
+WorkingDirectory=/var/freenet
+
+[Install]
+WantedBy=multi-user.target
diff --git a/net-p2p/freenet/files/libraryloader-revert-using-of-absolute-path.patch b/net-p2p/freenet/files/libraryloader-revert-using-of-absolute-path.patch
new file mode 100644
index 00000000000..e252aed003d
--- /dev/null
+++ b/net-p2p/freenet/files/libraryloader-revert-using-of-absolute-path.patch
@@ -0,0 +1,19 @@
+commit bad37bf86798d30292769581aca7e71471c34485
+Author: Matthew Toseland <toad@amphibian.dyndns.org>
+Date: Fri Nov 5 23:30:43 2010 +0000
+
+ Use the specific, absolute path, rather than loading from path, for NativeBigInteger library.
+
+diff --git a/src/freenet/support/LibraryLoader.java b/src/freenet/support/LibraryLoader.java
+index d4a22a0..2470d40 100644
+--- a/src/freenet/support/LibraryLoader.java
++++ b/src/freenet/support/LibraryLoader.java
+@@ -45,7 +45,7 @@ public class LibraryLoader {
+ File nativeLib = new File((System.getProperty("java.library.path")) + "/lib" + libraryName + prefix);
+ if (nativeLib.exists()) {
+ System.out.println("Attempting to load the NativeThread library ["+libraryName+']');
+- System.loadLibrary(libraryName);
++ System.loadLibrary(nativeLib.getAbsolutePath());
+ success = true;
+ } else {
+ try {
diff --git a/net-p2p/freenet/files/run.sh-20090501 b/net-p2p/freenet/files/run.sh-20090501
new file mode 100644
index 00000000000..3f9723ff3e7
--- /dev/null
+++ b/net-p2p/freenet/files/run.sh-20090501
@@ -0,0 +1,585 @@
+#! /bin/sh
+
+#
+# Copyright (c) 1999, 2006 Tanuki Software Inc.
+#
+# Java Service Wrapper sh script. Suitable for starting and stopping
+# wrapped Java applications on UNIX platforms.
+#
+
+#-----------------------------------------------------------------------------
+# These settings can be modified to fit the needs of your application
+
+# Application
+APP_NAME="Freenet"
+APP_LONG_NAME="Freenet 0.7"
+
+# Wrapper
+WRAPPER_CMD="/usr/bin/wrapper"
+WRAPPER_CONF="/etc/freenet-wrapper.conf"
+
+# Priority at which to run the wrapper. See "man nice" for valid priorities.
+# nice is only used if a priority is specified.
+
+# Note that Freenet will scale its usage within the specifed niceness, some
+# threads will have a lower priority (higher nice value) than this. Also please
+# don't renice Freenet once it's started.
+PRIORITY=10
+
+# Location of the pid file.
+PIDDIR="/var/freenet/"
+
+# If uncommented, causes the Wrapper to be shutdown using an anchor file.
+# When launched with the 'start' command, it will also ignore all INT and
+# TERM signals.
+IGNORE_SIGNALS=true
+
+# If specified, the Wrapper will be run as the specified user.
+# IMPORTANT - Make sure that the user has the required privileges to write
+# the PID file and wrapper.log files. Failure to be able to write the log
+# file will cause the Wrapper to exit without any way to write out an error
+# message.
+# NOTE - This will set the user which is used to run the Wrapper as well as
+# the JVM and is not useful in situations where a privileged resource or
+# port needs to be allocated prior to the user being changed.
+RUN_AS_USER=freenet
+
+# The following two lines are used by the chkconfig command. Change as is
+# appropriate for your application. They should remain commented.
+# chkconfig: 2345 20 80
+# description: @app.long.name@
+
+# Do not modify anything beyond this point
+#-----------------------------------------------------------------------------
+
+if [ "X`id -u`" = "X0" -a -z "$RUN_AS_USER" ]
+then
+ echo "Do not run this script as root."
+ exit 1
+fi
+
+# and get java implementation too, Sun JDK or Kaffe
+JAVA_IMPL=`java -version 2>&1 | head -n 1 | cut -f1 -d' '`
+
+# sun specific options
+LDPROP=""
+#if [ "$JAVA_IMPL" = "java" ]
+#then
+# echo Sun java detected.
+# # Tell it not to use NPTL.
+# # BAD THINGS happen if it uses NPTL.
+# # Specifically, at least on 1.4.1. and 1.5.0b2, we get hangs
+# # where many threads are stuck waiting for a lock to be
+# # unlocked but no thread owns it.
+#
+# ## won't work on libc2.4 ... let's hope it's fixed
+# if [[ -z "$(/lib/libc.so.6 | head -n 1 | grep 'release version 2.4')" ]]
+# then
+# if [[ -d /lib/tls ]]
+# then
+# LDPROP="set.LD_ASSUME_KERNEL=2.4.1"
+# fi
+# fi
+#fi
+
+
+# Get the fully qualified path to the script
+case $0 in
+ /*)
+ SCRIPT="$0"
+ ;;
+ *)
+ PWD=`pwd`
+ SCRIPT="$PWD/$0"
+ ;;
+esac
+
+# Resolve the true real path without any sym links.
+CHANGED=true
+while [ "X$CHANGED" != "X" ]
+do
+ # Change spaces to ":" so the tokens can be parsed.
+ SCRIPT=`echo $SCRIPT | sed -e 's; ;:;g'`
+ # Get the real path to this script, resolving any symbolic links
+ TOKENS=`echo $SCRIPT | sed -e 's;/; ;g'`
+ REALPATH=
+ for C in $TOKENS; do
+ REALPATH="$REALPATH/$C"
+ while [ -h "$REALPATH" ] ; do
+ LS="`ls -ld "$REALPATH"`"
+ LINK="`expr "$LS" : '.*-> \(.*\)$'`"
+ if expr "$LINK" : '/.*' > /dev/null; then
+ REALPATH="$LINK"
+ else
+ REALPATH="`dirname "$REALPATH"`""/$LINK"
+ fi
+ done
+ done
+
+ # Change ":" chars back to spaces.
+ REALPATH="`echo $REALPATH | sed -e 's;:; ;g'`"
+ SCRIPT="`echo $SCRIPT | sed -e 's;:; ;g'`"
+
+ if [ "$REALPATH" = "$SCRIPT" ]
+ then
+ CHANGED=""
+ else
+ SCRIPT="$REALPATH"
+ fi
+done
+
+# Change the current directory to the location of the script
+cd "`dirname \"$REALPATH\"`"
+REALDIR="`pwd`"
+# If the PIDDIR is relative, set its value relative to the full REALPATH to avoid problems if
+# the working directory is later changed.
+FIRST_CHAR="`echo $PIDDIR | cut -c1,1`"
+if [ "$FIRST_CHAR" != "/" ]
+then
+ PIDDIR="$REALDIR/$PIDDIR"
+fi
+# Same test for WRAPPER_CMD
+FIRST_CHAR="`echo $WRAPPER_CMD | cut -c1,1`"
+if [ "$FIRST_CHAR" != "/" ]
+then
+ WRAPPER_CMD="$REALDIR/$WRAPPER_CMD"
+fi
+# Same test for WRAPPER_CONF
+FIRST_CHAR="`echo $WRAPPER_CONF | cut -c1,1`"
+if [ "$FIRST_CHAR" != "/" ]
+then
+ WRAPPER_CONF="$REALDIR/$WRAPPER_CONF"
+fi
+
+# Process ID
+ANCHORFILE="$PIDDIR/$APP_NAME.anchor"
+PIDFILE="$PIDDIR/$APP_NAME.pid"
+LOCKDIR="$REALDIR"
+LOCKFILE="$LOCKDIR/$APP_NAME"
+pid=""
+
+# Resolve the os
+DIST_OS=`uname -s | tr [:upper:] [:lower:] | tr -d [:blank:]`
+case "$DIST_OS" in
+ 'sunos')
+ DIST_OS="solaris"
+ ;;
+ 'hp-ux' | 'hp-ux64')
+ DIST_OS="hpux"
+ ;;
+ 'darwin' | 'oarwin')
+ DIST_OS="macosx"
+
+ #We use the 1.5 jvm if it exists
+ if [ -d /System/Library/Frameworks/JavaVM.framework/Versions/1.5.0/ ]
+ then
+ export JAVA_HOME="/System/Library/Frameworks/JavaVM.framework/Versions/1.5.0/Home"
+ fi
+ ;;
+ 'unix_sv')
+ DIST_OS="unixware"
+ ;;
+esac
+
+# Resolve the architecture
+DIST_ARCH=`uname -m | tr [:upper:] [:lower:] | tr -d [:blank:]`
+case "$DIST_ARCH" in
+ 'amd64' | 'ia32' | 'ia64' | 'i386' | 'i486' | 'i586' | 'i686' | 'x86_64')
+ DIST_ARCH="x86"
+ ;;
+ 'ip27' | 'mips')
+ DIST_ARCH="mips"
+ ;;
+ 'power' | 'powerpc' | 'power_pc' | 'ppc64')
+ DIST_ARCH="ppc"
+ ;;
+ 'pa_risc' | 'pa-risc')
+ DIST_ARCH="parisc"
+ ;;
+ 'sun4u' | 'sparcv9')
+ DIST_ARCH="sparc"
+ ;;
+ '9000/800')
+ DIST_ARCH="parisc"
+ ;;
+esac
+
+# Check if we are running on 64bit platform, seems like a workaround for now...
+DIST_BIT=`uname -m | tr [:upper:] [:lower:] | tr -d [:blank:]`
+case "$DIST_BIT" in
+ 'amd64' | 'ia64' | 'x86_64' | 'ppc64')
+ DIST_BIT="64"
+ ;;
+# 'pa_risc' | 'pa-risc') # Are some of these 64bit? Least not all...
+# BIT="64"
+# ;;
+ 'sun4u' | 'sparcv9') # Are all sparcs 64?
+ DIST_BIT="64"
+ ;;
+# '9000/800')
+# DIST_BIT="64"
+# ;;
+ *) # In any other case default to 32
+ DIST_BIT="32"
+ ;;
+esac
+
+# Decide on the wrapper binary to use.
+# 64bit wrapper by default on 64bit platforms, because
+# they might not have 32bit emulation libs installed.
+# For macosx, we also want to look for universal binaries.
+
+WRAPPER_TEST_CMD="$WRAPPER_CMD-$DIST_OS-$DIST_ARCH-$DIST_BIT"
+
+if [ -x "$WRAPPER_TEST_CMD" ]
+then
+ WRAPPER_CMD="$WRAPPER_TEST_CMD"
+else
+ if [ "$DIST_OS" = "macosx" ] # Some osx weirdness, someone please check that this still works
+ then
+ WRAPPER_TEST_CMD="$WRAPPER_CMD-$DIST_OS-universal-$DIST_BIT"
+ if [ -x "$WRAPPER_TEST_CMD" ]
+ then
+ WRAPPER_CMD="$WRAPPER_TEST_CMD"
+ else
+ WRAPPER_TEST_CMD="$WRAPPER_CMD-$DIST_OS-$DIST_ARCH-$DIST_BIT"
+ if [ -x "$WRAPPER_TEST_CMD" ]
+ then
+ WRAPPER_CMD="$WRAPPER_TEST_CMD"
+ else
+ WRAPPER_TEST_CMD="$WRAPPER_CMD-$DIST_OS-universal-$DIST_BIT"
+ if [ -x "$WRAPPER_TEST_CMD" ]
+ then
+ WRAPPER_CMD="$WRAPPER_TEST_CMD"
+ else
+ if [ ! -x "$WRAPPER_CMD" ]
+ then
+ echo "Unable to locate any of the following binaries:"
+ echo " $WRAPPER_CMD-$DIST_OS-$DIST_ARCH-$DIST_BIT"
+ echo " $WRAPPER_CMD-$DIST_OS-universal-$DIST_BIT"
+ echo " $WRAPPER_CMD"
+ #
+ # We need -Djava.net.preferIPv4Stack=true on FreeBSD, otherwise recent jvms thow an IllegalArgumentException when we create the socket
+ #
+ NO_WRAPPER="java -Djava.net.preferIPv4Stack=true -cp freenet-ext.jar:freenet.jar freenet.node.NodeStarter"
+ fi
+ fi
+ fi
+ fi
+ else
+ if [ ! -x "$WRAPPER_CMD" ]
+ then
+ echo "Unable to locate any of the following binaries:"
+ echo " $WRAPPER_CMD-$DIST_OS-$DIST_ARCH-$DIST_BIT"
+ echo " $WRAPPER_CMD"
+ NO_WRAPPER="java -cp freenet-ext.jar:freenet.jar freenet.node.NodeStarter"
+ fi
+ fi
+fi
+
+# Build the nice clause
+if [ "X$PRIORITY" = "X" ]
+then
+ CMDNICE=""
+else
+ CMDNICE="nice -$PRIORITY"
+fi
+
+# Build the anchor file clause.
+if [ "X$IGNORE_SIGNALS" = "X" ]
+then
+ ANCHORPROP=
+ IGNOREPROP=
+else
+ ANCHORPROP=wrapper.anchorfile=\"$ANCHORFILE\"
+ IGNOREPROP=wrapper.ignore_signals=TRUE
+fi
+
+# Build the lock file clause. Only create a lock file if the lock directory exists on this platform.
+if [ -d "$LOCKDIR" ]
+then
+ LOCKPROP=wrapper.lockfile=\"$LOCKFILE\"
+else
+ LOCKPROP=
+fi
+
+checkUser() {
+ # Check the configured user. If necessary rerun this script as the desired user.
+ if [ "X$RUN_AS_USER" != "X" ]
+ then
+ # Resolve the location of the 'id' command
+ IDEXE="/usr/xpg4/bin/id"
+ if [ ! -x $IDEXE ]
+ then
+ IDEXE="/usr/bin/id"
+ if [ ! -x $IDEXE ]
+ then
+ echo "Unable to locate 'id'."
+ echo "Please report this message along with the location of the command on your system."
+ exit 1
+ fi
+ fi
+
+ if [ "`$IDEXE -u -n`" = "$RUN_AS_USER" ]
+ then
+ # Already running as the configured user. Avoid password prompts by not calling su.
+ RUN_AS_USER=""
+ fi
+ fi
+ if [ "X$RUN_AS_USER" != "X" ]
+ then
+ # If LOCKPROP and $RUN_AS_USER are defined then the new user will most likely not be
+ # able to create the lock file. The Wrapper will be able to update this file once it
+ # is created but will not be able to delete it on shutdown. If $2 is defined then
+ # the lock file should be created for the current command
+ if [ "X$LOCKPROP" != "X" ]
+ then
+ if [ "X$2" != "X" ]
+ then
+ # Resolve the primary group
+ RUN_AS_GROUP=`groups $RUN_AS_USER | awk '{print $3}' | tail -1`
+ if [ "X$RUN_AS_GROUP" = "X" ]
+ then
+ RUN_AS_GROUP=$RUN_AS_USER
+ fi
+ touch "$LOCKFILE"
+ chown $RUN_AS_USER:$RUN_AS_GROUP "$LOCKFILE"
+ fi
+ fi
+
+ # Still want to change users, recurse. This means that the user will only be
+ # prompted for a password once.
+ su -m $RUN_AS_USER -c "$REALPATH $1"
+
+ # Now that we are the original user again, we may need to clean up the lock file.
+ if [ "X$LOCKPROP" != "X" ]
+ then
+ getpid
+ if [ "X$pid" = "X" ]
+ then
+ # Wrapper is not running so make sure the lock file is deleted.
+ if [ -f "$LOCKFILE" ]
+ then
+ rm "$LOCKFILE"
+ fi
+ fi
+ fi
+
+ exit 0
+ fi
+}
+
+getpid() {
+ if [ -f "$PIDFILE" ]
+ then
+ if [ -r "$PIDFILE" ]
+ then
+ pid="`cat \"$PIDFILE\"`"
+ if [ "X$pid" != "X" ]
+ then
+ # It is possible that 'a' process with the pid exists but that it is not the
+ # correct process. This can happen in a number of cases, but the most
+ # common is during system startup after an unclean shutdown.
+ # So make sure the process is one of "ours" -- that we can send
+ # a signal to it. (We don't use ps(1) because that's neither
+ # safe nor portable.
+ if ! kill -0 $pid 2>/dev/null
+ then
+ # This is a stale pid file.
+ rm -f "$PIDFILE"
+ echo "Removed stale pid file: $PIDFILE"
+ pid=""
+ fi
+ # Sometimes the pid exists and it's ours!
+ if ! test -f /proc/$pid/cwd/Freenet.pid
+ then
+ # This is a stale pid file.
+ rm -f "$PIDFILE"
+ echo "Removed stale pid file2: $PIDFILE"
+ pid=""
+
+ fi
+ fi
+ else
+ echo "Cannot read $PIDFILE."
+ exit 1
+ fi
+ fi
+}
+
+testpid() {
+ if ! kill -0 $pid 2>/dev/null
+ then
+ # Process is gone so remove the pid file.
+ rm -f "$PIDFILE"
+ pid=""
+ fi
+}
+
+console() {
+ echo "Running $APP_LONG_NAME..."
+ getpid
+ if [ "X$pid" = "X" ]
+ then
+ COMMAND_LINE="$CMDNICE \"$WRAPPER_CMD\" \"$WRAPPER_CONF\" wrapper.syslog.ident=\"$APP_NAME\" wrapper.pidfile=\"$PIDFILE\" $LDPROP $ANCHORPROP $LOCKPROP"
+ eval $COMMAND_LINE
+ else
+ echo "$APP_LONG_NAME is already running."
+ exit 1
+ fi
+}
+
+start() {
+ echo "Starting $APP_LONG_NAME..."
+ getpid
+ if [ "X$pid" = "X" ]
+ then
+ if [ "$NO_WRAPPER" ] # Check if we don't have usable wrapper, and run without it
+ then
+ echo ""
+ echo "Let's start the node without the wrapper, you'll have to daemonize it yourself."
+ eval $NO_WRAPPER
+ else # Otherwise use the wrapper
+ COMMAND_LINE="$CMDNICE \"$WRAPPER_CMD\" \"$WRAPPER_CONF\" wrapper.syslog.ident=\"$APP_NAME\" wrapper.pidfile=\"$PIDFILE\" $LDPROP wrapper.daemonize=TRUE $ANCHORPROP $IGNOREPROP $LOCKPROP"
+ eval $COMMAND_LINE
+ fi
+ else
+ echo "$APP_LONG_NAME is already running."
+ exit 1
+ fi
+}
+
+stopit() {
+ echo "Stopping $APP_LONG_NAME..."
+ getpid
+ if [ "X$pid" = "X" ]
+ then
+ echo "$APP_LONG_NAME was not running."
+ else
+ if [ "X$IGNORE_SIGNALS" = "X" ]
+ then
+ # Running so try to stop it.
+ kill $pid
+ if [ $? -ne 0 ]
+ then
+ # An explanation for the failure should have been given
+ echo "Unable to stop $APP_LONG_NAME."
+ exit 1
+ fi
+ else
+ rm -f "$ANCHORFILE"
+ if [ -f "$ANCHORFILE" ]
+ then
+ # An explanation for the failure should have been given
+ echo "Unable to stop $APP_LONG_NAME."
+ exit 1
+ fi
+ fi
+
+ # We can not predict how long it will take for the wrapper to
+ # actually stop as it depends on settings in wrapper.conf.
+ # Loop until it does.
+ savepid=$pid
+ CNT=0
+ TOTCNT=0
+ while [ "X$pid" != "X" ]
+ do
+ # Show a waiting message every 5 seconds.
+ if [ "$CNT" -lt "5" ]
+ then
+ CNT=`expr $CNT + 1`
+ else
+ echo "Waiting for $APP_LONG_NAME to exit..."
+ CNT=0
+ fi
+ TOTCNT=`expr $TOTCNT + 1`
+
+ sleep 1
+
+ testpid
+ done
+
+ pid=$savepid
+ testpid
+ if [ "X$pid" != "X" ]
+ then
+ echo "Failed to stop $APP_LONG_NAME."
+ exit 1
+ else
+ echo "Stopped $APP_LONG_NAME."
+ fi
+ fi
+}
+
+status() {
+ getpid
+ if [ "X$pid" = "X" ]
+ then
+ echo "$APP_LONG_NAME is not running."
+ exit 1
+ else
+ echo "$APP_LONG_NAME is running ($pid)."
+ exit 0
+ fi
+}
+
+dump() {
+ echo "Dumping $APP_LONG_NAME..."
+ getpid
+ if [ "X$pid" = "X" ]
+ then
+ echo "$APP_LONG_NAME was not running."
+
+ else
+ kill -QUIT $pid
+
+ if [ $? -ne 0 ]
+ then
+ echo "Failed to dump $APP_LONG_NAME."
+ exit 1
+ else
+ echo "Dumped $APP_LONG_NAME."
+ fi
+ fi
+}
+
+case "$1" in
+
+ 'console')
+ checkUser $1 touchlock
+ console
+ ;;
+
+ 'start')
+ checkUser $1 touchlock
+ start
+ ;;
+
+ 'stop')
+ checkUser $1
+ stopit
+ ;;
+
+ 'restart')
+ checkUser $1 touchlock
+ stopit
+ start
+ ;;
+
+ 'status')
+ checkUser $1
+ status
+ ;;
+
+ 'dump')
+ checkUser $1
+ dump
+ ;;
+
+ *)
+ echo "Usage: $0 { console | start | stop | restart | status | dump }"
+ exit 1
+ ;;
+esac
+
+exit 0
diff --git a/net-p2p/freenet/freenet-0.7.5_p1466.ebuild b/net-p2p/freenet/freenet-0.7.5_p1466.ebuild
new file mode 100644
index 00000000000..92d7654f2b5
--- /dev/null
+++ b/net-p2p/freenet/freenet-0.7.5_p1466.ebuild
@@ -0,0 +1,144 @@
+# Copyright 1999-2014 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI="5"
+DATE=20140810
+JAVA_PKG_IUSE="doc source"
+
+inherit eutils java-pkg-2 java-ant-2 multilib systemd user
+
+DESCRIPTION="An encrypted network without censorship"
+HOMEPAGE="https://freenetproject.org/"
+SRC_URI="https://github.com/${PN}/fred/archive/build0${PV#*p}.zip -> ${P}.zip
+ mirror://gentoo/seednodes-${DATE}.fref.bz2
+ mirror://gentoo/freenet-ant-1.7.1.jar"
+
+LICENSE="GPL-2+ GPL-2 MIT BSD-2 Apache-2.0"
+SLOT="0"
+KEYWORDS="~amd64 ~x86"
+IUSE="test"
+
+CDEPEND="dev-java/bcprov:1.49
+ dev-java/commons-compress:0
+ dev-db/db-je:3.3
+ dev-java/fec:0
+ dev-java/java-service-wrapper:0
+ dev-java/db4o-jdk11:0
+ dev-java/db4o-jdk12:0
+ dev-java/db4o-jdk5:0
+ dev-java/jbitcollider-core:0
+ dev-java/lzma:0
+ dev-java/lzmajio:0
+ dev-java/mersennetwister:0"
+DEPEND="app-arch/unzip
+ >=virtual/jdk-1.6
+ ${CDEPEND}
+ test? ( dev-java/junit:0
+ dev-java/ant-junit:0 )
+ dev-java/ant-core:0"
+RDEPEND=">=virtual/jre-1.6
+ net-libs/nativebiginteger:0
+ ${CDEPEND}"
+PDEPEND="net-libs/NativeThread:0"
+
+JAVA_PKG_BSFIX_NAME+=" build-clean.xml"
+JAVA_ANT_REWRITE_CLASSPATH="yes"
+JAVA_ANT_CLASSPATH_TAGS+=" javadoc"
+JAVA_ANT_ENCODING="utf8"
+
+EANT_BUILD_TARGET="package"
+EANT_TEST_TARGET="unit"
+EANT_BUILD_XML="build-clean.xml"
+EANT_GENTOO_CLASSPATH="bcprov-1.49,commons-compress,db4o-jdk5,db4o-jdk12,db4o-jdk11,db-je-3.3,fec,java-service-wrapper,jbitcollider-core,lzma,lzmajio,mersennetwister"
+EANT_EXTRA_ARGS="-Dsuppress.gjs=true -Dlib.contrib.present=true -Dlib.bouncycastle.present=true -Dlib.junit.present=true -Dtest.skip=true"
+
+S=${WORKDIR}/fred-build0${PV#*p}
+
+pkg_setup() {
+ has_version dev-java/icedtea[cacao] && {
+ ewarn "dev-java/icedtea was built with cacao USE flag."
+ ewarn "freenet may compile with it, but it will refuse to run."
+ ewarn "Please remerge dev-java/icedtea without cacao USE flag,"
+ ewarn "if you plan to use it for running freenet."
+ }
+ java-pkg-2_pkg_setup
+ enewgroup freenet
+ enewuser freenet -1 -1 /var/freenet freenet
+}
+
+src_unpack() {
+ unpack ${P}.zip seednodes-${DATE}.fref.bz2
+ mv "${WORKDIR}"/freenet-fred-* "${S}"
+}
+
+java_prepare() {
+ cp "${FILESDIR}"/freenet-0.7.5_p1422-wrapper.conf freenet-wrapper.conf || die
+ cp "${FILESDIR}"/run.sh-20090501 run.sh || die
+ epatch "${FILESDIR}"/0.7.5_p1321-ext.patch
+
+ sed -i -e "s:=/usr/lib:=/usr/$(get_libdir):g" \
+ freenet-wrapper.conf || die "sed failed"
+
+ echo "wrapper.java.classpath.1=/usr/share/freenet/lib/freenet.jar" >> freenet-wrapper.conf
+
+ local i=2 pkg jars jar
+ local ifs_original=${IFS}
+ IFS=","
+ for pkg in ${EANT_GENTOO_CLASSPATH} ; do
+ jars="$(java-pkg_getjars ${pkg})"
+ for jar in ${jars} ; do
+ echo "wrapper.java.classpath.$((i++))=${jar}" >> freenet-wrapper.conf
+ done
+ done
+ IFS=${ifs_original}
+ echo "wrapper.java.classpath.$((i++))=/usr/share/freenet/lib/ant.jar" >> freenet-wrapper.conf
+
+ cp "${DISTDIR}"/freenet-ant-1.7.1.jar lib/ant.jar || die
+}
+
+EANT_TEST_EXTRA_ARGS="-Dtest.skip=false"
+
+src_test() {
+ java-pkg-2_src_test
+}
+
+src_install() {
+ java-pkg_dojar dist/freenet.jar
+ java-pkg_newjar "${DISTDIR}"/freenet-ant-1.7.1.jar ant.jar
+ if has_version =sys-apps/baselayout-2*; then
+ doinitd "${FILESDIR}"/freenet
+ else
+ newinitd "${FILESDIR}"/freenet.old freenet
+ fi
+ systemd_dounit "${FILESDIR}"/freenet.service
+ dodoc AUTHORS || die
+ newdoc README.md README || die
+ insinto /etc
+ doins freenet-wrapper.conf || die
+ insinto /var/freenet
+ doins run.sh || die
+ newins "${WORKDIR}"/seednodes-${DATE}.fref seednodes.fref || die
+ fperms +x /var/freenet/run.sh
+ dosym java-service-wrapper/libwrapper.so /usr/$(get_libdir)/libwrapper.so
+ use doc && java-pkg_dojavadoc javadoc
+ use source && java-pkg_dosrc src
+}
+
+pkg_postinst() {
+ elog " "
+ elog "1. Start freenet with /etc/init.d/freenet start."
+ elog "2. Open localhost:8888 in your browser for the web interface."
+ #workaround for previously existing freenet user
+ [[ $(stat --format="%U" /var/freenet) == "freenet" ]] || chown \
+ freenet:freenet /var/freenet
+}
+
+pkg_postrm() {
+ if ! [[ -e /usr/share/freenet/lib/freenet.jar ]] ; then
+ elog " "
+ elog "If you dont want to use freenet any more"
+ elog "and dont want to keep your identity/other stuff"
+ elog "remember to do 'rm -rf /var/freenet' to remove everything"
+ fi
+}
diff --git a/net-p2p/freenet/freenet-0.7.5_p1467.ebuild b/net-p2p/freenet/freenet-0.7.5_p1467.ebuild
new file mode 100644
index 00000000000..001072432b3
--- /dev/null
+++ b/net-p2p/freenet/freenet-0.7.5_p1467.ebuild
@@ -0,0 +1,144 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI="5"
+DATE=20150427
+JAVA_PKG_IUSE="doc source"
+
+inherit eutils java-pkg-2 java-ant-2 multilib systemd user
+
+DESCRIPTION="An encrypted network without censorship"
+HOMEPAGE="https://freenetproject.org/"
+SRC_URI="https://github.com/${PN}/fred/archive/build0${PV#*p}.zip -> ${P}.zip
+ mirror://gentoo/seednodes-${DATE}.fref.bz2
+ mirror://gentoo/freenet-ant-1.7.1.jar"
+
+LICENSE="GPL-2+ GPL-2 MIT BSD-2 Apache-2.0"
+SLOT="0"
+KEYWORDS="~amd64 ~x86"
+IUSE="test"
+
+CDEPEND="dev-java/bcprov:1.49
+ dev-java/commons-compress:0
+ dev-db/db-je:3.3
+ dev-java/fec:0
+ dev-java/java-service-wrapper:0
+ dev-java/db4o-jdk11:0
+ dev-java/db4o-jdk12:0
+ dev-java/db4o-jdk5:0
+ dev-java/jbitcollider-core:0
+ dev-java/lzma:0
+ dev-java/lzmajio:0
+ dev-java/mersennetwister:0"
+DEPEND="app-arch/unzip
+ >=virtual/jdk-1.6
+ ${CDEPEND}
+ test? ( dev-java/junit:0
+ dev-java/ant-junit:0 )
+ dev-java/ant-core:0"
+RDEPEND=">=virtual/jre-1.6
+ net-libs/nativebiginteger:0
+ ${CDEPEND}"
+PDEPEND="net-libs/NativeThread:0"
+
+JAVA_PKG_BSFIX_NAME+=" build-clean.xml"
+JAVA_ANT_REWRITE_CLASSPATH="yes"
+JAVA_ANT_CLASSPATH_TAGS+=" javadoc"
+JAVA_ANT_ENCODING="utf8"
+
+EANT_BUILD_TARGET="package"
+EANT_TEST_TARGET="unit"
+EANT_BUILD_XML="build-clean.xml"
+EANT_GENTOO_CLASSPATH="bcprov-1.49,commons-compress,db4o-jdk5,db4o-jdk12,db4o-jdk11,db-je-3.3,fec,java-service-wrapper,jbitcollider-core,lzma,lzmajio,mersennetwister"
+EANT_EXTRA_ARGS="-Dsuppress.gjs=true -Dlib.contrib.present=true -Dlib.bouncycastle.present=true -Dlib.junit.present=true -Dtest.skip=true"
+
+S=${WORKDIR}/fred-build0${PV#*p}
+
+pkg_setup() {
+ has_version dev-java/icedtea[cacao] && {
+ ewarn "dev-java/icedtea was built with cacao USE flag."
+ ewarn "freenet may compile with it, but it will refuse to run."
+ ewarn "Please remerge dev-java/icedtea without cacao USE flag,"
+ ewarn "if you plan to use it for running freenet."
+ }
+ java-pkg-2_pkg_setup
+ enewgroup freenet
+ enewuser freenet -1 -1 /var/freenet freenet
+}
+
+src_unpack() {
+ unpack ${P}.zip seednodes-${DATE}.fref.bz2
+ mv "${WORKDIR}"/freenet-fred-* "${S}"
+}
+
+java_prepare() {
+ cp "${FILESDIR}"/freenet-0.7.5_p1422-wrapper.conf freenet-wrapper.conf || die
+ cp "${FILESDIR}"/run.sh-20090501 run.sh || die
+ epatch "${FILESDIR}"/0.7.5_p1321-ext.patch
+
+ sed -i -e "s:=/usr/lib:=/usr/$(get_libdir):g" \
+ freenet-wrapper.conf || die "sed failed"
+
+ echo "wrapper.java.classpath.1=/usr/share/freenet/lib/freenet.jar" >> freenet-wrapper.conf
+
+ local i=2 pkg jars jar
+ local ifs_original=${IFS}
+ IFS=","
+ for pkg in ${EANT_GENTOO_CLASSPATH} ; do
+ jars="$(java-pkg_getjars ${pkg})"
+ for jar in ${jars} ; do
+ echo "wrapper.java.classpath.$((i++))=${jar}" >> freenet-wrapper.conf
+ done
+ done
+ IFS=${ifs_original}
+ echo "wrapper.java.classpath.$((i++))=/usr/share/freenet/lib/ant.jar" >> freenet-wrapper.conf
+
+ cp "${DISTDIR}"/freenet-ant-1.7.1.jar lib/ant.jar || die
+}
+
+EANT_TEST_EXTRA_ARGS="-Dtest.skip=false"
+
+src_test() {
+ java-pkg-2_src_test
+}
+
+src_install() {
+ java-pkg_dojar dist/freenet.jar
+ java-pkg_newjar "${DISTDIR}"/freenet-ant-1.7.1.jar ant.jar
+ if has_version =sys-apps/baselayout-2*; then
+ doinitd "${FILESDIR}"/freenet
+ else
+ newinitd "${FILESDIR}"/freenet.old freenet
+ fi
+ systemd_dounit "${FILESDIR}"/freenet.service
+ dodoc AUTHORS || die
+ newdoc README.md README || die
+ insinto /etc
+ doins freenet-wrapper.conf || die
+ insinto /var/freenet
+ doins run.sh || die
+ newins "${WORKDIR}"/seednodes-${DATE}.fref seednodes.fref || die
+ fperms +x /var/freenet/run.sh
+ dosym java-service-wrapper/libwrapper.so /usr/$(get_libdir)/libwrapper.so
+ use doc && java-pkg_dojavadoc javadoc
+ use source && java-pkg_dosrc src
+}
+
+pkg_postinst() {
+ elog " "
+ elog "1. Start freenet with /etc/init.d/freenet start."
+ elog "2. Open localhost:8888 in your browser for the web interface."
+ #workaround for previously existing freenet user
+ [[ $(stat --format="%U" /var/freenet) == "freenet" ]] || chown \
+ freenet:freenet /var/freenet
+}
+
+pkg_postrm() {
+ if ! [[ -e /usr/share/freenet/lib/freenet.jar ]] ; then
+ elog " "
+ elog "If you dont want to use freenet any more"
+ elog "and dont want to keep your identity/other stuff"
+ elog "remember to do 'rm -rf /var/freenet' to remove everything"
+ fi
+}
diff --git a/net-p2p/freenet/metadata.xml b/net-p2p/freenet/metadata.xml
new file mode 100644
index 00000000000..005173b245e
--- /dev/null
+++ b/net-p2p/freenet/metadata.xml
@@ -0,0 +1,11 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+ <maintainer>
+ <email>tommy@gentoo.org</email>
+ <name>Thomas Sachau (Tommy[D])</name>
+ </maintainer>
+ <upstream>
+ <remote-id type="github">freenet/fred</remote-id>
+ </upstream>
+</pkgmetadata>
diff --git a/net-p2p/gift-ares/Manifest b/net-p2p/gift-ares/Manifest
new file mode 100644
index 00000000000..e83633317a0
--- /dev/null
+++ b/net-p2p/gift-ares/Manifest
@@ -0,0 +1 @@
+DIST gift-ares-0.3.0.tar.bz2 311141 SHA256 bfbd6673c58b8d7304cbfffd0dbb776b4fd6ca0ac5c807d71cdd702d3f411419
diff --git a/net-p2p/gift-ares/gift-ares-0.3.0-r1.ebuild b/net-p2p/gift-ares/gift-ares-0.3.0-r1.ebuild
new file mode 100644
index 00000000000..21e9139b041
--- /dev/null
+++ b/net-p2p/gift-ares/gift-ares-0.3.0-r1.ebuild
@@ -0,0 +1,39 @@
+# Copyright 1999-2012 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+inherit eutils
+
+IUSE=""
+
+DESCRIPTION="Ares Plugin for giFT"
+HOMEPAGE="http://gift-ares.berlios.de/"
+SRC_URI="mirror://berlios/${PN}/${P}.tar.bz2"
+SLOT="0"
+LICENSE="GPL-2"
+KEYWORDS="alpha amd64 ia64 ~ppc sparc x86 ~x86-fbsd"
+
+RDEPEND=">=net-p2p/gift-0.11.8"
+DEPEND="virtual/pkgconfig
+ ${RDEPEND}"
+
+src_compile() {
+ econf --datadir=/usr/share/giFT || die "Ares plugin failed to configure"
+ emake || die "Ares plugin failed to build"
+}
+
+src_install() {
+ make DESTDIR=${D} plugindir=/usr/$(get_libdir)/giFT install || die "Ares plugin failed to install"
+ dodoc AUTHORS COPYING ChangeLog NEWS README TODO
+}
+
+pkg_postinst() {
+ einfo "It is recommended that you re-run gift-setup as"
+ einfo "the user you will run the giFT daemon as:"
+ einfo "\tgift-setup"
+ echo
+ einfo "Alternatively, if this plugin is already"
+ einfo "configured, you can add the following line"
+ einfo "to ~/.giFT/giftd.conf"
+ einfo "plugins = Ares"
+}
diff --git a/net-p2p/gift-ares/metadata.xml b/net-p2p/gift-ares/metadata.xml
new file mode 100644
index 00000000000..aa0f3664825
--- /dev/null
+++ b/net-p2p/gift-ares/metadata.xml
@@ -0,0 +1,5 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+<herd>net-p2p</herd>
+</pkgmetadata>
diff --git a/net-p2p/gift-fasttrack/Manifest b/net-p2p/gift-fasttrack/Manifest
new file mode 100644
index 00000000000..89f7927d5d7
--- /dev/null
+++ b/net-p2p/gift-fasttrack/Manifest
@@ -0,0 +1 @@
+DIST giFT-FastTrack-0.8.9.tar.gz 449505 SHA256 910a3b053e50ac149efd1edab8dc5b79e79a67720afc7c81e68c5f6481e2cad1
diff --git a/net-p2p/gift-fasttrack/gift-fasttrack-0.8.9-r1.ebuild b/net-p2p/gift-fasttrack/gift-fasttrack-0.8.9-r1.ebuild
new file mode 100644
index 00000000000..d711901dc8e
--- /dev/null
+++ b/net-p2p/gift-fasttrack/gift-fasttrack-0.8.9-r1.ebuild
@@ -0,0 +1,41 @@
+# Copyright 1999-2012 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+inherit multilib
+
+IUSE=""
+
+MY_P=${P/gift-fasttrack/giFT-FastTrack}
+
+DESCRIPTION="FastTrack Plugin for giFT"
+HOMEPAGE="https://developer.berlios.de/projects/gift-fasttrack/"
+SRC_URI="mirror://berlios/${PN}/${MY_P}.tar.gz"
+SLOT="0"
+LICENSE="GPL-2"
+KEYWORDS="alpha amd64 ia64 ~ppc sparc x86 ~x86-fbsd"
+
+RDEPEND=">=net-p2p/gift-0.11.1"
+DEPEND="virtual/pkgconfig
+ ${RDEPEND}"
+
+S=${WORKDIR}/${MY_P}
+
+src_install() {
+ make DESTDIR=${D} \
+ giftconfdir=/etc/giFT \
+ plugindir=/usr/$(get_libdir)/giFT \
+ libgiftincdir=/usr/include/libgift \
+ install || die "Install failed"
+ dodoc AUTHORS ChangeLog NEWS README TODO
+}
+
+pkg_postinst() {
+ einfo "It is recommended that you re-run gift-setup as"
+ einfo "the user you will run the giFT daemon as:"
+ einfo "\tgift-setup"
+ echo
+ einfo "Alternatively you can add the following line to"
+ einfo "your ~/.giFT/giftd.conf configuration file:"
+ einfo "plugins = OpenFT:FastTrack"
+}
diff --git a/net-p2p/gift-fasttrack/metadata.xml b/net-p2p/gift-fasttrack/metadata.xml
new file mode 100644
index 00000000000..aa0f3664825
--- /dev/null
+++ b/net-p2p/gift-fasttrack/metadata.xml
@@ -0,0 +1,5 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+<herd>net-p2p</herd>
+</pkgmetadata>
diff --git a/net-p2p/gift-gnutella/Manifest b/net-p2p/gift-gnutella/Manifest
new file mode 100644
index 00000000000..ad7879ed5ed
--- /dev/null
+++ b/net-p2p/gift-gnutella/Manifest
@@ -0,0 +1 @@
+DIST gift-gnutella-0.0.11.tar.bz2 405742 SHA256 5a28fd53ad617a6acdc3042144829e74822510d80963a6ca35e7d256d5a06f86
diff --git a/net-p2p/gift-gnutella/files/cacheupdate.sh b/net-p2p/gift-gnutella/files/cacheupdate.sh
new file mode 100644
index 00000000000..ee6f832aae2
--- /dev/null
+++ b/net-p2p/gift-gnutella/files/cacheupdate.sh
@@ -0,0 +1,73 @@
+#!/bin/bash
+# Copyright 1999-2007 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+CACHE_LIST="g2.tjtech.org/g2/
+ gwc1c.olden.ch.3557.nyud.net:8080/gwc/
+ gwc.eod.cc/skulls.php
+ skulls.mi-cha-el.org/skulls.php
+ gwc.frodoslair.net/skulls/skulls"
+
+URLFILE="?urlfile=1\&client=GEN2\&version=0.2"
+HOSTFILE="?hostfile=1\&client=GEN2\&version=0.2"
+
+if [ -d ~/.giFT/Gnutella/ ]; then
+ cd ~/.giFT/Gnutella
+
+ # Try to fetch an updated list
+ wget http://gcachescan.jonatkins.com/ -O .my_list &> /dev/null
+ if [[ $? -eq 0 ]] ; then
+ my_cache_list=$(grep gcachedetail .my_list | sed -e "s:.*gcachedetail.cgi?\(.*\)\">?</a>.*:\1:g" | head -n 10)
+ [[ -n ${my_cache_list} ]] && CACHE_LIST=${my_cache_list}
+ else
+ echo "Failed to fetch gwebcaches' list, trying with local list."
+ fi
+
+ # Fetch gwebcaches
+ ok=0
+ for cache in ${CACHE_LIST} ; do
+ wget ${cache}${URLFILE} -O .gwebcaches.new &> /dev/null
+ if [[ $? -ne 0 ]] ; then
+ echo "Failed to fetch gwebcaches file from ${cache}"
+ #CACHE_LIST=${CACHE_LIST/${cache}/}
+ elif [[ -z $(grep -e "^http://.*" .gwebcaches.new) ]] || [[ -n $(grep ERROR .gwebcaches.new) ]] ; then
+ echo "Fetched file from ${cache} is invalid"
+ else
+ mv .gwebcaches.new gwebcaches
+ echo -e "\ngwebcaches fetched\n"
+ ok=1
+ break
+ fi
+ done
+ if [[ $ok -ne 1 ]] ; then
+ echo "Couldn't fetch gwebcaches!"
+ exit 1
+ fi
+
+ # Fetch nodes
+ ok=0
+ for cache in ${CACHE_LIST} ; do
+ wget ${cache}${HOSTFILE} -O .nodes.new &> /dev/null
+ if [[ $? -ne 0 ]] ; then
+ echo "Failed to fetch nodes file from ${cache}"
+ #CACHE_LIST=${CACHE_LIST/${cache}/}
+ elif [[ -n $(grep ERROR .nodes.new) ]] ; then
+ echo "Fetched file from ${cache} is invalid"
+ else
+ mv .nodes.new nodes
+ echo -e "\nnodes fetched\n"
+ ok=1
+ break
+ fi
+ done
+ if [[ $ok -ne 1 ]] ; then
+ echo "Couldn't fetch nodes!"
+ exit 1
+ fi
+
+ rm .my_list
+ echo -e "\nUpdate complete!"
+else
+ echo " ~/.giFT/Gnutella/ does not exist. Please run gift-setup."
+fi
diff --git a/net-p2p/gift-gnutella/gift-gnutella-0.0.11.ebuild b/net-p2p/gift-gnutella/gift-gnutella-0.0.11.ebuild
new file mode 100644
index 00000000000..43c817730a0
--- /dev/null
+++ b/net-p2p/gift-gnutella/gift-gnutella-0.0.11.ebuild
@@ -0,0 +1,47 @@
+# Copyright 1999-2012 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+inherit eutils
+
+DESCRIPTION="The giFT Gnutella plugin"
+HOMEPAGE="http://gift.sf.net/"
+SRC_URI="mirror://sourceforge/gift/${P}.tar.bz2"
+
+SLOT="0"
+LICENSE="GPL-2"
+KEYWORDS="alpha amd64 ia64 ~ppc sparc x86 ~x86-fbsd"
+IUSE="xml"
+
+RDEPEND=">=net-p2p/gift-0.11.6"
+DEPEND="${RDEPEND}
+ virtual/pkgconfig
+ app-arch/bzip2
+ dev-libs/libxml2"
+
+src_compile() {
+ econf $(use_with xml libxml) || die "failed to configure"
+ emake || die "failed to build"
+}
+
+src_install() {
+ einstall giftconfdir="${D}"/etc/giFT \
+ plugindir="${D}"/usr/$(get_libdir)/giFT \
+ datadir="${D}"/usr/share \
+ giftperldir="${D}"/usr/bin \
+ libgiftincdir="${D}"/usr/include/libgift || die "einstall failed"
+ newbin "${FILESDIR}"/cacheupdate.sh ${PN}-cacheupdate.sh
+}
+
+pkg_postinst() {
+ elog "It is recommended that you re-run gift-setup as"
+ elog "the user you will run the giFT daemon as:"
+ elog "\tgift-setup"
+ echo
+ elog "Alternatively you can add the following line to"
+ elog "your ~/.giFT/giftd.conf configuration file:"
+ elog "plugins = Gnutella"
+ echo
+ elog "To update your caches, run:"
+ elog "\t${PN}-cacheupdate.sh"
+}
diff --git a/net-p2p/gift-gnutella/metadata.xml b/net-p2p/gift-gnutella/metadata.xml
new file mode 100644
index 00000000000..166c0c55741
--- /dev/null
+++ b/net-p2p/gift-gnutella/metadata.xml
@@ -0,0 +1,8 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+ <herd>net-p2p</herd>
+ <upstream>
+ <remote-id type="sourceforge">gift</remote-id>
+ </upstream>
+</pkgmetadata>
diff --git a/net-p2p/gift-openft/Manifest b/net-p2p/gift-openft/Manifest
new file mode 100644
index 00000000000..2bd42c4206a
--- /dev/null
+++ b/net-p2p/gift-openft/Manifest
@@ -0,0 +1 @@
+DIST gift-openft-0.2.1.6.tar.bz2 338786 SHA256 7b8db8d18b11e31c051c5687eee0e61182b53087edcaee3211dd767d7b31f47d
diff --git a/net-p2p/gift-openft/gift-openft-0.2.1.6.ebuild b/net-p2p/gift-openft/gift-openft-0.2.1.6.ebuild
new file mode 100644
index 00000000000..0f01a0bd197
--- /dev/null
+++ b/net-p2p/gift-openft/gift-openft-0.2.1.6.ebuild
@@ -0,0 +1,48 @@
+# Copyright 1999-2012 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+inherit eutils
+
+IUSE="berkdb"
+DESCRIPTION="The giFT OpenFT plugin"
+HOMEPAGE="http://gift.sf.net/"
+SRC_URI="mirror://sourceforge/gift/${P}.tar.bz2"
+RESTRICT="mirror"
+SLOT="0"
+LICENSE="GPL-2"
+KEYWORDS="alpha amd64 ia64 ~ppc sparc x86 ~x86-fbsd"
+
+RDEPEND=">=net-p2p/gift-0.11.8
+ berkdb? ( >=sys-libs/db-3.3 )"
+DEPEND="virtual/pkgconfig
+ ${RDEPEND}"
+
+src_compile() {
+ econf $(use_enable berkdb libdb) || die "failed to configure"
+ emake || die "failed to build"
+}
+
+src_install() {
+ einstall giftconfdir=${D}/etc/giFT \
+ plugindir=${D}/usr/$(get_libdir)/giFT \
+ datadir=${D}/usr/share/giFT \
+ giftperldir=${D}/usr/bin \
+ libgiftincdir=${D}/usr/include/libgift || die "Install failed"
+ dodoc README NEWS ChangeLog TODO
+}
+
+pkg_postinst() {
+ if ! use berkdb; then
+ ewarn "To become a search node, you must have berkdb set"
+ ewarn "in your USE flags."
+ echo
+ fi
+ einfo "It is recommended that you re-run gift-setup as"
+ einfo "the user you will run the giFT daemon as:"
+ einfo "\tgift-setup"
+ echo
+ einfo "Alternatively you can add the following line to"
+ einfo "your ~/.giFT/giftd.conf configuration file:"
+ einfo "plugins = OpenFT"
+}
diff --git a/net-p2p/gift-openft/metadata.xml b/net-p2p/gift-openft/metadata.xml
new file mode 100644
index 00000000000..166c0c55741
--- /dev/null
+++ b/net-p2p/gift-openft/metadata.xml
@@ -0,0 +1,8 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+ <herd>net-p2p</herd>
+ <upstream>
+ <remote-id type="sourceforge">gift</remote-id>
+ </upstream>
+</pkgmetadata>
diff --git a/net-p2p/gift/Manifest b/net-p2p/gift/Manifest
new file mode 100644
index 00000000000..410b03b7991
--- /dev/null
+++ b/net-p2p/gift/Manifest
@@ -0,0 +1 @@
+DIST gift-0.11.8.1.tar.bz2 541446 SHA256 7b22e6d36482119a0d2dfd3e911a208439be32f554919536629b4c7c22ea5882
diff --git a/net-p2p/gift/files/gift.confd b/net-p2p/gift/files/gift.confd
new file mode 100644
index 00000000000..be9036eedcd
--- /dev/null
+++ b/net-p2p/gift/files/gift.confd
@@ -0,0 +1,22 @@
+# Copyright 1999-2004 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+# /etc/conf.d/gift
+# Config file for gift control script
+
+# Change the following vars only if you know
+# what you're doing, there's no checking for
+# invalid data yet!
+
+# owner of giFTd process (don't change, must be existing)
+USER="p2p"
+
+# directory with configuration
+LOCAL_DIR="/usr/share/giFT"
+
+# logfile (/dev/null for nowhere)
+LOG="/var/log/giftd.log"
+
+# nice level, 0<x<19, more nice -> less cpuspeed consumed
+NICE="19"
diff --git a/net-p2p/gift/files/gift.initd b/net-p2p/gift/files/gift.initd
new file mode 100644
index 00000000000..193cb23adf2
--- /dev/null
+++ b/net-p2p/gift/files/gift.initd
@@ -0,0 +1,35 @@
+#!/sbin/runscript
+# Copyright 1999-2004 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+depend() {
+ need net
+}
+
+start() {
+ ebegin "Starting giFTd"
+ start-stop-daemon --quiet --start -c ${USER} --make-pidfile \
+ --pidfile /var/run/giftd.pid --exec /usr/bin/giftd \
+ --nicelevel ${NICE} -- \
+ --local-dir=${LOCAL_DIR} &>${LOG} &
+ result=$?
+ sleep 1
+ [ -z "`pgrep -u ${USER} giftd`" ] && result=1
+ if [ $result -eq 1 ]; then
+ eerror "Failed to start gift. Check ${LOG} for more information"
+ fi;
+ eend $result
+}
+
+stop() {
+ ebegin "Stopping giFTd - please wait"
+ start-stop-daemon --stop --quiet --pidfile /var/run/giftd.pid
+ eend $?
+}
+
+restart() {
+ svc_stop
+ sleep 10
+ svc_start
+}
diff --git a/net-p2p/gift/gift-0.11.8.1-r1.ebuild b/net-p2p/gift/gift-0.11.8.1-r1.ebuild
new file mode 100644
index 00000000000..a51fe1f3f0d
--- /dev/null
+++ b/net-p2p/gift/gift-0.11.8.1-r1.ebuild
@@ -0,0 +1,64 @@
+# Copyright 1999-2014 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+inherit eutils libtool user
+
+DESCRIPTION="A OpenFT, Gnutella and FastTrack p2p network daemon"
+HOMEPAGE="http://gift.sourceforge.net"
+SRC_URI="mirror://sourceforge/${PN}/${P}.tar.bz2"
+IUSE="ares fasttrack gnutella imagemagick openft vorbis"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="alpha amd64 ia64 ~ppc sparc x86 ~x86-fbsd"
+
+DEPEND=">=sys-libs/zlib-1.1.4
+ sys-apps/file
+ imagemagick? ( >=media-gfx/imagemagick-5.5.7.15 )
+ vorbis? ( >=media-libs/libvorbis-1 )"
+PDEPEND="ares? ( net-p2p/gift-ares )
+ fasttrack? ( net-p2p/gift-fasttrack )
+ gnutella? ( net-p2p/gift-gnutella )
+ openft? ( net-p2p/gift-openft )"
+
+GIFTUSER="p2p"
+
+pkg_preinst() {
+ # Add a new user
+ enewuser ${GIFTUSER} -1 /bin/bash /home/p2p users
+}
+
+src_compile() {
+ econf --enable-libmagic \
+ `use_enable imagemagick` \
+ `use_enable vorbis libvorbis` || die
+ emake || die
+}
+
+src_install() {
+ make DESTDIR=${D} install || die "Install failed"
+
+ # init scripts for users who want a central server
+ newconfd ${FILESDIR}/gift.confd gift
+ newinitd ${FILESDIR}/gift.initd gift
+
+ touch ${D}/usr/share/giFT/giftd.log
+ chown ${GIFTUSER}:root ${D}/usr/share/giFT/giftd.log
+}
+
+pkg_postinst() {
+ elog "Configure gift in /usr/share/giFT/ or run gift-setup"
+ elog "as normal user and make:"
+ elog 'cp -R $HOME/.giFT/* /usr/share/giFT/'
+ elog "chown -R p2p:root /usr/share/giFT/*"
+ elog "(be carefull while specyfing directories in gift-setup;"
+ elog "keep in mind that giFT will run as process of user "
+ elog 'specified in /etc/conf.d/gift with his $HOME directory)'
+ echo
+ elog "Also, if you will be using the giFT init script, you"
+ elog "will need to create /usr/share/giFT/giftd.conf"
+ elog "This method is only recommended for users with a"
+ elog "central giFT server."
+ echo
+}
diff --git a/net-p2p/gift/metadata.xml b/net-p2p/gift/metadata.xml
new file mode 100644
index 00000000000..f3039a55197
--- /dev/null
+++ b/net-p2p/gift/metadata.xml
@@ -0,0 +1,14 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+ <herd>net-p2p</herd>
+ <use>
+ <flag name="ares">pull in Ares plugin</flag>
+ <flag name="fasttrack">pull in FastTrack plugin</flag>
+ <flag name="gnutella">pull in Gnutella plugin</flag>
+ <flag name="openft">pull in OpenFT plugin</flag>
+ </use>
+ <upstream>
+ <remote-id type="sourceforge">gift</remote-id>
+ </upstream>
+</pkgmetadata>
diff --git a/net-p2p/giftcurs/Manifest b/net-p2p/giftcurs/Manifest
new file mode 100644
index 00000000000..372d55fa599
--- /dev/null
+++ b/net-p2p/giftcurs/Manifest
@@ -0,0 +1 @@
+DIST giFTcurs-0.6.2.tar.gz 455055 SHA256 80db72ac16463ce084e76dc9aaae5b54ce8db085610c98fe2975c5b8f51a598d
diff --git a/net-p2p/giftcurs/giftcurs-0.6.2.ebuild b/net-p2p/giftcurs/giftcurs-0.6.2.ebuild
new file mode 100644
index 00000000000..b799aa5db91
--- /dev/null
+++ b/net-p2p/giftcurs/giftcurs-0.6.2.ebuild
@@ -0,0 +1,37 @@
+# Copyright 1999-2012 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+MY_P="giFTcurs-${PV}"
+S="${WORKDIR}/${MY_P}"
+DESCRIPTION="A ncurses frontend to the giFT daemon"
+SRC_URI="http://savannah.nongnu.org/download/${PN}/${MY_P}.tar.gz"
+HOMEPAGE="http://www.nongnu.org/giftcurs/"
+SLOT="0"
+LICENSE="GPL-2"
+IUSE="gpm nls unicode"
+KEYWORDS="alpha amd64 ~ia64 ~ppc sparc x86 ~x86-fbsd"
+
+RDEPEND="
+ >=sys-libs/ncurses-5.2
+ >=dev-libs/glib-2.0"
+DEPEND="${RDEPEND}
+ virtual/pkgconfig"
+
+src_compile() {
+ local myconf=""
+
+ use gpm || myconf="${myconf} --disable-mouse --disable-libgpm"
+ use nls || myconf="${myconf} --disable-nls"
+ use unicode && myconf="${myconf} --with-ncursesw"
+
+ econf $myconf || die "./configure failed"
+
+ emake || die "Compilation failed"
+}
+
+src_install() {
+ einstall || die "Installation failed"
+
+ dodoc AUTHORS ChangeLog NEWS README TODO
+}
diff --git a/net-p2p/giftcurs/metadata.xml b/net-p2p/giftcurs/metadata.xml
new file mode 100644
index 00000000000..aa0f3664825
--- /dev/null
+++ b/net-p2p/giftcurs/metadata.xml
@@ -0,0 +1,5 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+<herd>net-p2p</herd>
+</pkgmetadata>
diff --git a/net-p2p/gnut/Manifest b/net-p2p/gnut/Manifest
new file mode 100644
index 00000000000..18c0ec0d8de
--- /dev/null
+++ b/net-p2p/gnut/Manifest
@@ -0,0 +1,2 @@
+DIST gnut-0.4.28-patches.tar.bz2 8663 SHA256 c9a4e06f79bea33542576132c44f69f5acc5b68a28fc3f3e1817d166bc2c5bbb
+DIST gnut-0.4.28.tar.gz 333625 SHA256 f82aa6287c84376b2cb5fdabe6be2c27a0f72ed25672e277c2a9b521417f0fec
diff --git a/net-p2p/gnut/gnut-0.4.28-r1.ebuild b/net-p2p/gnut/gnut-0.4.28-r1.ebuild
new file mode 100644
index 00000000000..22bacd643c9
--- /dev/null
+++ b/net-p2p/gnut/gnut-0.4.28-r1.ebuild
@@ -0,0 +1,28 @@
+# Copyright 1999-2008 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+inherit eutils
+
+DESCRIPTION="Text-mode gnutella client"
+SRC_URI="http://alge.anart.no/ftp/pub/gnutella/${P}.tar.gz
+ mirror://gentoo/${P}-patches.tar.bz2"
+HOMEPAGE="http://www.gnutelliums.com/linux_unix/gnut/"
+
+SLOT="0"
+LICENSE="GPL-2"
+KEYWORDS="x86 ppc"
+IUSE=""
+
+src_unpack() {
+ unpack ${A}
+ epatch configure.patch
+ epatch src.patch
+}
+
+src_install () {
+ make DESTDIR="${D}" install || die
+ dohtml doc/*.html
+ dodoc doc/TUTORIAL AUTHORS COPYING ChangeLog GDJ HACKING \
+ INSTALL NEWS README TODO
+}
diff --git a/net-p2p/gnut/metadata.xml b/net-p2p/gnut/metadata.xml
new file mode 100644
index 00000000000..aa0f3664825
--- /dev/null
+++ b/net-p2p/gnut/metadata.xml
@@ -0,0 +1,5 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+<herd>net-p2p</herd>
+</pkgmetadata>
diff --git a/net-p2p/gtk-gnutella/Manifest b/net-p2p/gtk-gnutella/Manifest
new file mode 100644
index 00000000000..ece2724078d
--- /dev/null
+++ b/net-p2p/gtk-gnutella/Manifest
@@ -0,0 +1,2 @@
+DIST gtk-gnutella-1.1.1.tar.bz2 35342037 SHA256 6e077204ddc23d0b8a044c3d7f12f40e8876b523f12a90c00b6725170611b501 SHA512 c8226f74bbbc901a608aa59544ba5d7f924f5bcef0e98ba16145c4ae07a93dc710376201cf46bedaddcefb4438e18c259ce06be076a5f365a80b445cf788ec02 WHIRLPOOL 19e41cea5dfbfc27d21c7a5ed7ea69a14ef4fb4c0285eedd218d2506a6a133bb9f81462e4396bc936528618216d419f1ac38e53ff887c9e640cd51264727d824
+DIST gtk-gnutella-1.1.3.tar.bz2 19504243 SHA256 2659ddb846f60d13789674e926a71bbb4a8b9d3ca98c6b034a95eaa073531405 SHA512 df143b6e89b0a4c6e8ddbba24ddcab3603f04e7df1fab7d389241a112c6cd3297e4837dfc0d225289997b99867a5466a5b8697c68ef2bdc5817261fbc103d505 WHIRLPOOL fe1a1375e75204bdf92c9690f1885211dc456c2cc466f4d7e47c865fc0e1c77ce07d27b58ff2e53c4c28214d055878c7d805f0b79043748e1448c6b8ac398c82
diff --git a/net-p2p/gtk-gnutella/gtk-gnutella-1.1.1.ebuild b/net-p2p/gtk-gnutella/gtk-gnutella-1.1.1.ebuild
new file mode 100644
index 00000000000..62a6075dc61
--- /dev/null
+++ b/net-p2p/gtk-gnutella/gtk-gnutella-1.1.1.ebuild
@@ -0,0 +1,86 @@
+# Copyright 1999-2014 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=5
+
+inherit eutils
+
+IUSE="nls dbus ssl +gtk"
+
+DESCRIPTION="A GTK+ Gnutella client"
+SRC_URI="mirror://sourceforge/${PN}/${P}.tar.bz2"
+HOMEPAGE="http://gtk-gnutella.sourceforge.net/"
+
+SLOT="0"
+LICENSE="GPL-2"
+KEYWORDS="amd64 ppc x86 ~x86-fbsd"
+
+RDEPEND="
+ dev-libs/glib:2
+ sys-libs/zlib
+ gtk? ( >=x11-libs/gtk+-2.2.1:2 )
+ dbus? ( >=sys-apps/dbus-0.35.2 )
+ ssl? ( >=net-libs/gnutls-2.2.5 )
+ nls? ( >=sys-devel/gettext-0.11.5 )"
+DEPEND="${RDEPEND}
+ virtual/pkgconfig"
+
+src_prepare() {
+ strip-linguas -i po
+
+ echo "# Gentoo-selected LINGUAS" > po/LINGUAS
+ for ling in ${LINGUAS}; do
+ echo $ling >> po/LINGUAS
+ done
+}
+
+src_configure() {
+ # There is no option to turn off optimization through the build.sh
+ # script.
+ sed -i -e "s/Configure -Oder/Configure -Oder -Doptimize=none/" build.sh || die
+
+ # The build script does not support the equivalent --enable
+ # options so we must construct the configuration by hand.
+
+ local myconf
+
+ if ! use nls; then
+ myconf="${myconf} --disable-nls"
+ fi
+
+ if ! use dbus; then
+ myconf="${myconf} --disable-dbus"
+ fi
+
+ if ! use ssl; then
+ myconf="${myconf} --disable-gnutls"
+ fi
+
+ if use gtk; then
+ myconf="${myconf} --gtk2"
+ else
+ myconf="${myconf} --topless"
+ fi
+
+ ./build.sh \
+ --configure-only \
+ --prefix="/usr" \
+ --cc=$(tc-getCC) \
+ ${myconf}
+}
+
+src_compile() {
+ # Build system is not parallel-safe, bug 500760
+ emake -j1
+}
+
+src_install() {
+ dodir /usr/bin
+ emake INSTALL_PREFIX="${D}" install || die "Install failed"
+ dodoc AUTHORS ChangeLog README TODO
+
+ # Touch the symbols file into the future to avoid warnings from
+ # gtk-gnutella later on, since we will most likely strip the binary.
+ touch --date="next minute" "${D}/usr/lib/gtk-gnutella/gtk-gnutella.nm" || die
+}
diff --git a/net-p2p/gtk-gnutella/gtk-gnutella-1.1.3.ebuild b/net-p2p/gtk-gnutella/gtk-gnutella-1.1.3.ebuild
new file mode 100644
index 00000000000..154b509fd54
--- /dev/null
+++ b/net-p2p/gtk-gnutella/gtk-gnutella-1.1.3.ebuild
@@ -0,0 +1,86 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=5
+
+inherit eutils
+
+IUSE="nls dbus ssl +gtk"
+
+DESCRIPTION="A GTK+ Gnutella client"
+SRC_URI="mirror://sourceforge/${PN}/${P}.tar.bz2"
+HOMEPAGE="http://gtk-gnutella.sourceforge.net/"
+
+SLOT="0"
+LICENSE="GPL-2"
+KEYWORDS="~amd64 ~ppc ~x86 ~x86-fbsd"
+
+RDEPEND="
+ dev-libs/glib:2
+ sys-libs/zlib
+ gtk? ( >=x11-libs/gtk+-2.2.1:2 )
+ dbus? ( >=sys-apps/dbus-0.35.2 )
+ ssl? ( >=net-libs/gnutls-2.2.5 )
+ nls? ( >=sys-devel/gettext-0.11.5 )"
+DEPEND="${RDEPEND}
+ virtual/pkgconfig"
+
+src_prepare() {
+ strip-linguas -i po
+
+ echo "# Gentoo-selected LINGUAS" > po/LINGUAS
+ for ling in ${LINGUAS}; do
+ echo $ling >> po/LINGUAS
+ done
+}
+
+src_configure() {
+ # There is no option to turn off optimization through the build.sh
+ # script.
+ sed -i -e "s/Configure -Oder/Configure -Oder -Doptimize=none/" build.sh || die
+
+ # The build script does not support the equivalent --enable
+ # options so we must construct the configuration by hand.
+
+ local myconf
+
+ if ! use nls; then
+ myconf="${myconf} --disable-nls"
+ fi
+
+ if ! use dbus; then
+ myconf="${myconf} --disable-dbus"
+ fi
+
+ if ! use ssl; then
+ myconf="${myconf} --disable-gnutls"
+ fi
+
+ if use gtk; then
+ myconf="${myconf} --gtk2"
+ else
+ myconf="${myconf} --topless"
+ fi
+
+ ./build.sh \
+ --configure-only \
+ --prefix="/usr" \
+ --cc=$(tc-getCC) \
+ ${myconf}
+}
+
+src_compile() {
+ # Build system is not parallel-safe, bug 500760
+ emake -j1
+}
+
+src_install() {
+ dodir /usr/bin
+ emake INSTALL_PREFIX="${D}" install || die "Install failed"
+ dodoc AUTHORS ChangeLog README TODO
+
+ # Touch the symbols file into the future to avoid warnings from
+ # gtk-gnutella later on, since we will most likely strip the binary.
+ touch --date="next minute" "${D}/usr/lib/gtk-gnutella/gtk-gnutella.nm" || die
+}
diff --git a/net-p2p/gtk-gnutella/metadata.xml b/net-p2p/gtk-gnutella/metadata.xml
new file mode 100644
index 00000000000..ab027197642
--- /dev/null
+++ b/net-p2p/gtk-gnutella/metadata.xml
@@ -0,0 +1,11 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+ <maintainer>
+ <email>graaff@gentoo.org</email>
+ </maintainer>
+ <herd>net-p2p</herd>
+ <upstream>
+ <remote-id type="sourceforge">gtk-gnutella</remote-id>
+ </upstream>
+</pkgmetadata>
diff --git a/net-p2p/gtorrentviewer/Manifest b/net-p2p/gtorrentviewer/Manifest
new file mode 100644
index 00000000000..08f39adfc8a
--- /dev/null
+++ b/net-p2p/gtorrentviewer/Manifest
@@ -0,0 +1 @@
+DIST GTorrentViewer-0.2b.tar.gz 247584 SHA256 6e56351103f5d46a45be160baa1b7b956b4416fcdb4533b3d17a309665690c95 SHA512 4e8a0181d0492e9a88de09fe6399b9c6e4ca16913550b53597c00c2a413cd4c332b305b4b24735fa2b84bea87618ce7c22b111779f452a8d977470830d145b10 WHIRLPOOL 081245cbec27e98bf3931cd7fda06c275228028cb521eb67dbfcbdf003c7ebe88625a5addc4bba34b440babeeca1f2a0ae34b33702d593289dbe371d92d4175c
diff --git a/net-p2p/gtorrentviewer/files/gtorrentviewer-0.2b-curl-headers.patch b/net-p2p/gtorrentviewer/files/gtorrentviewer-0.2b-curl-headers.patch
new file mode 100644
index 00000000000..66e33fb3932
--- /dev/null
+++ b/net-p2p/gtorrentviewer/files/gtorrentviewer-0.2b-curl-headers.patch
@@ -0,0 +1,12 @@
+diff --git a/src/main.c b/src/main.c
+index fc51205..f46d30a 100644
+--- a/src/main.c
++++ b/src/main.c
+@@ -40,7 +40,6 @@
+ #include <errno.h>
+
+ #include <curl/curl.h>
+-#include <curl/types.h>
+ #include <curl/easy.h>
+
+ #include "bencode.h"
diff --git a/net-p2p/gtorrentviewer/files/gtorrentviewer-0.2b-desktop.patch b/net-p2p/gtorrentviewer/files/gtorrentviewer-0.2b-desktop.patch
new file mode 100644
index 00000000000..8ddad12c368
--- /dev/null
+++ b/net-p2p/gtorrentviewer/files/gtorrentviewer-0.2b-desktop.patch
@@ -0,0 +1,16 @@
+--- data/gtorrentviewer.desktop.in.old 2014-11-22 17:48:55.859683842 +0100
++++ data/gtorrentviewer.desktop.in 2014-11-22 17:49:25.400108137 +0100
+@@ -3,11 +3,9 @@
+ _GenericName=Torrent Viewer
+ _Comment=Viewer and Editor for .torrent files
+ Exec=gtorrentviewer %U
+-Icon=gtorrentviewer.png
++Icon=gtorrentviewer
+ StartupNotify=false
+ Terminal=false
+ Type=Application
+-Encoding=UTF-8
+-Categories=Application;Network;
++Categories=Network;
+ MimeType=application/x-bittorrent;
+-Version=0.2
diff --git a/net-p2p/gtorrentviewer/files/gtorrentviewer-0.2b-underlinking.patch b/net-p2p/gtorrentviewer/files/gtorrentviewer-0.2b-underlinking.patch
new file mode 100644
index 00000000000..22dd373e296
--- /dev/null
+++ b/net-p2p/gtorrentviewer/files/gtorrentviewer-0.2b-underlinking.patch
@@ -0,0 +1,14 @@
+--- configure.ac
++++ configure.ac
+@@ -51,6 +51,11 @@
+ # Checks for libraries.
+ #
+
++dnl Check for libm for ceil()
++AC_SEARCH_LIBS([ceil], [m], [], [
++ AC_MSG_ERROR([unable to find the ceil() function])
++])
++
+ # check for libcurl.
+ AC_ARG_WITH([curl-config],
+ AC_HELP_STRING([--with-curl-config=PATH], [path to curl-config (e.g. /opt/bin)]),
diff --git a/net-p2p/gtorrentviewer/gtorrentviewer-0.2b.ebuild b/net-p2p/gtorrentviewer/gtorrentviewer-0.2b.ebuild
new file mode 100644
index 00000000000..825e26735d0
--- /dev/null
+++ b/net-p2p/gtorrentviewer/gtorrentviewer-0.2b.ebuild
@@ -0,0 +1,46 @@
+# Copyright 1999-2014 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=5
+GCONF_DEBUG="yes"
+
+inherit autotools eutils gnome2
+
+MY_PN=${PN/gtorrentviewer/GTorrentViewer}
+MY_P=${MY_PN}-${PV}
+
+DESCRIPTION="A GTK2-based viewer and editor for BitTorrent meta files"
+HOMEPAGE="http://gtorrentviewer.sourceforge.net/"
+SRC_URI="mirror://sourceforge/gtorrentviewer/${MY_P}.tar.gz"
+
+LICENSE="GPL-2"
+KEYWORDS="amd64 ~ppc x86 ~x86-fbsd"
+
+SLOT="0"
+IUSE=""
+
+S=${WORKDIR}/${MY_P}
+
+RDEPEND="
+ net-misc/curl
+ >=x11-libs/gtk+-2.4:2
+ >=dev-libs/glib-2.4:2
+"
+DEPEND="${RDEPEND}
+ virtual/pkgconfig
+"
+
+src_prepare() {
+ mv configure.in configure.ac || die #426262
+
+ epatch "${FILESDIR}"/${P}-curl-headers.patch
+ epatch "${FILESDIR}"/${P}-underlinking.patch
+ epatch "${FILESDIR}"/${P}-desktop.patch
+
+ # Fix tests
+ echo "data/gtorrentviewer.desktop.in" >> po/POTFILES.in || die
+
+ eautoreconf
+ gnome2_src_prepare
+}
diff --git a/net-p2p/gtorrentviewer/metadata.xml b/net-p2p/gtorrentviewer/metadata.xml
new file mode 100644
index 00000000000..a2e44fa192c
--- /dev/null
+++ b/net-p2p/gtorrentviewer/metadata.xml
@@ -0,0 +1,8 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+ <herd>net-p2p</herd>
+ <upstream>
+ <remote-id type="sourceforge">gtorrentviewer</remote-id>
+ </upstream>
+</pkgmetadata>
diff --git a/net-p2p/hx/Manifest b/net-p2p/hx/Manifest
new file mode 100644
index 00000000000..cecfa5f5899
--- /dev/null
+++ b/net-p2p/hx/Manifest
@@ -0,0 +1 @@
+DIST mhxd-0.4.11.tar.bz2 970664 SHA256 54906798fd9155cf3f53c171f0d839ed1e5a329fa89e56bbcdfda4ce8dda0b91
diff --git a/net-p2p/hx/hx-0.4.11.ebuild b/net-p2p/hx/hx-0.4.11.ebuild
new file mode 100644
index 00000000000..d82e40767d9
--- /dev/null
+++ b/net-p2p/hx/hx-0.4.11.ebuild
@@ -0,0 +1,48 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+inherit autotools
+
+LICENSE="GPL-2"
+KEYWORDS="ppc ~sparc x86"
+MY_P=mhxd-${PV}
+
+DESCRIPTION="This is a Hotline 1.5+ compatible *nix Hotline Client in CLI. It supports IRC compatibility"
+SRC_URI="http://projects.acidbeats.de/${MY_P}.tar.bz2"
+HOMEPAGE="http://hotlinex.sf.net/"
+
+IUSE="ssl"
+
+DEPEND="
+ ssl? ( >=dev-libs/openssl-0.9.6d )
+ >=sys-libs/zlib-1.1.4"
+
+SLOT="0"
+
+S="${WORKDIR}/${MY_P}"
+
+src_unpack() {
+ unpack ${A}
+
+ cd "${S}"
+ eautoreconf
+}
+
+src_compile() {
+ econf \
+ `use_enable ssl idea` \
+ `use_enable ssl cipher` \
+ `use_enable ssl hope` \
+ `use_enable ssl compress` \
+ --enable-hx || die "bad configure"
+ emake || die "compile problem"
+ make install || die "compile problem"
+}
+
+src_install() {
+ dodoc AUTHORS INSTALL PROBLEMS README* ChangeLog TODO NEWS run/hx/ghxvars run/hx/ghxvars.jp \
+ run/hx/hxrc run/hx/hxvars
+
+ dobin run/hx/bin/hx
+}
diff --git a/net-p2p/hx/metadata.xml b/net-p2p/hx/metadata.xml
new file mode 100644
index 00000000000..b8f4c471b1c
--- /dev/null
+++ b/net-p2p/hx/metadata.xml
@@ -0,0 +1,10 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+ <herd>net-p2p</herd>
+ <longdescription>
+ hx is an Hotline Client under the GPL for Linux/Unixes.
+ It supports the Hotline Protocol from 1.2.3 up to 1.5+.
+ See http://www.hotspringsinc.com/
+ </longdescription>
+</pkgmetadata>
diff --git a/net-p2p/i2p/Manifest b/net-p2p/i2p/Manifest
new file mode 100644
index 00000000000..cd5a61ebb01
--- /dev/null
+++ b/net-p2p/i2p/Manifest
@@ -0,0 +1 @@
+DIST i2psource_0.9.18.tar.bz2 24147960 SHA256 6f02f38c933662874c485cb52ca800a9e07c36e74a26fdfeece65e25979beb4b SHA512 6cc336f94f8e4331b26d6e42958808f193ad3709ab6098981077c9390749233fb3d20df5c8fea34ec7810bc8846fd2e11ed7a79bf7c1ec68402b1ccacae999d6 WHIRLPOOL 467285b189af69b300c56756992e53979aa049515cb89ce0d5cbff80b9270c4ab1188f419dd0206b2406780b36ddde73861b5e2e69c7b2e7d8ed00b7bcaaa7a7
diff --git a/net-p2p/i2p/files/i2p-0.9.18_fix-paths.patch b/net-p2p/i2p/files/i2p-0.9.18_fix-paths.patch
new file mode 100644
index 00000000000..d1c207f10e9
--- /dev/null
+++ b/net-p2p/i2p/files/i2p-0.9.18_fix-paths.patch
@@ -0,0 +1,137 @@
+--- clients.config 2015-03-15 02:02:29.021408673 -0700
++++ clients.config 2015-03-15 02:24:33.460308396 -0700
+@@ -60,7 +60,7 @@
+ clientApp.4.name=Open Router Console in web browser at startup
+ clientApp.4.args=http://127.0.0.1:7657/
+ clientApp.4.delay=3
+-clientApp.4.startOnLoad=true
++clientApp.4.startOnLoad=false
+
+ # BOB bridge
+ clientApp.5.args=
+--- eepget 2015-03-15 02:02:29.078407997 -0700
++++ eepget 2015-03-15 02:17:51.441075791 -0700
+@@ -1,3 +1,3 @@
+ #!/bin/sh
+-I2P="%INSTALL_PATH"
++I2P="/usr/share/i2p"
+ java -cp "$I2P/lib/i2p.jar" net.i2p.util.EepGet "$@"
+--- i2prouter 2015-03-15 02:02:29.079407985 -0700
++++ i2prouter 2015-03-15 02:11:13.023194731 -0700
+@@ -28,20 +28,22 @@
+ # Note that (percent)INSTALL_PATH, (percent)USER_HOME, and (percent)SYSTEM_java_io_tmpdir
+ # should have been replaced by the izpack installer.
+ # If you did not run the installer, replace them with the appropriate paths.
+-I2P="%INSTALL_PATH"
++USER_HOME="$HOME"
++SYSTEM_java_io_tmpdir="$USER_HOME/.i2p"
++I2P="/usr/share/i2p"
+ if [ "`uname -s`" = "Darwin" ]; then
+- if [ -d "%USER_HOME/Library/Application Support" ]; then
+- I2P_CONFIG_DIR="%USER_HOME/Library/Application Support/i2p"
++ if [ -d "$USER_HOME/Library/Application Support" ]; then
++ I2P_CONFIG_DIR="$USER_HOME/Library/Application Support/i2p"
+ else
+- I2P_CONFIG_DIR="%USER_HOME/.i2p"
++ I2P_CONFIG_DIR="$USER_HOME/.i2p"
+ fi
+ else
+- I2P_CONFIG_DIR="%USER_HOME/.i2p"
++ I2P_CONFIG_DIR="$USER_HOME/.i2p"
+ fi
+-I2PTEMP="%SYSTEM_java_io_tmpdir"
++I2PTEMP="$SYSTEM_java_io_tmpdir"
+ # PORTABLE installation:
+ # Use the following instead.
+-#I2PTEMP="%INSTALL_PATH"
++#I2PTEMP="/usr/share/i2p"
+
+ # Application
+ APP_NAME="i2p"
+--- runplain.sh 2015-03-15 02:02:29.078407997 -0700
++++ runplain.sh 2015-03-15 02:18:46.530422508 -0700
+@@ -11,8 +11,8 @@
+ # Note that (percent)INSTALL_PATH and (percent)SYSTEM_java_io_tmpdir
+ # should have been replaced by the izpack installer.
+ # If you did not run the installer, replace them with the appropriate path.
+-I2P="%INSTALL_PATH"
+-I2PTEMP="%SYSTEM_java_io_tmpdir"
++I2P="/usr/share/i2p"
++I2PTEMP="$SYSTEM_java_io_tmpdir"
+
+ # Having IPv6 enabled can cause problems with certain configurations. Changing the
+ # next value to true may help.
+--- wrapper.config 2015-03-15 02:02:29.022408661 -0700
++++ wrapper.config 2015-03-15 02:21:50.666238909 -0700
+@@ -60,13 +60,17 @@
+ # classes, or all the classes of i2p.jar, are in a different directory).
+ # Be sure there are no other duplicate classes.
+ #
+-wrapper.java.classpath.1=$INSTALL_PATH/lib/*.jar
++wrapper.java.classpath.1=/usr/share/i2p/lib/*.jar
++wrapper.java.classpath.2=/usr/share/jakarta-jstl/lib/*.jar
++wrapper.java.classpath.3=/usr/share/java-service-wrapper/lib/*.jar
++wrapper.java.classpath.4=/usr/share/bcprov/lib/*.jar
+ # uncomment this to use the system classpath as well (e.g. to get tools.jar)
+ # wrapper.java.classpath.2=%CLASSPATH%
+
+ # Java Library Path (location of Wrapper.DLL or libwrapper.so)
+-wrapper.java.library.path.1=$INSTALL_PATH
+-wrapper.java.library.path.2=$INSTALL_PATH/lib
++wrapper.java.library.path.1=/usr/share/i2p
++wrapper.java.library.path.2=/usr/share/i2p/lib
++wrapper.java.library.path.3=/usr/lib/java-service-wrapper
+
+ # Java Bits. On applicable platforms, tells the JVM to run in 32 or 64-bit mode.
+ wrapper.java.additional.auto_bits=TRUE
+@@ -76,7 +80,7 @@
+ wrapper.java.additional.1=-DloggerFilenameOverride=logs/log-router-@.txt
+ wrapper.java.additional.2=-Dorg.mortbay.http.Version.paranoid=true
+ wrapper.java.additional.3=-Dorg.mortbay.xml.XmlParser.NotValidating=true
+-wrapper.java.additional.4=-Di2p.dir.base="$INSTALL_PATH"
++wrapper.java.additional.4=-Di2p.dir.base="/usr/share/i2p"
+ wrapper.java.additional.4.stripquotes=TRUE
+
+ # On some IPv6 enabled systems, I2P and other network-enabled java applications
+@@ -96,11 +100,11 @@
+ # wrapper.java.additional.7=-Dorg.mortbay.util.FileResource.checkAliases=false
+ # PORTABLE installation:
+ # uncomment the following
+-#wrapper.java.additional.7=-Di2p.dir.pid="$INSTALL_PATH"
++#wrapper.java.additional.7=-Di2p.dir.pid="/usr/share/i2p"
+ #wrapper.java.additional.7.stripquotes=TRUE
+-#wrapper.java.additional.8=-Di2p.dir.temp="$INSTALL_PATH"
++#wrapper.java.additional.8=-Di2p.dir.temp="/usr/share/i2p"
+ #wrapper.java.additional.8.stripquotes=TRUE
+-#wrapper.java.additional.9=-Di2p.dir.config="$INSTALL_PATH"
++#wrapper.java.additional.9=-Di2p.dir.config="/usr/share/i2p"
+ #wrapper.java.additional.9.stripquotes=TRUE
+ #
+ # Uncomment this for better performance.
+@@ -147,7 +151,7 @@
+ # PORTABLE installation:
+ # Use the following instead. I2P will find the logfile here,
+ # no need for a wrapper.java.additional line too.
+-#wrapper.logfile=$INSTALL_PATH/wrapper.log
++#wrapper.logfile=/usr/share/i2p/wrapper.log
+
+ # Format of output for the log file.
+ # The format consists of the tokens 'L' for log level, 'P' for prefix, 'D' for thread,
+@@ -220,7 +224,7 @@
+ #wrapper.java.pidfile=$SYSTEM_java_io_tmpdir/routerjvm.pid
+ # PORTABLE installation:
+ # Use the following instead.
+-#wrapper.java.pidfile=$INSTALL_PATH/routerjvm.pid
++#wrapper.java.pidfile=/usr/share/i2p/routerjvm.pid
+ # pid file for the service monitoring the JVM
+ #
+ # From i2prouter:
+@@ -238,7 +242,7 @@
+ #wrapper.pidfile=$SYSTEM_java_io_tmpdir/i2p.pid
+ # PORTABLE installation:
+ # Use the following instead.
+-#wrapper.pidfile=$INSTALL_PATH/i2p.pid
++#wrapper.pidfile=/usr/share/i2p/i2p.pid
+
+ #********************************************************************
+ # Wrapper General Properties
diff --git a/net-p2p/i2p/files/i2p.initd b/net-p2p/i2p/files/i2p.initd
new file mode 100644
index 00000000000..ca39586113e
--- /dev/null
+++ b/net-p2p/i2p/files/i2p.initd
@@ -0,0 +1,36 @@
+#!/sbin/runscript
+# Copyright 1999-2013 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+depend() {
+ need net
+}
+
+HOME="/var/lib/i2p"
+USER_HOME="$HOME"
+JAVABINARY="/etc/java-config-2/current-system-vm/bin/java"
+INSTALL_PATH="/usr/share/i2p"
+I2P="$INSTALL_PATH"
+I2P_CONFIG_DIR="$USER_HOME/.i2p"
+SYSTEM_java_io_tmpdir="$I2P_CONFIG_DIR"
+I2PTEMP="$SYSTEM_java_io_tmpdir"
+LOGFILE="$I2P_CONFIG_DIR/wrapper.log"
+PIDFILE="/var/run/i2p.pid"
+WRAPPER_CMD="$I2P/i2psvc"
+WRAPPER_CONF="$I2P/wrapper.config"
+
+start() {
+ ebegin "Starting I2P"
+ start-stop-daemon --start -b -m -u i2p --pidfile "$PIDFILE" --quiet --exec $WRAPPER_CMD -- -c $WRAPPER_CONF wrapper.daemonize=FALSE wrapper.syslog.ident=i2p wrapper.java.command="$JAVABINARY" wrapper.name=i2p wrapper.displayname="I2P Service" wrapper.statusfile="$I2P_CONFIG_DIR/i2p.status" wrapper.java.statusfile="$I2P_CONFIG_DIR/i2p.java.status" wrapper.logfile="$LOGFILE"
+ sleep 1
+ [ -e "$PIDFILE" -a -e /proc/$(cat "$PIDFILE") ]
+ eend $?
+}
+
+stop() {
+ ebegin "Stopping I2P"
+ start-stop-daemon --stop -u i2p --pidfile "$PIDFILE" --quiet --exec $WRAPPER_CMD -R SIGTERM/20 SIGKILL/20 -P
+ eend $?
+}
+
diff --git a/net-p2p/i2p/files/i2p.service b/net-p2p/i2p/files/i2p.service
new file mode 100644
index 00000000000..ccbadbd4d16
--- /dev/null
+++ b/net-p2p/i2p/files/i2p.service
@@ -0,0 +1,13 @@
+[Unit]
+Description=Invisible Internet Project
+After=network.target
+
+[Service]
+User=i2p
+Type=forking
+ExecReload=/usr/bin/i2prouter restart
+ExecStart=/usr/bin/i2prouter start
+ExecStop=/usr/bin/i2prouter stop
+
+[Install]
+WantedBy=multi-user.target
diff --git a/net-p2p/i2p/i2p-0.9.18.ebuild b/net-p2p/i2p/i2p-0.9.18.ebuild
new file mode 100644
index 00000000000..22ac101f032
--- /dev/null
+++ b/net-p2p/i2p/i2p-0.9.18.ebuild
@@ -0,0 +1,97 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI="5"
+
+inherit eutils java-pkg-2 java-ant-2 systemd user
+
+DESCRIPTION="A privacy-centric, anonymous network."
+HOMEPAGE="https://geti2p.net"
+SRC_URI="https://download.i2p2.de/releases/${PV}/i2psource_${PV}.tar.bz2"
+
+LICENSE="Apache-2.0 Artistic BSD CC-BY-2.5 CC-BY-3.0 CC-BY-SA-3.0 EPL-1.0 GPL-2 GPL-3 LGPL-2.1 LGPL-3 MIT public-domain WTFPL-2"
+SLOT="0"
+# Until the deps reach other arches
+KEYWORDS="~amd64 ~x86"
+IUSE="nls"
+# dev-java/ant-core is automatically added due to java-ant-2.eclass
+DEPEND=">=dev-java/bcprov-1.50
+ dev-java/eclipse-ecj:*
+ dev-java/jakarta-jstl
+ dev-java/java-service-wrapper
+ dev-java/jrobin
+ dev-java/slf4j-api
+ dev-libs/gmp:*
+ nls? ( sys-devel/gettext )
+ >=virtual/jdk-1.6:="
+RDEPEND="${DEPEND} >=virtual/jre-1.6"
+
+EANT_BUILD_TARGET="pkg"
+EANT_GENTOO_CLASSPATH="jakarta-jstl,java-service-wrapper,jrobin,slf4j-api"
+
+pkg_setup() {
+ enewgroup i2p
+ enewuser i2p -1 -1 /var/lib/i2p i2p -m
+}
+
+src_unpack() {
+ unpack ${A}
+ cd "${S}"
+ java-ant_rewrite-classpath
+}
+
+src_prepare() {
+ # We're on GNU/Linux, we don't need .exe files
+ echo "noExe=true" > override.properties
+ if ! use nls; then
+ echo "require.gettext=false" >> override.properties
+ fi
+}
+
+src_install() {
+ # Using ${D} here results in an error. Docs say use $ROOT
+ i2p_home="${ROOT}/usr/share/i2p"
+ # Patch the relevant files. This needs to be in src_install due to
+ # preinst() generating the files we're patching
+ cd pkg-temp
+ epatch "${FILESDIR}/i2p-0.9.18_fix-paths.patch"
+
+ # This is ugly, but to satisfy all non-system .jar dependencies, jetty and
+ # systray4j would need to be packaged. The former would be too large a task
+ # for an unseasoned developer and systray4j hasn't been touched in over 10
+ # years. This seems to be the most pragmatic solution
+ java-pkg_jarinto "${i2p_home}/lib"
+ for i in BOB commons-el commons-logging i2p i2psnark i2ptunnel \
+ jasper-compiler jasper-runtime javax.servlet jbigi jetty* mstreaming org.mortbay.* router* \
+ sam standard streaming systray systray4j; do
+ java-pkg_dojar lib/${i}.jar
+ done
+
+ # Set up symlinks for binaries
+ dosym /usr/bin/wrapper ${i2p_home}/i2psvc
+ dosym ${i2p_home}/i2prouter /usr/bin/i2prouter
+ dosym ${i2p_home}/eepget /usr/bin/eepget
+
+ # Install main files and basic documentation
+ exeinto ${i2p_home}
+ insinto ${i2p_home}
+ doins blocklist.txt hosts.txt *.config
+ doexe eepget i2prouter runplain.sh
+ dodoc history.txt INSTALL-headless.txt LICENSE.txt
+ doman man/*
+
+ # Install other directories
+ doins -r certificates docs eepsite geoip scripts
+ dodoc -r licenses
+ java-pkg_dowar webapps/*.war
+
+ # Install daemon files
+ newinitd "${FILESDIR}/i2p.initd" i2p
+ systemd_newunit "${FILESDIR}"/i2p.service i2p.service
+}
+
+pkg_postinst() {
+ elog "Custom configuration belongs in /var/lib/i2p/.i2p/ to avoid being overwritten."
+ elog "I2P can be configured through the web interface at http://localhost:7657/index.jsp"
+}
diff --git a/net-p2p/i2p/metadata.xml b/net-p2p/i2p/metadata.xml
new file mode 100644
index 00000000000..316d7cc335c
--- /dev/null
+++ b/net-p2p/i2p/metadata.xml
@@ -0,0 +1,15 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+<herd>java</herd>
+<herd>proxy-maintainers</herd>
+<maintainer>
+ <email>sam@cmpct.info</email>
+ <description>Proxy-maintainer; add or CC them for bugs</description>
+</maintainer>
+<maintainer><email>zlg@gentoo.org</email></maintainer>
+<longdescription>I2P is an anonymous network, exposing a simple layer that applications can use to anonymously and securely send messages to each other.</longdescription>
+<use>
+<flag name="nls">Adds Native Language Support using GNU gettext.</flag>
+</use>
+</pkgmetadata>
diff --git a/net-p2p/imule/Manifest b/net-p2p/imule/Manifest
new file mode 100644
index 00000000000..8b9cdfbb520
--- /dev/null
+++ b/net-p2p/imule/Manifest
@@ -0,0 +1,2 @@
+DIST 2015-03-22_nodes.dat 57832 SHA256 0c7f7f7afe875f1a1c5dc0bfaf960a9f24e51f1eeec42b8dc8a538c62362b7cb SHA512 fd1a1cf2f9f0084bb1e0a802c994308e62a58ebe14b3455b1e86c7b419dcbc206ef982a01ea163c5810d0f79a2388b4a1b4672e73f63a9034e8967d667c3a817 WHIRLPOOL 10ed68cadc4834aa0230679013436f8c91aa5240de1972a6619e357d99d63fdb606f781db341a171b79f03a50c80ef942159a5b0f8f3f095a2a62d6886dc8a36
+DIST iMule-2.3.2.3-src.tbz 13143310 SHA256 f5d1657ce34893b305cb1e8ec163274661926dc9116dccf0d41ce31f0693be43 SHA512 5db856db83e8300faa399922f05b552670a4c9947e3e778031f8904a1a91fe6b02e067bfa2f96883d16c74899d6b713bbd58210529071c0c71202134b41276c9 WHIRLPOOL 93c73028119875b4ec00278849ff11f1cdd0af32af02cac9b98d836f79bc84bb03df18096294c0316e04b39f87e44a973d93a17ad651f9156bac8c1888b006e8
diff --git a/net-p2p/imule/imule-2.3.2.3-r1.ebuild b/net-p2p/imule/imule-2.3.2.3-r1.ebuild
new file mode 100644
index 00000000000..83f41104860
--- /dev/null
+++ b/net-p2p/imule/imule-2.3.2.3-r1.ebuild
@@ -0,0 +1,65 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI="5"
+WX_GTK_VER="2.8"
+inherit wxwidgets
+
+MY_PN="iMule"
+
+DESCRIPTION="P2P sharing software which connects through I2P and Kad networks"
+# New homepage has a few resources and a working nodes.dat file users need
+# in order to get iMule to work
+HOMEPAGE="http://echelon.i2p/imule"
+SRC_URI="http://dev.gentoo.org/~zlg/extra/net-p2p/imule/${MY_PN}-${PV}-src.tbz http://dev.gentoo.org/~zlg/extra/net-p2p/imule/2015-03-22_nodes.dat"
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="~amd64"
+IUSE="webserver static-libs nls"
+RESTRICT="mirror"
+
+# wxGTK 2.8 is required; later versions result in failed compile
+# Other versions indicated are from the tarball's INSTALL file
+DEPEND="x11-libs/wxGTK:2.8
+ net-p2p/i2p
+ >=net-libs/libupnp-1.6.6
+ sys-devel/flex
+ sys-apps/texinfo
+ >=dev-libs/crypto++-5.1
+ !net-p2p/amule"
+RDEPEND="x11-libs/wxGTK:2.8 net-p2p/i2p"
+
+S="${WORKDIR}/${MY_PN}-${PV}-src"
+
+src_unpack() {
+ default
+ cp "${DISTDIR}"/2015-03-22_nodes.dat "${WORKDIR}"
+}
+
+src_configure() {
+ WX_GTK_VER="2.8" need-wxwidgets unicode
+ # Enabling imulecmd results in a compilation error.
+ econf --with-wx-config=${WX_CONFIG} \
+ --enable-imule-daemon \
+ --enable-alc \
+ --enable-alcc \
+ --enable-optimize \
+ --disable-debug \
+ $(use_enable nls) \
+ $(use_enable webserver) \
+ $(use_enable static-libs static)
+}
+
+src_install() {
+ default
+ insinto /usr/share/${PN}
+ newins "${WORKDIR}"/2015-03-22_nodes.dat nodes.dat
+}
+
+pkg_postinst() {
+ elog "iMule will not function without a valid 'nodes.dat' file and"
+ elog "an I2P router running."
+ elog "A nodes.dat file can be found in /usr/share/imule. It can"
+ elog "be copied to ~/.iMule/nodes.dat for convenience."
+}
diff --git a/net-p2p/imule/imule-2.3.2.3.ebuild b/net-p2p/imule/imule-2.3.2.3.ebuild
new file mode 100644
index 00000000000..224a199eab5
--- /dev/null
+++ b/net-p2p/imule/imule-2.3.2.3.ebuild
@@ -0,0 +1,51 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI="5"
+WX_GTK_VER="2.8"
+inherit wxwidgets
+
+MY_PN="iMule"
+
+DESCRIPTION="P2P sharing software which connects through I2P and Kad network"
+# New homepage has a few resources and a working nodes.dat file users need
+# in order to get iMule to work
+HOMEPAGE="http://echelon.i2p/imule"
+SRC_URI="http://echelon.i2p/imule/${PV}/${MY_PN}-${PV}-src.tbz http://dev.gentoo.org/~zlg/extra/net-p2p/imule/2015-03-22_nodes.dat"
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="~amd64"
+IUSE="webserver static-libs nls"
+
+# wxGTK 2.8 is required; later versions result in failed compile
+# Other versions indicated are from the tarball's INSTALL file
+DEPEND="x11-libs/wxGTK:2.8
+ net-p2p/i2p
+ >=net-libs/libupnp-1.6.6
+ sys-devel/flex
+ sys-apps/texinfo
+ >=dev-libs/crypto++-5.1"
+RDEPEND="x11-libs/wxGTK:2.8 net-p2p/i2p"
+
+S="${WORKDIR}/${MY_PN}-${PV}-src"
+
+src_configure() {
+ WX_GTK_VER="2.8" need-wxwidgets unicode
+ # Enabling imulecmd results in a compilation error.
+ econf --with-wx-config=${WX_CONFIG} \
+ --enable-imule-daemon \
+ --enable-alc \
+ --enable-alcc \
+ --enable-optimize \
+ --disable-debug \
+ $(use_enable nls) \
+ $(use_enable webserver) \
+ $(use_enable static-libs static)
+}
+
+pkg_postinst() {
+ elog "iMule will not function without a valid 'nodes.dat' file and"
+ elog "an I2P router running."
+ elog "The nodes.dat file can be found at http://echelon.i2p/imule."
+}
diff --git a/net-p2p/imule/metadata.xml b/net-p2p/imule/metadata.xml
new file mode 100644
index 00000000000..f48160a14d4
--- /dev/null
+++ b/net-p2p/imule/metadata.xml
@@ -0,0 +1,12 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+<herd>java</herd>
+<maintainer><email>maintainer-wanted@gentoo.org</email></maintainer>
+<longdescription>A P2P file-sharing application designed to work on top of the I2P or Kad network stacks.</longdescription>
+<use>
+<flag name="nls">Adds Native Language Support using GNU gettext.</flag>
+<flag name="static-libs">Builds a statically-linked application.</flag>
+<flag name="webserver">Enables a webserver to administer remotely.</flag>
+</use>
+</pkgmetadata>
diff --git a/net-p2p/kmldonkey/Manifest b/net-p2p/kmldonkey/Manifest
new file mode 100644
index 00000000000..076ff54b700
--- /dev/null
+++ b/net-p2p/kmldonkey/Manifest
@@ -0,0 +1 @@
+DIST kmldonkey-2.0.7.tar.bz2 204642 SHA256 49954b7bf7f883e31ea1999e0109f416c12d646d8f51f410190d2ae79cab76e1 SHA512 59435fc13739fae51eb6ee4c9cdbc1aaddc08251b29208e67671bc7dd9e92cacfefec62a8cab8d780c237eb126b529980d17d00ec80c2e954641b2f18c7b48d2 WHIRLPOOL 3fcaef4d4c8fdd250e959a76158a46554332f367f55b6d2a8e25060bfe075c277a8fd893279e0e3d936d0f48c1b828f9a09948fb4ba2464108bd3b7b37bd1638
diff --git a/net-p2p/kmldonkey/kmldonkey-2.0.7.ebuild b/net-p2p/kmldonkey/kmldonkey-2.0.7.ebuild
new file mode 100644
index 00000000000..de69ca071c6
--- /dev/null
+++ b/net-p2p/kmldonkey/kmldonkey-2.0.7.ebuild
@@ -0,0 +1,34 @@
+# Copyright 1999-2014 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=5
+
+inherit kde4-base
+
+DESCRIPTION="Provides integration for the MLDonkey P2P software and KDE 4"
+HOMEPAGE="http://www.kde.org/"
+SRC_URI="https://api.opensuse.org/public/source/home:eduardhc/${PN}-kde4/${P}.tar.bz2"
+
+LICENSE="GPL-2 LGPL-2"
+SLOT="4"
+KEYWORDS="amd64 x86"
+IUSE="debug plasma"
+
+DEPEND="plasma? ( $(add_kdebase_dep plasma-workspace) )"
+RDEPEND="${DEPEND}"
+
+src_configure() {
+ local mycmakeargs=(
+ $(cmake-utils_use_with plasma)
+ )
+
+ kde4-base_src_configure
+}
+
+pkg_postinst() {
+ if ! has_version net-p2p/mldonkey ; then
+ elog ${PN} is a only a client, and requires access to an instance of
+ elog net-p2p/mldonkey to function.
+ fi
+}
diff --git a/net-p2p/kmldonkey/metadata.xml b/net-p2p/kmldonkey/metadata.xml
new file mode 100644
index 00000000000..8d36d5b01cd
--- /dev/null
+++ b/net-p2p/kmldonkey/metadata.xml
@@ -0,0 +1,5 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+ <herd>kde</herd>
+</pkgmetadata>
diff --git a/net-p2p/ktorrent/Manifest b/net-p2p/ktorrent/Manifest
new file mode 100644
index 00000000000..5d0ff1a2890
--- /dev/null
+++ b/net-p2p/ktorrent/Manifest
@@ -0,0 +1 @@
+DIST ktorrent-4.3.1.tar.bz2 2943708 SHA256 66094f6833347afb0c49e332f0ec15ec48db652cbe66476840846ffd5ca0e4a1 SHA512 bf1fa144295cb00fccce3a511afe845bc7bf42d77d70205f5893686e7b1fa78c5799c46c7e4e04435ab6fdd4bc9b3b4a25bffb2c5538a25af36302c60742900e WHIRLPOOL 61303c19f0160bba9bdd288415d86519594f26c5c062f394cee7924093506a9cc6236fd8eedec16c6f799f71a15cb4af15c4b7c079831dccb4e498b833c2234e
diff --git a/net-p2p/ktorrent/files/ktorrent-4.3.0-mountedstoragecheck.patch b/net-p2p/ktorrent/files/ktorrent-4.3.0-mountedstoragecheck.patch
new file mode 100644
index 00000000000..bdb494c4956
--- /dev/null
+++ b/net-p2p/ktorrent/files/ktorrent-4.3.0-mountedstoragecheck.patch
@@ -0,0 +1,25 @@
+--- a/ktorrent/core.cpp
++++ b/ktorrent/core.cpp
+@@ -1206,6 +1206,10 @@
+
+ bool Core::checkMissingFiles(TorrentInterface* tc)
+ {
++ QStringList missing;
++ if(!tc->hasMissingFiles(missing))
++ return true;
++
+ QStringList not_mounted;
+ while(!tc->isStorageMounted(not_mounted))
+ {
+@@ -1226,10 +1230,6 @@
+ }
+ }
+
+- QStringList missing;
+- if(!tc->hasMissingFiles(missing))
+- return true;
+-
+ if(tc->getStats().multi_file_torrent)
+ {
+ QString msg = i18n(
+
diff --git a/net-p2p/ktorrent/files/ktorrent-4.3.1-ipfilter.patch b/net-p2p/ktorrent/files/ktorrent-4.3.1-ipfilter.patch
new file mode 100644
index 00000000000..4572c3d89c6
--- /dev/null
+++ b/net-p2p/ktorrent/files/ktorrent-4.3.1-ipfilter.patch
@@ -0,0 +1,72 @@
+From 3dfcbeb9765e99f9b99951134b17268eb7a617d2 Mon Sep 17 00:00:00 2001
+From: Joris Guisson <joris.guisson@gmail.com>
+Date: Thu, 1 Aug 2013 13:19:29 +0200
+Subject: [PATCH] Backport ipfilter extraction fixes from master branch to 4.3
+ branch
+
+BUG: 315239
+---
+ ChangeLog | 3 +++
+ plugins/ipfilter/downloadandconvertjob.cpp | 22 +++++-----------------
+ 2 files changed, 8 insertions(+), 17 deletions(-)
+
+diff --git a/ChangeLog b/ChangeLog
+index c5ae9da..42c48ff 100644
+--- a/ChangeLog
++++ b/ChangeLog
+@@ -1,3 +1,6 @@
++Changes in 4.3.2:
++- Backport ipfilter extraction fixes from master branch (315239)
++
+ Changes in 4.3.1:
+ - Fix new custom groups not appearing in add to group submenu (307230)
+ - Fix crash when right clicking on some locations in the GroupView due to 0 pointer (307160)
+diff --git a/plugins/ipfilter/downloadandconvertjob.cpp b/plugins/ipfilter/downloadandconvertjob.cpp
+index d3092ac..4080c2a 100644
+--- a/plugins/ipfilter/downloadandconvertjob.cpp
++++ b/plugins/ipfilter/downloadandconvertjob.cpp
+@@ -114,12 +114,13 @@ namespace kt
+
+ //now determine if it's ZIP or TXT file
+ KMimeType::Ptr ptr = KMimeType::findByPath(temp);
++ Out(SYS_IPF|LOG_NOTICE) << "Mimetype: " << ptr->name() << endl;
+ if (ptr->name() == "application/zip")
+ {
+ active_job = KIO::file_move(temp,QString(kt::DataDir() + QLatin1String("level1.zip")),-1,KIO::HideProgressInfo|KIO::Overwrite);
+ connect(active_job,SIGNAL(result(KJob*)),this,SLOT(extract(KJob*)));
+ }
+- else if (ptr->name() == "application/x-gzip" || ptr->name() == "application/x-bzip")
++ else if (ptr->name() == "application/x-gzip" || ptr->name() == "application/x-bzip" || ptr->name() == "application/gzip")
+ {
+ active_job = new bt::DecompressFileJob(temp,QString(kt::DataDir() + "level1.txt"));
+ connect(active_job,SIGNAL(result(KJob*)),this,SLOT(convert(KJob*)));
+@@ -174,23 +175,10 @@ namespace kt
+ }
+
+ QString destination = kt::DataDir() + "level1.txt";
+- if (zip->directory()->entries().contains("splist.txt"))
++ QStringList entries = zip->directory()->entries();
++ if (entries.count() >= 1)
+ {
+- active_job = new bt::ExtractFileJob(zip,"splist.txt",destination);
+- connect(active_job,SIGNAL(result(KJob*)),this,SLOT(convert(KJob*)));
+- unzip = true;
+- active_job->start();
+- }
+- else if (zip->directory()->entries().contains("level1.txt"))
+- {
+- active_job = new bt::ExtractFileJob(zip,"level1.txt",destination);
+- connect(active_job,SIGNAL(result(KJob*)),this,SLOT(convert(KJob*)));
+- unzip = true;
+- active_job->start();
+- }
+- else if (zip->directory()->entries().contains("ipfilter.dat"))
+- {
+- active_job = new bt::ExtractFileJob(zip,"ipfilter.dat",destination);
++ active_job = new bt::ExtractFileJob(zip,entries.front(),destination);
+ connect(active_job,SIGNAL(result(KJob*)),this,SLOT(convert(KJob*)));
+ unzip = true;
+ active_job->start();
+--
+1.8.3.2
+
diff --git a/net-p2p/ktorrent/files/ktorrent-4.3.1-underlinking.patch b/net-p2p/ktorrent/files/ktorrent-4.3.1-underlinking.patch
new file mode 100644
index 00000000000..84e6fa72e6b
--- /dev/null
+++ b/net-p2p/ktorrent/files/ktorrent-4.3.1-underlinking.patch
@@ -0,0 +1,21 @@
+From 3ef62c439027acc0a166101419fff4bc0c69013d Mon Sep 17 00:00:00 2001
+From: Christoph Feck <christoph@maxiom.de>
+Date: Fri, 19 Oct 2012 10:56:22 +0200
+Subject: [PATCH] SVN_SILENT link
+
+---
+ plugins/ipfilter/tests/CMakeLists.txt | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/plugins/ipfilter/tests/CMakeLists.txt b/plugins/ipfilter/tests/CMakeLists.txt
+index 3b40887..90d6d42 100644
+--- a/plugins/ipfilter/tests/CMakeLists.txt
++++ b/plugins/ipfilter/tests/CMakeLists.txt
+@@ -1,3 +1,3 @@
+ set(ipblocklisttest_SRCS ipblocklisttest.cpp ../ipblocklist.cpp)
+ kde4_add_unit_test(ipblocklisttest TESTNAME ipblocklisttest ${ipblocklisttest_SRCS})
+-target_link_libraries(ipblocklisttest ${QT_QTTEST_LIBRARY} ktorrent)
++target_link_libraries(ipblocklisttest ${QT_QTCORE_LIBRARY} ${QT_QTNETWORK_LIBRARY} ${QT_QTTEST_LIBRARY} ${LIBKTORRENT_LIBRARIES})
+--
+1.8.1.2
+
diff --git a/net-p2p/ktorrent/ktorrent-4.3.1-r1.ebuild b/net-p2p/ktorrent/ktorrent-4.3.1-r1.ebuild
new file mode 100644
index 00000000000..5b937e10a06
--- /dev/null
+++ b/net-p2p/ktorrent/ktorrent-4.3.1-r1.ebuild
@@ -0,0 +1,103 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=5
+
+KDE_SCM="git"
+LIBKT_VERSION_MIN="${PV}"
+LIBKT_VERSION_MAX="99999999"
+if [[ ${PV} != 9999* ]]; then
+ inherit versionator
+ # upstream likes to skip that _ in beta releases
+ MY_PV="${PV/_/}"
+ LIBKT_VERSION_MIN=$(($(get_major_version)-3)).$(get_version_component_range 2-3 ${PV})
+ LIBKT_VERSION_MAX=$(($(get_major_version)-3)).$(($(get_version_component_range 2)+1))
+ MY_P="${PN}-${MY_PV}"
+ KDE_HANDBOOK="optional"
+ KDE_DOC_DIRS="doc"
+
+ KDE_LINGUAS="ar ast be bg bs ca ca@valencia cs da de el en_GB eo es et eu
+ fi fr ga gl hi hne hr hu is it ja km ku lt lv mai ms nb nds nl nn oc
+ pl pt pt_BR ro ru se si sk sl sq sr sr@ijekavian sr@ijekavianlatin
+ sr@latin sv tr ug uk zh_CN zh_TW"
+ SRC_URI="http://ktorrent.org/downloads/${MY_PV}/${MY_P}.tar.bz2"
+ S="${WORKDIR}"/"${MY_P}"
+
+ KEYWORDS="amd64 ppc x86"
+else
+ LIBKT_VERSION_MIN="${PV}"
+ LIBKT_VERSION_MAX="99999999"
+ KEYWORDS=""
+fi
+
+inherit kde4-base
+
+DESCRIPTION="A BitTorrent program for KDE"
+HOMEPAGE="http://ktorrent.org/"
+
+LICENSE="GPL-2"
+SLOT="4"
+IUSE="+bwscheduler debug +downloadorder +infowidget +ipfilter +kross +logviewer
++magnetgenerator +mediaplayer plasma rss +scanfolder +search +shutdown +stats
++upnp webinterface +zeroconf"
+
+COMMONDEPEND="
+ <net-libs/libktorrent-${LIBKT_VERSION_MAX}
+ >=net-libs/libktorrent-${LIBKT_VERSION_MIN}
+ infowidget? ( dev-libs/geoip )
+ mediaplayer? ( >=media-libs/taglib-1.5 )
+ plasma? ( $(add_kdebase_dep libtaskmanager) )
+ rss? ( $(add_kdebase_dep kdepimlibs) )
+ shutdown? ( $(add_kdebase_dep libkworkspace) )
+"
+DEPEND="${COMMONDEPEND}
+ dev-libs/boost
+ sys-devel/gettext
+"
+RDEPEND="${COMMONDEPEND}
+ ipfilter? (
+ app-arch/bzip2
+ app-arch/unzip
+ $(add_kdeapps_dep kdebase-kioslaves)
+ )
+ kross? ( $(add_kdebase_dep krosspython) )
+"
+
+PATCHES=(
+ "${FILESDIR}/${P}-ipfilter.patch"
+ "${FILESDIR}/${P}-underlinking.patch"
+)
+
+src_prepare() {
+ if ! use plasma; then
+ sed -i \
+ -e "s:add_subdirectory(plasma):#nada:g" \
+ CMakeLists.txt || die "Failed to make plasmoid optional"
+ fi
+
+ kde4-base_src_prepare
+}
+
+src_configure() {
+ mycmakeargs=(
+ $(cmake-utils_use_enable bwscheduler BWSCHEDULER_PLUGIN)
+ $(cmake-utils_use_enable downloadorder DOWNLOADORDER_PLUGIN)
+ $(cmake-utils_use_enable infowidget INFOWIDGET_PLUGIN)
+ $(cmake-utils_use_with infowidget SYSTEM_GEOIP)
+ $(cmake-utils_use_enable ipfilter IPFILTER_PLUGIN)
+ $(cmake-utils_use_enable kross SCRIPTING_PLUGIN)
+ $(cmake-utils_use_enable logviewer LOGVIEWER_PLUGIN)
+ $(cmake-utils_use_enable magnetgenerator MAGNETGENERATOR_PLUGIN)
+ $(cmake-utils_use_enable mediaplayer MEDIAPLAYER_PLUGIN)
+ $(cmake-utils_use_enable rss SYNDICATION_PLUGIN)
+ $(cmake-utils_use_enable scanfolder SCANFOLDER_PLUGIN)
+ $(cmake-utils_use_enable search SEARCH_PLUGIN)
+ $(cmake-utils_use_enable shutdown SHUTDOWN_PLUGIN)
+ $(cmake-utils_use_enable stats STATS_PLUGIN)
+ $(cmake-utils_use_enable upnp UPNP_PLUGIN)
+ $(cmake-utils_use_enable webinterface WEBINTERFACE_PLUGIN)
+ $(cmake-utils_use_enable zeroconf ZEROCONF_PLUGIN)
+ )
+ kde4-base_src_configure
+}
diff --git a/net-p2p/ktorrent/metadata.xml b/net-p2p/ktorrent/metadata.xml
new file mode 100644
index 00000000000..566ffb324a6
--- /dev/null
+++ b/net-p2p/ktorrent/metadata.xml
@@ -0,0 +1,23 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+ <herd>kde</herd>
+ <herd>net-p2p</herd>
+ <use>
+ <flag name="bwscheduler">Schedule upload and download limits over a period of a week</flag>
+ <flag name="downloadorder">Specify the download order of a multi-file torrent</flag>
+ <flag name="kross">Enable kross scripting support</flag>
+ <flag name="infowidget">Displays general information about a torrent in several tabs</flag>
+ <flag name="ipfilter">Filter IP addresses through a blocklist</flag>
+ <flag name="logviewer">Displays the logging output</flag>
+ <flag name="magnetgenerator">Generates magnet URI's</flag>
+ <flag name="mediaplayer">Phonon-based media player</flag>
+ <flag name="rss">Syndication plugin for KTorrent, supporting RSS and Atom feeds</flag>
+ <flag name="scanfolder">Scan folders for torrent files and load them</flag>
+ <flag name="search">Search for torrents</flag>
+ <flag name="shutdown">Shutdown when done</flag>
+ <flag name="stats">Shows statistics about torrents in several graphs</flag>
+ <flag name="webinterface">Allows control of KTorrent via a web interface</flag>
+ <flag name="zeroconf">Discover peers on the local network using the Zeroconf protocol</flag>
+ </use>
+</pkgmetadata>
diff --git a/net-p2p/linuxdcpp/Manifest b/net-p2p/linuxdcpp/Manifest
new file mode 100644
index 00000000000..1dec68acefd
--- /dev/null
+++ b/net-p2p/linuxdcpp/Manifest
@@ -0,0 +1 @@
+DIST linuxdcpp-1.0.3.tar.bz2 289891 SHA256 3b4eb6cf015f0fe8283508976b24dbb1cd4fb861116d4536f1055136c2442c71 SHA512 c0eb38b89b6a47a4a29ade90b3813e302b8c4dd8bea39770fce4e232ff17035ba355b36feb6b69195ba7c8448a69943ee61722e335ad514f426238fb8a089e79 WHIRLPOOL e6feb69c38020a13b2d37cc7dd51614946e2ba2642d7173e72d9d50af37cc510b8ac0f983c1bf68feab3e2d82027471ab8fc3beacbe96b680c87c889cdd88034
diff --git a/net-p2p/linuxdcpp/linuxdcpp-1.0.3-r1.ebuild b/net-p2p/linuxdcpp/linuxdcpp-1.0.3-r1.ebuild
new file mode 100644
index 00000000000..6ff5e9064e0
--- /dev/null
+++ b/net-p2p/linuxdcpp/linuxdcpp-1.0.3-r1.ebuild
@@ -0,0 +1,54 @@
+# Copyright 1999-2014 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=2
+
+# TODO: This needs to use the escons eclass.
+inherit eutils multiprocessing
+
+DESCRIPTION="Direct connect client, looks and works like famous DC++"
+HOMEPAGE="https://launchpad.net/linuxdcpp"
+SRC_URI="http://launchpad.net/linuxdcpp/1.0/${PV}/+download/${P}.tar.bz2"
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="~amd64 ~ppc ~ppc64 ~x86 ~x86-fbsd"
+IUSE="debug"
+
+RDEPEND=">=gnome-base/libglade-2.4:2.0
+ >=x11-libs/gtk+-2.6:2
+ app-arch/bzip2
+ dev-libs/openssl"
+DEPEND="${RDEPEND}
+ media-libs/fontconfig
+ >=dev-util/scons-0.96
+ virtual/pkgconfig"
+
+src_prepare() {
+ # prevent scons installation of *txt files to wrong directory
+ sed -i 's/.*source = text_files.*//' SConstruct
+}
+
+src_compile() {
+ local myconf=""
+ use debug && myconf="${myconf} debug=1"
+
+ scons ${myconf} -j$(makeopts_jobs) CXXFLAGS="${CXXFLAGS}" PREFIX=/usr || die "scons failed"
+}
+
+src_install() {
+ # linuxdcpp does not install docs according to gentoos naming scheme, so do it by hand
+ dodoc Readme.txt Changelog.txt Credits.txt
+ rm "${S}"/*.txt
+
+ scons install PREFIX="/usr" FAKE_ROOT="${D}" || die "scons install failed"
+
+ doicon pixmaps/${PN}.png
+ make_desktop_entry ${PN} ${PN}
+}
+
+pkg_postinst() {
+ elog
+ elog "After adding first directory to shares you might need to restart linuxdcpp."
+ elog
+}
diff --git a/net-p2p/linuxdcpp/metadata.xml b/net-p2p/linuxdcpp/metadata.xml
new file mode 100644
index 00000000000..a7223bf09a4
--- /dev/null
+++ b/net-p2p/linuxdcpp/metadata.xml
@@ -0,0 +1,8 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+ <herd>net-p2p</herd>
+ <upstream>
+ <remote-id type="launchpad">linuxdcpp</remote-id>
+ </upstream>
+</pkgmetadata>
diff --git a/net-p2p/litecoin-qt/Manifest b/net-p2p/litecoin-qt/Manifest
new file mode 100644
index 00000000000..1ead5112eb4
--- /dev/null
+++ b/net-p2p/litecoin-qt/Manifest
@@ -0,0 +1,2 @@
+DIST litecoin-0.10.2.2.tar.gz 4700783 SHA256 952c84b181323db17a8fa23217f59b576ad3ebad92c158b3a7c29d458a1130dc SHA512 46e4c014ae8527dd58af073bab96ea4fd55c69fcc63eaa4fd600bf3c1fc2102500151b49431a72b55334a409d4f5226937cd0c5337feaa4ad49e6ef9e9728aba WHIRLPOOL 5c1d5605d4afb16744fcf0b09dd52eb574aea0cdd9754f94d4cfd9ac064491a0e192d8c4b1a3324e355d71758735265b272dfa41f938212e17badb9f8a70698b
+DIST litecoin-0.8.7.4.tar.gz 4808429 SHA256 032d1eb2ffb06ce467f514e08a66f42bcd507df2d8f1cf2c0541f2906288931a SHA512 14588dab6450bee439c3af16e277afc1f2ff562c93463d9767da27cf724cd6bb4a1c64100806d61dc1d062a39f440e4878e19b425f29e866562acc56c893cca5 WHIRLPOOL 1329d7c234c75b5083f58f5edf69b6ea9acc13f48a9734cd839001dcd3e52c10d3ade55ac853e196deca8b149aba00a3590e52cf766f62b941bd4e4828f10b96
diff --git a/net-p2p/litecoin-qt/files/0.9.0-sys_leveldb.patch b/net-p2p/litecoin-qt/files/0.9.0-sys_leveldb.patch
new file mode 100644
index 00000000000..60e9f2b2094
--- /dev/null
+++ b/net-p2p/litecoin-qt/files/0.9.0-sys_leveldb.patch
@@ -0,0 +1,34 @@
+commit c38e0af3e021eb0b2aba846c77b06ca71de06b11 (personal-github/sys_leveldb, sys_leveldb)
+Author: Luke Dashjr <luke-jr+git@utopios.org>
+Date: Mon Sep 9 03:06:17 2013 +0000
+
+ configure: Add unsupported --with-system-leveldb configure flag
+
+diff --git a/configure.ac b/configure.ac
+index 3ed4549..5a5852d 100644
+--- a/configure.ac
++++ b/configure.ac
+@@ -332,10 +332,22 @@ AC_TRY_COMPILE([#include <sys/socket.h>],
+ [ AC_MSG_RESULT(no)]
+ )
+
++dnl Check for leveldb, only if explicitly requested
+ LEVELDB_CPPFLAGS=
+ LIBLEVELDB=
+ LIBMEMENV=
+-AM_CONDITIONAL([EMBEDDED_LEVELDB],[true])
++AC_ARG_WITH([system-leveldb],
++ [AS_HELP_STRING([--with-system-leveldb],
++ [Build with system LevelDB (default is no; DANGEROUS; NOT SUPPORTED)])],
++ [system_leveldb=$withval],
++ [system_leveldb=no]
++)
++if test x$system_leveldb != xno; then
++ LEVELDB_CPPFLAGS=
++ LIBLEVELDB=-lleveldb
++ LIBMEMENV=-lmemenv
++fi
++AM_CONDITIONAL([EMBEDDED_LEVELDB],[test x$system_leveldb = xno])
+ AC_SUBST(LEVELDB_CPPFLAGS)
+ AC_SUBST(LIBLEVELDB)
+ AC_SUBST(LIBMEMENV)
diff --git a/net-p2p/litecoin-qt/files/litecoin-sys_leveldb.patch b/net-p2p/litecoin-qt/files/litecoin-sys_leveldb.patch
new file mode 100644
index 00000000000..a4ae56aeabb
--- /dev/null
+++ b/net-p2p/litecoin-qt/files/litecoin-sys_leveldb.patch
@@ -0,0 +1,193 @@
+diff -Naur litecoin-0.8.5.3-rc3.orig/bitcoin-qt.pro litecoin-0.8.5.3-rc3/bitcoin-qt.pro
+--- litecoin-0.8.5.3-rc3.orig/bitcoin-qt.pro 2013-11-28 21:17:05.000000000 -0500
++++ litecoin-0.8.5.3-rc3/bitcoin-qt.pro 2013-11-29 14:53:00.960537685 -0500
+@@ -5,7 +5,7 @@
+ INCLUDEPATH += src src/json src/qt
+ QT += core gui network
+ greaterThan(QT_MAJOR_VERSION, 4): QT += widgets
+-DEFINES += QT_GUI BOOST_THREAD_USE_LIB BOOST_SPIRIT_THREADSAFE
++DEFINES += QT_GUI BOOST_THREAD_USE_LIB BOOST_SPIRIT_THREADSAFE LEVELDB_WITHOUT_MEMENV
+ CONFIG += no_include_pwd
+ CONFIG += thread
+
+@@ -101,25 +101,30 @@
+ QTPLUGIN += qcncodecs qjpcodecs qtwcodecs qkrcodecs qtaccessiblewidgets
+ }
+
++contains(USE_SYSTEM_LEVELDB, 1) {
++ LIBS += -lleveldb
++} else {
+ INCLUDEPATH += src/leveldb/include src/leveldb/helpers
+-LIBS += $$PWD/src/leveldb/libleveldb.a $$PWD/src/leveldb/libmemenv.a
++LIBS += $$PWD/src/leveldb/libleveldb.a
+ !win32 {
+ # we use QMAKE_CXXFLAGS_RELEASE even without RELEASE=1 because we use RELEASE to indicate linking preferences not -O preferences
+- genleveldb.commands = cd $$PWD/src/leveldb && CC=$$QMAKE_CC CXX=$$QMAKE_CXX $(MAKE) OPT=\"$$QMAKE_CXXFLAGS $$QMAKE_CXXFLAGS_RELEASE\" libleveldb.a libmemenv.a
++ genleveldb.commands = cd $$PWD/src/leveldb && CC=$$QMAKE_CC CXX=$$QMAKE_CXX $(MAKE) OPT=\"$$QMAKE_CXXFLAGS $$QMAKE_CXXFLAGS_RELEASE\" libleveldb.a
+ } else {
+ # make an educated guess about what the ranlib command is called
+ isEmpty(QMAKE_RANLIB) {
+ QMAKE_RANLIB = $$replace(QMAKE_STRIP, strip, ranlib)
+ }
+ LIBS += -lshlwapi
+- genleveldb.commands = cd $$PWD/src/leveldb && CC=$$QMAKE_CC CXX=$$QMAKE_CXX TARGET_OS=OS_WINDOWS_CROSSCOMPILE $(MAKE) OPT=\"$$QMAKE_CXXFLAGS $$QMAKE_CXXFLAGS_RELEASE\" libleveldb.a libmemenv.a && $$QMAKE_RANLIB $$PWD/src/leveldb/libleveldb.a && $$QMAKE_RANLIB $$PWD/src/leveldb/libmemenv.a
++ genleveldb.commands = cd $$PWD/src/leveldb && CC=$$QMAKE_CC CXX=$$QMAKE_CXX TARGET_OS=OS_WINDOWS_CROSSCOMPILE $(MAKE) OPT=\"$$QMAKE_CXXFLAGS $$QMAKE_CXXFLAGS_RELEASE\" libleveldb.a && $$QMAKE_RANLIB $$PWD/src/leveldb/libleveldb.a
+ }
+ genleveldb.target = $$PWD/src/leveldb/libleveldb.a
+ genleveldb.depends = FORCE
+ PRE_TARGETDEPS += $$PWD/src/leveldb/libleveldb.a
+ QMAKE_EXTRA_TARGETS += genleveldb
++}
+ # Gross ugly hack that depends on qmake internals, unfortunately there is no other way to do it.
+-QMAKE_CLEAN += $$PWD/src/leveldb/libleveldb.a; cd $$PWD/src/leveldb ; $(MAKE) clean
++QMAKE_CLEAN += $$PWD/src/leveldb/libleveldb.a; cd $$PWD/src/leveldb && $(MAKE) clean || true
++
+
+ # regenerate src/build.h
+ !win32|contains(USE_BUILD_INFO, 1) {
+diff -Naur litecoin-0.8.5.3-rc3.orig/src/leveldb.cpp litecoin-0.8.5.3-rc3/src/leveldb.cpp
+--- litecoin-0.8.5.3-rc3.orig/src/leveldb.cpp 2013-11-28 21:17:05.000000000 -0500
++++ litecoin-0.8.5.3-rc3/src/leveldb.cpp 2013-11-29 14:55:33.760543008 -0500
+@@ -8,7 +8,9 @@
+ #include <leveldb/env.h>
+ #include <leveldb/cache.h>
+ #include <leveldb/filter_policy.h>
+-#include <memenv/memenv.h>
++#ifndef LEVELDB_WITHOUT_MEMENV
++#include <memenv.h>
++#endif
+
+ #include <boost/filesystem.hpp>
+
+@@ -43,8 +45,12 @@
+ options = GetOptions(nCacheSize);
+ options.create_if_missing = true;
+ if (fMemory) {
++#ifndef LEVELDB_WITHOUT_MEMENV
+ penv = leveldb::NewMemEnv(leveldb::Env::Default());
+ options.env = penv;
++#else
++ throw std::runtime_error("CLevelDB(): compiled without memenv support");
++#endif
+ } else {
+ if (fWipe) {
+ printf("Wiping LevelDB in %s\n", path.string().c_str());
+diff -Naur litecoin-0.8.5.3-rc3.orig/src/makefile.unix litecoin-0.8.5.3-rc3/src/makefile.unix
+--- litecoin-0.8.5.3-rc3.orig/src/makefile.unix 2013-11-28 21:17:05.000000000 -0500
++++ litecoin-0.8.5.3-rc3/src/makefile.unix 2013-11-29 15:08:58.337571033 -0500
+@@ -110,8 +110,7 @@
+ # adds some defaults in front. Unfortunately, LDFLAGS=... $(LDFLAGS) does not work.
+ xLDFLAGS=$(LDHARDENING) $(LDFLAGS)
+
+-OBJS= \
+- leveldb/libleveldb.a \
++BASEOBJS := \
+ obj/alert.o \
+ obj/version.o \
+ obj/checkpoints.o \
+@@ -120,7 +119,6 @@
+ obj/crypter.o \
+ obj/key.o \
+ obj/db.o \
+- obj/init.o \
+ obj/keystore.o \
+ obj/main.o \
+ obj/net.o \
+@@ -141,9 +139,17 @@
+ obj/hash.o \
+ obj/bloom.o \
+ obj/noui.o \
+- obj/leveldb.o \
+ obj/txdb.o
+
++OBJS := \
++ obj/leveldb.o \
++ obj/init.o \
++ $(BASEOBJS)
++
++TESTOBJS := \
++ obj-test/leveldb.o \
++ $(patsubst test/%.cpp,obj-test/%.o,$(wildcard test/*.cpp)) \
++ $(BASEOBJS)
+
+ ifdef USE_SSE2
+ DEFS += -DUSE_SSE2
+@@ -156,15 +162,25 @@
+ test check: test_litecoin FORCE
+ ./test_litecoin
+
++ifdef USE_SYSTEM_LEVELDB
++ LIBS += -lleveldb
++ TESTLIBS += -lmemenv
++else
+ #
+ # LevelDB support
+ #
+ MAKEOVERRIDES =
+-LIBS += $(CURDIR)/leveldb/libleveldb.a $(CURDIR)/leveldb/libmemenv.a
++LIBS += $(CURDIR)/leveldb/libleveldb.a
++TESTLIBS += $(CURDIR)/leveldb/libmemenv.a
+ DEFS += $(addprefix -I,$(CURDIR)/leveldb/include)
+ DEFS += $(addprefix -I,$(CURDIR)/leveldb/helpers)
+ leveldb/libleveldb.a:
+- @echo "Building LevelDB ..." && cd leveldb && $(MAKE) CC=$(CC) CXX=$(CXX) OPT="$(xCXXFLAGS)" libleveldb.a libmemenv.a && cd ..
++ @echo "Building LevelDB ..." && cd leveldb && $(MAKE) CC=$(CC) CXX=$(CXX) OPT="$(xCXXFLAGS)" libleveldb.a && cd ..
++leveldb/libmemenv.a:
++ @echo "Building LevelDB memenv ..." && cd leveldb && $(MAKE) CC=$(CC) CXX=$(CXX) OPT="$(xCXXFLAGS)" libmemenv.a && cd ..
++OBJS += leveldb/libleveldb.a
++TESTOBJS += leveldb/libmemenv.a
++endif
+
+ # auto-generated dependencies:
+ -include obj/*.P
+@@ -175,33 +191,34 @@
+ version.cpp: obj/build.h
+ DEFS += -DHAVE_BUILD_INFO
+
+-obj/%-sse2.o: %-sse2.cpp
+- $(CXX) -c $(xCXXFLAGS) -msse2 -MMD -MF $(@:%.o=%.d) -o $@ $<
++P_TO_D = \
+ @cp $(@:%.o=%.d) $(@:%.o=%.P); \
+- sed -e 's/#.*//' -e 's/^[^:]*: *//' -e 's/ *\\$$//' \
++ sed -e 's/\#.*//' -e 's/^[^:]*: *//' -e 's/ *\\$$//' \
+ -e '/^$$/ d' -e 's/$$/ :/' < $(@:%.o=%.d) >> $(@:%.o=%.P); \
+ rm -f $(@:%.o=%.d)
+
++obj/%-sse2.o: %-sse2.cpp
++ $(CXX) -c $(xCXXFLAGS) -msse2 -MMD -MF $(@:%.o=%.d) -o $@ $<
++ $(P_TO_D)
++
+ obj/%.o: %.cpp
+- $(CXX) -c $(xCXXFLAGS) -MMD -MF $(@:%.o=%.d) -o $@ $<
+- @cp $(@:%.o=%.d) $(@:%.o=%.P); \
+- sed -e 's/#.*//' -e 's/^[^:]*: *//' -e 's/ *\\$$//' \
+- -e '/^$$/ d' -e 's/$$/ :/' < $(@:%.o=%.d) >> $(@:%.o=%.P); \
+- rm -f $(@:%.o=%.d)
++ $(CXX) -c $(xCXXFLAGS) -DLEVELDB_WITHOUT_MEMENV -MMD -MF $(@:%.o=%.d) -o $@ $<
++ $(P_TO_D)
+
+-litecoind: $(OBJS:obj/%=obj/%)
++litecoind: $(OBJS)
+ $(LINK) $(xCXXFLAGS) -o $@ $^ $(xLDFLAGS) $(LIBS)
+
+-TESTOBJS := $(patsubst test/%.cpp,obj-test/%.o,$(wildcard test/*.cpp))
+-
+ obj-test/%.o: test/%.cpp
+ $(CXX) -c $(TESTDEFS) $(xCXXFLAGS) -MMD -MF $(@:%.o=%.d) -o $@ $<
+- @cp $(@:%.o=%.d) $(@:%.o=%.P); \
+- sed -e 's/#.*//' -e 's/^[^:]*: *//' -e 's/ *\\$$//' \
+- -e '/^$$/ d' -e 's/$$/ :/' < $(@:%.o=%.d) >> $(@:%.o=%.P); \
+- rm -f $(@:%.o=%.d)
++ $(P_TO_D)
++
++obj-test/leveldb.o: leveldb.cpp
++ $(CXX) -c $(TESTDEFS) $(xCXXFLAGS) -MMD -MF $(@:%.o=%.d) -o $@ $<
++ $(P_TO_D)
++
++TESTOBJS := $(patsubst test/%.cpp,obj-test/%.o,$(wildcard test/*.cpp))
+
+-test_litecoin: $(TESTOBJS) $(filter-out obj/init.o,$(OBJS:obj/%=obj/%))
++test_litecoin: $(TESTOBJS)
+ $(LINK) $(xCXXFLAGS) -o $@ $(LIBPATHS) $^ $(TESTLIBS) $(xLDFLAGS) $(LIBS)
+
+ clean:
diff --git a/net-p2p/litecoin-qt/litecoin-qt-0.10.2.2.ebuild b/net-p2p/litecoin-qt/litecoin-qt-0.10.2.2.ebuild
new file mode 100644
index 00000000000..94f0d994270
--- /dev/null
+++ b/net-p2p/litecoin-qt/litecoin-qt-0.10.2.2.ebuild
@@ -0,0 +1,143 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=5
+
+DB_VER="4.8"
+
+LANGS="ach af_ZA ar be_BY bg bs ca_ES ca ca@valencia cmn cs cy da de el_GR en eo es_CL es_DO es_MX es es_UY et eu_ES fa_IR fa fi fr_CA fr gl gu_IN he hi_IN hr hu id_ID it ja ka kk_KZ ko_KR ky la lt lv_LV mn ms_MY nb nl pam pl pt_BR pt_PT ro_RO ru sah sk sl_SI sq sr sv th_TH tr uk ur_PK uz@Cyrl vi vi_VN zh_CN zh_HK zh_TW"
+
+inherit autotools db-use eutils fdo-mime gnome2-utils kde4-functions qt4-r2
+
+MyPV="${PV/_/-}"
+MyPN="litecoin"
+MyP="${MyPN}-${MyPV}"
+
+DESCRIPTION="P2P Internet currency based on Bitcoin but easier to mine"
+HOMEPAGE="https://litecoin.org/"
+SRC_URI="https://github.com/${MyPN}-project/${MyPN}/archive/v${MyPV}.tar.gz -> ${MyP}.tar.gz"
+
+LICENSE="MIT ISC GPL-3 LGPL-2.1 public-domain || ( CC-BY-SA-3.0 LGPL-2.1 )"
+SLOT="0"
+KEYWORDS="~amd64 ~x86"
+IUSE="dbus kde +qrcode qt5 upnp"
+
+RDEPEND="
+ dev-libs/boost[threads(+)]
+ dev-libs/openssl:0[-bindist]
+ dev-libs/protobuf:=
+ qrcode? (
+ media-gfx/qrencode
+ )
+ upnp? (
+ net-libs/miniupnpc
+ )
+ sys-libs/db:$(db_ver_to_slot "${DB_VER}")[cxx]
+ virtual/bitcoin-leveldb
+ !qt5? (
+ dev-qt/qtgui:4
+ dbus? (
+ dev-qt/qtdbus:4
+ )
+ )
+ qt5? (
+ dev-qt/qtgui:5
+ dbus? (
+ dev-qt/qtdbus:5
+ )
+ )
+"
+DEPEND="${RDEPEND}
+ >=app-shells/bash-4.1
+"
+
+DOCS="doc/README.md doc/release-notes.md"
+
+S="${WORKDIR}/${MyP}"
+
+src_prepare() {
+ epatch "${FILESDIR}/0.9.0-sys_leveldb.patch"
+ eautoreconf
+ rm -r src/leveldb
+
+ cd src || die
+
+ local filt= yeslang= nolang=
+
+ for lan in $LANGS; do
+ if [ ! -e qt/locale/bitcoin_$lan.ts ]; then
+ ewarn "Language '$lan' no longer supported. Ebuild needs update."
+ fi
+ done
+
+ for ts in $(ls qt/locale/*.ts)
+ do
+ x="${ts/*bitcoin_/}"
+ x="${x/.ts/}"
+ if ! use "linguas_$x"; then
+ nolang="$nolang $x"
+ #rm "$ts"
+ filt="$filt\\|$x"
+ else
+ yeslang="$yeslang $x"
+ fi
+ done
+
+ filt="bitcoin_\\(${filt:2}\\)\\.\(qm\|ts\)"
+ sed "/${filt}/d" -i 'qt/bitcoin_locale.qrc'
+ einfo "Languages -- Enabled:$yeslang -- Disabled:$nolang"
+}
+
+src_configure() {
+ local my_econf=
+ if use upnp; then
+ my_econf="${my_econf} --with-miniupnpc --enable-upnp-default"
+ else
+ my_econf="${my_econf} --without-miniupnpc --disable-upnp-default"
+ fi
+ econf \
+ --enable-wallet \
+ --disable-ccache \
+ --disable-static \
+ --disable-tests \
+ --with-system-leveldb \
+ --with-system-libsecp256k1 \
+ --without-libs \
+ --without-utils \
+ --without-daemon \
+ --with-gui=$(usex qt5 qt5 qt4) \
+ $(use_with dbus qtdbus) \
+ $(use_with qrcode qrencode) \
+ ${my_econf}
+}
+
+src_install() {
+ default
+
+ insinto /usr/share/pixmaps
+ newins "share/pixmaps/bitcoin.ico" "${PN}.ico"
+
+ make_desktop_entry "${PN} %u" "Litecoin-Qt" "/usr/share/pixmaps/${PN}.ico" "Qt;Network;P2P;Office;Finance;" "MimeType=x-scheme-handler/litecoin;\nTerminal=false"
+
+ newman contrib/debian/manpages/bitcoin-qt.1 ${PN}.1
+
+ if use kde; then
+ insinto /usr/share/kde4/services
+ newins contrib/debian/bitcoin-qt.protocol ${PN}.protocol
+ fi
+}
+
+update_caches() {
+ gnome2_icon_cache_update
+ fdo-mime_desktop_database_update
+ buildsycoca
+}
+
+pkg_postinst() {
+ update_caches
+}
+
+pkg_postrm() {
+ update_caches
+}
diff --git a/net-p2p/litecoin-qt/litecoin-qt-0.8.7.4.ebuild b/net-p2p/litecoin-qt/litecoin-qt-0.8.7.4.ebuild
new file mode 100644
index 00000000000..01d62fafd31
--- /dev/null
+++ b/net-p2p/litecoin-qt/litecoin-qt-0.8.7.4.ebuild
@@ -0,0 +1,143 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=5
+
+DB_VER="4.8"
+
+LANGS="af_ZA ar bg bs ca ca_ES cs cy da de el_GR en eo es es_CL et eu_ES fa fa_IR fi fr fr_CA gu_IN he hi_IN hr hu it ja la lt lv_LV nb nl pl pt_BR pt_PT ro_RO ru sk sr sv th_TH tr uk zh_CN zh_TW"
+inherit db-use eutils fdo-mime gnome2-utils kde4-functions qt4-r2
+
+MyPV="${PV/_/-}"
+MyPN="litecoin"
+MyP="${MyPN}-${MyPV}"
+
+DESCRIPTION="P2P Internet currency based on Bitcoin but easier to mine"
+HOMEPAGE="https://litecoin.org/"
+SRC_URI="https://github.com/${MyPN}-project/${MyPN}/archive/v${MyPV}.tar.gz -> ${MyP}.tar.gz"
+
+LICENSE="MIT ISC GPL-3 LGPL-2.1 public-domain || ( CC-BY-SA-3.0 LGPL-2.1 )"
+SLOT="0"
+KEYWORDS="~amd64 ~x86"
+IUSE="dbus ipv6 kde +qrcode upnp"
+
+RDEPEND="
+ dev-libs/boost[threads(+)]
+ dev-libs/openssl:0[-bindist]
+ qrcode? (
+ media-gfx/qrencode
+ )
+ upnp? (
+ net-libs/miniupnpc
+ )
+ sys-libs/db:$(db_ver_to_slot "${DB_VER}")[cxx]
+ <=dev-libs/leveldb-1.12.0[-snappy]
+ dev-qt/qtgui:4
+ dbus? (
+ dev-qt/qtdbus:4
+ )
+"
+DEPEND="${RDEPEND}
+ >=app-shells/bash-4.1
+"
+
+DOCS="doc/README.md doc/release-notes.md"
+
+S="${WORKDIR}/${MyP}"
+
+src_prepare() {
+ epatch "${FILESDIR}"/${MyPN}-sys_leveldb.patch
+ rm -r src/leveldb
+
+ cd src || die
+
+ local filt= yeslang= nolang=
+
+ for lan in $LANGS; do
+ if [ ! -e qt/locale/bitcoin_$lan.ts ]; then
+ ewarn "Language '$lan' no longer supported. Ebuild needs update."
+ fi
+ done
+
+ for ts in $(ls qt/locale/*.ts)
+ do
+ x="${ts/*bitcoin_/}"
+ x="${x/.ts/}"
+ if ! use "linguas_$x"; then
+ nolang="$nolang $x"
+ rm "$ts"
+ filt="$filt\\|$x"
+ else
+ yeslang="$yeslang $x"
+ fi
+ done
+
+ filt="bitcoin_\\(${filt:2}\\)\\.\(qm\|ts\)"
+ sed "/${filt}/d" -i 'qt/bitcoin.qrc'
+ einfo "Languages -- Enabled:$yeslang -- Disabled:$nolang"
+}
+
+src_configure() {
+ OPTS=()
+
+ use dbus && OPTS+=("USE_DBUS=1")
+ if use upnp; then
+ OPTS+=("USE_UPNP=1")
+ else
+ OPTS+=("USE_UPNP=-")
+ fi
+
+ use qrcode && OPTS+=("USE_QRCODE=1")
+ use ipv6 || OPTS+=("USE_IPV6=-")
+
+ OPTS+=("USE_SYSTEM_LEVELDB=1")
+ OPTS+=("BDB_INCLUDE_PATH=$(db_includedir "${DB_VER}")")
+ OPTS+=("BDB_LIB_SUFFIX=-${DB_VER}")
+
+ if has_version '>=dev-libs/boost-1.52'; then
+ OPTS+=("LIBS+=-lboost_chrono\$\$BOOST_LIB_SUFFIX")
+ fi
+
+ #The litecoin codebase is mostly taken from bitcoin-qt
+ eqmake4 bitcoin-qt.pro "${OPTS[@]}"
+}
+
+#Tests are broken with and without our litecoin-sys_leveldb.patch
+#src_test() {
+# cd src || die
+# emake -f makefile.unix "${OPTS[@]}" test_litecoin
+# ./test_litecoin || die 'Tests failed'
+#}
+
+src_install() {
+ qt4-r2_src_install
+
+ dobin ${PN}
+
+ insinto /usr/share/pixmaps
+ newins "share/pixmaps/bitcoin.ico" "${PN}.ico"
+
+ make_desktop_entry "${PN} %u" "Litecoin-Qt" "/usr/share/pixmaps/${PN}.ico" "Qt;Network;P2P;Office;Finance;" "MimeType=x-scheme-handler/litecoin;\nTerminal=false"
+
+ newman contrib/debian/manpages/bitcoin-qt.1 ${PN}.1
+
+ if use kde; then
+ insinto /usr/share/kde4/services
+ newins contrib/debian/bitcoin-qt.protocol ${PN}.protocol
+ fi
+}
+
+update_caches() {
+ gnome2_icon_cache_update
+ fdo-mime_desktop_database_update
+ buildsycoca
+}
+
+pkg_postinst() {
+ update_caches
+}
+
+pkg_postrm() {
+ update_caches
+}
diff --git a/net-p2p/litecoin-qt/metadata.xml b/net-p2p/litecoin-qt/metadata.xml
new file mode 100644
index 00000000000..f9bb68f6e62
--- /dev/null
+++ b/net-p2p/litecoin-qt/metadata.xml
@@ -0,0 +1,14 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+ <maintainer>
+ <email>blueness@gentoo.org</email>
+ <name>Anthony G. Basile</name>
+ </maintainer>
+ <use>
+ <flag name="qrcode">Enable generation of QR Codes for receiving payments</flag>
+ </use>
+ <upstream>
+ <remote-id type="github">litecoin-project/litecoin</remote-id>
+ </upstream>
+</pkgmetadata>
diff --git a/net-p2p/litecoind/Manifest b/net-p2p/litecoind/Manifest
new file mode 100644
index 00000000000..1ead5112eb4
--- /dev/null
+++ b/net-p2p/litecoind/Manifest
@@ -0,0 +1,2 @@
+DIST litecoin-0.10.2.2.tar.gz 4700783 SHA256 952c84b181323db17a8fa23217f59b576ad3ebad92c158b3a7c29d458a1130dc SHA512 46e4c014ae8527dd58af073bab96ea4fd55c69fcc63eaa4fd600bf3c1fc2102500151b49431a72b55334a409d4f5226937cd0c5337feaa4ad49e6ef9e9728aba WHIRLPOOL 5c1d5605d4afb16744fcf0b09dd52eb574aea0cdd9754f94d4cfd9ac064491a0e192d8c4b1a3324e355d71758735265b272dfa41f938212e17badb9f8a70698b
+DIST litecoin-0.8.7.4.tar.gz 4808429 SHA256 032d1eb2ffb06ce467f514e08a66f42bcd507df2d8f1cf2c0541f2906288931a SHA512 14588dab6450bee439c3af16e277afc1f2ff562c93463d9767da27cf724cd6bb4a1c64100806d61dc1d062a39f440e4878e19b425f29e866562acc56c893cca5 WHIRLPOOL 1329d7c234c75b5083f58f5edf69b6ea9acc13f48a9734cd839001dcd3e52c10d3ade55ac853e196deca8b149aba00a3590e52cf766f62b941bd4e4828f10b96
diff --git a/net-p2p/litecoind/files/0.9.0-sys_leveldb.patch b/net-p2p/litecoind/files/0.9.0-sys_leveldb.patch
new file mode 100644
index 00000000000..60e9f2b2094
--- /dev/null
+++ b/net-p2p/litecoind/files/0.9.0-sys_leveldb.patch
@@ -0,0 +1,34 @@
+commit c38e0af3e021eb0b2aba846c77b06ca71de06b11 (personal-github/sys_leveldb, sys_leveldb)
+Author: Luke Dashjr <luke-jr+git@utopios.org>
+Date: Mon Sep 9 03:06:17 2013 +0000
+
+ configure: Add unsupported --with-system-leveldb configure flag
+
+diff --git a/configure.ac b/configure.ac
+index 3ed4549..5a5852d 100644
+--- a/configure.ac
++++ b/configure.ac
+@@ -332,10 +332,22 @@ AC_TRY_COMPILE([#include <sys/socket.h>],
+ [ AC_MSG_RESULT(no)]
+ )
+
++dnl Check for leveldb, only if explicitly requested
+ LEVELDB_CPPFLAGS=
+ LIBLEVELDB=
+ LIBMEMENV=
+-AM_CONDITIONAL([EMBEDDED_LEVELDB],[true])
++AC_ARG_WITH([system-leveldb],
++ [AS_HELP_STRING([--with-system-leveldb],
++ [Build with system LevelDB (default is no; DANGEROUS; NOT SUPPORTED)])],
++ [system_leveldb=$withval],
++ [system_leveldb=no]
++)
++if test x$system_leveldb != xno; then
++ LEVELDB_CPPFLAGS=
++ LIBLEVELDB=-lleveldb
++ LIBMEMENV=-lmemenv
++fi
++AM_CONDITIONAL([EMBEDDED_LEVELDB],[test x$system_leveldb = xno])
+ AC_SUBST(LEVELDB_CPPFLAGS)
+ AC_SUBST(LIBLEVELDB)
+ AC_SUBST(LIBMEMENV)
diff --git a/net-p2p/litecoind/files/litecoin-sys_leveldb.patch b/net-p2p/litecoind/files/litecoin-sys_leveldb.patch
new file mode 100644
index 00000000000..a4ae56aeabb
--- /dev/null
+++ b/net-p2p/litecoind/files/litecoin-sys_leveldb.patch
@@ -0,0 +1,193 @@
+diff -Naur litecoin-0.8.5.3-rc3.orig/bitcoin-qt.pro litecoin-0.8.5.3-rc3/bitcoin-qt.pro
+--- litecoin-0.8.5.3-rc3.orig/bitcoin-qt.pro 2013-11-28 21:17:05.000000000 -0500
++++ litecoin-0.8.5.3-rc3/bitcoin-qt.pro 2013-11-29 14:53:00.960537685 -0500
+@@ -5,7 +5,7 @@
+ INCLUDEPATH += src src/json src/qt
+ QT += core gui network
+ greaterThan(QT_MAJOR_VERSION, 4): QT += widgets
+-DEFINES += QT_GUI BOOST_THREAD_USE_LIB BOOST_SPIRIT_THREADSAFE
++DEFINES += QT_GUI BOOST_THREAD_USE_LIB BOOST_SPIRIT_THREADSAFE LEVELDB_WITHOUT_MEMENV
+ CONFIG += no_include_pwd
+ CONFIG += thread
+
+@@ -101,25 +101,30 @@
+ QTPLUGIN += qcncodecs qjpcodecs qtwcodecs qkrcodecs qtaccessiblewidgets
+ }
+
++contains(USE_SYSTEM_LEVELDB, 1) {
++ LIBS += -lleveldb
++} else {
+ INCLUDEPATH += src/leveldb/include src/leveldb/helpers
+-LIBS += $$PWD/src/leveldb/libleveldb.a $$PWD/src/leveldb/libmemenv.a
++LIBS += $$PWD/src/leveldb/libleveldb.a
+ !win32 {
+ # we use QMAKE_CXXFLAGS_RELEASE even without RELEASE=1 because we use RELEASE to indicate linking preferences not -O preferences
+- genleveldb.commands = cd $$PWD/src/leveldb && CC=$$QMAKE_CC CXX=$$QMAKE_CXX $(MAKE) OPT=\"$$QMAKE_CXXFLAGS $$QMAKE_CXXFLAGS_RELEASE\" libleveldb.a libmemenv.a
++ genleveldb.commands = cd $$PWD/src/leveldb && CC=$$QMAKE_CC CXX=$$QMAKE_CXX $(MAKE) OPT=\"$$QMAKE_CXXFLAGS $$QMAKE_CXXFLAGS_RELEASE\" libleveldb.a
+ } else {
+ # make an educated guess about what the ranlib command is called
+ isEmpty(QMAKE_RANLIB) {
+ QMAKE_RANLIB = $$replace(QMAKE_STRIP, strip, ranlib)
+ }
+ LIBS += -lshlwapi
+- genleveldb.commands = cd $$PWD/src/leveldb && CC=$$QMAKE_CC CXX=$$QMAKE_CXX TARGET_OS=OS_WINDOWS_CROSSCOMPILE $(MAKE) OPT=\"$$QMAKE_CXXFLAGS $$QMAKE_CXXFLAGS_RELEASE\" libleveldb.a libmemenv.a && $$QMAKE_RANLIB $$PWD/src/leveldb/libleveldb.a && $$QMAKE_RANLIB $$PWD/src/leveldb/libmemenv.a
++ genleveldb.commands = cd $$PWD/src/leveldb && CC=$$QMAKE_CC CXX=$$QMAKE_CXX TARGET_OS=OS_WINDOWS_CROSSCOMPILE $(MAKE) OPT=\"$$QMAKE_CXXFLAGS $$QMAKE_CXXFLAGS_RELEASE\" libleveldb.a && $$QMAKE_RANLIB $$PWD/src/leveldb/libleveldb.a
+ }
+ genleveldb.target = $$PWD/src/leveldb/libleveldb.a
+ genleveldb.depends = FORCE
+ PRE_TARGETDEPS += $$PWD/src/leveldb/libleveldb.a
+ QMAKE_EXTRA_TARGETS += genleveldb
++}
+ # Gross ugly hack that depends on qmake internals, unfortunately there is no other way to do it.
+-QMAKE_CLEAN += $$PWD/src/leveldb/libleveldb.a; cd $$PWD/src/leveldb ; $(MAKE) clean
++QMAKE_CLEAN += $$PWD/src/leveldb/libleveldb.a; cd $$PWD/src/leveldb && $(MAKE) clean || true
++
+
+ # regenerate src/build.h
+ !win32|contains(USE_BUILD_INFO, 1) {
+diff -Naur litecoin-0.8.5.3-rc3.orig/src/leveldb.cpp litecoin-0.8.5.3-rc3/src/leveldb.cpp
+--- litecoin-0.8.5.3-rc3.orig/src/leveldb.cpp 2013-11-28 21:17:05.000000000 -0500
++++ litecoin-0.8.5.3-rc3/src/leveldb.cpp 2013-11-29 14:55:33.760543008 -0500
+@@ -8,7 +8,9 @@
+ #include <leveldb/env.h>
+ #include <leveldb/cache.h>
+ #include <leveldb/filter_policy.h>
+-#include <memenv/memenv.h>
++#ifndef LEVELDB_WITHOUT_MEMENV
++#include <memenv.h>
++#endif
+
+ #include <boost/filesystem.hpp>
+
+@@ -43,8 +45,12 @@
+ options = GetOptions(nCacheSize);
+ options.create_if_missing = true;
+ if (fMemory) {
++#ifndef LEVELDB_WITHOUT_MEMENV
+ penv = leveldb::NewMemEnv(leveldb::Env::Default());
+ options.env = penv;
++#else
++ throw std::runtime_error("CLevelDB(): compiled without memenv support");
++#endif
+ } else {
+ if (fWipe) {
+ printf("Wiping LevelDB in %s\n", path.string().c_str());
+diff -Naur litecoin-0.8.5.3-rc3.orig/src/makefile.unix litecoin-0.8.5.3-rc3/src/makefile.unix
+--- litecoin-0.8.5.3-rc3.orig/src/makefile.unix 2013-11-28 21:17:05.000000000 -0500
++++ litecoin-0.8.5.3-rc3/src/makefile.unix 2013-11-29 15:08:58.337571033 -0500
+@@ -110,8 +110,7 @@
+ # adds some defaults in front. Unfortunately, LDFLAGS=... $(LDFLAGS) does not work.
+ xLDFLAGS=$(LDHARDENING) $(LDFLAGS)
+
+-OBJS= \
+- leveldb/libleveldb.a \
++BASEOBJS := \
+ obj/alert.o \
+ obj/version.o \
+ obj/checkpoints.o \
+@@ -120,7 +119,6 @@
+ obj/crypter.o \
+ obj/key.o \
+ obj/db.o \
+- obj/init.o \
+ obj/keystore.o \
+ obj/main.o \
+ obj/net.o \
+@@ -141,9 +139,17 @@
+ obj/hash.o \
+ obj/bloom.o \
+ obj/noui.o \
+- obj/leveldb.o \
+ obj/txdb.o
+
++OBJS := \
++ obj/leveldb.o \
++ obj/init.o \
++ $(BASEOBJS)
++
++TESTOBJS := \
++ obj-test/leveldb.o \
++ $(patsubst test/%.cpp,obj-test/%.o,$(wildcard test/*.cpp)) \
++ $(BASEOBJS)
+
+ ifdef USE_SSE2
+ DEFS += -DUSE_SSE2
+@@ -156,15 +162,25 @@
+ test check: test_litecoin FORCE
+ ./test_litecoin
+
++ifdef USE_SYSTEM_LEVELDB
++ LIBS += -lleveldb
++ TESTLIBS += -lmemenv
++else
+ #
+ # LevelDB support
+ #
+ MAKEOVERRIDES =
+-LIBS += $(CURDIR)/leveldb/libleveldb.a $(CURDIR)/leveldb/libmemenv.a
++LIBS += $(CURDIR)/leveldb/libleveldb.a
++TESTLIBS += $(CURDIR)/leveldb/libmemenv.a
+ DEFS += $(addprefix -I,$(CURDIR)/leveldb/include)
+ DEFS += $(addprefix -I,$(CURDIR)/leveldb/helpers)
+ leveldb/libleveldb.a:
+- @echo "Building LevelDB ..." && cd leveldb && $(MAKE) CC=$(CC) CXX=$(CXX) OPT="$(xCXXFLAGS)" libleveldb.a libmemenv.a && cd ..
++ @echo "Building LevelDB ..." && cd leveldb && $(MAKE) CC=$(CC) CXX=$(CXX) OPT="$(xCXXFLAGS)" libleveldb.a && cd ..
++leveldb/libmemenv.a:
++ @echo "Building LevelDB memenv ..." && cd leveldb && $(MAKE) CC=$(CC) CXX=$(CXX) OPT="$(xCXXFLAGS)" libmemenv.a && cd ..
++OBJS += leveldb/libleveldb.a
++TESTOBJS += leveldb/libmemenv.a
++endif
+
+ # auto-generated dependencies:
+ -include obj/*.P
+@@ -175,33 +191,34 @@
+ version.cpp: obj/build.h
+ DEFS += -DHAVE_BUILD_INFO
+
+-obj/%-sse2.o: %-sse2.cpp
+- $(CXX) -c $(xCXXFLAGS) -msse2 -MMD -MF $(@:%.o=%.d) -o $@ $<
++P_TO_D = \
+ @cp $(@:%.o=%.d) $(@:%.o=%.P); \
+- sed -e 's/#.*//' -e 's/^[^:]*: *//' -e 's/ *\\$$//' \
++ sed -e 's/\#.*//' -e 's/^[^:]*: *//' -e 's/ *\\$$//' \
+ -e '/^$$/ d' -e 's/$$/ :/' < $(@:%.o=%.d) >> $(@:%.o=%.P); \
+ rm -f $(@:%.o=%.d)
+
++obj/%-sse2.o: %-sse2.cpp
++ $(CXX) -c $(xCXXFLAGS) -msse2 -MMD -MF $(@:%.o=%.d) -o $@ $<
++ $(P_TO_D)
++
+ obj/%.o: %.cpp
+- $(CXX) -c $(xCXXFLAGS) -MMD -MF $(@:%.o=%.d) -o $@ $<
+- @cp $(@:%.o=%.d) $(@:%.o=%.P); \
+- sed -e 's/#.*//' -e 's/^[^:]*: *//' -e 's/ *\\$$//' \
+- -e '/^$$/ d' -e 's/$$/ :/' < $(@:%.o=%.d) >> $(@:%.o=%.P); \
+- rm -f $(@:%.o=%.d)
++ $(CXX) -c $(xCXXFLAGS) -DLEVELDB_WITHOUT_MEMENV -MMD -MF $(@:%.o=%.d) -o $@ $<
++ $(P_TO_D)
+
+-litecoind: $(OBJS:obj/%=obj/%)
++litecoind: $(OBJS)
+ $(LINK) $(xCXXFLAGS) -o $@ $^ $(xLDFLAGS) $(LIBS)
+
+-TESTOBJS := $(patsubst test/%.cpp,obj-test/%.o,$(wildcard test/*.cpp))
+-
+ obj-test/%.o: test/%.cpp
+ $(CXX) -c $(TESTDEFS) $(xCXXFLAGS) -MMD -MF $(@:%.o=%.d) -o $@ $<
+- @cp $(@:%.o=%.d) $(@:%.o=%.P); \
+- sed -e 's/#.*//' -e 's/^[^:]*: *//' -e 's/ *\\$$//' \
+- -e '/^$$/ d' -e 's/$$/ :/' < $(@:%.o=%.d) >> $(@:%.o=%.P); \
+- rm -f $(@:%.o=%.d)
++ $(P_TO_D)
++
++obj-test/leveldb.o: leveldb.cpp
++ $(CXX) -c $(TESTDEFS) $(xCXXFLAGS) -MMD -MF $(@:%.o=%.d) -o $@ $<
++ $(P_TO_D)
++
++TESTOBJS := $(patsubst test/%.cpp,obj-test/%.o,$(wildcard test/*.cpp))
+
+-test_litecoin: $(TESTOBJS) $(filter-out obj/init.o,$(OBJS:obj/%=obj/%))
++test_litecoin: $(TESTOBJS)
+ $(LINK) $(xCXXFLAGS) -o $@ $(LIBPATHS) $^ $(TESTLIBS) $(xLDFLAGS) $(LIBS)
+
+ clean:
diff --git a/net-p2p/litecoind/files/litecoin.conf b/net-p2p/litecoind/files/litecoin.conf
new file mode 100644
index 00000000000..c6a55f3d913
--- /dev/null
+++ b/net-p2p/litecoind/files/litecoin.conf
@@ -0,0 +1,8 @@
+# http://www.bitcoin.org/smf/index.php?topic=644.0
+#rpcuser=
+#rpcpassword=
+
+
+
+
+
diff --git a/net-p2p/litecoind/files/litecoin.confd b/net-p2p/litecoind/files/litecoin.confd
new file mode 100644
index 00000000000..4261f6e25fe
--- /dev/null
+++ b/net-p2p/litecoind/files/litecoin.confd
@@ -0,0 +1,10 @@
+# Config file for /etc/init.d/litecoind
+
+# owner of liteciond process (don't change, must be existing)
+LITECOIN_USER="litecoin"
+
+# See http://www.bitcoin.org/smf/index.php?topic=1063
+LITECOIN_OPTS="${LITECOIN_OPTS}"
+
+# nice level
+NICELEVEL="19"
diff --git a/net-p2p/litecoind/files/litecoin.initd b/net-p2p/litecoind/files/litecoin.initd
new file mode 100644
index 00000000000..036ab8c577a
--- /dev/null
+++ b/net-p2p/litecoind/files/litecoin.initd
@@ -0,0 +1,104 @@
+#!/sbin/runscript
+# Distributed under the terms of the GNU General Public License, v2 or later
+
+VARDIR="/var/lib/litecoin"
+CONFFILE="${VARDIR}/.litecoin/litecoin.conf"
+
+depend() {
+ need net
+}
+
+checkconfig() {
+ if [[ "${LITECOIN_USER}" == "" ]] ; then
+ eerror "Please edit /etc/conf.d/litecoind"
+ eerror "A user must be specified to run litecoind as that user."
+ eerror "Modify USER to your needs (you may also add a group after a colon)"
+ return 1
+ fi
+ if ! `getent passwd | cut -d ':' -f 1 | grep $( echo "${LITECOIN_USER}" | cut -d ':' -f 1 ) -sq` ; then
+ eerror "Please edit /etc/conf.d/litecoind"
+ eerror "Specified user must exist!"
+ return 1
+ fi
+ if `echo "${LITECOIN_USER}" | grep ':' -sq` ; then
+ if ! `cut -d ':' -f 1 /etc/group | grep $( echo "${LITECOIN_USER}" | cut -d ':' -f 2 ) -sq` ; then
+ eerror "Please edit /etc/conf.d/litecoind"
+ eerror "Specified group must exist!"
+ return 1
+ fi
+ fi
+ if ! grep -q '^rpcpassword=' "${CONFFILE}"; then
+ eerror "Please edit `readlink -f ${CONFFILE}`"
+ eerror "There must be at least a line assigning rpcpassword=something-secure"
+ return 1
+ fi
+ if ! stat -Lc '%a' "${CONFFILE}" | grep -q '^[4567]00$'; then
+ eerror "`readlink -f ${CONFFILE}` should not be readable by other users"
+ return 1
+ fi
+ return 0
+}
+
+start() {
+ checkconfig || return 1
+ ebegin "Starting Litecoind daemon"
+
+ pkg-config openrc
+ if [ $? = 0 ]; then
+ start_openrc
+ else
+ start_baselayout
+ fi
+}
+
+stop() {
+ ebegin "Stopping Litecoin daemon"
+
+ pkg-config openrc
+ if [ $? = 0 ]; then
+ stop_openrc
+ else
+ stop_baselayout
+ fi
+}
+
+start_openrc() {
+ start-stop-daemon \
+ --start --user "${LITECOIN_USER}" --name litecoind \
+ --pidfile /var/run/litecoind.pid --make-pidfile \
+ --env HOME="${VARDIR}" --exec /usr/bin/litecoind \
+ --nicelevel "${NICELEVEL}" \
+ --background \
+ --wait 2000 \
+ -- ${LITECOIN_OPTS}
+ eend $?
+}
+
+stop_openrc() {
+ start-stop-daemon --stop --user "${LITECOIN_USER}" \
+ --name litecoind --pidfile /var/run/litecoind.pid \
+ --wait 30000 \
+ --progress
+ eend $?
+}
+
+start_baselayout() {
+ start-stop-daemon \
+ --start --user "${LITECOIN_USER}" --name litecoind \
+ --pidfile /var/run/litecoind.pid --make-pidfile \
+ --env HOME="${VARDIR}" --exec /usr/bin/litecoind \
+ --chuid "${LITECOIN_USER}" \
+ --nicelevel "${NICELEVEL}" \
+ --background \
+ -- ${LITECOIN_OPTS}
+ eend $?
+}
+
+stop_baselayout() {
+ start-stop-daemon \
+ --stop \
+ --user "${LITECOIN_USER}" \
+ --name litecoind \
+ --pidfile /var/run/litecoind.pid
+ eend $?
+}
diff --git a/net-p2p/litecoind/files/litecoin.initd-r1 b/net-p2p/litecoind/files/litecoin.initd-r1
new file mode 100644
index 00000000000..c5bd2f9ceef
--- /dev/null
+++ b/net-p2p/litecoind/files/litecoin.initd-r1
@@ -0,0 +1,29 @@
+#!/sbin/runscript
+# Copyright 1999-2014 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+vardir="/var/lib/litecoin"
+conffile="${vardir}/.litecoin/litecoin.conf"
+litecoind_user="${LITECOIN_USER:-nobody:nobody}"
+
+description="P2P Internet currency based on Bitcoin but easier to mine."
+pidfile="/run/${SVCNAME}.pid"
+command="/usr/bin/litecoind"
+command_args="${LITECOIN_OPTS}"
+command_background="true"
+start_stop_daemon_args="-u ${litecoind_user} -e HOME=${vardir} -N ${NICELEVEL:-0} -w 2000"
+
+depend() {
+ need net
+}
+
+start_pre() {
+ checkpath -f -o ${litecoind_user} -m 0400 ${conffile} || return 1
+
+ if ! grep -q '^rpcpassword=' "${conffile}"; then
+ eerror "Please edit `readlink -f ${conffile}`"
+ eerror "There must be at least a line assigning rpcpassword=something-secure"
+ return 1
+ fi
+}
diff --git a/net-p2p/litecoind/files/litecoin.service b/net-p2p/litecoind/files/litecoin.service
new file mode 100644
index 00000000000..ae063ac48e1
--- /dev/null
+++ b/net-p2p/litecoind/files/litecoin.service
@@ -0,0 +1,30 @@
+# It's not recommended to modify this file in-place, because it will be
+# overwritten during package upgrades. If you want to customize, the
+# best way is to create file
+# "/etc/systemd/system/litecoind.service.d/*.conf"
+# containing your changes
+
+# For example, if you want to change some daemon and/or unit options,
+# create a file named
+# "/etc/systemd/system/litecoind.service.d/myopts.conf"
+# containing:
+# [Service]
+# Environment="LITECOIN_OPTS=-debug -logtimestamps"
+# Nice=10
+# This will override the setting appearing below.
+
+# Note that almost all daemon options could be specified in
+# /etc/litecoin/litecoin.conf
+
+[Unit]
+Description=Litecoin Daemon
+After=network.target
+
+[Service]
+User=litecoin
+Environment=LITECOIN_OPTS=
+ExecStart=/usr/bin/litecoind -daemon=0 $LITECOIN_OPTS
+ExecReload=/bin/kill -HUP $MAINPID
+
+[Install]
+WantedBy=multi-user.target
diff --git a/net-p2p/litecoind/files/litecoind.logrotate b/net-p2p/litecoind/files/litecoind.logrotate
new file mode 100644
index 00000000000..5b091aa00c4
--- /dev/null
+++ b/net-p2p/litecoind/files/litecoind.logrotate
@@ -0,0 +1,7 @@
+/var/lib/litecoin/.litecoin/debug.log {
+ weekly
+ sharedscripts
+ postrotate
+ killall -HUP litecoind
+ endscript
+}
diff --git a/net-p2p/litecoind/litecoind-0.10.2.2-r1.ebuild b/net-p2p/litecoind/litecoind-0.10.2.2-r1.ebuild
new file mode 100644
index 00000000000..0a3c95d314f
--- /dev/null
+++ b/net-p2p/litecoind/litecoind-0.10.2.2-r1.ebuild
@@ -0,0 +1,98 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=5
+
+DB_VER="4.8"
+
+inherit autotools db-use eutils systemd user
+
+MyPV="${PV/_/-}"
+MyPN="litecoin"
+MyP="${MyPN}-${MyPV}"
+
+DESCRIPTION="P2P Internet currency based on Bitcoin but easier to mine"
+HOMEPAGE="https://litecoin.org/"
+SRC_URI="https://github.com/${MyPN}-project/${MyPN}/archive/v${MyPV}.tar.gz -> ${MyP}.tar.gz"
+
+LICENSE="MIT ISC GPL-2"
+SLOT="0"
+KEYWORDS="~amd64 ~x86"
+IUSE="logrotate upnp +wallet"
+
+RDEPEND="
+ dev-libs/boost[threads(+)]
+ dev-libs/openssl:0[-bindist]
+ logrotate? ( app-admin/logrotate )
+ upnp? ( net-libs/miniupnpc )
+ sys-libs/db:$(db_ver_to_slot "${DB_VER}")[cxx]
+ virtual/bitcoin-leveldb
+"
+DEPEND="${RDEPEND}
+ >=app-shells/bash-4.1
+ sys-apps/sed
+"
+
+S="${WORKDIR}/${MyP}"
+
+pkg_setup() {
+ local UG='litecoin'
+ enewgroup "${UG}"
+ enewuser "${UG}" -1 -1 /var/lib/litecoin "${UG}"
+}
+
+src_prepare() {
+ epatch "${FILESDIR}/0.9.0-sys_leveldb.patch"
+ eautoreconf
+ rm -r src/leveldb
+}
+
+src_configure() {
+ local my_econf=
+ if use upnp; then
+ my_econf="${my_econf} --with-miniupnpc --enable-upnp-default"
+ else
+ my_econf="${my_econf} --without-miniupnpc --disable-upnp-default"
+ fi
+ econf \
+ $(use_enable wallet)\
+ --disable-ccache \
+ --disable-static \
+ --disable-tests \
+ --with-system-leveldb \
+ --with-system-libsecp256k1 \
+ --without-libs \
+ --with-daemon \
+ --without-gui \
+ --without-qrencode \
+ ${my_econf}
+}
+
+src_install() {
+ default
+
+ insinto /etc/litecoin
+ doins "${FILESDIR}/litecoin.conf"
+ fowners litecoin:litecoin /etc/litecoin/litecoin.conf
+ fperms 600 /etc/litecoin/litecoin.conf
+
+ newconfd "${FILESDIR}/litecoin.confd" ${PN}
+ newinitd "${FILESDIR}/litecoin.initd-r1" ${PN}
+ systemd_dounit "${FILESDIR}/litecoin.service"
+
+ keepdir /var/lib/litecoin/.litecoin
+ fperms 700 /var/lib/litecoin
+ fowners litecoin:litecoin /var/lib/litecoin/
+ fowners litecoin:litecoin /var/lib/litecoin/.litecoin
+ dosym /etc/litecoin/litecoin.conf /var/lib/litecoin/.litecoin/litecoin.conf
+
+ dodoc doc/README.md doc/release-notes.md
+ newman contrib/debian/manpages/bitcoind.1 litecoind.1
+ newman contrib/debian/manpages/bitcoin.conf.5 litecoin.conf.5
+
+ if use logrotate; then
+ insinto /etc/logrotate.d
+ newins "${FILESDIR}/litecoind.logrotate" litecoind
+ fi
+}
diff --git a/net-p2p/litecoind/litecoind-0.8.7.4.ebuild b/net-p2p/litecoind/litecoind-0.8.7.4.ebuild
new file mode 100644
index 00000000000..26d0a7f2dfe
--- /dev/null
+++ b/net-p2p/litecoind/litecoind-0.8.7.4.ebuild
@@ -0,0 +1,123 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=5
+
+DB_VER="4.8"
+
+inherit bash-completion-r1 db-use eutils systemd user
+
+MyPV="${PV/_/-}"
+MyPN="litecoin"
+MyP="${MyPN}-${MyPV}"
+
+DESCRIPTION="P2P Internet currency based on Bitcoin but easier to mine"
+HOMEPAGE="https://litecoin.org/"
+SRC_URI="https://github.com/${MyPN}-project/${MyPN}/archive/v${MyPV}.tar.gz -> ${MyP}.tar.gz"
+
+LICENSE="MIT ISC GPL-2"
+SLOT="0"
+KEYWORDS="~amd64 ~x86"
+IUSE="examples ipv6 logrotate upnp"
+
+RDEPEND="
+ dev-libs/boost[threads(+)]
+ dev-libs/openssl:0[-bindist]
+ logrotate? (
+ app-admin/logrotate
+ )
+ upnp? (
+ net-libs/miniupnpc
+ )
+ sys-libs/db:$(db_ver_to_slot "${DB_VER}")[cxx]
+ <=dev-libs/leveldb-1.12.0[-snappy]
+"
+DEPEND="${RDEPEND}
+ >=app-shells/bash-4.1
+ sys-apps/sed
+"
+
+S="${WORKDIR}/${MyP}"
+
+pkg_setup() {
+ local UG='litecoin'
+ enewgroup "${UG}"
+ enewuser "${UG}" -1 -1 /var/lib/litecoin "${UG}"
+}
+
+src_prepare() {
+ epatch "${FILESDIR}"/${MyPN}-sys_leveldb.patch
+ rm -r src/leveldb
+
+ if has_version '>=dev-libs/boost-1.52'; then
+ sed -i 's/\(-l db_cxx\)/-l boost_chrono$(BOOST_LIB_SUFFIX) \1/' src/makefile.unix
+ fi
+}
+
+src_configure() {
+ OPTS=()
+
+ OPTS+=("DEBUGFLAGS=")
+ OPTS+=("CXXFLAGS=${CXXFLAGS}")
+ OPTS+=("LDFLAGS=${LDFLAGS}")
+
+ if use upnp; then
+ OPTS+=("USE_UPNP=1")
+ else
+ OPTS+=("USE_UPNP=-")
+ fi
+
+ use ipv6 || OPTS+=("USE_IPV6=-")
+
+ OPTS+=("USE_SYSTEM_LEVELDB=1")
+ OPTS+=("BDB_INCLUDE_PATH=$(db_includedir "${DB_VER}")")
+ OPTS+=("BDB_LIB_SUFFIX=-${DB_VER}")
+
+ cd src || die
+ emake CC="$(tc-getCC)" CXX="$(tc-getCXX)" -f makefile.unix "${OPTS[@]}" ${PN}
+}
+
+#Tests are broken with and without our litecoin-sys_leveldb.patch.
+#When tests work, make sure to inherit toolchain-funcs
+#src_test() {
+# cd src || die
+# emake CC="$(tc-getCC)" CXX="$(tc-getCXX)" -f makefile.unix "${OPTS[@]}" test_litecoin
+# ./test_litecoin || die 'Tests failed'
+#}
+
+src_install() {
+ dobin src/${PN}
+
+ insinto /etc/litecoin
+ doins "${FILESDIR}/litecoin.conf"
+ fowners litecoin:litecoin /etc/litecoin/litecoin.conf
+ fperms 600 /etc/litecoin/litecoin.conf
+
+ newconfd "${FILESDIR}/litecoin.confd" ${PN}
+ newinitd "${FILESDIR}/litecoin.initd-r1" ${PN}
+ systemd_dounit "${FILESDIR}/litecoin.service"
+
+ keepdir /var/lib/litecoin/.litecoin
+ fperms 700 /var/lib/litecoin
+ fowners litecoin:litecoin /var/lib/litecoin/
+ fowners litecoin:litecoin /var/lib/litecoin/.litecoin
+ dosym /etc/litecoin/litecoin.conf /var/lib/litecoin/.litecoin/litecoin.conf
+
+ dodoc doc/README.md doc/release-notes.md
+ newman contrib/debian/manpages/bitcoind.1 litecoind.1
+ newman contrib/debian/manpages/bitcoin.conf.5 litecoin.conf.5
+
+ sed -i -e 's/bitcoin/litecoin/g' contrib/bitcoind.bash-completion
+ newbashcomp contrib/bitcoind.bash-completion ${PN}.bash-completion
+
+ if use examples; then
+ docinto examples
+ dodoc -r contrib/{bitrpc,pyminer,spendfrom,tidy_datadir.sh,wallettools}
+ fi
+
+ if use logrotate; then
+ insinto /etc/logrotate.d
+ newins "${FILESDIR}/litecoind.logrotate" litecoind
+ fi
+}
diff --git a/net-p2p/litecoind/metadata.xml b/net-p2p/litecoind/metadata.xml
new file mode 100644
index 00000000000..bc7a1fd1d7a
--- /dev/null
+++ b/net-p2p/litecoind/metadata.xml
@@ -0,0 +1,15 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+ <maintainer>
+ <email>blueness@gentoo.org</email>
+ <name>Anthony G. Basile</name>
+ </maintainer>
+ <use>
+ <flag name="logrotate">Use app-admin/logrotate for rotating logs</flag>
+ <flag name='wallet'>Enable wallet support</flag>
+ </use>
+ <upstream>
+ <remote-id type="github">litecoin-project/litecoin</remote-id>
+ </upstream>
+</pkgmetadata>
diff --git a/net-p2p/metadata.xml b/net-p2p/metadata.xml
new file mode 100644
index 00000000000..b04d29b9628
--- /dev/null
+++ b/net-p2p/metadata.xml
@@ -0,0 +1,34 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE catmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<catmetadata>
+ <longdescription lang="en">
+ The net-p2p category contains peer-to-peer networking applications.
+ </longdescription>
+ <longdescription lang="de">
+ Die Kategorie net-p2p enthält Peer-to-Peer-Software.
+ </longdescription>
+ <longdescription lang="es">
+ La categoría net-p2p contiene aplicaciones peer-to-peer.
+ </longdescription>
+ <longdescription lang="ja">
+ net-p2pカテゴリーにはピア・トゥ・ピアの
+ ネットワーキング・アプリケーションが含まれています。
+ </longdescription>
+ <longdescription lang="nl">
+ De net-p2p categorie bevat peer-to-peer netwerkapplicaties.
+ </longdescription>
+ <longdescription lang="vi">
+ Nhóm net-p2p chứa các phần mềm mạng ngang hàng (peer-to-peer).
+ </longdescription>
+ <longdescription lang="it">
+ La categoria net-p2p contiene applicazioni peer-to-peer.
+ </longdescription>
+ <longdescription lang="pt">
+ A categoria net-p2p contém aplicações de rede peer-to-peer.
+ </longdescription>
+ <longdescription lang="pl">
+ Kategoria net-p2p zawiera programy służące do wymiany plików w sieciach
+ peer-to-peer.
+ </longdescription>
+</catmetadata>
+
diff --git a/net-p2p/microdc/Manifest b/net-p2p/microdc/Manifest
new file mode 100644
index 00000000000..baa2f04e5ce
--- /dev/null
+++ b/net-p2p/microdc/Manifest
@@ -0,0 +1 @@
+DIST microdc-0.11.0.tar.gz 517879 SHA256 57e12a6cfdf1feb5c526f4bfc9b250bb25c652e1ed81db28c9db1ab64af67b7e
diff --git a/net-p2p/microdc/metadata.xml b/net-p2p/microdc/metadata.xml
new file mode 100644
index 00000000000..aa0f3664825
--- /dev/null
+++ b/net-p2p/microdc/metadata.xml
@@ -0,0 +1,5 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+<herd>net-p2p</herd>
+</pkgmetadata>
diff --git a/net-p2p/microdc/microdc-0.11.0.ebuild b/net-p2p/microdc/microdc-0.11.0.ebuild
new file mode 100644
index 00000000000..185bb022f16
--- /dev/null
+++ b/net-p2p/microdc/microdc-0.11.0.ebuild
@@ -0,0 +1,26 @@
+# Copyright 1999-2006 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+DESCRIPTION="A small command-line based Direct Connect client"
+HOMEPAGE="http://www.nongnu.org/microdc/"
+SRC_URI="http://savannah.nongnu.org/download/microdc/${P}.tar.gz"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="~amd64 ~x86"
+IUSE="nls"
+
+DEPEND="sys-libs/ncurses
+ >=sys-libs/readline-4
+ nls? ( sys-devel/gettext )"
+
+src_compile() {
+ econf $(use_enable nls) || die "configure failed"
+ emake || die "make failed"
+}
+
+src_install() {
+ make DESTDIR="${D}" install || die "make install failed"
+ dodoc AUTHORS ChangeLog NEWS README doc/*
+}
diff --git a/net-p2p/microdc2/Manifest b/net-p2p/microdc2/Manifest
new file mode 100644
index 00000000000..91fc4037351
--- /dev/null
+++ b/net-p2p/microdc2/Manifest
@@ -0,0 +1,2 @@
+DIST microdc2-0.15.6.tar.gz 639392 SHA256 d1990eb1aa52115c649466011c8163e454272250b041e480f0a521212c04bc49
+DIST microdc2_0.15.6-1.debian.tar.gz 162790 SHA256 3761ce9f6ea8b7ad77f21c9300cee9cc9570e6ab057d6c1b21edc8bb81f75665
diff --git a/net-p2p/microdc2/metadata.xml b/net-p2p/microdc2/metadata.xml
new file mode 100644
index 00000000000..aa0f3664825
--- /dev/null
+++ b/net-p2p/microdc2/metadata.xml
@@ -0,0 +1,5 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+<herd>net-p2p</herd>
+</pkgmetadata>
diff --git a/net-p2p/microdc2/microdc2-0.15.6-r2.ebuild b/net-p2p/microdc2/microdc2-0.15.6-r2.ebuild
new file mode 100644
index 00000000000..7361a4b68ff
--- /dev/null
+++ b/net-p2p/microdc2/microdc2-0.15.6-r2.ebuild
@@ -0,0 +1,49 @@
+# Copyright 1999-2010 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+inherit autotools eutils
+
+DESCRIPTION="A small command-line based Direct Connect client"
+HOMEPAGE="http://corsair626.no-ip.org/microdc/"
+SRC_URI="http://corsair626.no-ip.org/microdc/${P}.tar.gz
+ mirror://debian/pool/main/m/${PN}/${PN}_${PV}-1.debian.tar.gz"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="~amd64 ~x86"
+IUSE="nls"
+
+RDEPEND="app-arch/bzip2
+ >=dev-libs/libxml2-2.6.16
+ sys-libs/ncurses
+ >=sys-libs/readline-4"
+DEPEND="${RDEPEND}
+ nls? ( sys-devel/gettext )"
+
+src_unpack() {
+ unpack ${A}
+ cd "${S}"
+
+ local dpatch="${WORKDIR}/debian/patches"
+
+ epatch \
+ "${dpatch}"/disable-libxml2-version-check \
+ "${dpatch}"/rename-manpage \
+ "${dpatch}"/disable-make-tthsum \
+ "${dpatch}"/debian-link-system-bz2
+
+ eautoreconf
+}
+
+src_compile() {
+ econf \
+ $(use_enable nls)
+
+ emake || die
+}
+
+src_install() {
+ emake DESTDIR="${D}" install || die
+ dodoc AUTHORS ChangeLog NEWS README doc/*
+}
diff --git a/net-p2p/mktorrent-borg/Manifest b/net-p2p/mktorrent-borg/Manifest
new file mode 100644
index 00000000000..c62b24644df
--- /dev/null
+++ b/net-p2p/mktorrent-borg/Manifest
@@ -0,0 +1 @@
+DIST mktorrent-0.9.9.tgz 6087 SHA256 d9dc38d13dffe817c4e20c9c489b0e46a0f2b9ae2bc0367d5e6bba8e5cdde83f
diff --git a/net-p2p/mktorrent-borg/metadata.xml b/net-p2p/mktorrent-borg/metadata.xml
new file mode 100644
index 00000000000..aa0f3664825
--- /dev/null
+++ b/net-p2p/mktorrent-borg/metadata.xml
@@ -0,0 +1,5 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+<herd>net-p2p</herd>
+</pkgmetadata>
diff --git a/net-p2p/mktorrent-borg/mktorrent-borg-0.9.9.ebuild b/net-p2p/mktorrent-borg/mktorrent-borg-0.9.9.ebuild
new file mode 100644
index 00000000000..354e9dced3f
--- /dev/null
+++ b/net-p2p/mktorrent-borg/mktorrent-borg-0.9.9.ebuild
@@ -0,0 +1,29 @@
+# Copyright 1999-2008 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+inherit eutils toolchain-funcs
+
+DESCRIPTION="Console .torrent file creator. It support Multi Trackers (tier groups)"
+HOMEPAGE="http://borg.uu3.net/~borg/"
+SRC_URI="ftp://borg.uu3.net/pub/unix/mktorrent/mktorrent-${PV}.tgz"
+
+LICENSE="BSD"
+SLOT="0"
+KEYWORDS="~x86"
+IUSE=""
+
+S="${WORKDIR}/${PN%-borg}"
+
+src_unpack() {
+ unpack ${A}
+ cd "${S}"
+
+ sed -i -e "s/CC=gcc/CC=$(tc-getCC)/g" \
+ -e "s/^CFLAGS =/CFLAGS +=/g" Makefile
+}
+
+src_install() {
+ newbin mktorrent mktorrent-borg || die "newbin failed"
+ dodoc CHANGES
+}
diff --git a/net-p2p/mktorrent/Manifest b/net-p2p/mktorrent/Manifest
new file mode 100644
index 00000000000..733adc34b81
--- /dev/null
+++ b/net-p2p/mktorrent/Manifest
@@ -0,0 +1 @@
+DIST mktorrent-1.0.tar.gz 23089 SHA256 6f8e562af6366e0d9bde76e434f740b55722c6c3c555860dbe80083f9d1d119f SHA512 f103c8860c008796c2dc604fcabce7374264fd7814237fcad5f9dab0fe10e927b0e2d9b58e7462dd198265a7d83fe30fd68313c7dce4029d8c331a6f2d4622de WHIRLPOOL 2a907fe846ae5a35dbb38fbd6707a89121d34b9658f1afa682db14da9254cc58ed376fc23c834753409769643868294b0f1354fd7d9d567ec0cff49ee713b163
diff --git a/net-p2p/mktorrent/metadata.xml b/net-p2p/mktorrent/metadata.xml
new file mode 100644
index 00000000000..5907da4c707
--- /dev/null
+++ b/net-p2p/mktorrent/metadata.xml
@@ -0,0 +1,8 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+ <herd>net-p2p</herd>
+ <upstream>
+ <remote-id type="sourceforge">mktorrent</remote-id>
+ </upstream>
+</pkgmetadata>
diff --git a/net-p2p/mktorrent/mktorrent-1.0-r1.ebuild b/net-p2p/mktorrent/mktorrent-1.0-r1.ebuild
new file mode 100644
index 00000000000..22c51689aab
--- /dev/null
+++ b/net-p2p/mktorrent/mktorrent-1.0-r1.ebuild
@@ -0,0 +1,34 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=5
+inherit toolchain-funcs
+
+DESCRIPTION="Simple command line utility to create BitTorrent metainfo files"
+HOMEPAGE="http://mktorrent.sourceforge.net"
+SRC_URI="mirror://sourceforge/${PN}/${P}.tar.gz"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="amd64 x86"
+IUSE="threads +ssl debug"
+
+RDEPEND="ssl? ( dev-libs/openssl:0 )"
+DEPEND="${RDEPEND}"
+
+src_compile() {
+ tc-export CC
+ MAKEPARAM="USE_LONG_OPTIONS=1"
+ MAKEPARAM="${MAKEPARAM} USE_LARGE_FILES=1"
+ use debug && MAKEPARAM="${MAKEPARAM} DEBUG=1"
+ use ssl && MAKEPARAM="${MAKEPARAM} USE_OPENSSL=1"
+ use threads && MAKEPARAM="${MAKEPARAM} USE_PTHREADS=1"
+
+ emake ${MAKEPARAM}
+}
+
+src_install() {
+ dobin ${PN}
+ dodoc README
+}
diff --git a/net-p2p/mldonkey/Manifest b/net-p2p/mldonkey/Manifest
new file mode 100644
index 00000000000..fccb1759855
--- /dev/null
+++ b/net-p2p/mldonkey/Manifest
@@ -0,0 +1,2 @@
+DIST mldonkey-3.1.3.tar.bz2 2848964 SHA256 7c259f9f41cc12899045710ddce02e6d25962b2cb5c22f9cf58af0483f06d9e2 SHA512 921e428743934cd7a94fcdb8fea43a5a57cc3232a68fff443dbeb7f724fbe6805c38f4ae8c6e58c552e7a42c49f1c233f622239d6c7ee1ccf920bc19b2aef8f9 WHIRLPOOL 3e544fa8000e27d16a34af19969a8830f6c22de9ec21e4da2310ca4674a009e64b3bb03b530a03bf2d4cd71346f6de13288bae4b1b04ec0dc9df92f79835afdc
+DIST mldonkey-3.1.5.tar.bz2 2847382 SHA256 74f9d4bcc72356aa28d0812767ef5b9daa03efc5d1ddabf56447dc04969911cb SHA512 96e75acf91d7ecc41490f898e06d284da27404c7e567f173936d8113885a3b4b6bc93341358f92a30d3f699eef681d97ce56414a37bb02a535ad2da4d4ad13a3 WHIRLPOOL b9e15809a49cc12e69a6d1188441e9d5603ec76cb7bfe2b2e0bfce3c50abb31296904c842f487076b227f577046ccbd3ceb7cd1a601d3faa6928b1bfde8c780f
diff --git a/net-p2p/mldonkey/files/2.9.5-execstacks.patch b/net-p2p/mldonkey/files/2.9.5-execstacks.patch
new file mode 100644
index 00000000000..487bfbc3810
--- /dev/null
+++ b/net-p2p/mldonkey/files/2.9.5-execstacks.patch
@@ -0,0 +1,44 @@
+diff -ur mldonkey-2.9.5.orig/src/utils/lib/md4_i386.s mldonkey-2.9.5/src/utils/lib/md4_i386.s
+--- mldonkey-2.9.5.orig/src/utils/lib/md4_i386.s 2008-06-30 17:45:37.000000000 +0200
++++ mldonkey-2.9.5/src/utils/lib/md4_i386.s 2008-06-30 17:48:10.000000000 +0200
+@@ -934,3 +934,7 @@
+
+ .data
+
++#if defined(__linux__) && defined(__ELF__)
++.section .note.GNU-stack,"",%progbits
++#endif
++
+diff -ur mldonkey-2.9.5.orig/src/utils/lib/md4_i486.s mldonkey-2.9.5/src/utils/lib/md4_i486.s
+--- mldonkey-2.9.5.orig/src/utils/lib/md4_i486.s 2008-06-30 17:45:37.000000000 +0200
++++ mldonkey-2.9.5/src/utils/lib/md4_i486.s 2008-06-30 17:48:21.000000000 +0200
+@@ -1091,3 +1091,7 @@
+
+ .data
+
++#if defined(__linux__) && defined(__ELF__)
++.section .note.GNU-stack,"",%progbits
++#endif
++
+diff -ur mldonkey-2.9.5.orig/src/utils/lib/md4_i586.s mldonkey-2.9.5/src/utils/lib/md4_i586.s
+--- mldonkey-2.9.5.orig/src/utils/lib/md4_i586.s 2008-06-30 17:45:37.000000000 +0200
++++ mldonkey-2.9.5/src/utils/lib/md4_i586.s 2008-06-30 17:48:27.000000000 +0200
+@@ -1047,3 +1047,7 @@
+
+ .data
+
++#if defined(__linux__) && defined(__ELF__)
++.section .note.GNU-stack,"",%progbits
++#endif
++
+diff -ur mldonkey-2.9.5.orig/src/utils/lib/md4_i686.s mldonkey-2.9.5/src/utils/lib/md4_i686.s
+--- mldonkey-2.9.5.orig/src/utils/lib/md4_i686.s 2008-06-30 17:45:37.000000000 +0200
++++ mldonkey-2.9.5/src/utils/lib/md4_i686.s 2008-06-30 17:48:34.000000000 +0200
+@@ -1009,3 +1009,7 @@
+
+ .data
+
++#if defined(__linux__) && defined(__ELF__)
++.section .note.GNU-stack,"",%progbits
++#endif
++
diff --git a/net-p2p/mldonkey/files/mldonkey.confd-2.8 b/net-p2p/mldonkey/files/mldonkey.confd-2.8
new file mode 100644
index 00000000000..1d1f282234f
--- /dev/null
+++ b/net-p2p/mldonkey/files/mldonkey.confd-2.8
@@ -0,0 +1,39 @@
+# /etc/conf.d/mldonkey
+# Config file for mldonkey control script
+
+# Change the following vars only if you know
+# what you're doing, there's no checking for
+# invalid data yet!
+
+# owner of mlnet process (don't change, must be existing)
+USER="p2p"
+
+# mldonkey's working dir (must be existing)
+MLDONKEY_DIR="/home/p2p/mldonkey"
+
+# logfile (/dev/null for nowhere)
+LOG="/var/log/mldonkey.log"
+
+# set to true, if you have enabled logging to syslog in MLDonkey with
+# set log_to_syslog true
+USE_LOGGER=false
+
+# bandwidth control, values in kb/s
+LOW_DOWN="6"
+LOW_UP="2"
+HIGH_DOWN="30"
+HIGH_UP="10"
+
+# nice level, 0<x<19, more nice -> less cpuspeed consumed
+NICE="19"
+
+# mldonkey server ip, usually localhost
+SERVER="localhost"
+
+# port for webinterface, usually 4080
+PORT="4080"
+
+# to enable password restricted access,
+# uncomment and set BOTH following vars:
+#USERNAME="admin"
+#PASSWORD=""
diff --git a/net-p2p/mldonkey/files/mldonkey.initd b/net-p2p/mldonkey/files/mldonkey.initd
new file mode 100644
index 00000000000..7a007dededf
--- /dev/null
+++ b/net-p2p/mldonkey/files/mldonkey.initd
@@ -0,0 +1,121 @@
+#!/sbin/runscript
+
+extra_started_commands="reload slow fast info"
+
+MLDONKEY_BINARY=${MLDONKEY_BINARY:-/usr/bin/mlnet}
+MLDONKEY_TIMEOUT=${TIMEOUT:-10}
+
+depend() {
+ need localmount net
+ ${USE_LOGGER} && use logger
+}
+
+start() {
+ if [ -z "${MLDONKEY_DIR}" ]; then
+ ewarn "mldonkey's start script has been changed. You should remove"
+ ewarn "BASEDIR and SUBDIR from /etc/conf.d/mldonkey and set MLDONKEY_DIR"
+ ewarn "to the correct value (you probably want"
+ ewarn "MLDONKEY_DIR=${BASEDIR}/${SUBDIR})"
+ MLDONKEY_DIR="${BASEDIR}/${SUBDIR}"
+ einfo "Using ${MLDONKEY_DIR} as working directory"
+ fi
+
+ if [ ! -d "${MLDONKEY_DIR}" ]; then
+ ebegin "Directory ${MLDONKEY_DIR} not existing, trying to create..."
+ mkdir -p "${MLDONKEY_DIR}" && chown ${USER}:users "${MLDONKEY_DIR}"
+ eend $? || return 1
+ fi
+
+ ebegin "Starting ${SVCNAME}"
+ cd "${MLDONKEY_DIR}"
+ export MLDONKEY_DIR
+ start-stop-daemon --start --user "${USER}" --nice "${NICE}" \
+ --exec "${MLDONKEY_BINARY}" --pidfile /var/run/"${SVCNAME}".pid \
+ --background --make-pidfile
+ eend $?
+}
+
+setup_uri() {
+ BASE="http://"
+ if [ -n "${USERNAME}" -a -n "${PASSWORD}" ]; then
+ BASE="${BASE}${USERNAME}:${PASSWORD}@"
+ fi
+ BASE="${BASE}${SERVER}:${PORT}"
+}
+
+stop() {
+ ebegin "Stopping ${SVCNAME} -- please wait"
+
+ setup_uri
+ wget --spider --timeout="${MLDONKEY_TIMEOUT}" "${BASE}"/submit?q=close_fds -q
+ wget --spider --timeout="${MLDONKEY_TIMEOUT}" "${BASE}"/submit?q=save -q
+ wget --spider --timeout="${MLDONKEY_TIMEOUT}" "${BASE}"/submit?q=kill -q
+
+ # give it a chance to die:
+ local timeout=${MLDONKEY_TIMEOUT}
+ while [ $timeout -gt 0 ]; do
+ if ! start-stop-daemon --test --quiet --stop \
+ --exec "${MLDONKEY_BINARY}" \
+ --pidfile /var/run/"${SVCNAME}".pid ; then
+ eend 0
+ return 0
+ fi
+ sleep 1
+ timeout=$((${timeout} - 1))
+ done
+
+ eend 1 "Failed to cleanly stop ${SVCNAME}"
+ ebegin "Forcing ${SVCNAME} to stop"
+ start-stop-daemon --stop --exec "${MLDONKEY_BINARY}" \
+ --pidfile /var/run/"${SVCNAME}".pid
+ eend $?
+}
+
+# This doesn't work for baselayout-2
+restart() {
+ svc_stop
+ sleep 5
+ svc_start
+}
+
+reload() {
+ ebegin "Reloading ${SVCNAME}"
+ start-stop-daemon --stop --signal HUP --oknodo \
+ --exec "${MLDONKEY_BINARY}" --pidfile /var/run/"${SVCNAME}".pid
+ eend $?
+}
+
+slow() {
+ ebegin "Reducing bandwidth to ${LOW_DOWN}k/${LOW_UP}k"
+ setup_uri
+ wget --spider --timeout="${MLDONKEY_TIMEOUT}" \
+ "${BASE}/submit?q=set+max_hard_download_rate+${LOW_DOWN}" -q
+ wget --spider --timeout=${MLDONKEY_TIMEOUT} \
+ "${BASE}/submit?q=set+max_hard_upload_rate+${LOW_UP}" -q
+ eend $?
+}
+
+fast() {
+ ebegin "Increasing bandwidth to ${HIGH_DOWN}k/${HIGH_UP}k"
+
+ setup_uri
+ wget --spider --timeout="${MLDONKEY_TIMEOUT}" \
+ "${BASE}/submit?q=set+max_hard_upload_rate+${HIGH_UP}" -q
+ wget --spider --timeout="${MLDONKEY_TIMEOUT}" \
+ "${BASE}/submit?q=set+max_hard_download_rate+${HIGH_DOWN}" -q
+ eend $?
+}
+
+
+info() {
+ setup_uri
+ local result=$(wget --timeout="${MLDONKEY_TIMEOUT}" \
+ -O - "${BASE}"/submit?q=vo 2>/dev/null | \
+ grep -C1 max_hard_upload | \
+ grep value=\" | cut -d\" -f2)
+ if [ "${result}" = "${LOW_UP}" ]; then
+ einfo "${SVCNAME} runs slow"
+ else
+ einfo "${SVCNAME} runs fast"
+ fi
+}
diff --git a/net-p2p/mldonkey/files/ocaml4.patch b/net-p2p/mldonkey/files/ocaml4.patch
new file mode 100644
index 00000000000..32882417b62
--- /dev/null
+++ b/net-p2p/mldonkey/files/ocaml4.patch
@@ -0,0 +1,12 @@
+Index: mldonkey-3.1.5/src/utils/net/terminal.ml
+===================================================================
+--- mldonkey-3.1.5.orig/src/utils/net/terminal.ml
++++ mldonkey-3.1.5/src/utils/net/terminal.ml
+@@ -185,7 +185,6 @@ module Output = struct
+ let canal = List.assoc chan !chanmap in
+ etat.chan <- Some (chan, canal);
+ info (sprintf "connecte au canal '%s'" chan);
+- (* {| canal ALL } *)
+ with Not_found -> (* pas encore de recepteur pour ce canal *)
+ try (* on en cree un *)
+ let serveur = nsrecord.get_loc chan in
diff --git a/net-p2p/mldonkey/metadata.xml b/net-p2p/mldonkey/metadata.xml
new file mode 100644
index 00000000000..bc22bf0cb84
--- /dev/null
+++ b/net-p2p/mldonkey/metadata.xml
@@ -0,0 +1,16 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+ <herd>net-p2p</herd>
+ <longdescription>An ocaml client to access the eDonkey network.</longdescription>
+ <use>
+ <flag name="bittorrent">enable bittorrent support</flag>
+ <flag name="fasttrack">enable fasttrack support</flag>
+ <flag name="gnutella">enable gnutella and gnutella2 support</flag>
+ <flag name="guionly">enable client build only</flag>
+ <flag name="magic">enable use of libmagic</flag>
+ </use>
+ <upstream>
+ <remote-id type="sourceforge">mldonkey</remote-id>
+ </upstream>
+</pkgmetadata>
diff --git a/net-p2p/mldonkey/mldonkey-3.1.3.ebuild b/net-p2p/mldonkey/mldonkey-3.1.3.ebuild
new file mode 100644
index 00000000000..cbdce7b3600
--- /dev/null
+++ b/net-p2p/mldonkey/mldonkey-3.1.3.ebuild
@@ -0,0 +1,170 @@
+# Copyright 1999-2014 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI="2"
+WANT_AUTOCONF=2.5
+
+inherit flag-o-matic eutils autotools toolchain-funcs user
+
+IUSE="bittorrent doc fasttrack gd gnutella gtk guionly magic +ocamlopt"
+
+DESCRIPTION="A multi-network P2P application written in Ocaml, with its own Gtk GUI, web and telnet interface"
+HOMEPAGE="http://mldonkey.sourceforge.net/"
+SRC_URI="mirror://sourceforge/${PN}/${P}.tar.bz2"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="~alpha amd64 ~arm hppa ~ia64 ppc ~sparc x86 ~x86-fbsd"
+
+RDEPEND="dev-lang/perl
+ guionly? ( >=gnome-base/librsvg-2.4.0
+ >=dev-ml/lablgtk-2.6 )
+ gtk? ( >=gnome-base/librsvg-2.4.0
+ >=dev-ml/lablgtk-2.6[svg] )
+ gd? ( >=media-libs/gd-2.0.28[truetype] )
+ magic? ( sys-apps/file )"
+
+DEPEND="${RDEPEND}
+ >=dev-lang/ocaml-3.10.2[ocamlopt?]"
+
+MLUSER="p2p"
+
+pkg_setup() {
+ if use gtk; then
+ echo ""
+ einfo "If the compile with gui fails, and you have updated Ocaml"
+ einfo "recently, you may have forgotten that you need to run"
+ einfo "/usr/portage/dev-lang/ocaml/files/ocaml-rebuild.sh"
+ einfo "to learn which ebuilds you need to recompile"
+ einfo "each time you update Ocaml to a different version"
+ einfo "see the Ocaml ebuild for details"
+ echo ""
+ fi
+
+ # dev-lang/ocaml creates its own objects but calls gcc for linking, which will
+ # results in relocations if gcc wants to create a PIE executable
+ if gcc-specs-pie ; then
+ append-ldflags -nopie
+ ewarn "Ocaml generates its own native asm, you're using a PIE compiler"
+ ewarn "We have appended -nopie to ocaml build options"
+ ewarn "because linking an executable with pie while the objects are not pic will not work"
+ fi
+}
+
+src_prepare() {
+ cd "${S}"/config
+ eautoconf
+ cd "${S}"
+ use ocamlopt || sed -i -e "s/ocamlopt/idontwantocamlopt/g" "${S}/config/configure" || die "failed to disable ocamlopt"
+}
+
+src_configure() {
+ # the dirs are not (yet) used, but it doesn't hurt to specify them anyway
+
+ # onlygui Disable all nets support, build only chosen GUI
+
+ if use gtk || use guionly; then
+ myconf="--enable-gui=newgui2"
+ else
+ myconf="--disable-gui"
+ fi
+
+ if use guionly; then
+ myconf="${myconf} --disable-multinet --disable-donkey"
+ fi
+
+ cd "${S}"
+
+ local my_extra_libs
+ if use gd; then
+ my_extra_libs="-lpng"
+ fi
+
+ econf LIBS="${my_extra_libs}"\
+ --sysconfdir=/etc/mldonkey \
+ --sharedstatedir=/var/mldonkey \
+ --localstatedir=/var/mldonkey \
+ --enable-checks \
+ --disable-batch \
+ $(use_enable bittorrent) \
+ $(use_enable fasttrack) \
+ $(use_enable gnutella) \
+ $(use_enable gnutella gnutella2) \
+ $(use_enable gd) \
+ $(use_enable magic) \
+ ${myconf}
+}
+
+src_compile() {
+ export OCAMLRUNPARAM="l=256M"
+ emake || die "emake failed"
+
+ if ! use guionly; then
+ emake utils || die "emake utils failed"
+ fi;
+}
+
+src_install() {
+ local myext=""
+ use ocamlopt || myext=".byte"
+ use ocamlopt || export STRIP_MASK="*/bin/*"
+ if ! use guionly; then
+ for i in mlnet mld_hash get_range copysources subconv; do
+ newbin $i$myext $i || die "failed to install $i"
+ done
+ use bittorrent && newbin make_torrent$myext make_torrent
+
+ newconfd "${FILESDIR}/mldonkey.confd-2.8" mldonkey
+ fperms 600 /etc/conf.d/mldonkey
+ newinitd "${FILESDIR}/mldonkey.initd" mldonkey
+ fi
+
+ if use gtk; then
+ for i in mlgui mlguistarter; do
+ newbin $i$myext $i || die "failed to install $i"
+ done
+ make_desktop_entry mlgui "MLDonkey GUI" mldonkey "Network;P2P"
+ newicon "${S}"/packages/rpm/mldonkey-icon-48.png ${PN}.png
+ fi
+
+ if use doc ; then
+ cd "${S}"/distrib
+ dodoc ChangeLog *.txt
+
+ insinto /usr/share/doc/${PF}/scripts
+ doins kill_mldonkey mldonkey_command mldonkey_previewer make_buginfo
+
+ cd "${S}"/docs
+ dodoc *.txt *.tex *.pdf
+ dohtml *.html
+
+ cd "${S}"/docs/developers
+ dodoc *.txt *.tex
+
+ cd "${S}"/docs/images
+ insinto /usr/share/doc/${PF}/html/images
+ doins *
+ fi
+}
+
+pkg_preinst() {
+ if ! use guionly; then
+ enewuser ${MLUSER} -1 -1 /home/p2p users
+ fi
+}
+
+pkg_postinst() {
+ if ! use guionly; then
+ echo
+ einfo "If you want to start MLDonkey as a system service, use"
+ einfo "the /etc/init.d/mldonkey script. To control bandwidth, use"
+ einfo "the 'slow' and 'fast' arguments. Be sure to have a look at"
+ einfo "/etc/conf.d/mldonkey also."
+ echo
+ else
+ echo
+ einfo "Simply run mlgui to start the chosen MLDonkey gui."
+ einfo "It puts its config files into ~/.mldonkey"
+ fi
+}
diff --git a/net-p2p/mldonkey/mldonkey-3.1.5.ebuild b/net-p2p/mldonkey/mldonkey-3.1.5.ebuild
new file mode 100644
index 00000000000..fb3a0b9bb5e
--- /dev/null
+++ b/net-p2p/mldonkey/mldonkey-3.1.5.ebuild
@@ -0,0 +1,171 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI="5"
+WANT_AUTOCONF=2.5
+
+inherit flag-o-matic eutils autotools toolchain-funcs user
+
+IUSE="bittorrent doc fasttrack gd gnutella gtk guionly magic +ocamlopt"
+
+DESCRIPTION="A multi-network P2P application written in Ocaml, with its own Gtk GUI, web and telnet interface"
+HOMEPAGE="http://mldonkey.sourceforge.net/"
+SRC_URI="mirror://sourceforge/${PN}/${P}.tar.bz2"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="~alpha ~amd64 ~arm ~hppa ~ia64 ~ppc ~sparc ~x86 ~x86-fbsd"
+
+RDEPEND="dev-lang/perl
+ guionly? ( >=gnome-base/librsvg-2.4.0
+ >=dev-ml/lablgtk-2.6 )
+ gtk? ( >=gnome-base/librsvg-2.4.0
+ >=dev-ml/lablgtk-2.6[svg] )
+ gd? ( >=media-libs/gd-2.0.28[truetype] )
+ magic? ( sys-apps/file )"
+
+DEPEND="${RDEPEND}
+ >=dev-lang/ocaml-3.10.2[ocamlopt?]"
+
+MLUSER="p2p"
+
+pkg_setup() {
+ if use gtk; then
+ echo ""
+ einfo "If the compile with gui fails, and you have updated Ocaml"
+ einfo "recently, you may have forgotten that you need to run"
+ einfo "/usr/portage/dev-lang/ocaml/files/ocaml-rebuild.sh"
+ einfo "to learn which ebuilds you need to recompile"
+ einfo "each time you update Ocaml to a different version"
+ einfo "see the Ocaml ebuild for details"
+ echo ""
+ fi
+
+ # dev-lang/ocaml creates its own objects but calls gcc for linking, which will
+ # results in relocations if gcc wants to create a PIE executable
+ if gcc-specs-pie ; then
+ append-ldflags -nopie
+ ewarn "Ocaml generates its own native asm, you're using a PIE compiler"
+ ewarn "We have appended -nopie to ocaml build options"
+ ewarn "because linking an executable with pie while the objects are not pic will not work"
+ fi
+}
+
+src_prepare() {
+ cd "${S}"/config
+ eautoconf
+ cd "${S}"
+ use ocamlopt || sed -i -e "s/ocamlopt/idontwantocamlopt/g" "${S}/config/configure" || die "failed to disable ocamlopt"
+ epatch "${FILESDIR}/ocaml4.patch"
+}
+
+src_configure() {
+ # the dirs are not (yet) used, but it doesn't hurt to specify them anyway
+
+ # onlygui Disable all nets support, build only chosen GUI
+
+ if use gtk || use guionly; then
+ myconf="--enable-gui=newgui2"
+ else
+ myconf="--disable-gui"
+ fi
+
+ if use guionly; then
+ myconf="${myconf} --disable-multinet --disable-donkey"
+ fi
+
+ cd "${S}"
+
+ local my_extra_libs
+ if use gd; then
+ my_extra_libs="-lpng"
+ fi
+
+ econf LIBS="${my_extra_libs}"\
+ --sysconfdir=/etc/mldonkey \
+ --sharedstatedir=/var/mldonkey \
+ --localstatedir=/var/mldonkey \
+ --enable-checks \
+ --disable-batch \
+ $(use_enable bittorrent) \
+ $(use_enable fasttrack) \
+ $(use_enable gnutella) \
+ $(use_enable gnutella gnutella2) \
+ $(use_enable gd) \
+ $(use_enable magic) \
+ ${myconf}
+}
+
+src_compile() {
+ export OCAMLRUNPARAM="l=256M"
+ emake
+
+ if ! use guionly; then
+ emake utils
+ fi;
+}
+
+src_install() {
+ local myext=""
+ use ocamlopt || myext=".byte"
+ use ocamlopt || export STRIP_MASK="*/bin/*"
+ if ! use guionly; then
+ for i in mlnet mld_hash get_range copysources subconv; do
+ newbin $i$myext $i
+ done
+ use bittorrent && newbin make_torrent$myext make_torrent
+
+ newconfd "${FILESDIR}/mldonkey.confd-2.8" mldonkey
+ fperms 600 /etc/conf.d/mldonkey
+ newinitd "${FILESDIR}/mldonkey.initd" mldonkey
+ fi
+
+ if use gtk; then
+ for i in mlgui mlguistarter; do
+ newbin $i$myext $i
+ done
+ make_desktop_entry mlgui "MLDonkey GUI" mldonkey "Network;P2P"
+ newicon "${S}"/packages/rpm/mldonkey-icon-48.png ${PN}.png
+ fi
+
+ if use doc ; then
+ cd "${S}"/distrib
+ dodoc ChangeLog *.txt
+
+ insinto /usr/share/doc/${PF}/scripts
+ doins kill_mldonkey mldonkey_command mldonkey_previewer make_buginfo
+
+ cd "${S}"/docs
+ dodoc *.txt *.tex *.pdf
+ dohtml *.html
+
+ cd "${S}"/docs/developers
+ dodoc *.txt *.tex
+
+ cd "${S}"/docs/images
+ insinto /usr/share/doc/${PF}/html/images
+ doins *
+ fi
+}
+
+pkg_preinst() {
+ if ! use guionly; then
+ enewuser ${MLUSER} -1 -1 /home/p2p users
+ fi
+}
+
+pkg_postinst() {
+ if ! use guionly; then
+ echo
+ einfo "If you want to start MLDonkey as a system service, use"
+ einfo "the /etc/init.d/mldonkey script. To control bandwidth, use"
+ einfo "the 'slow' and 'fast' arguments. Be sure to have a look at"
+ einfo "/etc/conf.d/mldonkey also."
+ echo
+ else
+ echo
+ einfo "Simply run mlgui to start the chosen MLDonkey gui."
+ einfo "It puts its config files into ~/.mldonkey"
+ fi
+}
diff --git a/net-p2p/multibit/Manifest b/net-p2p/multibit/Manifest
new file mode 100644
index 00000000000..f48eb9ce5f6
--- /dev/null
+++ b/net-p2p/multibit/Manifest
@@ -0,0 +1 @@
+DIST multibit-0.5.18-linux.jar 7993916 SHA256 a067c9638edfdf39f3e9fa154b0c6d8cfb7c58c0edd95a02c0ca903160ca3aad SHA512 788910b4a8b27f345df2cc58f8641a34d038091ffcddd69eca07c9452ed406113cf70479e6214ea52f39536d8eb21b34ecb7ab359868199223b2796b50b1b561 WHIRLPOOL d75467437d0d6eb744fce183071c1197386481ffc905d6abb02a31a6725b1e2b61c388815e0839b2120bd37029e9bf8ae76aa4ed5980ff30fb2abc041ec80549
diff --git a/net-p2p/multibit/files/auto-install.xml b/net-p2p/multibit/files/auto-install.xml
new file mode 100644
index 00000000000..338377b9822
--- /dev/null
+++ b/net-p2p/multibit/files/auto-install.xml
@@ -0,0 +1,12 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<AutomatedInstallation langpack="eng">
+<com.izforge.izpack.panels.HelloPanel id="UNKNOWN (com.izforge.izpack.panels.HelloPanel)"/>
+<com.izforge.izpack.panels.InfoPanel id="UNKNOWN (com.izforge.izpack.panels.InfoPanel)"/>
+<com.izforge.izpack.panels.LicencePanel id="UNKNOWN (com.izforge.izpack.panels.LicencePanel)"/>
+<com.izforge.izpack.panels.TargetPanel id="UNKNOWN (com.izforge.izpack.panels.TargetPanel)">
+<installpath>ED/opt/MultiBit</installpath>
+</com.izforge.izpack.panels.TargetPanel>
+<com.izforge.izpack.panels.ShortcutPanel id="UNKNOWN (com.izforge.izpack.panels.ShortcutPanel)"/>
+<com.izforge.izpack.panels.InstallPanel id="UNKNOWN (com.izforge.izpack.panels.InstallPanel)"/>
+<com.izforge.izpack.panels.FinishPanel id="UNKNOWN (com.izforge.izpack.panels.FinishPanel)"/>
+</AutomatedInstallation>
diff --git a/net-p2p/multibit/files/multibit b/net-p2p/multibit/files/multibit
new file mode 100755
index 00000000000..c0335cac10b
--- /dev/null
+++ b/net-p2p/multibit/files/multibit
@@ -0,0 +1,3 @@
+#!/bin/bash
+
+/usr/bin/java -jar /opt/MultiBit/multibit-exe.jar >/dev/null 2>&1 &
diff --git a/net-p2p/multibit/metadata.xml b/net-p2p/multibit/metadata.xml
new file mode 100644
index 00000000000..1e7587374fd
--- /dev/null
+++ b/net-p2p/multibit/metadata.xml
@@ -0,0 +1,8 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+ <maintainer>
+ <email>blueness@gentoo.org</email>
+ <name>Anthony G. Basile</name>
+ </maintainer>
+</pkgmetadata>
diff --git a/net-p2p/multibit/multibit-0.5.18.ebuild b/net-p2p/multibit/multibit-0.5.18.ebuild
new file mode 100644
index 00000000000..7fc08032b9c
--- /dev/null
+++ b/net-p2p/multibit/multibit-0.5.18.ebuild
@@ -0,0 +1,36 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=5
+
+inherit eutils
+
+DESCRIPTION="Secure, lightweight, international Bitcoin wallet written in Java"
+HOMEPAGE="https://multibit.org/"
+SRC_URI="https://multibit.org/releases/${P}/${P}-linux.jar"
+
+LICENSE="MIT"
+SLOT="0"
+KEYWORDS="~amd64"
+IUSE=""
+
+DEPEND=">=virtual/jre-1.6"
+RDEPEND="${DEPEND}"
+
+S=${WORKDIR}
+
+src_unpack() { :; }
+
+src_prepare() {
+ cp "${FILESDIR}"/auto-install.xml "${WORKDIR}" || die
+ sed -i "s:ED:${ED}:" auto-install.xml || die
+}
+
+src_install() {
+ dobin "${FILESDIR}"/${PN}
+
+ make_desktop_entry "${PN}" "Multibit" "/opt/MultiBit/multibit48.png" "GNOME;Network;P2P;Office;Finance;" "MimeType=x-scheme-handler/multibit;\nTerminal=false"
+
+ java -jar "${DISTDIR}"/${P}-linux.jar auto-install.xml >/dev/null 2>&1
+}
diff --git a/net-p2p/myster/Manifest b/net-p2p/myster/Manifest
new file mode 100644
index 00000000000..365e98d8128
--- /dev/null
+++ b/net-p2p/myster/Manifest
@@ -0,0 +1 @@
+DIST Myster_PR8_Generic.zip 934533 SHA256 5156ea269bbdc565567eadaef1c64efed8863f10818ae2a6fab28611b5d7ed37
diff --git a/net-p2p/myster/metadata.xml b/net-p2p/myster/metadata.xml
new file mode 100644
index 00000000000..7a9e12eb9c4
--- /dev/null
+++ b/net-p2p/myster/metadata.xml
@@ -0,0 +1,8 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+ <herd>net-p2p</herd>
+ <upstream>
+ <remote-id type="sourceforge">myster</remote-id>
+ </upstream>
+</pkgmetadata>
diff --git a/net-p2p/myster/myster-8.0-r1.ebuild b/net-p2p/myster/myster-8.0-r1.ebuild
new file mode 100644
index 00000000000..559b4550b71
--- /dev/null
+++ b/net-p2p/myster/myster-8.0-r1.ebuild
@@ -0,0 +1,27 @@
+# Copyright 1999-2007 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+inherit java-pkg-2
+
+MY_PV=${PV/.0/}
+DESCRIPTION="Myster is a decentralized file sharing network"
+HOMEPAGE="http://www.mysternetworks.com/"
+SRC_URI="mirror://sourceforge/myster/Myster_PR${MY_PV}_Generic.zip"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="~ppc x86"
+IUSE=""
+
+DEPEND="app-arch/unzip"
+RDEPEND=">=virtual/jre-1.4"
+
+S="${WORKDIR}"
+
+src_install () {
+ insinto /opt/myster
+ doins -r */*
+ java-pkg_regjar "${D}"/opt/myster/*.jar
+ java-pkg_dolauncher ${PN}
+}
diff --git a/net-p2p/nap/Manifest b/net-p2p/nap/Manifest
new file mode 100644
index 00000000000..df6dd76d6a0
--- /dev/null
+++ b/net-p2p/nap/Manifest
@@ -0,0 +1 @@
+DIST nap-1.5.4.tar.gz 321353 SHA256 55c7527951fb9408a133b4c3302df6096de6bc4e0511b3654d820ce455694db2 SHA512 dcb0db523f7e3eeb910b6cfd9768a562b0b383ea33a236a144e0b3299c2cd9e89c15165a8e28525bc1d94d84f2b8c5d41ec54102f1f2ce3aca2cdc022c81944d WHIRLPOOL fa04300bca97d82478da861c9bc071eabbf5adffdc454ba31b915680669e477d74aec4d1ccd894dc15922f5efc268759d34ceff2177ffd7a34f8e11e70736161
diff --git a/net-p2p/nap/metadata.xml b/net-p2p/nap/metadata.xml
new file mode 100644
index 00000000000..aa0f3664825
--- /dev/null
+++ b/net-p2p/nap/metadata.xml
@@ -0,0 +1,5 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+<herd>net-p2p</herd>
+</pkgmetadata>
diff --git a/net-p2p/nap/nap-1.5.4-r1.ebuild b/net-p2p/nap/nap-1.5.4-r1.ebuild
new file mode 100644
index 00000000000..5d4a33524d8
--- /dev/null
+++ b/net-p2p/nap/nap-1.5.4-r1.ebuild
@@ -0,0 +1,34 @@
+# Copyright 1999-2013 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+inherit toolchain-funcs
+
+DESCRIPTION="Console Napster/OpenNap client"
+HOMEPAGE="http://www.mathstat.dal.ca/~selinger/nap/"
+SRC_URI="http://www.mathstat.dal.ca/~selinger/nap/dist/${P}.tar.gz"
+
+LICENSE="nap GPL-2+ LGPL-2+"
+SLOT="0"
+KEYWORDS="ppc x86"
+IUSE=""
+RESTRICT="bindist"
+
+src_unpack() {
+ unpack ${A}
+
+ # Install the docs in the right dir
+ sed -i -e "s~\$(prefix)/doc/nap~\$(prefix)/share/doc/${P}~g" \
+ "${S}"/doc/Makefile.in
+}
+
+src_compile() {
+ ./configure --prefix="${D}"/usr --mandir="${D}"/usr/share/man || die "configure problem"
+ emake CC="$(tc-getCC)" || die "compile problem"
+}
+
+src_install() {
+ emake install || die "install problem"
+
+ dodoc AUTHORS COPYRIGHT ChangeLog NEWS README
+}
diff --git a/net-p2p/ncdc/Manifest b/net-p2p/ncdc/Manifest
new file mode 100644
index 00000000000..e3909e31d03
--- /dev/null
+++ b/net-p2p/ncdc/Manifest
@@ -0,0 +1,3 @@
+DIST ncdc-1.18.1.tar.gz 350781 SHA256 cc257731cd2ccc55831b8606694c379d0d8c441d250b8003785bec3d58fa8685 SHA512 0d52906de277215b5ed3f00cd3d502f3942a6ab5041197efc1edfd9e7a5b3ee32c2eda957a0bb1efa5e4ffb9f187c76cb324bfe2cd43ba591f9cd3301b88a70e WHIRLPOOL 21b506d41c7f546ef81f42d7d21b9d8ef4ce5bfc9a0403103559282cbf5b48d74380a8a84d4e1a41eaa48be3d9eadcc2ea41532e9399a205b51553d6f65aee9f
+DIST ncdc-1.19.1.tar.gz 354308 SHA256 a6b23381434a47f7134d9ebdf5658fd06768f9b5de498c43e0fa00d1c7229d47 SHA512 36eda8c582ddb40ef732151ecc1654eae927a6a004430d8d27528b3c57ae5e1b06c23a867d8e1624ee4365031325fd7ced2888dd64ff129431bba9ff4171f189 WHIRLPOOL eec4f206ffc15c2389855215c17dada8004200c4eaa5d54bb175296dccccd1fa9518b6a12798c72751896645ea4f77bae58708dee4743bef50c5af98e97af36e
+DIST ncdc-1.19.tar.gz 354337 SHA256 c24130b8bb735f936b1090d4e5f4413c08548a45a2640193386c26dc1dc7fbf1 SHA512 0c94a003f61258f1b1fd5bfc347ca33d1b6b48923238e0f7c26e655178ba4a231eca1e47d1c0fccca1cfe6858ad88651180f901e5bca16838e56302ce074fa69 WHIRLPOOL 55c97274a1bffa5c42f8c9acdb5bf6d8e22adeab15d9391fd6d47133cc25f9b0db11ff471242149440706125bd70205fe9ff0836007b3c9b4e7b7a49c0fc2881
diff --git a/net-p2p/ncdc/metadata.xml b/net-p2p/ncdc/metadata.xml
new file mode 100644
index 00000000000..9d60532f08b
--- /dev/null
+++ b/net-p2p/ncdc/metadata.xml
@@ -0,0 +1,16 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+<maintainer>
+ <email>xmw@gentoo.org</email>
+ <name>Michael Weber</name>
+</maintainer>
+<upstream>
+ <maintainer status="active">
+ <email>projects@yorhel.nl</email>
+ </maintainer>
+ <changelog>http://dev.yorhel.nl/ncdc/changes</changelog>
+ <doc lang="en">http://dev.yorhel.nl/ncdc/man</doc>
+ <bugs-to>http://dev.yorhel.nl/ncdc/bug</bugs-to>
+</upstream>
+</pkgmetadata>
diff --git a/net-p2p/ncdc/ncdc-1.18.1.ebuild b/net-p2p/ncdc/ncdc-1.18.1.ebuild
new file mode 100644
index 00000000000..28ce780e762
--- /dev/null
+++ b/net-p2p/ncdc/ncdc-1.18.1.ebuild
@@ -0,0 +1,30 @@
+# Copyright 1999-2014 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=5
+
+inherit toolchain-funcs
+
+DESCRIPTION="ncurses directconnect client"
+HOMEPAGE="http://dev.yorhel.nl/ncdc"
+SRC_URI="http://dev.yorhel.nl/download/${P}.tar.gz"
+
+LICENSE="MIT"
+SLOT="0"
+KEYWORDS="amd64 ~ppc ~sparc x86"
+IUSE=""
+
+RDEPEND="app-arch/bzip2
+ dev-db/sqlite:3
+ dev-libs/glib:2
+ net-libs/gnutls
+ sys-libs/ncurses:5[unicode]
+ sys-libs/zlib"
+DEPEND="${RDEPEND}
+ dev-util/makeheaders
+ virtual/pkgconfig"
+
+src_compile() {
+ emake AR="$(tc-getAR)"
+}
diff --git a/net-p2p/ncdc/ncdc-1.19.1.ebuild b/net-p2p/ncdc/ncdc-1.19.1.ebuild
new file mode 100644
index 00000000000..01fb8437997
--- /dev/null
+++ b/net-p2p/ncdc/ncdc-1.19.1.ebuild
@@ -0,0 +1,40 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=5
+
+inherit autotools eutils toolchain-funcs
+
+DESCRIPTION="ncurses directconnect client"
+HOMEPAGE="http://dev.yorhel.nl/ncdc"
+SRC_URI="http://dev.yorhel.nl/download/${P}.tar.gz"
+
+LICENSE="MIT"
+SLOT="0"
+KEYWORDS="amd64 ~ppc ~sparc x86"
+IUSE="geoip"
+
+RDEPEND="app-arch/bzip2
+ dev-db/sqlite:3
+ dev-libs/glib:2
+ net-libs/gnutls
+ sys-libs/ncurses:5[unicode]
+ sys-libs/zlib
+ geoip? ( dev-libs/geoip )"
+DEPEND="${RDEPEND}
+ dev-util/makeheaders
+ virtual/pkgconfig"
+
+src_prepare() {
+ epatch_user && eautoreconf
+}
+
+src_configure() {
+ econf \
+ $(use_with geoip)
+}
+
+src_compile() {
+ emake AR="$(tc-getAR)"
+}
diff --git a/net-p2p/ncdc/ncdc-1.19.ebuild b/net-p2p/ncdc/ncdc-1.19.ebuild
new file mode 100644
index 00000000000..b721600054a
--- /dev/null
+++ b/net-p2p/ncdc/ncdc-1.19.ebuild
@@ -0,0 +1,35 @@
+# Copyright 1999-2014 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=5
+
+inherit toolchain-funcs
+
+DESCRIPTION="ncurses directconnect client"
+HOMEPAGE="http://dev.yorhel.nl/ncdc"
+SRC_URI="http://dev.yorhel.nl/download/${P}.tar.gz"
+
+LICENSE="MIT"
+SLOT="0"
+KEYWORDS="~amd64 ~ppc ~sparc ~x86"
+IUSE="geoip"
+
+RDEPEND="app-arch/bzip2
+ dev-db/sqlite:3
+ dev-libs/glib:2
+ net-libs/gnutls
+ sys-libs/ncurses:5[unicode]
+ sys-libs/zlib
+ geoip? ( dev-libs/geoip )"
+DEPEND="${RDEPEND}
+ dev-util/makeheaders
+ virtual/pkgconfig"
+
+src_configure() {
+ econf $(use_with geoip)
+}
+
+src_compile() {
+ emake AR="$(tc-getAR)"
+}
diff --git a/net-p2p/ncdc/ncdc-9999.ebuild b/net-p2p/ncdc/ncdc-9999.ebuild
new file mode 100644
index 00000000000..3fe8ec778bd
--- /dev/null
+++ b/net-p2p/ncdc/ncdc-9999.ebuild
@@ -0,0 +1,41 @@
+# Copyright 1999-2014 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=5
+
+inherit autotools eutils git-2 toolchain-funcs
+
+DESCRIPTION="ncurses directconnect client"
+HOMEPAGE="http://dev.yorhel.nl/ncdc"
+EGIT_REPO_URI="git://g.blicky.net/ncdc.git"
+
+LICENSE="MIT"
+SLOT="0"
+KEYWORDS=""
+IUSE="geoip"
+
+RDEPEND="app-arch/bzip2
+ dev-db/sqlite:3
+ dev-libs/glib:2
+ net-libs/gnutls
+ sys-libs/ncurses:5[unicode]
+ sys-libs/zlib
+ geoip? ( dev-libs/geoip )"
+DEPEND="${RDEPEND}
+ dev-util/makeheaders
+ virtual/pkgconfig"
+
+src_prepare() {
+ epatch_user
+ eautoreconf
+}
+
+src_configure() {
+ econf --enable-git-version \
+ $(use_with geoip)
+}
+
+src_compile() {
+ emake AR="$(tc-getAR)"
+}
diff --git a/net-p2p/nicotine+/Manifest b/net-p2p/nicotine+/Manifest
new file mode 100644
index 00000000000..54c486ffa51
--- /dev/null
+++ b/net-p2p/nicotine+/Manifest
@@ -0,0 +1 @@
+DIST nicotine+-1.2.16.tar.bz2 3892006 SHA256 71e5b33e273daaf072dbf63839536c14d7ead9d149323d50eee09f7429e34c1d SHA512 8b5b7f99e14f28f3a1c7a77fc12662cfafa0f9ac9d3c8c2a2d1e959f96a9161005a29ad2ed07fa07ea8908b88f247f3c120b299e7183a0558994b5e96cb47f78 WHIRLPOOL 0c650df11e6f6e1c8d94f863bcb00c84f7a92a13c754977d04d1664066b64fd4b95d824001046b36299f7a53493e418562d23f6ac25c0c91ceace95a024571fb
diff --git a/net-p2p/nicotine+/metadata.xml b/net-p2p/nicotine+/metadata.xml
new file mode 100644
index 00000000000..387556b1d70
--- /dev/null
+++ b/net-p2p/nicotine+/metadata.xml
@@ -0,0 +1,12 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+ <herd>net-p2p</herd>
+ <maintainer>
+ <email>rhill@gentoo.org</email>
+ <name>Ryan Hill</name>
+ </maintainer>
+ <upstream>
+ <remote-id type="sourceforge">nicotine-plus</remote-id>
+ </upstream>
+</pkgmetadata>
diff --git a/net-p2p/nicotine+/nicotine+-1.2.16-r1.ebuild b/net-p2p/nicotine+/nicotine+-1.2.16-r1.ebuild
new file mode 100644
index 00000000000..e368c857e56
--- /dev/null
+++ b/net-p2p/nicotine+/nicotine+-1.2.16-r1.ebuild
@@ -0,0 +1,51 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=5
+
+PYTHON_COMPAT=( python2_7 )
+DISTUTILS_SINGLE_IMPL=1
+
+inherit distutils-r1
+
+DESCRIPTION="A fork of nicotine, a Soulseek client in Python"
+HOMEPAGE="http://nicotine-plus.sourceforge.net"
+SRC_URI="mirror://sourceforge/nicotine-plus/${P}.tar.bz2"
+
+LICENSE="GPL-3 LGPL-3"
+SLOT="0"
+KEYWORDS="~amd64 ~ppc ~x86 ~x86-fbsd"
+IUSE=""
+
+RDEPEND=">=dev-python/pygtk-2.12[${PYTHON_USEDEP}]
+ gnome-base/librsvg"
+
+DEPEND="${RDEPEND}"
+
+pkg_setup() {
+ python-single-r1_pkg_setup
+}
+
+src_prepare() {
+ distutils-r1_src_prepare
+ sed -i -e 's:\(Icon=\).*:\1nicotine-plus-32px:' \
+ "${S}"/files/nicotine.desktop
+}
+
+src_install() {
+ distutils-r1_src_install
+ python_fix_shebang "${D}"
+ dosym nicotine.py /usr/bin/nicotine
+}
+
+pkg_postinst() {
+ echo
+ elog "You may want to install these packages to add additional features"
+ elog "to Nicotine+:"
+ elog
+ elog "dev-python/geoip-python Country lookup and flag display"
+ elog "media-libs/mutagen Media metadata extraction"
+ elog "net-libs/miniupnpc UPnP portmapping"
+ echo
+}
diff --git a/net-p2p/nicotine+/nicotine+-1.2.16.ebuild b/net-p2p/nicotine+/nicotine+-1.2.16.ebuild
new file mode 100644
index 00000000000..3ab01e7e715
--- /dev/null
+++ b/net-p2p/nicotine+/nicotine+-1.2.16.ebuild
@@ -0,0 +1,51 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI="3"
+PYTHON_DEPEND="2"
+
+inherit distutils
+
+DESCRIPTION="A fork of nicotine, a Soulseek client in Python"
+HOMEPAGE="http://nicotine-plus.sourceforge.net"
+SRC_URI="mirror://sourceforge/nicotine-plus/${P}.tar.bz2"
+
+LICENSE="GPL-3 LGPL-3"
+SLOT="0"
+KEYWORDS="amd64 ppc x86 ~x86-fbsd"
+IUSE=""
+
+RDEPEND=">=dev-python/pygtk-2.12
+ gnome-base/librsvg"
+
+DEPEND="${RDEPEND}"
+
+PYTHON_MODNAME="pynicotine"
+
+pkg_setup() {
+ python_set_active_version 2
+}
+
+src_prepare() {
+ sed -i -e 's:\(Icon=\).*:\1nicotine-plus-32px:' \
+ "${S}"/files/nicotine.desktop
+}
+
+src_install() {
+ distutils_src_install
+ python_convert_shebangs -r 2 "${D}"
+ dosym nicotine.py /usr/bin/nicotine
+}
+
+pkg_postinst() {
+ distutils_pkg_postinst
+ echo
+ elog "You may want to install these packages to add additional features"
+ elog "to Nicotine+:"
+ elog
+ elog "dev-python/geoip-python Country lookup and flag display"
+ elog "media-libs/mutagen Media metadata extraction"
+ elog "net-libs/miniupnpc UPnP portmapping"
+ echo
+}
diff --git a/net-p2p/opendchub/Manifest b/net-p2p/opendchub/Manifest
new file mode 100644
index 00000000000..b99e607888b
--- /dev/null
+++ b/net-p2p/opendchub/Manifest
@@ -0,0 +1 @@
+DIST opendchub-0.8.2.tar.gz 188551 SHA256 c00d5859fde939741699026da9d4d5fd0b409474608353710204c3c78a8ac5bf
diff --git a/net-p2p/opendchub/files/0.7.14-overflow.patch b/net-p2p/opendchub/files/0.7.14-overflow.patch
new file mode 100644
index 00000000000..996ff65fd0a
--- /dev/null
+++ b/net-p2p/opendchub/files/0.7.14-overflow.patch
@@ -0,0 +1,12 @@
+diff -Naur opendchub-0.7.14.vanilla/src/commands.c opendchub-0.7.14/src/commands.c
+--- opendchub-0.7.14.vanilla/src/commands.c 2003-11-15 08:07:43.000000000 -0600
++++ opendchub-0.7.14/src/commands.c 2004-11-27 09:54:57.113410240 -0600
+@@ -2842,7 +2842,7 @@
+ {
+ char move_string[MAX_HOST_LEN+20];
+
+- sprintf(move_string, "$ForceMove %s", buf);
++ snprintf(move_string, MAX_HOST_LEN, "$ForceMove %s", buf);
+
+ send_to_humans(move_string, REGULAR | REGISTERED | OP, user);
+ remove_all(UNKEYED | NON_LOGGED | REGULAR | REGISTERED | OP, 1, 1);
diff --git a/net-p2p/opendchub/files/0.7.14-telnet.patch b/net-p2p/opendchub/files/0.7.14-telnet.patch
new file mode 100644
index 00000000000..f5254cbbbe1
--- /dev/null
+++ b/net-p2p/opendchub/files/0.7.14-telnet.patch
@@ -0,0 +1,12 @@
+diff -Naur opendchub-0.7.14.vanilla/src/main.c opendchub-0.7.14/src/main.c
+--- opendchub-0.7.14.vanilla/src/main.c 2003-11-15 08:01:16.000000000 -0600
++++ opendchub-0.7.14/src/main.c 2004-08-23 15:58:33.119710184 -0500
+@@ -1056,7 +1056,7 @@
+ /* The chat command, starts with <nick> */
+ else if(*temp == '<')
+ {
+- if((user->type & (SCRIPT | UNKEYED | LINKED | NON_LOGGED)) == 0)
++ if((user->type & (SCRIPT | UNKEYED | LINKED | NON_LOGGED | NON_LOGGED_ADM)) == 0)
+ chat(temp, user);
+ }
+
diff --git a/net-p2p/opendchub/files/opendchub-0.8.2-telnet.patch b/net-p2p/opendchub/files/opendchub-0.8.2-telnet.patch
new file mode 100644
index 00000000000..f81bf44cbc6
--- /dev/null
+++ b/net-p2p/opendchub/files/opendchub-0.8.2-telnet.patch
@@ -0,0 +1,11 @@
+--- opendchub-0.8.2/src/main.c.orig
++++ opendchub-0.8.2/src/main.c
+@@ -1073,7 +1073,7 @@
+ /* The chat command, starts with <nick> */
+ else if(*temp == '<')
+ {
+- if((user->type & (SCRIPT | UNKEYED | LINKED | NON_LOGGED)) == 0)
++ if((user->type & (SCRIPT | UNKEYED | LINKED | NON_LOGGED | NON_LOGGED_ADM)) == 0)
+ chat(temp, user);
+ }
+
diff --git a/net-p2p/opendchub/files/opendchub-gentoo.patch b/net-p2p/opendchub/files/opendchub-gentoo.patch
new file mode 100644
index 00000000000..c6854e2178c
--- /dev/null
+++ b/net-p2p/opendchub/files/opendchub-gentoo.patch
@@ -0,0 +1,30 @@
+--- configure~ 2004-04-11 18:31:55.000000000 +0000
++++ configure 2004-04-11 18:40:42.068793280 +0000
+@@ -4343,12 +4343,6 @@
+ fi
+ fi
+
+-if test ! -d $HOME/.opendchub; then
+- echo "creating config directory: $HOME/.opendchub"
+- mkdir $HOME/.opendchub
+- chmod 700 $HOME/.opendchub;
+-fi
+-
+ # Check whether --enable-perl or --disable-perl was given.
+ if test "${enable_perl+set}" = set; then
+ enableval="$enable_perl"
+@@ -4406,14 +4400,6 @@
+
+ perl_libs=`perl -MExtUtils::Embed -e ldopts`
+
+- if test ! -d $HOME/.opendchub/scripts; then
+- echo "creating script directory: $HOME/.opendchub/scripts"
+- mkdir $HOME/.opendchub/scripts
+- chmod 700 $HOME/.opendchub/scripts;
+- for i in Samplescripts/*; do
+- cp $i $HOME/.opendchub/scripts;
+- done
+- fi
+ fi
+ else
+ echo "Perl script support is disabled."
diff --git a/net-p2p/opendchub/files/opendchub_setup.sh b/net-p2p/opendchub/files/opendchub_setup.sh
new file mode 100644
index 00000000000..2944a02c395
--- /dev/null
+++ b/net-p2p/opendchub/files/opendchub_setup.sh
@@ -0,0 +1,20 @@
+#!/bin/bash
+if test ! -d $HOME/.opendchub; then
+ echo "creating config directory: $HOME/.opendchub"
+ mkdir $HOME/.opendchub
+ chmod 700 $HOME/.opendchub
+else
+ echo "$HOME/.opendchub already exists!"
+fi
+if test ! -d $HOME/.opendchub/scripts; then
+ echo "creating script directory: $HOME/.opendchub/scripts"
+ mkdir $HOME/.opendchub/scripts
+ chmod 700 $HOME/.opendchub/scripts;
+ echo "copying scripts..."
+ for i in /usr/share/opendchub/scripts/*; do
+ cp $i $HOME/.opendchub/scripts;
+ done
+else
+ echo "$HOME/.opendchub/scripts already exists!"
+fi
+echo "done!"
diff --git a/net-p2p/opendchub/metadata.xml b/net-p2p/opendchub/metadata.xml
new file mode 100644
index 00000000000..66c6da71d70
--- /dev/null
+++ b/net-p2p/opendchub/metadata.xml
@@ -0,0 +1,8 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+ <herd>net-p2p</herd>
+ <upstream>
+ <remote-id type="sourceforge">opendchub</remote-id>
+ </upstream>
+</pkgmetadata>
diff --git a/net-p2p/opendchub/opendchub-0.8.2.ebuild b/net-p2p/opendchub/opendchub-0.8.2.ebuild
new file mode 100644
index 00000000000..ce857bc4350
--- /dev/null
+++ b/net-p2p/opendchub/opendchub-0.8.2.ebuild
@@ -0,0 +1,50 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=5
+
+inherit autotools eutils
+
+DESCRIPTION="hub software for Direct Connect"
+HOMEPAGE="http://opendchub.sf.net"
+SRC_URI="mirror://sourceforge/${PN}/${P}.tar.gz"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="~amd64 ~ppc ~sparc x86"
+IUSE="perl"
+
+RDEPEND="perl? ( dev-lang/perl )"
+DEPEND="${RDEPEND}"
+
+DOCS="NEWS TODO README AUTHORS Documentation/*"
+
+src_prepare() {
+ epatch "${FILESDIR}"/${P}-telnet.patch
+ eautoreconf
+}
+
+src_configure() {
+ use perl || myconf="--disable-perl --enable-switch_user"
+ econf ${myconf}
+}
+
+src_install() {
+ default
+
+ if use perl ; then
+ dobin "${FILESDIR}"/opendchub_setup.sh
+ insinto /usr/share/opendchub/scripts
+ doins Samplescripts/*
+ fi
+}
+
+pkg_postinst() {
+ if use perl ; then
+ echo
+ einfo "To set up perl scripts for opendchub to use, please run"
+ einfo "opendchub_setup.sh as the user you will be using opendchub as."
+ echo
+ fi
+}
diff --git a/net-p2p/phex/Manifest b/net-p2p/phex/Manifest
new file mode 100644
index 00000000000..41199c8f601
--- /dev/null
+++ b/net-p2p/phex/Manifest
@@ -0,0 +1 @@
+DIST phex_3.2.0.102_src.zip 5416827 SHA256 e5b6316a3e60c68949ca33321804ae9473858f7d65d5fb59275a4f0e7a64eda9
diff --git a/net-p2p/phex/files/0001-Remove-MacOS-GUI-references.patch b/net-p2p/phex/files/0001-Remove-MacOS-GUI-references.patch
new file mode 100644
index 00000000000..f772157084e
--- /dev/null
+++ b/net-p2p/phex/files/0001-Remove-MacOS-GUI-references.patch
@@ -0,0 +1,113 @@
+From 2bd7907aef02530680cfd795f3f757613777c064 Mon Sep 17 00:00:00 2001
+From: Stanislav Ochotnicky <sochotnicky@gmail.com>
+Date: Sat, 10 Jul 2010 15:50:13 +0200
+Subject: [PATCH] Remove MacOS GUI references
+
+---
+ src/phex/gui/common/FileDialogHandler.java | 45 +--------------------------
+ src/phex/gui/common/GUIRegistry.java | 5 ---
+ 2 files changed, 2 insertions(+), 48 deletions(-)
+
+diff --git a/src/phex/gui/common/FileDialogHandler.java b/src/phex/gui/common/FileDialogHandler.java
+index a5ee4f7..530f374 100644
+--- a/src/phex/gui/common/FileDialogHandler.java
++++ b/src/phex/gui/common/FileDialogHandler.java
+@@ -34,7 +34,6 @@ import javax.swing.filechooser.FileFilter;
+
+ import org.apache.commons.lang.SystemUtils;
+
+-import phex.gui.macosx.MacOsxGUIUtils;
+ import phex.utils.DirectoryOnlyFileFilter;
+
+ public class FileDialogHandler
+@@ -45,7 +44,7 @@ public class FileDialogHandler
+ {
+ if ( SystemUtils.IS_OS_MAC_OSX )
+ {
+- return openMacDirectoryChooser( title, null, null );
++ return null;
+ }
+ else
+ {
+@@ -71,10 +70,7 @@ public class FileDialogHandler
+ {
+ if ( SystemUtils.IS_OS_MAC_OSX )
+ {
+- return new File[]
+- {
+- openMacDirectoryChooser( title, notifyPopupTitle, notifyPopupShortMessage )
+- };
++ return null;
+ }
+ else
+ {
+@@ -85,43 +81,6 @@ public class FileDialogHandler
+ }
+ }
+
+- private static File openMacDirectoryChooser( String title,
+- String notifyPopupTitle, String notifyPopupShortMessage )
+- {
+- // create folder dialog through other class this prevents
+- // NoClassDefFoundError on Windows systems since the import of the
+- // required OS X classes is elsewhere.
+- FileDialog dia = MacOsxGUIUtils.createFolderDialog();
+- dia.setTitle(title);
+-
+- // unfortunatly its not possible to display notification popup
+- // besides heavy weight dialog.
+- //if ( notifyPopupTitle != null || notifyPopupShortMessage != null )
+- //{
+- //displayMacNotificationPopup( dia, notifyPopupTitle,
+- // notifyPopupShortMessage );
+- //}
+-
+- DirectoryOnlyFileFilter filter = new DirectoryOnlyFileFilter();
+- dia.setFilenameFilter( new FileFilterWrapper(
+- filter) );
+- dia.setVisible( true );
+- String dirStr = dia.getDirectory();
+- String fileStr = dia.getFile();
+-
+- if( dirStr == null || fileStr == null )
+- {
+- return null;
+- }
+- File file = new File(dirStr, fileStr);
+- // validate filter
+- if( !filter.accept(file) )
+- {
+- return null;
+- }
+- return file;
+- }
+-
+ private static JFileChooser initDefaultChooser( String title,
+ String approveBtnText, char approveBtnMnemonic, FileFilter filter,
+ int mode, File currentDirectory, String notifyPopupTitle,
+diff --git a/src/phex/gui/common/GUIRegistry.java b/src/phex/gui/common/GUIRegistry.java
+index 852722e..3c28f2e 100644
+--- a/src/phex/gui/common/GUIRegistry.java
++++ b/src/phex/gui/common/GUIRegistry.java
+@@ -47,7 +47,6 @@ import phex.gui.actions.FWAction;
+ import phex.gui.actions.NewDownloadAction;
+ import phex.gui.actions.SwitchNetworkAction;
+ import phex.gui.chat.ChatFrameManager;
+-import phex.gui.macosx.MacOsxGUIUtils;
+ import phex.gui.prefs.InterfacePrefs;
+ import phex.update.UpdateCheckRunner;
+ import phex.utils.Localizer;
+@@ -119,10 +118,6 @@ public final class GUIRegistry implements GUIRegistryConstants
+ }
+ }
+
+- if ( SystemUtils.IS_OS_MAC_OSX )
+- {
+- MacOsxGUIUtils.installEventHandlers();
+- }
+ initializeGlobalActions();
+ chatFrameManager = new ChatFrameManager();
+ try
+--
+1.7.1
+
diff --git a/net-p2p/phex/files/phex-3.0.0.99.sh b/net-p2p/phex/files/phex-3.0.0.99.sh
new file mode 100644
index 00000000000..9713680ef58
--- /dev/null
+++ b/net-p2p/phex/files/phex-3.0.0.99.sh
@@ -0,0 +1,7 @@
+# Copyright 1999-2006 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+#!/bin/sh
+
+java -classpath $(java-config -p commons-logging,commons-httpclient-3,phex,jgoodies-looks-2.0,jgoodies-forms) phex.Main
diff --git a/net-p2p/phex/metadata.xml b/net-p2p/phex/metadata.xml
new file mode 100644
index 00000000000..dbb3a316f9b
--- /dev/null
+++ b/net-p2p/phex/metadata.xml
@@ -0,0 +1,9 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+ <herd>net-p2p</herd>
+ <herd>java</herd>
+ <upstream>
+ <remote-id type="sourceforge">phex</remote-id>
+ </upstream>
+</pkgmetadata>
diff --git a/net-p2p/phex/phex-3.2.0.102-r1.ebuild b/net-p2p/phex/phex-3.2.0.102-r1.ebuild
new file mode 100644
index 00000000000..75b2f8c92d1
--- /dev/null
+++ b/net-p2p/phex/phex-3.2.0.102-r1.ebuild
@@ -0,0 +1,65 @@
+# Copyright 1999-2010 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=2
+
+inherit java-pkg-2 java-ant-2
+
+MY_P="${PN}_${PV}"
+
+DESCRIPTION="java gnutella file-sharing application"
+HOMEPAGE="http://phex.sourceforge.net/"
+SRC_URI="mirror://sourceforge/${PN}/${MY_P}_src.zip"
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="~x86 ~amd64"
+IUSE=""
+COMMON_DEPEND="dev-java/commons-httpclient:3
+ dev-java/commons-logging:0
+ dev-java/jgoodies-forms:0
+ dev-java/jgoodies-looks:2.0
+ dev-java/log4j:0
+ dev-java/l2fprod-common:0
+ dev-java/commons-beanutils:1.7
+ dev-java/commons-codec:0
+ dev-java/commons-collections:0
+ dev-java/commons-lang:2.1"
+
+DEPEND="app-arch/unzip
+ >=virtual/jdk-1.5
+ ${COMMON_DEPEND}"
+RDEPEND=">=virtual/jre-1.5
+ ${COMMON_DEPEND}"
+
+S="${WORKDIR}/${MY_P}_src"
+
+JAVA_PKG_BSFIX="off"
+
+src_prepare() {
+ # remove parts related to MacOS gui classes
+ epatch "${FILESDIR}/0001-Remove-MacOS-GUI-references.patch"
+ # remove unused class (make sure it's not compiled)
+ rm -vf src/phex/gui/macosx/MacOsxGUIUtils.java
+
+ rm -vf lib/*.jar || die
+ # avoid patches like plague
+ sed -i "s/createJar, copyThirdpartyJars/createJar/" build/buildJava.xml || die
+ JAVA_ANT_REWRITE_CLASSPATH="true" java-ant_bsfix_files build/*.xml
+ # remove bundled packages that we have - bug #176739
+ rm -rf src/com/l2fprod src/org/apache || die
+}
+
+src_compile() {
+ local gcp="$(java-pkg_getjars commons-httpclient-3,commons-logging,jgoodies-forms,jgoodies-looks-2.0,log4j,l2fprod-common,commons-beanutils-1.7,commons-codec,commons-collections,commons-lang-2.1)"
+ cd build
+ eant -Dgentoo.classpath="${gcp}:MRJAdapter.jar" -Dproject.buildtarget=build buildJava
+}
+
+src_install() {
+ java-pkg_dojar build/lib/${PN}.jar
+
+ java-pkg_dolauncher ${PN} --main phex.Main
+
+ dohtml docs/readme/* || die
+}
diff --git a/net-p2p/phxd/Manifest b/net-p2p/phxd/Manifest
new file mode 100644
index 00000000000..0a35ae4c2bf
--- /dev/null
+++ b/net-p2p/phxd/Manifest
@@ -0,0 +1 @@
+DIST phxd-0.1.0_pre23092005.tar.bz2 25224 SHA256 18f79eadb80524138a569cd6b1c3e4214bc65866a30d6ac3b5e13997c5115953
diff --git a/net-p2p/phxd/files/80phxd b/net-p2p/phxd/files/80phxd
new file mode 100644
index 00000000000..4c93ff2c5ba
--- /dev/null
+++ b/net-p2p/phxd/files/80phxd
@@ -0,0 +1 @@
+CONFIG_PROTECT="/var/phxd"
diff --git a/net-p2p/phxd/metadata.xml b/net-p2p/phxd/metadata.xml
new file mode 100644
index 00000000000..02b118029ce
--- /dev/null
+++ b/net-p2p/phxd/metadata.xml
@@ -0,0 +1,9 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+ <herd>net-p2p</herd>
+ <longdescription>phxd is an Hotline server under the GPL for Linux/Unixes.
+ It supports the Hotline Protocol from 1.2.3 up to 1.5+ (and this means
+ it also includes the 1.9+ clients)
+ </longdescription>
+</pkgmetadata>
diff --git a/net-p2p/phxd/phxd-0.1.0_pre23092005.ebuild b/net-p2p/phxd/phxd-0.1.0_pre23092005.ebuild
new file mode 100644
index 00000000000..41d945af6a6
--- /dev/null
+++ b/net-p2p/phxd/phxd-0.1.0_pre23092005.ebuild
@@ -0,0 +1,51 @@
+# Copyright 1999-2014 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+inherit eutils user
+
+DESCRIPTION="Next generation Hotline server in python. kang's branch"
+HOMEPAGE="http://www.avaraline.net"
+SRC_URI="mirror://gentoo/phxd-0.1.0_pre23092005.tar.bz2"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="~ppc ~x86"
+IUSE=""
+
+DEPEND="dev-python/twisted-core
+ dev-python/twisted-web"
+
+RDEPEND=""
+
+pkg_postinst() {
+ enewgroup phxd
+ enewuser phxd -1 /bin/bash /var/phxd phxd
+ chown phxd:phxd /var/phxd/files
+ chown phxd:phxd /var/phxd/chatlogs
+}
+
+src_install() {
+ cd "${WORKDIR}"
+ cd phxd
+
+ doenvd "${FILESDIR}"/80phxd
+
+ dodoc INSTALL README README-kang
+ dodir /var/phxd
+
+ exeinto /var/phxd; doexe phxd
+
+ cpdirs="support shared server client"
+ for i in $cpdirs; do
+ cp -R $i "${D}"/var/phxd
+ done
+ dodir /var/phxd/files
+ dodir /var/phxd/chatlogs
+
+ keepdir /var/phxd/files
+ keepdir /var/phxd/chatlogs
+ keepdir /var/phxd
+
+ insinto /var/phxd; doins config.py
+}
diff --git a/net-p2p/ppcoin-qt/Manifest b/net-p2p/ppcoin-qt/Manifest
new file mode 100644
index 00000000000..a98a901aaaf
--- /dev/null
+++ b/net-p2p/ppcoin-qt/Manifest
@@ -0,0 +1 @@
+DIST ppcoin-0.4.0.tar.gz 12652477 SHA256 561076e8d4e82085d577eb717b9f8b52571556fea2b8181fa8eb6039218d3f06 SHA512 755890e32048f8cdfb9f93706eff952ae2876be394c0a76cf93a79562a28fe03c74c829c97b9234fbc27c03e4b706373f55723564ca7b91a4ff908ca072299c4 WHIRLPOOL eaacd820045fe2a343c45698674096a15228605418cffe61fc9e31eaf330dbb29635d6dbae534a90677fe035a598c7b061c0c3fa05c747514c24cfc24addeef4
diff --git a/net-p2p/ppcoin-qt/metadata.xml b/net-p2p/ppcoin-qt/metadata.xml
new file mode 100644
index 00000000000..5c6c87d9a05
--- /dev/null
+++ b/net-p2p/ppcoin-qt/metadata.xml
@@ -0,0 +1,14 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+ <maintainer>
+ <email>blueness@gentoo.org</email>
+ <name>Anthony G. Basile</name>
+ </maintainer>
+ <use>
+ <flag name="qrcode">Enable generation of QR Codes for receiving payments</flag>
+ </use>
+ <upstream>
+ <remote-id type="sourceforge">ppcoin</remote-id>
+ </upstream>
+</pkgmetadata>
diff --git a/net-p2p/ppcoin-qt/ppcoin-qt-0.4.0.ebuild b/net-p2p/ppcoin-qt/ppcoin-qt-0.4.0.ebuild
new file mode 100644
index 00000000000..d61d135bea4
--- /dev/null
+++ b/net-p2p/ppcoin-qt/ppcoin-qt-0.4.0.ebuild
@@ -0,0 +1,138 @@
+# Copyright 1999-2014 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=5
+
+DB_VER="4.8"
+
+LANGS="ca_ES cs da de en es_CL es et eu_ES fa_IR fa fi fr_CA fr_FR he hr hu it lt nb nl pl pt_BR ro_RO ru sk sr sv tr uk zh_CN zh_TW"
+
+inherit db-use eutils fdo-mime gnome2-utils kde4-functions qt4-r2
+
+MyPV="${PV/_/-}"
+MyPN="ppcoin"
+MyP="${MyPN}-${MyPV}"
+
+DESCRIPTION="Cryptocurrency forked from Bitcoin which aims to be energy efficiency"
+HOMEPAGE="http://peercoin.net/"
+SRC_URI="mirror://sourceforge/${MyPN}/${MyP}-linux.tar.gz -> ${MyP}.tar.gz"
+
+LICENSE="MIT ISC GPL-3 LGPL-2.1 public-domain || ( CC-BY-SA-3.0 LGPL-2.1 )"
+SLOT="0"
+KEYWORDS="~amd64 ~x86"
+IUSE="dbus ipv6 kde +qrcode upnp"
+
+RDEPEND="
+ dev-libs/boost[threads(+)]
+ dev-libs/openssl:0[-bindist]
+ qrcode? (
+ media-gfx/qrencode
+ )
+ upnp? (
+ net-libs/miniupnpc
+ )
+ sys-libs/db:$(db_ver_to_slot "${DB_VER}")[cxx]
+ dev-qt/qtgui:4
+ dbus? (
+ dev-qt/qtdbus:4
+ )
+"
+DEPEND="${RDEPEND}
+ >=app-shells/bash-4.1
+"
+
+DOCS="../README README.md"
+
+S="${WORKDIR}/${MyP}-linux/src"
+
+src_prepare() {
+ cd src || die
+
+ local filt= yeslang= nolang=
+
+ for lan in $LANGS; do
+ if [ ! -e qt/locale/bitcoin_$lan.ts ]; then
+ ewarn "Language '$lan' no longer supported. Ebuild needs update."
+ fi
+ done
+
+ for ts in $(ls qt/locale/*.ts)
+ do
+ x="${ts/*bitcoin_/}"
+ x="${x/.ts/}"
+ if ! use "linguas_$x"; then
+ nolang="$nolang $x"
+ rm "$ts"
+ filt="$filt\\|$x"
+ else
+ yeslang="$yeslang $x"
+ fi
+ done
+
+ filt="bitcoin_\\(${filt:2}\\)\\.\(qm\|ts\)"
+ sed "/${filt}/d" -i 'qt/bitcoin.qrc'
+ einfo "Languages -- Enabled:$yeslang -- Disabled:$nolang"
+}
+
+src_configure() {
+ OPTS=()
+
+ use dbus && OPTS+=("USE_DBUS=1")
+ if use upnp; then
+ OPTS+=("USE_UPNP=1")
+ else
+ OPTS+=("USE_UPNP=-")
+ fi
+
+ use qrcode && OPTS+=("USE_QRCODE=1")
+ use ipv6 || OPTS+=("USE_IPV6=-")
+
+ OPTS+=("USE_SYSTEM_LEVELDB=1")
+ OPTS+=("BDB_INCLUDE_PATH=$(db_includedir "${DB_VER}")")
+ OPTS+=("BDB_LIB_SUFFIX=-${DB_VER}")
+
+ if has_version '>=dev-libs/boost-1.52'; then
+ OPTS+=("LIBS+=-lboost_chrono\$\$BOOST_LIB_SUFFIX")
+ fi
+
+ #The ppcoin codebase is mostly taken from bitcoin-qt
+ eqmake4 bitcoin-qt.pro "${OPTS[@]}"
+}
+
+#Tests are broken
+#src_test() {
+# cd src || die
+# emake -f makefile.unix "${OPTS[@]}" test_ppcoin
+# ./test_ppcoin || die 'Tests failed'
+#}
+
+src_install() {
+ qt4-r2_src_install
+
+ dobin ${PN}
+
+ insinto /usr/share/pixmaps
+ newins "src/qt/res/icons/ppcoin.ico" "${PN}.ico"
+
+ make_desktop_entry "${PN} %u" "PPcoin-Qt" "/usr/share/pixmaps/${PN}.ico" "Qt;Network;P2P;Office;Finance;" "MimeType=x-scheme-handler/ppcoin;\nTerminal=false"
+
+ if use kde; then
+ insinto /usr/share/kde4/services
+ newins contrib/debian/bitcoin-qt.protocol ${PN}.protocol
+ fi
+}
+
+update_caches() {
+ gnome2_icon_cache_update
+ fdo-mime_desktop_database_update
+ buildsycoca
+}
+
+pkg_postinst() {
+ update_caches
+}
+
+pkg_postrm() {
+ update_caches
+}
diff --git a/net-p2p/ppcoind/Manifest b/net-p2p/ppcoind/Manifest
new file mode 100644
index 00000000000..a98a901aaaf
--- /dev/null
+++ b/net-p2p/ppcoind/Manifest
@@ -0,0 +1 @@
+DIST ppcoin-0.4.0.tar.gz 12652477 SHA256 561076e8d4e82085d577eb717b9f8b52571556fea2b8181fa8eb6039218d3f06 SHA512 755890e32048f8cdfb9f93706eff952ae2876be394c0a76cf93a79562a28fe03c74c829c97b9234fbc27c03e4b706373f55723564ca7b91a4ff908ca072299c4 WHIRLPOOL eaacd820045fe2a343c45698674096a15228605418cffe61fc9e31eaf330dbb29635d6dbae534a90677fe035a598c7b061c0c3fa05c747514c24cfc24addeef4
diff --git a/net-p2p/ppcoind/files/ppcoin.conf b/net-p2p/ppcoind/files/ppcoin.conf
new file mode 100644
index 00000000000..c6a55f3d913
--- /dev/null
+++ b/net-p2p/ppcoind/files/ppcoin.conf
@@ -0,0 +1,8 @@
+# http://www.bitcoin.org/smf/index.php?topic=644.0
+#rpcuser=
+#rpcpassword=
+
+
+
+
+
diff --git a/net-p2p/ppcoind/files/ppcoin.confd b/net-p2p/ppcoind/files/ppcoin.confd
new file mode 100644
index 00000000000..81fbf49e9f3
--- /dev/null
+++ b/net-p2p/ppcoind/files/ppcoin.confd
@@ -0,0 +1,10 @@
+# Config file for /etc/init.d/ppcoind
+
+# owner of ppciond process (don't change, must be existing)
+PPCOIN_USER="ppcoin"
+
+# See http://www.bitcoin.org/smf/index.php?topic=1063
+PPCOIN_OPTS="${PPCOIN_OPTS}"
+
+# nice level
+NICELEVEL="19"
diff --git a/net-p2p/ppcoind/files/ppcoin.initd b/net-p2p/ppcoind/files/ppcoin.initd
new file mode 100644
index 00000000000..1c7373104e8
--- /dev/null
+++ b/net-p2p/ppcoind/files/ppcoin.initd
@@ -0,0 +1,104 @@
+#!/sbin/runscript
+# Distributed under the terms of the GNU General Public License, v2 or later
+
+VARDIR="/var/lib/ppcoin"
+CONFFILE="${VARDIR}/.ppcoin/ppcoin.conf"
+
+depend() {
+ need net
+}
+
+checkconfig() {
+ if [[ "${PPCOIN_USER}" == "" ]] ; then
+ eerror "Please edit /etc/conf.d/ppcoind"
+ eerror "A user must be specified to run ppcoind as that user."
+ eerror "Modify USER to your needs (you may also add a group after a colon)"
+ return 1
+ fi
+ if ! `getent passwd | cut -d ':' -f 1 | grep $( echo "${PPCOIN_USER}" | cut -d ':' -f 1 ) -sq` ; then
+ eerror "Please edit /etc/conf.d/ppcoind"
+ eerror "Specified user must exist!"
+ return 1
+ fi
+ if `echo "${PPCOIN_USER}" | grep ':' -sq` ; then
+ if ! `cut -d ':' -f 1 /etc/group | grep $( echo "${PPCOIN_USER}" | cut -d ':' -f 2 ) -sq` ; then
+ eerror "Please edit /etc/conf.d/ppcoind"
+ eerror "Specified group must exist!"
+ return 1
+ fi
+ fi
+ if ! grep -q '^rpcpassword=' "${CONFFILE}"; then
+ eerror "Please edit `readlink -f ${CONFFILE}`"
+ eerror "There must be at least a line assigning rpcpassword=something-secure"
+ return 1
+ fi
+ if ! stat -Lc '%a' "${CONFFILE}" | grep -q '^[4567]00$'; then
+ eerror "`readlink -f ${CONFFILE}` should not be readable by other users"
+ return 1
+ fi
+ return 0
+}
+
+start() {
+ checkconfig || return 1
+ ebegin "Starting PPcoind daemon"
+
+ pkg-config openrc
+ if [ $? = 0 ]; then
+ start_openrc
+ else
+ start_baselayout
+ fi
+}
+
+stop() {
+ ebegin "Stopping PPcoin daemon"
+
+ pkg-config openrc
+ if [ $? = 0 ]; then
+ stop_openrc
+ else
+ stop_baselayout
+ fi
+}
+
+start_openrc() {
+ start-stop-daemon \
+ --start --user "${PPCOIN_USER}" --name ppcoind \
+ --pidfile /var/run/ppcoind.pid --make-pidfile \
+ --env HOME="${VARDIR}" --exec /usr/bin/ppcoind \
+ --nicelevel "${NICELEVEL}" \
+ --background \
+ --wait 2000 \
+ -- ${PPCOIN_OPTS}
+ eend $?
+}
+
+stop_openrc() {
+ start-stop-daemon --stop --user "${PPCOIN_USER}" \
+ --name ppcoind --pidfile /var/run/ppcoind.pid \
+ --wait 30000 \
+ --progress
+ eend $?
+}
+
+start_baselayout() {
+ start-stop-daemon \
+ --start --user "${PPCOIN_USER}" --name ppcoind \
+ --pidfile /var/run/ppcoind.pid --make-pidfile \
+ --env HOME="${VARDIR}" --exec /usr/bin/ppcoind \
+ --chuid "${PPCOIN_USER}" \
+ --nicelevel "${NICELEVEL}" \
+ --background \
+ -- ${PPCOIN_OPTS}
+ eend $?
+}
+
+stop_baselayout() {
+ start-stop-daemon \
+ --stop \
+ --user "${PPCOIN_USER}" \
+ --name ppcoind \
+ --pidfile /var/run/ppcoind.pid
+ eend $?
+}
diff --git a/net-p2p/ppcoind/files/ppcoin.initd-r1 b/net-p2p/ppcoind/files/ppcoin.initd-r1
new file mode 100644
index 00000000000..4dabd48eff1
--- /dev/null
+++ b/net-p2p/ppcoind/files/ppcoin.initd-r1
@@ -0,0 +1,29 @@
+#!/sbin/runscript
+# Copyright 1999-2014 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+vardir="/var/lib/ppcoin"
+conffile="${vardir}/.ppcoin/ppcoin.conf"
+ppcoind_user="${PPCOIN_USER:-nobody:nobody}"
+
+description="Cryptocurrency forked from Bitcoin which aims to be energy efficiency."
+pidfile="/run/${SVCNAME}.pid"
+command="/usr/bin/ppcoind"
+command_args="${PPCOIN_OPTS}"
+command_background="true"
+start_stop_daemon_args="-u ${ppcoind_user} -e HOME=${vardir} -N ${NICELEVEL:-0} -w 2000"
+
+depend() {
+ need net
+}
+
+start_pre() {
+ checkpath -f -o ${ppcoind_user} -m 0400 ${conffile} || return 1
+
+ if ! grep -q '^rpcpassword=' "${conffile}"; then
+ eerror "Please edit `readlink -f ${conffile}`"
+ eerror "There must be at least a line assigning rpcpassword=something-secure"
+ return 1
+ fi
+}
diff --git a/net-p2p/ppcoind/files/ppcoin.service b/net-p2p/ppcoind/files/ppcoin.service
new file mode 100644
index 00000000000..3a83178fe04
--- /dev/null
+++ b/net-p2p/ppcoind/files/ppcoin.service
@@ -0,0 +1,30 @@
+# It's not recommended to modify this file in-place, because it will be
+# overwritten during package upgrades. If you want to customize, the
+# best way is to create file
+# "/etc/systemd/system/ppcoind.service.d/*.conf"
+# containing your changes
+
+# For example, if you want to change some daemon and/or unit options,
+# create a file named
+# "/etc/systemd/system/ppcoind.service.d/myopts.conf"
+# containing:
+# [Service]
+# Environment="PPCOIN_OPTS=-debug -logtimestamps"
+# Nice=10
+# This will override the setting appearing below.
+
+# Note that almost all daemon options could be specified in
+# /etc/ppcoin/ppcoin.conf
+
+[Unit]
+Description=PPcoin Daemon
+After=network.target
+
+[Service]
+User=ppcoin
+Environment=PPCOIN_OPTS=
+ExecStart=/usr/bin/ppcoind -daemon=0 $PPCOIN_OPTS
+ExecReload=/bin/kill -HUP $MAINPID
+
+[Install]
+WantedBy=multi-user.target
diff --git a/net-p2p/ppcoind/files/ppcoind.logrotate b/net-p2p/ppcoind/files/ppcoind.logrotate
new file mode 100644
index 00000000000..4ea060b0f0f
--- /dev/null
+++ b/net-p2p/ppcoind/files/ppcoind.logrotate
@@ -0,0 +1,7 @@
+/var/lib/ppcoin/.ppcoin/debug.log {
+ weekly
+ sharedscripts
+ postrotate
+ killall -HUP ppcoind
+ endscript
+}
diff --git a/net-p2p/ppcoind/metadata.xml b/net-p2p/ppcoind/metadata.xml
new file mode 100644
index 00000000000..f48e467393c
--- /dev/null
+++ b/net-p2p/ppcoind/metadata.xml
@@ -0,0 +1,14 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+ <maintainer>
+ <email>blueness@gentoo.org</email>
+ <name>Anthony G. Basile</name>
+ </maintainer>
+ <use>
+ <flag name="logrotate">Use app-admin/logrotate for rotating logs</flag>
+ </use>
+ <upstream>
+ <remote-id type="sourceforge">ppcoin</remote-id>
+ </upstream>
+</pkgmetadata>
diff --git a/net-p2p/ppcoind/ppcoind-0.4.0.ebuild b/net-p2p/ppcoind/ppcoind-0.4.0.ebuild
new file mode 100644
index 00000000000..b053df85f1e
--- /dev/null
+++ b/net-p2p/ppcoind/ppcoind-0.4.0.ebuild
@@ -0,0 +1,117 @@
+# Copyright 1999-2014 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=5
+
+DB_VER="4.8"
+
+inherit db-use eutils systemd user
+
+MyPV="${PV/_/-}"
+MyPN="ppcoin"
+MyP="${MyPN}-${MyPV}"
+
+DESCRIPTION="Cryptocurrency forked from Bitcoin which aims to be energy efficiency"
+HOMEPAGE="http://peercoin.net/"
+SRC_URI="mirror://sourceforge/${MyPN}/${MyP}-linux.tar.gz -> ${MyP}.tar.gz"
+
+LICENSE="MIT ISC GPL-2"
+SLOT="0"
+KEYWORDS="~amd64 ~x86"
+IUSE="examples ipv6 logrotate upnp"
+
+RDEPEND="
+ dev-libs/boost[threads(+)]
+ dev-libs/openssl:0[-bindist]
+ logrotate? (
+ app-admin/logrotate
+ )
+ upnp? (
+ net-libs/miniupnpc
+ )
+ sys-libs/db:$(db_ver_to_slot "${DB_VER}")[cxx]
+"
+DEPEND="${RDEPEND}
+ >=app-shells/bash-4.1
+ sys-apps/sed
+"
+
+S="${WORKDIR}/${MyP}-linux/src"
+
+pkg_setup() {
+ local UG='ppcoin'
+ enewgroup "${UG}"
+ enewuser "${UG}" -1 -1 /var/lib/ppcoin "${UG}"
+}
+
+src_prepare() {
+ if has_version '>=dev-libs/boost-1.52'; then
+ sed -i 's/\(-l db_cxx\)/-l boost_chrono$(BOOST_LIB_SUFFIX) \1/' src/makefile.unix
+ fi
+}
+
+src_configure() {
+ OPTS=()
+
+ OPTS+=("DEBUGFLAGS=")
+ OPTS+=("CXXFLAGS=${CXXFLAGS}")
+ OPTS+=("LDFLAGS=${LDFLAGS}")
+
+ if use upnp; then
+ OPTS+=("USE_UPNP=1")
+ else
+ OPTS+=("USE_UPNP=-")
+ fi
+
+ use ipv6 || OPTS+=("USE_IPV6=-")
+
+ OPTS+=("USE_SYSTEM_LEVELDB=1")
+ OPTS+=("BDB_INCLUDE_PATH=$(db_includedir "${DB_VER}")")
+ OPTS+=("BDB_LIB_SUFFIX=-${DB_VER}")
+
+ cd src || die
+ emake CC="$(tc-getCC)" CXX="$(tc-getCXX)" -f makefile.unix "${OPTS[@]}" ${PN}
+}
+
+#Tests are broken
+#src_test() {
+# cd src || die
+# emake CC="$(tc-getCC)" CXX="$(tc-getCXX)" -f makefile.unix "${OPTS[@]}" test_ppcoin
+# ./test_ppcoin || die 'Tests failed'
+#}
+
+src_install() {
+ dobin src/${PN}
+
+ insinto /etc/ppcoin
+ doins "${FILESDIR}/ppcoin.conf"
+ fowners ppcoin:ppcoin /etc/ppcoin/ppcoin.conf
+ fperms 600 /etc/ppcoin/ppcoin.conf
+
+ newconfd "${FILESDIR}/ppcoin.confd" ${PN}
+ newinitd "${FILESDIR}/ppcoin.initd-r1" ${PN}
+ systemd_dounit "${FILESDIR}/ppcoin.service"
+
+ keepdir /var/lib/ppcoin/.ppcoin
+ fperms 700 /var/lib/ppcoin
+ fowners ppcoin:ppcoin /var/lib/ppcoin/
+ fowners ppcoin:ppcoin /var/lib/ppcoin/.ppcoin
+ dosym /etc/ppcoin/ppcoin.conf /var/lib/ppcoin/.ppcoin/ppcoin.conf
+
+ dodoc ../README
+ dodoc README.md
+ newman contrib/debian/manpages/bitcoind.1 ppcoind.1
+ newman contrib/debian/manpages/bitcoin.conf.5 ppcoin.conf.5
+
+ if use examples; then
+ docinto examples
+ dodoc -r contrib/{bitrpc,gitian-descriptors,gitian-downloader,pyminer,wallettools}
+
+ fi
+
+ if use logrotate; then
+ insinto /etc/logrotate.d
+ newins "${FILESDIR}/ppcoind.logrotate" ppcoind
+ fi
+}
diff --git a/net-p2p/primecoin-qt/Manifest b/net-p2p/primecoin-qt/Manifest
new file mode 100644
index 00000000000..51e38c8436f
--- /dev/null
+++ b/net-p2p/primecoin-qt/Manifest
@@ -0,0 +1 @@
+DIST primecoin-0.1.2.tar.gz 16521236 SHA256 d0f3c6a91b4d505f25e9284bcca85e420cf09d0e6cf71e5a001b7e1367ef46d0 SHA512 cff71b0e6459c4e534e78acef9491090d05c0cb864a068c0a3cb289310a1ee13fd69c7b61a7d6cb9732af54fbcf1fa4e77db8c8528a09bbdafd36421fdf7aff1 WHIRLPOOL 5031efa135dcf08975a06a037179863ad180920e0c55e0ec5d1863b4b24d005ce829fa0e0f081120d3610bc0abd1d3919db477a33e32ec6d0d353b7177480eb1
diff --git a/net-p2p/primecoin-qt/files/primecoin-sys_leveldb.patch b/net-p2p/primecoin-qt/files/primecoin-sys_leveldb.patch
new file mode 100644
index 00000000000..39d0aa63fb7
--- /dev/null
+++ b/net-p2p/primecoin-qt/files/primecoin-sys_leveldb.patch
@@ -0,0 +1,176 @@
+diff -Naur primecoin-0.1.2-linux.orig/src/bitcoin-qt.pro primecoin-0.1.2-linux/src/bitcoin-qt.pro
+--- primecoin-0.1.2-linux.orig/src/bitcoin-qt.pro 2013-08-05 08:37:14.000000000 -0400
++++ primecoin-0.1.2-linux/src/bitcoin-qt.pro 2013-11-30 16:39:48.464770389 -0500
+@@ -4,7 +4,7 @@
+ VERSION = 0.8.3
+ INCLUDEPATH += src src/json src/qt
+ QT += network
+-DEFINES += QT_GUI BOOST_THREAD_USE_LIB BOOST_SPIRIT_THREADSAFE
++DEFINES += QT_GUI BOOST_THREAD_USE_LIB BOOST_SPIRIT_THREADSAFE LEVELDB_WITHOUT_MEMENV
+ CONFIG += no_include_pwd
+ CONFIG += thread
+
+@@ -98,25 +98,29 @@
+ QTPLUGIN += qcncodecs qjpcodecs qtwcodecs qkrcodecs qtaccessiblewidgets
+ }
+
++contains(USE_SYSTEM_LEVELDB, 1) {
++ LIBS += -lleveldb
++} else {
+ INCLUDEPATH += src/leveldb/include src/leveldb/helpers
+-LIBS += $$PWD/src/leveldb/libleveldb.a $$PWD/src/leveldb/libmemenv.a
++LIBS += $$PWD/src/leveldb/libleveldb.a
+ !win32 {
+ # we use QMAKE_CXXFLAGS_RELEASE even without RELEASE=1 because we use RELEASE to indicate linking preferences not -O preferences
+- genleveldb.commands = cd $$PWD/src/leveldb && CC=$$QMAKE_CC CXX=$$QMAKE_CXX $(MAKE) OPT=\"$$QMAKE_CXXFLAGS $$QMAKE_CXXFLAGS_RELEASE\" libleveldb.a libmemenv.a
++ genleveldb.commands = cd $$PWD/src/leveldb && CC=$$QMAKE_CC CXX=$$QMAKE_CXX $(MAKE) OPT=\"$$QMAKE_CXXFLAGS $$QMAKE_CXXFLAGS_RELEASE\" libleveldb.a
+ } else {
+ # make an educated guess about what the ranlib command is called
+ isEmpty(QMAKE_RANLIB) {
+ QMAKE_RANLIB = $$replace(QMAKE_STRIP, strip, ranlib)
+ }
+ LIBS += -lshlwapi
+- genleveldb.commands = cd $$PWD/src/leveldb && CC=$$QMAKE_CC CXX=$$QMAKE_CXX TARGET_OS=OS_WINDOWS_CROSSCOMPILE $(MAKE) OPT=\"$$QMAKE_CXXFLAGS $$QMAKE_CXXFLAGS_RELEASE\" libleveldb.a libmemenv.a && $$QMAKE_RANLIB $$PWD/src/leveldb/libleveldb.a && $$QMAKE_RANLIB $$PWD/src/leveldb/libmemenv.a
++ genleveldb.commands = cd $$PWD/src/leveldb && CC=$$QMAKE_CC CXX=$$QMAKE_CXX TARGET_OS=OS_WINDOWS_CROSSCOMPILE $(MAKE) OPT=\"$$QMAKE_CXXFLAGS $$QMAKE_CXXFLAGS_RELEASE\" libleveldb.a && $$QMAKE_RANLIB $$PWD/src/leveldb/libleveldb.a
+ }
+ genleveldb.target = $$PWD/src/leveldb/libleveldb.a
+ genleveldb.depends = FORCE
+ PRE_TARGETDEPS += $$PWD/src/leveldb/libleveldb.a
+ QMAKE_EXTRA_TARGETS += genleveldb
++}
+ # Gross ugly hack that depends on qmake internals, unfortunately there is no other way to do it.
+-QMAKE_CLEAN += $$PWD/src/leveldb/libleveldb.a; cd $$PWD/src/leveldb ; $(MAKE) clean
++QMAKE_CLEAN += $$PWD/src/leveldb/libleveldb.a; cd $$PWD/src/leveldb && $(MAKE) clean || true
+
+ # regenerate src/build.h
+ !win32|contains(USE_BUILD_INFO, 1) {
+diff -Naur primecoin-0.1.2-linux.orig/src/src/leveldb.cpp primecoin-0.1.2-linux/src/src/leveldb.cpp
+--- primecoin-0.1.2-linux.orig/src/src/leveldb.cpp 2013-08-05 08:37:20.000000000 -0400
++++ primecoin-0.1.2-linux/src/src/leveldb.cpp 2013-11-30 16:41:25.632773774 -0500
+@@ -8,7 +8,9 @@
+ #include <leveldb/env.h>
+ #include <leveldb/cache.h>
+ #include <leveldb/filter_policy.h>
+-#include <memenv/memenv.h>
++#ifndef LEVELDB_WITHOUT_MEMENV
++#include <memenv.h>
++#endif
+
+ #include <boost/filesystem.hpp>
+
+@@ -43,8 +45,12 @@
+ options = GetOptions(nCacheSize);
+ options.create_if_missing = true;
+ if (fMemory) {
++#ifndef LEVELDB_WITHOUT_MEMENV
+ penv = leveldb::NewMemEnv(leveldb::Env::Default());
+ options.env = penv;
++#else
++ throw std::runtime_error("CLevelDB(): compiled without memenv support");
++#endif
+ } else {
+ if (fWipe) {
+ printf("Wiping LevelDB in %s\n", path.string().c_str());
+diff -Naur primecoin-0.1.2-linux.orig/src/src/makefile.unix primecoin-0.1.2-linux/src/src/makefile.unix
+--- primecoin-0.1.2-linux.orig/src/src/makefile.unix 2013-08-05 08:37:21.000000000 -0400
++++ primecoin-0.1.2-linux/src/src/makefile.unix 2013-11-30 17:20:06.545854617 -0500
+@@ -111,8 +111,7 @@
+ # adds some defaults in front. Unfortunately, LDFLAGS=... $(LDFLAGS) does not work.
+ xLDFLAGS=$(LDHARDENING) $(LDFLAGS)
+
+-OBJS= \
+- leveldb/libleveldb.a \
++BASEOBJS := \
+ obj/alert.o \
+ obj/version.o \
+ obj/checkpoints.o \
+@@ -121,7 +120,6 @@
+ obj/crypter.o \
+ obj/key.o \
+ obj/db.o \
+- obj/init.o \
+ obj/keystore.o \
+ obj/main.o \
+ obj/net.o \
+@@ -141,25 +139,44 @@
+ obj/hash.o \
+ obj/bloom.o \
+ obj/noui.o \
+- obj/leveldb.o \
+ obj/txdb.o \
+ obj/prime.o \
+ obj/checkpointsync.o
+
++OBJS := \
++ obj/leveldb.o \
++ obj/init.o \
++ $(BASEOBJS)
++
++TESTOBJS := \
++ obj-test/leveldb.o \
++ $(patsubst test/%.cpp,obj-test/%.o,$(wildcard test/*.cpp)) \
++ $(BASEOBJS)
++
+ all: primecoind
+
+ test check: test_primecoin FORCE
+ ./test_primecoin
+
++ifdef USE_SYSTEM_LEVELDB
++ LIBS += -lleveldb
++ TESTLIBS += -lmemenv
++else
+ #
+ # LevelDB support
+ #
+ MAKEOVERRIDES =
+-LIBS += $(CURDIR)/leveldb/libleveldb.a $(CURDIR)/leveldb/libmemenv.a
++LIBS += $(CURDIR)/leveldb/libleveldb.a
++TESTLIBS += $(CURDIR)/leveldb/libmemenv.a
+ DEFS += $(addprefix -I,$(CURDIR)/leveldb/include)
+ DEFS += $(addprefix -I,$(CURDIR)/leveldb/helpers)
+ leveldb/libleveldb.a:
+- @echo "Building LevelDB ..." && cd leveldb && $(MAKE) CC=$(CC) CXX=$(CXX) OPT="$(xCXXFLAGS)" libleveldb.a libmemenv.a && cd ..
++ @echo "Building LevelDB ..." && cd leveldb && $(MAKE) CC=$(CC) CXX=$(CXX) OPT="$(xCXXFLAGS)" libleveldb.a && cd ..
++leveldb/libmemenv.a:
++ @echo "Building LevelDB memenv ..." && cd leveldb && $(MAKE) CC=$(CC) CXX=$(CXX) OPT="$(xCXXFLAGS)" libmemenv.a && cd ..
++OBJS += leveldb/libleveldb.a
++TESTOBJS += leveldb/libmemenv.a
++endif
+
+ # auto-generated dependencies:
+ -include obj/*.P
+@@ -170,24 +187,22 @@
+ version.cpp: obj/build.h
+ DEFS += -DHAVE_BUILD_INFO
+
+-obj/%.o: %.cpp
+- $(CXX) -c $(xCXXFLAGS) -MMD -MF $(@:%.o=%.d) -o $@ $<
++P_TO_D = \
+ @cp $(@:%.o=%.d) $(@:%.o=%.P); \
+- sed -e 's/#.*//' -e 's/^[^:]*: *//' -e 's/ *\\$$//' \
++ sed -e 's/\#.*//' -e 's/^[^:]*: *//' -e 's/ *\\$$//' \
+ -e '/^$$/ d' -e 's/$$/ :/' < $(@:%.o=%.d) >> $(@:%.o=%.P); \
+ rm -f $(@:%.o=%.d)
+
+-primecoind: $(OBJS:obj/%=obj/%)
+- $(LINK) $(xCXXFLAGS) -o $@ $^ $(xLDFLAGS) $(LIBS)
++obj/%.o: %.cpp
++ $(CXX) -c $(xCXXFLAGS) -DLEVELDB_WITHOUT_MEMENV -MMD -MF $(@:%.o=%.d) -o $@ $<
++ $(P_TO_D)
+
+-TESTOBJS := $(patsubst test/%.cpp,obj-test/%.o,$(wildcard test/*.cpp))
++primecoind: $(OBJS)
++ $(LINK) $(xCXXFLAGS) -o $@ $^ $(xLDFLAGS) $(LIBS)
+
+ obj-test/%.o: test/%.cpp
+- $(CXX) -c $(TESTDEFS) $(xCXXFLAGS) -MMD -MF $(@:%.o=%.d) -o $@ $<
+- @cp $(@:%.o=%.d) $(@:%.o=%.P); \
+- sed -e 's/#.*//' -e 's/^[^:]*: *//' -e 's/ *\\$$//' \
+- -e '/^$$/ d' -e 's/$$/ :/' < $(@:%.o=%.d) >> $(@:%.o=%.P); \
+- rm -f $(@:%.o=%.d)
++ $(CXX) -c $(xCXXFLAGS) -DLEVELDB_WITHOUT_MEMENV -MMD -MF $(@:%.o=%.d) -o $@ $<
++ $(P_TO_D)
+
+ test_primecoin: $(TESTOBJS) $(filter-out obj/init.o,$(OBJS:obj/%=obj/%))
+ $(LINK) $(xCXXFLAGS) -o $@ $(LIBPATHS) $^ $(TESTLIBS) $(xLDFLAGS) $(LIBS)
diff --git a/net-p2p/primecoin-qt/metadata.xml b/net-p2p/primecoin-qt/metadata.xml
new file mode 100644
index 00000000000..b57a9d926e7
--- /dev/null
+++ b/net-p2p/primecoin-qt/metadata.xml
@@ -0,0 +1,14 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+ <maintainer>
+ <email>blueness@gentoo.org</email>
+ <name>Anthony G. Basile</name>
+ </maintainer>
+ <use>
+ <flag name="qrcode">Enable generation of QR Codes for receiving payments</flag>
+ </use>
+ <upstream>
+ <remote-id type="sourceforge">primecoin</remote-id>
+ </upstream>
+</pkgmetadata>
diff --git a/net-p2p/primecoin-qt/primecoin-qt-0.1.2-r1.ebuild b/net-p2p/primecoin-qt/primecoin-qt-0.1.2-r1.ebuild
new file mode 100644
index 00000000000..768aba01d6f
--- /dev/null
+++ b/net-p2p/primecoin-qt/primecoin-qt-0.1.2-r1.ebuild
@@ -0,0 +1,144 @@
+# Copyright 1999-2014 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=5
+
+DB_VER="4.8"
+
+LANGS="af_ZA ar bg bs ca_ES ca cs cy da de el_GR en eo es_CL es et eu_ES fa_IR fa fi fr_CA fr gu_IN he hi_IN hr hu it ja la lt lv_LV nb nl pl pt_BR pt_PT ro_RO ru sk sr sv th_TH tr uk zh_CN zh_TW"
+
+inherit db-use eutils fdo-mime gnome2-utils kde4-functions qt4-r2
+
+MyPV="${PV/_/-}"
+MyPN="primecoin"
+MyP="${MyPN}-${MyPV}"
+
+DESCRIPTION="Cryptocurrency forked from Bitcoin which aims to be energy efficiency"
+HOMEPAGE="http://primecoin.org/"
+SRC_URI="mirror://sourceforge/${MyPN}/${MyP}-linux.tar.gz -> ${MyP}.tar.gz"
+
+LICENSE="MIT ISC GPL-3 LGPL-2.1 public-domain || ( CC-BY-SA-3.0 LGPL-2.1 )"
+SLOT="0"
+KEYWORDS="~amd64 ~x86"
+IUSE="dbus ipv6 kde +qrcode upnp"
+
+RDEPEND="
+ dev-libs/boost[threads(+)]
+ dev-libs/openssl:0[-bindist]
+ qrcode? (
+ media-gfx/qrencode
+ )
+ upnp? (
+ net-libs/miniupnpc
+ )
+ sys-libs/db:$(db_ver_to_slot "${DB_VER}")[cxx]
+ <=dev-libs/leveldb-1.12.0[-snappy]
+ dev-qt/qtgui:4
+ dbus? (
+ dev-qt/qtdbus:4
+ )
+"
+DEPEND="${RDEPEND}
+ >=app-shells/bash-4.1
+"
+
+DOCS="doc/README.md doc/release-notes.md"
+
+S="${WORKDIR}/${MyP}-linux/src"
+
+src_prepare() {
+ epatch "${FILESDIR}"/${MyPN}-sys_leveldb.patch
+ rm -r src/leveldb
+
+ cd src || die
+
+ local filt= yeslang= nolang=
+
+ for lan in $LANGS; do
+ if [ ! -e qt/locale/bitcoin_$lan.ts ]; then
+ ewarn "Language '$lan' no longer supported. Ebuild needs update."
+ fi
+ done
+
+ for ts in $(ls qt/locale/*.ts)
+ do
+ x="${ts/*bitcoin_/}"
+ x="${x/.ts/}"
+ if ! use "linguas_$x"; then
+ nolang="$nolang $x"
+ rm "$ts"
+ filt="$filt\\|$x"
+ else
+ yeslang="$yeslang $x"
+ fi
+ done
+
+ filt="bitcoin_\\(${filt:2}\\)\\.\(qm\|ts\)"
+ sed "/${filt}/d" -i 'qt/bitcoin.qrc'
+ einfo "Languages -- Enabled:$yeslang -- Disabled:$nolang"
+}
+
+src_configure() {
+ OPTS=()
+
+ use dbus && OPTS+=("USE_DBUS=1")
+ if use upnp; then
+ OPTS+=("USE_UPNP=1")
+ else
+ OPTS+=("USE_UPNP=-")
+ fi
+
+ use qrcode && OPTS+=("USE_QRCODE=1")
+ use ipv6 || OPTS+=("USE_IPV6=-")
+
+ OPTS+=("USE_SYSTEM_LEVELDB=1")
+ OPTS+=("BDB_INCLUDE_PATH=$(db_includedir "${DB_VER}")")
+ OPTS+=("BDB_LIB_SUFFIX=-${DB_VER}")
+
+ if has_version '>=dev-libs/boost-1.52'; then
+ OPTS+=("LIBS+=-lboost_chrono\$\$BOOST_LIB_SUFFIX")
+ fi
+
+ #The primecoin codebase is mostly taken from bitcoin-qt
+ eqmake4 bitcoin-qt.pro "${OPTS[@]}"
+}
+
+#Tests are broken
+#src_test() {
+# cd src || die
+# emake -f makefile.unix "${OPTS[@]}" test_primecoin
+# ./test_primecoin || die 'Tests failed'
+#}
+
+src_install() {
+ qt4-r2_src_install
+
+ dobin ${PN}
+
+ insinto /usr/share/pixmaps
+ newins "share/pixmaps/primecoin.ico" "${PN}.ico"
+
+ make_desktop_entry "${PN} %u" "Primecoin-Qt" "/usr/share/pixmaps/${PN}.ico" "Qt;Network;P2P;Office;Finance;" "MimeType=x-scheme-handler/primecoin;\nTerminal=false"
+
+ newman contrib/debian/manpages/bitcoin-qt.1 ${PN}.1
+
+ if use kde; then
+ insinto /usr/share/kde4/services
+ newins contrib/debian/bitcoin-qt.protocol ${PN}.protocol
+ fi
+}
+
+update_caches() {
+ gnome2_icon_cache_update
+ fdo-mime_desktop_database_update
+ buildsycoca
+}
+
+pkg_postinst() {
+ update_caches
+}
+
+pkg_postrm() {
+ update_caches
+}
diff --git a/net-p2p/primecoind/Manifest b/net-p2p/primecoind/Manifest
new file mode 100644
index 00000000000..51e38c8436f
--- /dev/null
+++ b/net-p2p/primecoind/Manifest
@@ -0,0 +1 @@
+DIST primecoin-0.1.2.tar.gz 16521236 SHA256 d0f3c6a91b4d505f25e9284bcca85e420cf09d0e6cf71e5a001b7e1367ef46d0 SHA512 cff71b0e6459c4e534e78acef9491090d05c0cb864a068c0a3cb289310a1ee13fd69c7b61a7d6cb9732af54fbcf1fa4e77db8c8528a09bbdafd36421fdf7aff1 WHIRLPOOL 5031efa135dcf08975a06a037179863ad180920e0c55e0ec5d1863b4b24d005ce829fa0e0f081120d3610bc0abd1d3919db477a33e32ec6d0d353b7177480eb1
diff --git a/net-p2p/primecoind/files/primecoin-sys_leveldb.patch b/net-p2p/primecoind/files/primecoin-sys_leveldb.patch
new file mode 100644
index 00000000000..39d0aa63fb7
--- /dev/null
+++ b/net-p2p/primecoind/files/primecoin-sys_leveldb.patch
@@ -0,0 +1,176 @@
+diff -Naur primecoin-0.1.2-linux.orig/src/bitcoin-qt.pro primecoin-0.1.2-linux/src/bitcoin-qt.pro
+--- primecoin-0.1.2-linux.orig/src/bitcoin-qt.pro 2013-08-05 08:37:14.000000000 -0400
++++ primecoin-0.1.2-linux/src/bitcoin-qt.pro 2013-11-30 16:39:48.464770389 -0500
+@@ -4,7 +4,7 @@
+ VERSION = 0.8.3
+ INCLUDEPATH += src src/json src/qt
+ QT += network
+-DEFINES += QT_GUI BOOST_THREAD_USE_LIB BOOST_SPIRIT_THREADSAFE
++DEFINES += QT_GUI BOOST_THREAD_USE_LIB BOOST_SPIRIT_THREADSAFE LEVELDB_WITHOUT_MEMENV
+ CONFIG += no_include_pwd
+ CONFIG += thread
+
+@@ -98,25 +98,29 @@
+ QTPLUGIN += qcncodecs qjpcodecs qtwcodecs qkrcodecs qtaccessiblewidgets
+ }
+
++contains(USE_SYSTEM_LEVELDB, 1) {
++ LIBS += -lleveldb
++} else {
+ INCLUDEPATH += src/leveldb/include src/leveldb/helpers
+-LIBS += $$PWD/src/leveldb/libleveldb.a $$PWD/src/leveldb/libmemenv.a
++LIBS += $$PWD/src/leveldb/libleveldb.a
+ !win32 {
+ # we use QMAKE_CXXFLAGS_RELEASE even without RELEASE=1 because we use RELEASE to indicate linking preferences not -O preferences
+- genleveldb.commands = cd $$PWD/src/leveldb && CC=$$QMAKE_CC CXX=$$QMAKE_CXX $(MAKE) OPT=\"$$QMAKE_CXXFLAGS $$QMAKE_CXXFLAGS_RELEASE\" libleveldb.a libmemenv.a
++ genleveldb.commands = cd $$PWD/src/leveldb && CC=$$QMAKE_CC CXX=$$QMAKE_CXX $(MAKE) OPT=\"$$QMAKE_CXXFLAGS $$QMAKE_CXXFLAGS_RELEASE\" libleveldb.a
+ } else {
+ # make an educated guess about what the ranlib command is called
+ isEmpty(QMAKE_RANLIB) {
+ QMAKE_RANLIB = $$replace(QMAKE_STRIP, strip, ranlib)
+ }
+ LIBS += -lshlwapi
+- genleveldb.commands = cd $$PWD/src/leveldb && CC=$$QMAKE_CC CXX=$$QMAKE_CXX TARGET_OS=OS_WINDOWS_CROSSCOMPILE $(MAKE) OPT=\"$$QMAKE_CXXFLAGS $$QMAKE_CXXFLAGS_RELEASE\" libleveldb.a libmemenv.a && $$QMAKE_RANLIB $$PWD/src/leveldb/libleveldb.a && $$QMAKE_RANLIB $$PWD/src/leveldb/libmemenv.a
++ genleveldb.commands = cd $$PWD/src/leveldb && CC=$$QMAKE_CC CXX=$$QMAKE_CXX TARGET_OS=OS_WINDOWS_CROSSCOMPILE $(MAKE) OPT=\"$$QMAKE_CXXFLAGS $$QMAKE_CXXFLAGS_RELEASE\" libleveldb.a && $$QMAKE_RANLIB $$PWD/src/leveldb/libleveldb.a
+ }
+ genleveldb.target = $$PWD/src/leveldb/libleveldb.a
+ genleveldb.depends = FORCE
+ PRE_TARGETDEPS += $$PWD/src/leveldb/libleveldb.a
+ QMAKE_EXTRA_TARGETS += genleveldb
++}
+ # Gross ugly hack that depends on qmake internals, unfortunately there is no other way to do it.
+-QMAKE_CLEAN += $$PWD/src/leveldb/libleveldb.a; cd $$PWD/src/leveldb ; $(MAKE) clean
++QMAKE_CLEAN += $$PWD/src/leveldb/libleveldb.a; cd $$PWD/src/leveldb && $(MAKE) clean || true
+
+ # regenerate src/build.h
+ !win32|contains(USE_BUILD_INFO, 1) {
+diff -Naur primecoin-0.1.2-linux.orig/src/src/leveldb.cpp primecoin-0.1.2-linux/src/src/leveldb.cpp
+--- primecoin-0.1.2-linux.orig/src/src/leveldb.cpp 2013-08-05 08:37:20.000000000 -0400
++++ primecoin-0.1.2-linux/src/src/leveldb.cpp 2013-11-30 16:41:25.632773774 -0500
+@@ -8,7 +8,9 @@
+ #include <leveldb/env.h>
+ #include <leveldb/cache.h>
+ #include <leveldb/filter_policy.h>
+-#include <memenv/memenv.h>
++#ifndef LEVELDB_WITHOUT_MEMENV
++#include <memenv.h>
++#endif
+
+ #include <boost/filesystem.hpp>
+
+@@ -43,8 +45,12 @@
+ options = GetOptions(nCacheSize);
+ options.create_if_missing = true;
+ if (fMemory) {
++#ifndef LEVELDB_WITHOUT_MEMENV
+ penv = leveldb::NewMemEnv(leveldb::Env::Default());
+ options.env = penv;
++#else
++ throw std::runtime_error("CLevelDB(): compiled without memenv support");
++#endif
+ } else {
+ if (fWipe) {
+ printf("Wiping LevelDB in %s\n", path.string().c_str());
+diff -Naur primecoin-0.1.2-linux.orig/src/src/makefile.unix primecoin-0.1.2-linux/src/src/makefile.unix
+--- primecoin-0.1.2-linux.orig/src/src/makefile.unix 2013-08-05 08:37:21.000000000 -0400
++++ primecoin-0.1.2-linux/src/src/makefile.unix 2013-11-30 17:20:06.545854617 -0500
+@@ -111,8 +111,7 @@
+ # adds some defaults in front. Unfortunately, LDFLAGS=... $(LDFLAGS) does not work.
+ xLDFLAGS=$(LDHARDENING) $(LDFLAGS)
+
+-OBJS= \
+- leveldb/libleveldb.a \
++BASEOBJS := \
+ obj/alert.o \
+ obj/version.o \
+ obj/checkpoints.o \
+@@ -121,7 +120,6 @@
+ obj/crypter.o \
+ obj/key.o \
+ obj/db.o \
+- obj/init.o \
+ obj/keystore.o \
+ obj/main.o \
+ obj/net.o \
+@@ -141,25 +139,44 @@
+ obj/hash.o \
+ obj/bloom.o \
+ obj/noui.o \
+- obj/leveldb.o \
+ obj/txdb.o \
+ obj/prime.o \
+ obj/checkpointsync.o
+
++OBJS := \
++ obj/leveldb.o \
++ obj/init.o \
++ $(BASEOBJS)
++
++TESTOBJS := \
++ obj-test/leveldb.o \
++ $(patsubst test/%.cpp,obj-test/%.o,$(wildcard test/*.cpp)) \
++ $(BASEOBJS)
++
+ all: primecoind
+
+ test check: test_primecoin FORCE
+ ./test_primecoin
+
++ifdef USE_SYSTEM_LEVELDB
++ LIBS += -lleveldb
++ TESTLIBS += -lmemenv
++else
+ #
+ # LevelDB support
+ #
+ MAKEOVERRIDES =
+-LIBS += $(CURDIR)/leveldb/libleveldb.a $(CURDIR)/leveldb/libmemenv.a
++LIBS += $(CURDIR)/leveldb/libleveldb.a
++TESTLIBS += $(CURDIR)/leveldb/libmemenv.a
+ DEFS += $(addprefix -I,$(CURDIR)/leveldb/include)
+ DEFS += $(addprefix -I,$(CURDIR)/leveldb/helpers)
+ leveldb/libleveldb.a:
+- @echo "Building LevelDB ..." && cd leveldb && $(MAKE) CC=$(CC) CXX=$(CXX) OPT="$(xCXXFLAGS)" libleveldb.a libmemenv.a && cd ..
++ @echo "Building LevelDB ..." && cd leveldb && $(MAKE) CC=$(CC) CXX=$(CXX) OPT="$(xCXXFLAGS)" libleveldb.a && cd ..
++leveldb/libmemenv.a:
++ @echo "Building LevelDB memenv ..." && cd leveldb && $(MAKE) CC=$(CC) CXX=$(CXX) OPT="$(xCXXFLAGS)" libmemenv.a && cd ..
++OBJS += leveldb/libleveldb.a
++TESTOBJS += leveldb/libmemenv.a
++endif
+
+ # auto-generated dependencies:
+ -include obj/*.P
+@@ -170,24 +187,22 @@
+ version.cpp: obj/build.h
+ DEFS += -DHAVE_BUILD_INFO
+
+-obj/%.o: %.cpp
+- $(CXX) -c $(xCXXFLAGS) -MMD -MF $(@:%.o=%.d) -o $@ $<
++P_TO_D = \
+ @cp $(@:%.o=%.d) $(@:%.o=%.P); \
+- sed -e 's/#.*//' -e 's/^[^:]*: *//' -e 's/ *\\$$//' \
++ sed -e 's/\#.*//' -e 's/^[^:]*: *//' -e 's/ *\\$$//' \
+ -e '/^$$/ d' -e 's/$$/ :/' < $(@:%.o=%.d) >> $(@:%.o=%.P); \
+ rm -f $(@:%.o=%.d)
+
+-primecoind: $(OBJS:obj/%=obj/%)
+- $(LINK) $(xCXXFLAGS) -o $@ $^ $(xLDFLAGS) $(LIBS)
++obj/%.o: %.cpp
++ $(CXX) -c $(xCXXFLAGS) -DLEVELDB_WITHOUT_MEMENV -MMD -MF $(@:%.o=%.d) -o $@ $<
++ $(P_TO_D)
+
+-TESTOBJS := $(patsubst test/%.cpp,obj-test/%.o,$(wildcard test/*.cpp))
++primecoind: $(OBJS)
++ $(LINK) $(xCXXFLAGS) -o $@ $^ $(xLDFLAGS) $(LIBS)
+
+ obj-test/%.o: test/%.cpp
+- $(CXX) -c $(TESTDEFS) $(xCXXFLAGS) -MMD -MF $(@:%.o=%.d) -o $@ $<
+- @cp $(@:%.o=%.d) $(@:%.o=%.P); \
+- sed -e 's/#.*//' -e 's/^[^:]*: *//' -e 's/ *\\$$//' \
+- -e '/^$$/ d' -e 's/$$/ :/' < $(@:%.o=%.d) >> $(@:%.o=%.P); \
+- rm -f $(@:%.o=%.d)
++ $(CXX) -c $(xCXXFLAGS) -DLEVELDB_WITHOUT_MEMENV -MMD -MF $(@:%.o=%.d) -o $@ $<
++ $(P_TO_D)
+
+ test_primecoin: $(TESTOBJS) $(filter-out obj/init.o,$(OBJS:obj/%=obj/%))
+ $(LINK) $(xCXXFLAGS) -o $@ $(LIBPATHS) $^ $(TESTLIBS) $(xLDFLAGS) $(LIBS)
diff --git a/net-p2p/primecoind/files/primecoin.conf b/net-p2p/primecoind/files/primecoin.conf
new file mode 100644
index 00000000000..c6a55f3d913
--- /dev/null
+++ b/net-p2p/primecoind/files/primecoin.conf
@@ -0,0 +1,8 @@
+# http://www.bitcoin.org/smf/index.php?topic=644.0
+#rpcuser=
+#rpcpassword=
+
+
+
+
+
diff --git a/net-p2p/primecoind/files/primecoin.confd b/net-p2p/primecoind/files/primecoin.confd
new file mode 100644
index 00000000000..6dd0defc0ce
--- /dev/null
+++ b/net-p2p/primecoind/files/primecoin.confd
@@ -0,0 +1,10 @@
+# Config file for /etc/init.d/primecoind
+
+# owner of primeciond process (don't change, must be existing)
+PRIMECOIN_USER="primecoin"
+
+# See http://www.bitcoin.org/smf/index.php?topic=1063
+PRIMECOIN_OPTS="${PRIMECOIN_OPTS}"
+
+# nice level
+NICELEVEL="19"
diff --git a/net-p2p/primecoind/files/primecoin.initd b/net-p2p/primecoind/files/primecoin.initd
new file mode 100644
index 00000000000..a821c3771fd
--- /dev/null
+++ b/net-p2p/primecoind/files/primecoin.initd
@@ -0,0 +1,104 @@
+#!/sbin/runscript
+# Distributed under the terms of the GNU General Public License, v2 or later
+
+VARDIR="/var/lib/primecoin"
+CONFFILE="${VARDIR}/.primecoin/primecoin.conf"
+
+depend() {
+ need net
+}
+
+checkconfig() {
+ if [[ "${PRIMECOIN_USER}" == "" ]] ; then
+ eerror "Please edit /etc/conf.d/primecoind"
+ eerror "A user must be specified to run primecoind as that user."
+ eerror "Modify USER to your needs (you may also add a group after a colon)"
+ return 1
+ fi
+ if ! `getent passwd | cut -d ':' -f 1 | grep $( echo "${PRIMECOIN_USER}" | cut -d ':' -f 1 ) -sq` ; then
+ eerror "Please edit /etc/conf.d/primecoind"
+ eerror "Specified user must exist!"
+ return 1
+ fi
+ if `echo "${PRIMECOIN_USER}" | grep ':' -sq` ; then
+ if ! `cut -d ':' -f 1 /etc/group | grep $( echo "${PRIMECOIN_USER}" | cut -d ':' -f 2 ) -sq` ; then
+ eerror "Please edit /etc/conf.d/primecoind"
+ eerror "Specified group must exist!"
+ return 1
+ fi
+ fi
+ if ! grep -q '^rpcpassword=' "${CONFFILE}"; then
+ eerror "Please edit `readlink -f ${CONFFILE}`"
+ eerror "There must be at least a line assigning rpcpassword=something-secure"
+ return 1
+ fi
+ if ! stat -Lc '%a' "${CONFFILE}" | grep -q '^[4567]00$'; then
+ eerror "`readlink -f ${CONFFILE}` should not be readable by other users"
+ return 1
+ fi
+ return 0
+}
+
+start() {
+ checkconfig || return 1
+ ebegin "Starting Primecoind daemon"
+
+ pkg-config openrc
+ if [ $? = 0 ]; then
+ start_openrc
+ else
+ start_baselayout
+ fi
+}
+
+stop() {
+ ebegin "Stopping Primecoin daemon"
+
+ pkg-config openrc
+ if [ $? = 0 ]; then
+ stop_openrc
+ else
+ stop_baselayout
+ fi
+}
+
+start_openrc() {
+ start-stop-daemon \
+ --start --user "${PRIMECOIN_USER}" --name primecoind \
+ --pidfile /var/run/primecoind.pid --make-pidfile \
+ --env HOME="${VARDIR}" --exec /usr/bin/primecoind \
+ --nicelevel "${NICELEVEL}" \
+ --background \
+ --wait 2000 \
+ -- ${PRIMECOIN_OPTS}
+ eend $?
+}
+
+stop_openrc() {
+ start-stop-daemon --stop --user "${PRIMECOIN_USER}" \
+ --name primecoind --pidfile /var/run/primecoind.pid \
+ --wait 30000 \
+ --progress
+ eend $?
+}
+
+start_baselayout() {
+ start-stop-daemon \
+ --start --user "${PRIMECOIN_USER}" --name primecoind \
+ --pidfile /var/run/primecoind.pid --make-pidfile \
+ --env HOME="${VARDIR}" --exec /usr/bin/primecoind \
+ --chuid "${PRIMECOIN_USER}" \
+ --nicelevel "${NICELEVEL}" \
+ --background \
+ -- ${PRIMECOIN_OPTS}
+ eend $?
+}
+
+stop_baselayout() {
+ start-stop-daemon \
+ --stop \
+ --user "${PRIMECOIN_USER}" \
+ --name primecoind \
+ --pidfile /var/run/primecoind.pid
+ eend $?
+}
diff --git a/net-p2p/primecoind/files/primecoin.initd-r1 b/net-p2p/primecoind/files/primecoin.initd-r1
new file mode 100644
index 00000000000..de80df26c37
--- /dev/null
+++ b/net-p2p/primecoind/files/primecoin.initd-r1
@@ -0,0 +1,29 @@
+#!/sbin/runscript
+# Copyright 1999-2014 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+vardir="/var/lib/primecoin"
+conffile="${vardir}/.primecoin/primecoin.conf"
+primecoind_user="${PRIMECOIN_USER:-nobody:nobody}"
+
+description="Bitcoin crypto-currency wallet for automated services"
+pidfile="/run/${SVCNAME}.pid"
+command="/usr/bin/primecoind"
+command_args="${PRIMECOIN_OPTS}"
+command_background="true"
+start_stop_daemon_args="-u ${primecoind_user} -e HOME=${vardir} -N ${NICELEVEL:-0} -w 2000"
+
+depend() {
+ need net
+}
+
+start_pre() {
+ checkpath -f -o ${primecoind_user} -m 0400 ${conffile} || return 1
+
+ if ! grep -q '^rpcpassword=' "${conffile}"; then
+ eerror "Please edit `readlink -f ${conffile}`"
+ eerror "There must be at least a line assigning rpcpassword=something-secure"
+ return 1
+ fi
+}
diff --git a/net-p2p/primecoind/files/primecoin.service b/net-p2p/primecoind/files/primecoin.service
new file mode 100644
index 00000000000..8fd2ecaba5a
--- /dev/null
+++ b/net-p2p/primecoind/files/primecoin.service
@@ -0,0 +1,30 @@
+# It's not recommended to modify this file in-place, because it will be
+# overwritten during package upgrades. If you want to customize, the
+# best way is to create file
+# "/etc/systemd/system/primecoind.service.d/*.conf"
+# containing your changes
+
+# For example, if you want to change some daemon and/or unit options,
+# create a file named
+# "/etc/systemd/system/primecoind.service.d/myopts.conf"
+# containing:
+# [Service]
+# Environment="PRIMECOIN_OPTS=-debug -logtimestamps"
+# Nice=10
+# This will override the setting appearing below.
+
+# Note that almost all daemon options could be specified in
+# /etc/primecoin/primecoin.conf
+
+[Unit]
+Description=Primecoin Daemon
+After=network.target
+
+[Service]
+User=primecoin
+Environment=PRIMECOIN_OPTS=
+ExecStart=/usr/bin/primecoind -daemon=0 $PRIMECOIN_OPTS
+ExecReload=/bin/kill -HUP $MAINPID
+
+[Install]
+WantedBy=multi-user.target
diff --git a/net-p2p/primecoind/files/primecoind.logrotate b/net-p2p/primecoind/files/primecoind.logrotate
new file mode 100644
index 00000000000..84623c46f96
--- /dev/null
+++ b/net-p2p/primecoind/files/primecoind.logrotate
@@ -0,0 +1,7 @@
+/var/lib/primecoin/.primecoin/debug.lo