sci-libs/cblas-reference: mark s390 stable
[gentoo.git] / sci-libs / cblas-reference / cblas-reference-20030223-r6.ebuild
1 # Copyright 1999-2018 Gentoo Authors
2 # Distributed under the terms of the GNU General Public License v2
3
4 EAPI=5
5
6 inherit autotools eutils fortran-2 multilib toolchain-funcs
7
8 MyPN="${PN/-reference/}"
9
10 DESCRIPTION="C wrapper interface to the F77 reference BLAS implementation"
11 HOMEPAGE="http://www.netlib.org/blas/"
12 SRC_URI="http://www.netlib.org/blas/blast-forum/${MyPN}.tgz"
13
14 SLOT="0"
15 LICENSE="public-domain"
16 IUSE=""
17 KEYWORDS="alpha amd64 hppa ppc ppc64 s390 sparc x86 ~amd64-fbsd ~x86-fbsd ~amd64-linux ~x86-linux ~x64-macos"
18
19 RDEPEND="
20         virtual/blas
21         app-eselect/eselect-cblas"
22 DEPEND="${RDEPEND}
23         virtual/pkgconfig"
24
25 ESELECT_PROF=reference
26 S="${WORKDIR}/CBLAS"
27
28 src_prepare() {
29         epatch "${FILESDIR}"/${P}-autotool.patch
30         eautoreconf
31
32         cp "${FILESDIR}"/eselect.cblas.reference "${T}"/ || die
33         sed -i -e "s:/usr:${EPREFIX}/usr:" "${T}"/eselect.cblas.reference || die
34         if [[ ${CHOST} == *-darwin* ]] ; then
35                 sed -i -e 's/\.so\([\.0-9]\+\)\?/\1.dylib/g' \
36                         "${T}"/eselect.cblas.reference || die
37         fi
38 }
39
40 src_configure() {
41         econf \
42                 --libdir="${EPREFIX}"/usr/$(get_libdir)/blas/reference \
43                 --with-blas="$($(tc-getPKG_CONFIG) --libs blas)"
44 }
45
46 src_install() {
47         default
48         dodoc cblas_example*c
49         eselect cblas add $(get_libdir) "${T}"/eselect.cblas.reference ${ESELECT_PROF}
50 }
51
52 pkg_postinst() {
53         local p=cblas
54         local current_lib=$(eselect ${p} show | cut -d' ' -f2)
55         if [[ ${current_lib} == ${ESELECT_PROF} || -z ${current_lib} ]]; then
56                 # work around eselect bug #189942
57                 local configfile="${EROOT}"/etc/env.d/${p}/$(get_libdir)/config
58                 [[ -e ${configfile} ]] && rm -f ${configfile}
59                 eselect ${p} set ${ESELECT_PROF}
60                 elog "${p} has been eselected to ${ESELECT_PROF}"
61         else
62                 elog "Current eselected ${p} is ${current_lib}"
63                 elog "To use ${p} ${ESELECT_PROF} implementation, you have to issue (as root):"
64                 elog "\t eselect ${p} set ${ESELECT_PROF}"
65         fi
66 }