summaryrefslogtreecommitdiff
blob: 3c83a453597910c3b1f2e01ee47b782e725d4e81 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
# Copyright 1999-2003 Gentoo Technologies, Inc.
# Distributed under the terms of the GNU General Public License v2
# $Header: /var/cvsroot/gentoo-x86/app-sci/singular/singular-2.0.4-r1.ebuild,v 1.3 2003/12/10 16:08:46 phosphan Exp $

S=${WORKDIR}/${P}
MINPV=${PV//./-}
BPN=${PN/s/S}
DESCRIPTION="computer algebra system for polynomial computations"
SRC_URI="ftp://www.mathematik.uni-kl.de/pub/Math/Singular/src/${BPN}-doc-${MINPV}.tar.gz
		ftp://www.mathematik.uni-kl.de/pub/Math/Singular/src/${BPN}-emacs-${MINPV}.tar.gz
		ftp://www.mathematik.uni-kl.de/pub/Math/Singular/src/${BPN}-factory-${MINPV}b.tar.gz
		ftp://www.mathematik.uni-kl.de/pub/Math/Singular/src/${BPN}-IntProg-${MINPV}a.tar.gz
		ftp://www.mathematik.uni-kl.de/pub/Math/Singular/src/${BPN}-kernel-${MINPV}a.tar.gz
		ftp://www.mathematik.uni-kl.de/pub/Math/Singular/src/${BPN}-libfac-${MINPV}b.tar.gz
	ftp://www.mathematik.uni-kl.de/pub/Math/Singular/src/${BPN}-main-${MINPV}c.tar.gz
	ftp://www.mathematik.uni-kl.de/pub/Math/Singular/src/${BPN}-MP-${MINPV}.tar.gz
	ftp://www.mathematik.uni-kl.de/pub/Math/Singular/src/${BPN}-NTL-5.2.tar.gz
	ftp://www.mathematik.uni-kl.de/pub/Math/Singular/src/${BPN}-NTL-generic.tar.gz
	ftp://www.mathematik.uni-kl.de/pub/Math/Singular/src/${BPN}-omalloc-${MINPV}.tar.gz
	ftp://www.mathematik.uni-kl.de/pub/Math/Singular/src/${BPN}-Tst-${MINPV}a.tar.gz"
HOMEPAGE="http://www.singular.uni-kl.de/"

RDEPEND=">=dev-lang/perl-5.6
		>=dev-libs/gmp-4.1-r1"

IUSE="doc"

DEPEND="${RDEPEND}
		doc? ( sys-apps/texinfo
				virtual/tetex
				dev-lang/perl )"

SLOT="0"
LICENSE="singular"
KEYWORDS="x86 ppc"

S=${WORKDIR}

src_unpack () {
	unpack ${A}
	epatch  $FILESDIR/singular-2.0.4-gentoo.diff
}



src_compile() {
	local myconf="${myconf} --with-NTL --prefix=${D}/usr"
	econf ${myconf}
	make CFLAGS="${CFLAGS}" CXXFLAGS="${CXXFLAGS}" || die "make failed"
}

src_install () {
	local myarchprefix
	case ${ARCH} in
		x86)
			myarchprefix=ix86
			;;
		*)
			myarchprefix=${ARCH}
			;;
	esac
	cd ${WORKDIR}/omalloc
	einstall || die
	cd ${WORKDIR}/MP
	einstall || die
	cd ${WORKDIR}/ntl
	einstall || die
	cd ${WORKDIR}/factory
	einstall || die
	cd ${WORKDIR}/libfac
	einstall || die
	cd ${WORKDIR}/Singular
	einstall || die
	rm ${D}/usr/LIB
	dodir /usr/share/singular/LIB
	dodir /usr/share/singular/LIB/gftables
	insinto /usr/share/singular/LIB
	cd ${WORKDIR}/Singular/LIB
	doins *.lib*
	insinto /usr/share/singular/LIB/gftables
	cd gftables
	doins *
	dodir /usr/bin
	dodir /usr/lib/singular
	insinto /usr/lib/singular
	cd ${D}/usr/${myarchprefix}-Linux
	rm Singular
	dobin *Singular*
	doins *.so
	use doc && 	( 	cd ${WORKDIR}/doc
					# fake ssh during doc creation
					cp ${FILESDIR}/fake_ssh ${T}/ssh
					chmod +x ${T}/ssh
					export PATH="${T}:${PATH}"
					make dvi
					dodoc *.dvi
					make ps
					dodoc *.ps
					local strange_error="Inappropriate ioctl for device"
					echo ${strange_error} > makeresult
					while grep -q "${strange_error}" makeresult
					do make 2>&1 info | tee makeresult
					done
					echo > singular.info "INFO-DIR-SECTION Math"
					echo >> singular.info "START-INFO-DIR-ENTRY"
					echo >> singular.info "* Singular: (singular).         A Computer Algebra System for Polynomial Computations"
					echo >> singular.info "END-INFO-DIR-ENTRY"
					cat singular.hlp >> singular.info
					doinfo singular.info
					make html
					dohtml -r html/.
					cd ${D}/usr
					mv doc/NTL share/doc/${PF}/
				)
	cd ${D}
	dosym /usr/bin/Singular-2-0-4 /usr/bin/Singular
	cd ${D}/usr
	rm -r ${myarchprefix}-Linux
}

pkg_postinst() {
	einfo "The authors ask you to register as a SINGULAR user."
	einfo "Please check the license file for details."
}