80c1c85576e45c0066700249ec6980c05cdabf13
[gentoo.git] / sci-mathematics / pspp / pspp-1.2.0.ebuild
1 # Copyright 1999-2020 Gentoo Authors
2 # Distributed under the terms of the GNU General Public License v2
3
4 EAPI=6
5
6 inherit eutils elisp-common ltprune
7
8 DESCRIPTION="Program for statistical analysis of sampled data"
9 HOMEPAGE="https://www.gnu.org/software/pspp/pspp.html"
10 SRC_URI="mirror://gnu/${PN}/${P}.tar.gz"
11
12 LICENSE="GPL-3"
13 SLOT="0/${PV}"
14 KEYWORDS="amd64 x86 ~amd64-linux ~x86-linux"
15 IUSE="cairo doc emacs examples gtk ncurses nls perl postgres static-libs"
16
17 RDEPEND="
18         dev-libs/libxml2:2=
19         sci-libs/gsl:0=
20         sys-devel/gettext:0=
21         sys-libs/readline:0=
22         sys-libs/zlib:0=
23         virtual/libiconv
24         cairo? ( x11-libs/cairo:0=[svg] )
25         emacs? ( >=app-editors/emacs-23.1:* )
26         gtk? (
27                         x11-libs/gtk+:3=
28                         x11-libs/gtksourceview:3.0=
29                         x11-libs/spread-sheet-widget )
30         ncurses? ( sys-libs/ncurses:0= )
31         postgres? ( dev-db/postgresql:=[server] )"
32 DEPEND="${RDEPEND}
33         virtual/pkgconfig
34         doc? ( virtual/latex-base )"
35
36 SITEFILE=50${PN}-gentoo.el
37
38 src_configure() {
39         econf \
40                 $(use_enable nls) \
41                 $(use_enable static-libs static) \
42                 $(use_with cairo) \
43                 $(use_with gtk gui) \
44                 $(use_with ncurses libncurses) \
45                 $(use_with perl perl-module) \
46                 $(use_with postgres libpq)
47 }
48
49 src_compile() {
50         default
51         use doc && emake html pdf
52         use emacs && elisp-compile *.el
53 }
54
55 src_install() {
56         default
57         if use doc; then
58                 dodoc doc/pspp{,-dev}.pdf
59                 insinto /usr/share/doc/${PF}/html
60                 dodoc -r doc/pspp{,-dev}.html
61         fi
62         if use examples; then
63                 insinto /usr/share/doc/${PF}
64                 doins -r examples
65         fi
66         if use emacs; then
67                 elisp-install ${PN} *.el *.elc
68                 elisp-site-file-install "${FILESDIR}/${SITEFILE}"
69         fi
70         prune_libtool_files --all
71 }
72
73 pkg_postinst () {
74         use emacs && elisp-site-regen
75 }
76
77 pkg_postrm() {
78         use emacs && elisp-site-regen
79 }