Gentoo Archives: gentoo-commits

From: Conrad Kostecki <conikost@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: sci-biology/foldingathome/
Date: Sun, 18 Jul 2021 18:42:42
Message-Id: 1626633734.d52cb3309baa6bfccc6bedb98c78b892bf71975d.conikost@gentoo
1 commit: d52cb3309baa6bfccc6bedb98c78b892bf71975d
2 Author: Conrad Kostecki <conikost <AT> gentoo <DOT> org>
3 AuthorDate: Sun Jul 18 18:20:08 2021 +0000
4 Commit: Conrad Kostecki <conikost <AT> gentoo <DOT> org>
5 CommitDate: Sun Jul 18 18:42:14 2021 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=d52cb330
7
8 sci-biology/foldingathome: migrate to GLEP 81
9
10 Bug: https://bugs.gentoo.org/781485
11 Package-Manager: Portage-3.0.20, Repoman-3.0.3
12 Signed-off-by: Conrad Kostecki <conikost <AT> gentoo.org>
13
14 .../foldingathome/foldingathome-7.6.13-r1.ebuild | 138 +++++++++++++++++++++
15 1 file changed, 138 insertions(+)
16
17 diff --git a/sci-biology/foldingathome/foldingathome-7.6.13-r1.ebuild b/sci-biology/foldingathome/foldingathome-7.6.13-r1.ebuild
18 new file mode 100644
19 index 00000000000..c45300719bf
20 --- /dev/null
21 +++ b/sci-biology/foldingathome/foldingathome-7.6.13-r1.ebuild
22 @@ -0,0 +1,138 @@
23 +# Copyright 1999-2021 Gentoo Authors
24 +# Distributed under the terms of the GNU General Public License v2
25 +
26 +EAPI=7
27 +
28 +inherit systemd
29 +
30 +DESCRIPTION="Folding@Home is a distributed computing project for protein folding"
31 +HOMEPAGE="https://foldingathome.org/"
32 +SRC_URI="https://download.foldingathome.org/releases/public/release/fahclient/centos-6.7-64bit/v$(ver_cut 1-2)/fahclient_${PV}-64bit-release.tar.bz2"
33 +S="${WORKDIR}/fahclient_${PV}-64bit-release"
34 +
35 +LICENSE="FAH-EULA-2014 FAH-special-permission"
36 +SLOT="0"
37 +KEYWORDS="~amd64"
38 +RESTRICT="mirror bindist strip"
39 +
40 +# Expressly listing all deps, as this is a binpkg and it is doubtful whether
41 +# i.e. uclibc or clang can provide what is necessary at runtime
42 +DEPEND="dev-util/patchelf"
43 +RDEPEND="
44 + acct-group/foldingathome
45 + acct-group/video
46 + acct-user/foldingathome
47 + app-arch/bzip2
48 + || (
49 + dev-libs/openssl-compat:1.0.0
50 + =dev-libs/openssl-1.0*:*
51 + )
52 + sys-devel/gcc
53 + sys-libs/glibc
54 + sys-libs/zlib
55 +"
56 +
57 +QA_PREBUILT="opt/foldingathome/*"
58 +
59 +pkg_setup() {
60 + elog ""
61 + elog "Special permission is hereby granted to the Gentoo project to provide an"
62 + elog "automated installer package which downloads and installs the Folding@home client"
63 + elog "software. Permission is also granted for future Gentoo installer packages on the"
64 + elog "condition that they continue to adhere to all of the terms of the accompanying"
65 + elog "Folding@home license agreements and display this notice."
66 + elog "-- Vijay S. Pande, Stanford University, 07 May 2013"
67 + elog ""
68 + elog "(ref: http://foldingforum.org/viewtopic.php?f=16&t=22524&p=241992#p241992 )"
69 + elog ""
70 +}
71 +
72 +src_install() {
73 + patchelf --set-rpath "${EPREFIX}/opt/foldingathome" FAHClient || die
74 + patchelf --set-rpath "${EPREFIX}/opt/foldingathome" FAHCoreWrapper || die
75 +
76 + dosym "../../usr/$(get_libdir)/libssl.so.1.0.0" /opt/foldingathome/libssl.so.10
77 + dosym "../../usr/$(get_libdir)/libcrypto.so.1.0.0" /opt/foldingathome/libcrypto.so.10
78 +
79 + exeinto /opt/foldingathome
80 + doexe {FAHClient,FAHCoreWrapper}
81 +
82 + insinto /opt/foldingathome
83 + doins sample-config.xml
84 +
85 + newconfd "${FILESDIR}"/7.3/folding-conf.d foldingathome
86 + cat <<EOF >"${T}"/fah-init
87 +#!/sbin/openrc-run
88 +# Copyright 1999-2020 Gentoo Authors
89 +# Distributed under the terms of the GNU General Public License v2
90 +
91 +start_stop_daemon_args="--chdir \"${EPREFIX}/opt/foldingathome\""
92 +command="${EPREFIX}/opt/foldingathome/FAHClient"
93 +command_args="\${FOLD_OPTS}"
94 +command_user=foldingathome
95 +command_background=1
96 +pidfile="\${PIDFILE}"
97 +EOF
98 + newinitd "${T}"/fah-init foldingathome
99 +
100 + cat <<EOF >"${T}"/fah-init.service
101 +[Unit]
102 +Description=Folding@Home V7 Client
103 +Documentation=https://foldingathome.org
104 +
105 +[Service]
106 +Type=simple
107 +User=foldingathome
108 +Group=foldingathome
109 +Nice=19
110 +WorkingDirectory=${EPREFIX}/opt/foldingathome
111 +ExecStart=${EPREFIX}/opt/foldingathome/FAHClient --fork=false --pid=false --respawn=false --service=false
112 +NoNewPrivileges=yes
113 +PrivateTmp=yes
114 +ProtectControlGroups=yes
115 +ProtectSystem=full
116 +RestrictRealtime=true
117 +ProtectControlGroups=yes
118 +
119 +[Install]
120 +WantedBy=multi-user.target
121 +EOF
122 + systemd_newunit "${T}"/fah-init.service foldingathome.service
123 +
124 + fowners -R foldingathome:foldingathome /opt/foldingathome
125 +}
126 +
127 +pkg_postinst() {
128 + elog "To run Folding@home in the background at boot:"
129 + elog "(openrc)\trc-update add foldingathome default"
130 + elog "(systemd)\tsystemctl enable foldingathome"
131 + elog ""
132 + if [ ! -e "${EPREFIX}"/opt/foldingathome/config.xml ]; then
133 + elog "No config.xml file found -- please run"
134 + elog "emerge --config ${P} to configure your client, or specify"
135 + elog "all necessary runtime options in FOLD_OPTS within"
136 + elog "${EPREFIX}/etc/conf.d/foldingathome"
137 + elog ""
138 + fi
139 + if [[ -n ${REPLACING_VERSIONS} ]]; then
140 + elog "NOTE, the 'initfolding' helper script has been dropped, please"
141 + elog "use emerge --config ${P} or run FAHClient --configure directly"
142 + elog "and adjust file permissions and ownership yourself"
143 + elog ""
144 + fi
145 + elog "Please see ${EPREFIX}/opt/foldingathome/FAHClient --help for more details."
146 + einfo ""
147 + einfo "The original package maintainer encourages you to acquire a username and join team 36480."
148 + einfo "http://folding.stanford.edu/English/Download#ntoc2"
149 + einfo ""
150 +}
151 +
152 +pkg_postrm() {
153 + elog "Folding@home data files were not removed."
154 + elog "Remove them manually from ${EPREFIX}/opt/foldingathome"
155 +}
156 +
157 +pkg_config() {
158 + cd "${EPREFIX}"/opt/foldingathome || die
159 + su foldingathome -s /bin/sh -c "./FAHClient --configure"
160 +}