1 |
commit: 8c59488046d56db4e1a1cfbd86b979f91ac78e9e |
2 |
Author: Austin English <wizardedit <AT> gentoo <DOT> org> |
3 |
AuthorDate: Tue May 3 17:09:56 2016 +0000 |
4 |
Commit: Austin English <wizardedit <AT> gentoo <DOT> org> |
5 |
CommitDate: Tue May 3 17:21:38 2016 +0000 |
6 |
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=8c594880 |
7 |
|
8 |
net-p2p/mldonkey: use #!/sbin/openrc-run instead of #!/sbin/runscript |
9 |
|
10 |
Gentoo-Bug: https://bugs.gentoo.org/573846 |
11 |
|
12 |
Package-Manager: portage-2.2.26 |
13 |
|
14 |
net-p2p/mldonkey/files/mldonkey.initd | 2 +- |
15 |
net-p2p/mldonkey/mldonkey-3.1.5-r1.ebuild | 175 ++++++++++++++++++++++++++++++ |
16 |
2 files changed, 176 insertions(+), 1 deletion(-) |
17 |
|
18 |
diff --git a/net-p2p/mldonkey/files/mldonkey.initd b/net-p2p/mldonkey/files/mldonkey.initd |
19 |
index 7a007de..12dd599 100644 |
20 |
--- a/net-p2p/mldonkey/files/mldonkey.initd |
21 |
+++ b/net-p2p/mldonkey/files/mldonkey.initd |
22 |
@@ -1,4 +1,4 @@ |
23 |
-#!/sbin/runscript |
24 |
+#!/sbin/openrc-run |
25 |
|
26 |
extra_started_commands="reload slow fast info" |
27 |
|
28 |
|
29 |
diff --git a/net-p2p/mldonkey/mldonkey-3.1.5-r1.ebuild b/net-p2p/mldonkey/mldonkey-3.1.5-r1.ebuild |
30 |
new file mode 100644 |
31 |
index 0000000..7a35089 |
32 |
--- /dev/null |
33 |
+++ b/net-p2p/mldonkey/mldonkey-3.1.5-r1.ebuild |
34 |
@@ -0,0 +1,175 @@ |
35 |
+# Copyright 1999-2016 Gentoo Foundation |
36 |
+# Distributed under the terms of the GNU General Public License v2 |
37 |
+# $Id$ |
38 |
+ |
39 |
+EAPI="6" |
40 |
+WANT_AUTOCONF=2.5 |
41 |
+ |
42 |
+inherit flag-o-matic eutils autotools toolchain-funcs user |
43 |
+ |
44 |
+IUSE="bittorrent doc fasttrack gd gnutella gtk guionly magic +ocamlopt" |
45 |
+ |
46 |
+DESCRIPTION="A multi-network P2P application written in Ocaml, with its own Gtk GUI, web and telnet interface" |
47 |
+HOMEPAGE="http://mldonkey.sourceforge.net/" |
48 |
+SRC_URI="mirror://sourceforge/${PN}/${P}.tar.bz2" |
49 |
+ |
50 |
+LICENSE="GPL-2" |
51 |
+SLOT="0" |
52 |
+KEYWORDS="~alpha amd64 ~arm hppa ~ia64 ppc ~sparc x86 ~x86-fbsd" |
53 |
+ |
54 |
+RDEPEND="dev-lang/perl |
55 |
+ dev-ml/camlp4:= |
56 |
+ guionly? ( >=gnome-base/librsvg-2.4.0 |
57 |
+ >=dev-ml/lablgtk-2.6 ) |
58 |
+ gtk? ( >=gnome-base/librsvg-2.4.0 |
59 |
+ >=dev-ml/lablgtk-2.6[svg] ) |
60 |
+ gd? ( >=media-libs/gd-2.0.28[truetype] ) |
61 |
+ magic? ( sys-apps/file )" |
62 |
+ |
63 |
+DEPEND="${RDEPEND} |
64 |
+ >=dev-lang/ocaml-3.10.2[ocamlopt?]" |
65 |
+ |
66 |
+MLUSER="p2p" |
67 |
+ |
68 |
+pkg_setup() { |
69 |
+ if use gtk; then |
70 |
+ echo "" |
71 |
+ einfo "If the compile with gui fails, and you have updated Ocaml" |
72 |
+ einfo "recently, you may have forgotten that you need to run" |
73 |
+ einfo "/usr/portage/dev-lang/ocaml/files/ocaml-rebuild.sh" |
74 |
+ einfo "to learn which ebuilds you need to recompile" |
75 |
+ einfo "each time you update Ocaml to a different version" |
76 |
+ einfo "see the Ocaml ebuild for details" |
77 |
+ echo "" |
78 |
+ fi |
79 |
+ |
80 |
+ # dev-lang/ocaml creates its own objects but calls gcc for linking, which will |
81 |
+ # results in relocations if gcc wants to create a PIE executable |
82 |
+ if gcc-specs-pie ; then |
83 |
+ append-ldflags -nopie |
84 |
+ ewarn "Ocaml generates its own native asm, you're using a PIE compiler" |
85 |
+ ewarn "We have appended -nopie to ocaml build options" |
86 |
+ ewarn "because linking an executable with pie while the objects are not pic will not work" |
87 |
+ fi |
88 |
+} |
89 |
+ |
90 |
+src_prepare() { |
91 |
+ cd "${S}"/config |
92 |
+ eautoconf |
93 |
+ cd "${S}" |
94 |
+ use ocamlopt || sed -i -e "s/ocamlopt/idontwantocamlopt/g" "${S}/config/configure" || die "failed to disable ocamlopt" |
95 |
+ eapply "${FILESDIR}/ocaml4.patch" |
96 |
+ has_version '>=dev-lang/ocaml-4.03' && eapply "${FILESDIR}/ocaml-4.03.patch" |
97 |
+ |
98 |
+ default |
99 |
+} |
100 |
+ |
101 |
+src_configure() { |
102 |
+ # the dirs are not (yet) used, but it doesn't hurt to specify them anyway |
103 |
+ |
104 |
+ # onlygui Disable all nets support, build only chosen GUI |
105 |
+ |
106 |
+ if use gtk || use guionly; then |
107 |
+ myconf="--enable-gui=newgui2" |
108 |
+ else |
109 |
+ myconf="--disable-gui" |
110 |
+ fi |
111 |
+ |
112 |
+ if use guionly; then |
113 |
+ myconf="${myconf} --disable-multinet --disable-donkey" |
114 |
+ fi |
115 |
+ |
116 |
+ cd "${S}" |
117 |
+ |
118 |
+ local my_extra_libs |
119 |
+ if use gd; then |
120 |
+ my_extra_libs="-lpng" |
121 |
+ fi |
122 |
+ |
123 |
+ econf LIBS="${my_extra_libs}"\ |
124 |
+ --sysconfdir=/etc/mldonkey \ |
125 |
+ --sharedstatedir=/var/mldonkey \ |
126 |
+ --localstatedir=/var/mldonkey \ |
127 |
+ --enable-checks \ |
128 |
+ --disable-batch \ |
129 |
+ $(use_enable bittorrent) \ |
130 |
+ $(use_enable fasttrack) \ |
131 |
+ $(use_enable gnutella) \ |
132 |
+ $(use_enable gnutella gnutella2) \ |
133 |
+ $(use_enable gd) \ |
134 |
+ $(use_enable magic) \ |
135 |
+ ${myconf} |
136 |
+} |
137 |
+ |
138 |
+src_compile() { |
139 |
+ export OCAMLRUNPARAM="l=256M" |
140 |
+ emake |
141 |
+ |
142 |
+ if ! use guionly; then |
143 |
+ emake utils |
144 |
+ fi; |
145 |
+} |
146 |
+ |
147 |
+src_install() { |
148 |
+ local myext="" |
149 |
+ use ocamlopt || myext=".byte" |
150 |
+ use ocamlopt || export STRIP_MASK="*/bin/*" |
151 |
+ if ! use guionly; then |
152 |
+ for i in mlnet mld_hash get_range copysources subconv; do |
153 |
+ newbin $i$myext $i |
154 |
+ done |
155 |
+ use bittorrent && newbin make_torrent$myext make_torrent |
156 |
+ |
157 |
+ newconfd "${FILESDIR}/mldonkey.confd-2.8" mldonkey |
158 |
+ fperms 600 /etc/conf.d/mldonkey |
159 |
+ newinitd "${FILESDIR}/mldonkey.initd" mldonkey |
160 |
+ fi |
161 |
+ |
162 |
+ if use gtk; then |
163 |
+ for i in mlgui mlguistarter; do |
164 |
+ newbin $i$myext $i |
165 |
+ done |
166 |
+ make_desktop_entry mlgui "MLDonkey GUI" mldonkey "Network;P2P" |
167 |
+ newicon "${S}"/packages/rpm/mldonkey-icon-48.png ${PN}.png |
168 |
+ fi |
169 |
+ |
170 |
+ if use doc ; then |
171 |
+ cd "${S}"/distrib |
172 |
+ dodoc ChangeLog *.txt |
173 |
+ |
174 |
+ insinto /usr/share/doc/${PF}/scripts |
175 |
+ doins kill_mldonkey mldonkey_command mldonkey_previewer make_buginfo |
176 |
+ |
177 |
+ cd "${S}"/docs |
178 |
+ dodoc *.txt *.tex *.pdf |
179 |
+ dohtml *.html |
180 |
+ |
181 |
+ cd "${S}"/docs/developers |
182 |
+ dodoc *.txt *.tex |
183 |
+ |
184 |
+ cd "${S}"/docs/images |
185 |
+ insinto /usr/share/doc/${PF}/html/images |
186 |
+ doins * |
187 |
+ fi |
188 |
+} |
189 |
+ |
190 |
+pkg_preinst() { |
191 |
+ if ! use guionly; then |
192 |
+ enewuser ${MLUSER} -1 -1 /home/p2p users |
193 |
+ fi |
194 |
+} |
195 |
+ |
196 |
+pkg_postinst() { |
197 |
+ if ! use guionly; then |
198 |
+ echo |
199 |
+ einfo "If you want to start MLDonkey as a system service, use" |
200 |
+ einfo "the /etc/init.d/mldonkey script. To control bandwidth, use" |
201 |
+ einfo "the 'slow' and 'fast' arguments. Be sure to have a look at" |
202 |
+ einfo "/etc/conf.d/mldonkey also." |
203 |
+ echo |
204 |
+ else |
205 |
+ echo |
206 |
+ einfo "Simply run mlgui to start the chosen MLDonkey gui." |
207 |
+ einfo "It puts its config files into ~/.mldonkey" |
208 |
+ fi |
209 |
+} |