1 |
commit: fb3f7ff1498a2a525dfeb40acaa219d31fe56471 |
2 |
Author: Alexey Shvetsov <alexxy <AT> gentoo <DOT> org> |
3 |
AuthorDate: Wed Dec 2 12:08:41 2020 +0000 |
4 |
Commit: Alexey Shvetsov <alexxy <AT> gentoo <DOT> org> |
5 |
CommitDate: Wed Dec 2 12:08:54 2020 +0000 |
6 |
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=fb3f7ff1 |
7 |
|
8 |
sci-chemistry/modeller: resurection |
9 |
|
10 |
Package-Manager: Portage-3.0.11, Repoman-3.0.2 |
11 |
Signed-off-by: Alexey Shvetsov <alexxy <AT> gentoo.org> |
12 |
|
13 |
sci-chemistry/modeller/Manifest | 1 + |
14 |
sci-chemistry/modeller/metadata.xml | 12 +++ |
15 |
sci-chemistry/modeller/modeller-9.25.ebuild | 149 ++++++++++++++++++++++++++++ |
16 |
3 files changed, 162 insertions(+) |
17 |
|
18 |
diff --git a/sci-chemistry/modeller/Manifest b/sci-chemistry/modeller/Manifest |
19 |
new file mode 100644 |
20 |
index 00000000000..e3d097b4b75 |
21 |
--- /dev/null |
22 |
+++ b/sci-chemistry/modeller/Manifest |
23 |
@@ -0,0 +1 @@ |
24 |
+DIST modeller-9.25.tar.gz 44820658 BLAKE2B b3e8a3cc8cc70689a25bc5ed2eee294d67bef8eea9ed4b64d41aba3a27c0bc428ae58e74d734da0eaab7e4fabb213d098b9ba66b9569557159ac7d4a58244b0a SHA512 93f273aba0ec0f884cde5bbcc24769a09386bfc6bf1744d80001e41924b1a682225ba3c554fb9898ef3bfd1fd8451f9458bb92431b20f2f51b01781e79686c91 |
25 |
|
26 |
diff --git a/sci-chemistry/modeller/metadata.xml b/sci-chemistry/modeller/metadata.xml |
27 |
new file mode 100644 |
28 |
index 00000000000..7daa2ce7e5f |
29 |
--- /dev/null |
30 |
+++ b/sci-chemistry/modeller/metadata.xml |
31 |
@@ -0,0 +1,12 @@ |
32 |
+<?xml version="1.0" encoding="UTF-8"?> |
33 |
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd"> |
34 |
+<pkgmetadata> |
35 |
+ <maintainer type="person"> |
36 |
+ <email>alexxy@g.o</email> |
37 |
+ <name>Alexey Shvetsov</name> |
38 |
+ </maintainer> |
39 |
+ <maintainer type="project"> |
40 |
+ <email>sci-chemistry@g.o</email> |
41 |
+ <name>Gentoo Chemistry Project</name> |
42 |
+ </maintainer> |
43 |
+</pkgmetadata> |
44 |
|
45 |
diff --git a/sci-chemistry/modeller/modeller-9.25.ebuild b/sci-chemistry/modeller/modeller-9.25.ebuild |
46 |
new file mode 100644 |
47 |
index 00000000000..2e2cae47f51 |
48 |
--- /dev/null |
49 |
+++ b/sci-chemistry/modeller/modeller-9.25.ebuild |
50 |
@@ -0,0 +1,149 @@ |
51 |
+# Copyright 1999-2020 Gentoo Authors |
52 |
+# Distributed under the terms of the GNU General Public License v2 |
53 |
+ |
54 |
+EAPI=7 |
55 |
+ |
56 |
+PYTHON_COMPAT=( python3_{6,7,8,9} ) |
57 |
+DISTUTILS_USE_SETUPTOOLS=no |
58 |
+ |
59 |
+inherit distutils-r1 eutils multilib |
60 |
+ |
61 |
+DESCRIPTION="Homology or comparative modeling of protein three-dimensional structures" |
62 |
+HOMEPAGE="https://salilab.org/modeller/" |
63 |
+SRC_URI="https://salilab.org/${PN}/${PV}/${P}.tar.gz" |
64 |
+ |
65 |
+LICENSE="modeller" |
66 |
+KEYWORDS="~amd64 ~x86 ~amd64-linux ~x86-linux" |
67 |
+IUSE="doc examples" |
68 |
+SLOT="0" |
69 |
+ |
70 |
+RESTRICT="mirror" |
71 |
+ |
72 |
+DEPEND=">=dev-lang/swig-1.3" |
73 |
+RDEPEND="" |
74 |
+ |
75 |
+INPATH="${EPREFIX}"/opt/modeller${ver} |
76 |
+ |
77 |
+QA_PREBUILT="/opt/*" |
78 |
+ |
79 |
+pkg_setup() { |
80 |
+ case ${ARCH} in |
81 |
+ x86) |
82 |
+ EXECTYPE="i386-intel8";; |
83 |
+ amd64) |
84 |
+ EXECTYPE="x86_64-intel8";; |
85 |
+ *) |
86 |
+ die "Your arch "${ARCH}" does not appear supported at this time.";; |
87 |
+ esac |
88 |
+} |
89 |
+ |
90 |
+python_prepare_all(){ |
91 |
+ sed "s:i386-intel8:${EXECTYPE}:g" -i src/swig/setup.py || die |
92 |
+ rm -rf modlib/modeller/python_library || die |
93 |
+ sed -i '1 i\#!/usr/bin/python' bin/modslave.py || die |
94 |
+ 2to3 -w -n modlib/modeller || die |
95 |
+ distutils-r1_python_prepare_all |
96 |
+} |
97 |
+ |
98 |
+python_compile(){ |
99 |
+ cd src/swig || die |
100 |
+ swig -python -keyword -nodefaultctor -nodefaultdtor -noproxy modeller.i || die |
101 |
+ distutils-r1_python_compile |
102 |
+} |
103 |
+ |
104 |
+python_install() { |
105 |
+ cd src/swig || die |
106 |
+ distutils-r1_python_install |
107 |
+} |
108 |
+ |
109 |
+python_install_all(){ |
110 |
+ cd "${S}" || die |
111 |
+ sed \ |
112 |
+ -e "/^EXECUTABLE_TYPE/s:xxx:${EXECTYPE}:g" \ |
113 |
+ -e "/MODINSTALL/s:xxx:\"${INPATH}\":g" \ |
114 |
+ -i bin/modscript || die |
115 |
+ |
116 |
+ sed -e "s;@TOPDIR\@;\"${INPATH}\";" \ |
117 |
+ -e "s;@EXETYPE\@;${EXECTYPE};" \ |
118 |
+ bin/modpy.sh.in > "${T}/modpy.sh" |
119 |
+ |
120 |
+ insinto ${INPATH} |
121 |
+ doins -r modlib |
122 |
+ python_foreach_impl python_domodule modlib/modeller |
123 |
+ |
124 |
+ insinto ${INPATH}/bin |
125 |
+ doins -r bin/{lib,*top} |
126 |
+ |
127 |
+ exeinto ${INPATH}/bin |
128 |
+ doexe bin/{modscript,mod${PV}_${EXECTYPE}} "${T}"/modpy.sh |
129 |
+ |
130 |
+ python_foreach_impl python_doscript bin/modslave.py |
131 |
+ dosym ${INPATH}/bin/modscript /opt/bin/mod${PV} |
132 |
+ dosym ${INPATH}/bin/modpy.sh /opt/bin/modpy.sh |
133 |
+ |
134 |
+ exeinto ${INPATH}/lib/${EXECTYPE}/ |
135 |
+ doexe lib/${EXECTYPE}/lib* |
136 |
+ dosym libmodeller.so.12 ${INPATH}/lib/${EXECTYPE}/libmodeller.so |
137 |
+ dosym ../../${INPATH}/lib/${EXECTYPE}/libmodeller.so.12 /usr/$(get_libdir)/libmodeller.so.12 |
138 |
+ |
139 |
+ use doc && HTML_DOCS=( doc/. ) |
140 |
+ distutils-r1_python_install_all |
141 |
+ |
142 |
+ if use examples; then |
143 |
+ insinto /usr/share/${PN}/ |
144 |
+ doins -r examples |
145 |
+ fi |
146 |
+ |
147 |
+ insinto /etc/revdep-rebuild |
148 |
+ cat >> "${T}"/40-${PN} <<- EOF |
149 |
+ SEARCH_DIRS_MASK="${EPREFIX}/opt/modeller/lib/" |
150 |
+ EOF |
151 |
+ doins "${T}"/40-${PN} |
152 |
+} |
153 |
+ |
154 |
+pkg_postinst() { |
155 |
+ if [[ ! -e "${INPATH}/modlib/modeller/config.py" ]]; then |
156 |
+ echo install_dir = \"${INPATH}/\"> ${INPATH}/modlib/modeller/config.py |
157 |
+ fi |
158 |
+ |
159 |
+ if grep -q license ${INPATH}/modlib/modeller/config.py; then |
160 |
+ einfo "A license key file is already present in ${IN_PATH}/modlib/modeller/config.py" |
161 |
+ else |
162 |
+ ewarn "Obtain a license Key from" |
163 |
+ ewarn "http://salilab.org/modeller/registration.html" |
164 |
+ ewarn "And run this before using modeller:" |
165 |
+ ewarn "emerge --config =${CATEGORY}/${PF}" |
166 |
+ ewarn "That way you can [re]enter your license key." |
167 |
+ fi |
168 |
+} |
169 |
+ |
170 |
+pkg_postrm() { |
171 |
+ ewarn "This package leaves a license Key file in ${INPATH}/modlib/modeller/config.py" |
172 |
+ ewarn "that you need to remove to completely get rid of modeller." |
173 |
+} |
174 |
+ |
175 |
+pkg_config() { |
176 |
+ ewarn "Your license key is NOT checked for validity here." |
177 |
+ ewarn " Make sure you type it in correctly." |
178 |
+ eerror "If you CTRL+C out of this, modeller will not run!" |
179 |
+ while true |
180 |
+ do |
181 |
+ einfo "Please enter your license key:" |
182 |
+ read license_key1 |
183 |
+ einfo "Please re-enter your license key:" |
184 |
+ read license_key2 |
185 |
+ if [[ "$license_key1" == "" ]] |
186 |
+ then |
187 |
+ echo "You entered a blank license key. Try again." |
188 |
+ else |
189 |
+ if [[ "$license_key1" == "$license_key2" ]] |
190 |
+ then |
191 |
+ echo license = '"'$license_key1'"' >> "${INPATH}/modlib/modeller/config.py" |
192 |
+ einfo "Thank you!" |
193 |
+ break |
194 |
+ else |
195 |
+ eerror "Your license key entries do not match. Try again." |
196 |
+ fi |
197 |
+ fi |
198 |
+ done |
199 |
+} |