/[gentoo-x86]/sci-mathematics/scilab/scilab-4.1.2.ebuild
Gentoo

Contents of /sci-mathematics/scilab/scilab-4.1.2.ebuild

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.4 - (show annotations) (download)
Fri Nov 7 15:17:39 2008 UTC (10 years, 11 months ago) by markusle
Branch: MAIN
CVS Tags: HEAD
Changes since 1.3: +1 -1 lines
FILE REMOVED
Added patch for insecure tempfile handling (CVE-2008-4983) (see bug #245922).
(Portage version: 2.2_rc13/cvs/Linux 2.6.27-SENTINEL-2 i686)

1 # Copyright 1999-2008 Gentoo Foundation
2 # Distributed under the terms of the GNU General Public License v2
3 # $Header: /var/cvsroot/gentoo-x86/sci-mathematics/scilab/scilab-4.1.2.ebuild,v 1.3 2008/02/08 23:59:46 markusle Exp $
4
5 inherit eutils fortran toolchain-funcs multilib autotools java-pkg-opt-2
6
7 DESCRIPTION="Scientific software package for numerical computations (Matlab lookalike)"
8 LICENSE="scilab"
9 SRC_URI="http://www.scilab.org/download/${PV}/${P}-src.tar.gz"
10 HOMEPAGE="http://www.scilab.org/"
11
12 SLOT="0"
13 IUSE="ocaml gtk Xaw3d java"
14 KEYWORDS="~amd64 ~ppc ~x86"
15
16 RDEPEND="virtual/blas
17 virtual/lapack
18 virtual/cblas
19 sys-libs/ncurses
20 gtk? (
21 media-libs/jpeg
22 media-libs/libpng
23 sys-libs/zlib
24 >=x11-libs/gtk+-2
25 x11-libs/vte
26 =gnome-extra/gtkhtml-2*
27 )
28 >=dev-lang/tk-8.4
29 >=dev-lang/tcl-8.4
30 Xaw3d? ( x11-libs/Xaw3d )
31 ocaml? ( dev-lang/ocaml )
32 java? ( >=virtual/jdk-1.4 )"
33
34 DEPEND="${RDEPEND}
35 app-text/sablotron"
36
37 pkg_setup() {
38 java-pkg-opt-2_pkg_setup
39 need_fortran gfortran g77
40 }
41
42 src_unpack() {
43 unpack ${A}
44 cd "${S}"
45
46 epatch "${FILESDIR}"/${PN}-4.0-makefile.patch
47 epatch "${FILESDIR}"/${PN}-4.1-java-pic.patch
48 epatch "${FILESDIR}"/${P}-header-fix.patch
49 epatch "${FILESDIR}"/${PN}-4.1-examples.patch
50 epatch "${FILESDIR}"/${P}-java-config.patch
51 eautoconf
52
53 sed -e '/^ATLAS_LAPACKBLAS\>/s,=.*,= $(ATLASDIR)/liblapack.so $(ATLASDIR)/libblas.so $(ATLASDIR)/libcblas.so,' \
54 -e 's,$(SCIDIR)/libs/lapack.a,,' \
55 -i Makefile.OBJ.in || die "Failed to fix Makefile.OBJ.in"
56
57 sed -e "s:\$(PREFIX):\${D}\$(PREFIX):g" \
58 -e "s:\$(PREFIX)/lib:\$(PREFIX)/$(get_libdir):g" \
59 -i Makefile.in || die "Failed to fix Makefile.in"
60
61 sed -e "s:@CC_OPTIONS@:${CFLAGS}:" \
62 -e "s:@FC_OPTIONS@:${FFLAGS}:" \
63 -e "s:@LD_LDFLAGS@:${LDFLAGS} -lpthread:" \
64 -i Makefile.incl.in || die "Failed to fix Makefile.incl.in"
65
66 # fix bad C practices by failure of scilab build system to
67 # include proper headers
68 sed -e "s:-DNOTMPNAM:-DNOTMPNAM -DSYSVSTR -DHASSTDLIB:" \
69 -i pvm3/conf/LINUX.def -i pvm3/conf/LINUX64.def || \
70 die "Failed to fix pvm3 conf scripts."
71
72 # fix examples
73 local MAKE_TO_FIX="callsci inter* link* m* interface-multi-so/lib interface-general/lib"
74 cd examples/
75 for name in ${MAKE_TO_FIX}; do
76 sed -e "s:gentoo-scidir:/usr/$(get_libdir)/${P}:" \
77 -i ${name}/Makefile || die "Failed to fix examples"
78 done
79 }
80
81 src_compile() {
82 local myopts
83 myopts="${myopts} --with-atlas-library=/usr/$(get_libdir)"
84
85 # the tk interface is the default
86 myopts="${myopts} --with-tk"
87
88 if [[ ${FORTRANC} == gfortran ]]; then
89 myopts="${myopts} --with-gfortran"
90 fi
91
92 econf $(use_with Xaw3d xaw3d) \
93 $(use_with gtk gtk2 ) \
94 $(use_with ocaml) \
95 $(use_with java ) \
96 ${myopts} || die "econf failed"
97 env HOME="${S}" emake -j1 all || die "emake failed"
98 }
99
100 src_install() {
101 DESTDIR="${D}" make install || die "installation failed"
102
103 # some postinstall fixes
104 echo "SCIDIR=/usr/$(get_libdir)/${P}" > \
105 "${D}/usr/$(get_libdir)/${P}/Path.incl"
106
107 # install docs
108 dodoc ACKNOWLEDGEMENTS CHANGES README_Unix RELEASE_NOTES \
109 Readme_Visual.txt || die "failed to install docs"
110
111 # install examples
112 insinto /usr/share/${PN}/
113 doins -r examples/ || die "failed to install examples"
114
115 insinto /usr/$(get_libdir)/${P}
116 doins Makefile.incl || die "failed to install Makefile.incl"
117
118 exeinto /usr/$(get_libdir)/${P}
119 doexe libtool || die "failed to install libtool"
120
121 insinto /usr/$(get_libdir)/${P}/config
122 doins config/Makeso.incl || die "failed to install Makeso.incl"
123
124 # The compile and install process causes the work folder
125 # to be registered as the runtime folder in many files.
126 # This is corrected here.
127 BAD_REF="${WORKDIR}/${P}"
128 FIXED_REF="/usr/$(get_libdir)/${P}"
129 local BIN_TO_FIX="Blpr BEpsf Blatexpr2 Blatexprs Blatexpr scilab"
130 for i in ${BIN_TO_FIX}; do
131 sed -e "s%${BAD_REF}%${FIXED_REF}%" -i \
132 "${D}"/usr/$(get_libdir)/${P}/bin/${i} || \
133 die "Failed to fix wrapper scripts"
134 done
135 local MISC_TO_FIX="util/Blatdoc util/Blatdocs"
136 for i in ${MISC_TO_FIX}; do
137 sed -e "s%${BAD_REF}%${FIXED_REF}%" -i \
138 "${D}"/usr/$(get_libdir)/${P}/${i} || \
139 die "Failed to fix Blatdocs"
140 done
141 }
142
143 pkg_postinst() {
144 einfo "To tell Scilab about your printers, set the environment"
145 einfo "variable PRINTERS in the form:"
146 einfo
147 einfo "PRINTERS=\"firstPrinter:secondPrinter:anotherPrinter\""
148 }

  ViewVC Help
Powered by ViewVC 1.1.20