net-p2p/retroshare update development ebuild
[gentoo.git] / net-p2p / retroshare / retroshare-0.6.9999.ebuild
1 # Copyright 1999-2018 Gentoo Foundation
2 # Distributed under the terms of the GNU General Public License v2
3
4 EAPI=6
5
6 EGIT_REPO_URI="https://github.com/RetroShare/RetroShare.git"
7 inherit eutils git-r3 gnome2-utils qmake-utils versionator
8
9 DESCRIPTION="P2P private sharing application"
10 HOMEPAGE="http://retroshare.net"
11
12 # pegmarkdown can also be used with MIT
13 LICENSE="AGPL-3 GPL-2 GPL-3 Apache-2.0 LGPL-2.1"
14 SLOT="0"
15 KEYWORDS=""
16
17 IUSE="cli control-socket gnome-keyring +gui settings-api +sqlcipher +webui"
18 REQUIRED_USE="
19         || ( cli gui )
20         settings-api? ( || ( control-socket webui ) )"
21
22 RDEPEND="
23         app-arch/bzip2
24         dev-libs/openssl:0=
25         >=dev-libs/rapidjson-1.1.0
26         net-libs/libupnp:0=
27         sys-libs/zlib
28         control-socket? ( dev-qt/qtnetwork:5 )
29         gnome-keyring? ( gnome-base/libgnome-keyring )
30         gui? (
31                 dev-qt/qtcore:5
32                 dev-qt/qtmultimedia:5
33                 dev-qt/qtnetwork:5
34                 dev-qt/qtprintsupport:5
35                 dev-qt/qtscript:5
36                 dev-qt/qtxml:5
37                 dev-qt/qtgui:5
38                 dev-qt/qtwidgets:5
39                 dev-qt/qtx11extras:5
40                 x11-libs/libX11
41                 x11-libs/libXScrnSaver
42         )
43         settings-api? ( dev-qt/qtcore:5 )
44         sqlcipher? ( dev-db/sqlcipher )
45         !sqlcipher? ( dev-db/sqlite:3 )
46         webui? ( net-libs/libmicrohttpd )"
47
48 DEPEND="${RDEPEND}
49         gui? ( dev-qt/designer:5 )
50         dev-qt/qtcore:5
51         virtual/pkgconfig
52 "
53
54 src_configure() {
55         local qConfigs=()
56
57         qConfigs+=( $(usex cli '' 'no_')retroshare_nogui )
58         qConfigs+=( $(usex control-socket '' 'no_')libresapilocalserver )
59         qConfigs+=( $(usex gnome-keyring '' 'no_')rs_autologin )
60         qConfigs+=( $(usex gui '' 'no_')retroshare_gui )
61         qConfigs+=( $(usex settings-api '' 'no_')libresapi_settings )
62         qConfigs+=( $(usex sqlcipher '' 'no_')sqlcipher )
63         qConfigs+=( $(usex webui '' 'no_')libresapihttpserver )
64
65         eqmake5 CONFIG+="${qConfigs[*]}"
66 }
67
68 src_install() {
69         use cli && dobin retroshare-nogui/src/retroshare-nogui
70         use gui && dobin retroshare-gui/src/retroshare
71
72         insinto /usr/share/retroshare
73         doins libbitdht/src/bitdht/bdboot.txt
74
75         use webui && doins -r libresapi/src/webui
76
77         dodoc README.md
78         make_desktop_entry retroshare
79
80         for i in 24 48 64 128 ; do
81                 doicon -s ${i} "data/${i}x${i}/apps/retroshare.png"
82         done
83 }
84
85 pkg_pretend() {
86         if ! use sqlcipher; then
87                 ewarn "You have disabled GXS database encryption, ${PN} will use SQLite"
88                 ewarn "instead of SQLCipher for GXS databases."
89                 ewarn "Builds using SQLite and builds using SQLCipher have incompatible"
90                 ewarn "database format, so you will need to manually delete GXS"
91                 ewarn "database (loosing all your GXS data and identities) when you"
92                 ewarn "toggle sqlcipher USE flag."
93         fi
94 }
95
96 pkg_preinst() {
97         local ver
98         for ver in ${REPLACING_VERSIONS}; do
99                 if ! version_is_at_least 0.5.9999 ${ver}; then
100                         ewarn "You are upgrading from Retroshare 0.5.* to ${PV}"
101                         ewarn "Version 0.6.* is backward-incompatible with 0.5 branch"
102                         ewarn "and clients with 0.6.* can not connect to clients that have 0.5.*"
103                         ewarn "It's recommended to drop all your configuration and either"
104                         ewarn "generate a new certificate or import existing from a backup"
105                         break
106                 fi
107                 if version_is_at_least 0.6.0 ${ver} && ! version_is_at_least 0.6.4 ${ver}; then
108                         elog "Main executable has been renamed upstream from RetroShare06 to retroshare"
109                         break
110                 fi
111         done
112 }
113
114 pkg_postinst() {
115         gnome2_icon_cache_update
116 }
117
118 pkg_postrm() {
119         gnome2_icon_cache_update
120 }