Merge remote-tracking branch 'github/pr/703'. Fixes bug 560362.
[gentoo.git] / dev-lang / logtalk / logtalk-2.41.0.ebuild
1 # Copyright 1999-2014 Gentoo Foundation
2 # Distributed under the terms of the GNU General Public License v2
3 # $Id$
4
5 inherit eutils versionator fdo-mime
6
7 DESCRIPTION="Open source object-oriented logic programming language"
8 HOMEPAGE="http://logtalk.org"
9 MY_PV="lgt$(delete_all_version_separators)"
10 SRC_URI="http://logtalk.org/files/${MY_PV}.tar.bz2"
11 LICENSE="Artistic-2"
12
13 SLOT="0"
14 KEYWORDS="~amd64 ~ppc ~x86"
15 IUSE="gnupl qupl swipl xsbpl yappl xslt fop"
16
17 DEPEND=""
18 RDEPEND="
19         gnupl? ( dev-lang/gprolog )
20         qupl? ( !amd64? ( dev-lang/qu-prolog ) )
21         swipl? ( dev-lang/swi-prolog )
22         xsbpl? ( x86? ( dev-lang/xsb ) )
23         yappl? ( dev-lang/yap )
24         xslt? ( dev-libs/libxslt )
25         fop? ( dev-java/fop )
26         ${DEPEND}"
27
28 S="${WORKDIR}/${MY_PV}"
29
30 src_install() {
31         # Look at scripts/install.sh for upstream installation process.
32         # Install logtalk base
33         mv scripts/logtalk_user_setup.sh integration/
34         mkdir -p "${D}/usr/share/${P}"
35         cp -r compiler configs contributions VERSION.txt \
36                 integration library wenv xml libpaths \
37                 examples settings.lgt "${D}/usr/share/${P}" \
38                 || die "Failed to install files"
39
40         # Install mime file, the database will be updated later
41         insinto /usr/share/mime/packages
42         doins scripts/freedesktop/logtalk.xml
43
44         # Install documentation
45         dodoc BIBLIOGRAPHY.bib CUSTOMIZE.txt INSTALL.txt \
46                 LICENSE.txt QUICK_START.txt README.txt \
47                 RELEASE_NOTES.txt UPGRADING.txt VERSION.txt
48         dohtml -r manuals/* || die "Failed to install html manual"
49
50         rm -f man/man1/logtalk_backend_select.1
51         rm -f man/man1/logtalk_version_select.1
52         doman man/man1/*.1 || die "Failed to install man pages"
53
54         # Integration symlinks
55         dosym /usr/share/${P}/integration/logtalk_user_setup.sh \
56                 /usr/bin/logtalk_user_setup
57         use gnupl && dosym /usr/share/${P}/integration/gplgt.sh \
58                 /usr/bin/gplgt
59         use qupl && ! use amd64 && dosym /usr/share/${P}/integration/qplgt.sh \
60                 /usr/bin/qplgt
61         use swipl && dosym /usr/share/${P}/integration/swilgt.sh \
62                 /usr/bin/swilgt
63         use xsbpl && use x86 && dosym /usr/share/${P}/integration/xsblgt.sh \
64                 /usr/bin/xsblgt
65         use yappl && dosym /usr/share/${P}/integration/yaplgt.sh \
66                 /usr/bin/yaplgt
67
68         dosym /usr/share/${P}/xml/lgt2xml.sh /usr/bin/lgt2xml
69         use xslt && dosym /usr/share/${P}/xml/lgt2html.sh /usr/bin/lgt2html
70         use xslt && dosym /usr/share/${P}/xml/lgt2txt.sh /usr/bin/lgt2txt
71         use fop  && dosym /usr/share/${P}/xml/lgt2pdf.sh /usr/bin/lgt2pdf
72
73         # Install environment files
74         echo "LOGTALKHOME=/usr/share/${P}" > 99logtalk
75         doenvd 99logtalk
76 }
77
78 pkg_postinst() {
79         fdo-mime_desktop_database_update
80
81         ewarn "Before running logtalk, users should execute"
82         ewarn "logtalk_user_setup *once*."
83         ewarn "To start logtalk use one of the following:"
84         use gnupl && ewarn "GNU Prolog: /usr/bin/gplgt"
85         use qupl && ! use amd64 && ewarn "Qu Prolog: /usr/bin/qplgt"
86         use swipl && ewarn "SWI Prolog: /usr/bin/swilgt"
87         use xsbpl && use x86 && ewarn "XSB: /usr/bin/xsblgt"
88         use yappl && ewarn "YAP: /usr/bin/yaplgt"
89         ewarn ""
90
91         ewarn "The environment has been set up to make the above"
92         ewarn "integration scripts find files automatically for logtalk."
93         ewarn "Please run 'etc-update && source /etc/profile' to update"
94         ewarn "the environment now, otherwise it will be updated at next"
95         ewarn "login."
96 }
97
98 pkg_postrm() {
99         fdo-mime_desktop_database_update
100 }