dev-python/mpmath: Bump to 1.4.0_alpha4
[gentoo/gentoo.git] / sci-electronics / splat / splat-1.4.2.ebuild
blob8a0b78e7f312febaac9b6ed99a35d420ae6d1e3c
1 # Copyright 1999-2021 Gentoo Authors
2 # Distributed under the terms of the GNU General Public License v2
4 EAPI=8
6 inherit toolchain-funcs
8 DESCRIPTION="RF Signal Propagation, Loss, And Terrain analysis tool"
9 HOMEPAGE="https://www.qsl.net/kd2bd/splat.html"
10 SRC_URI="https://www.qsl.net/kd2bd/${P}.tar.bz2"
12 LICENSE="GPL-2"
13 SLOT="0"
14 KEYWORDS="~amd64 ~ppc ~x86"
15 IUSE="doc hires l10n_es"
17 DEPEND="
18         app-arch/bzip2
19         sys-libs/zlib
21 RDEPEND="${DEPEND}"
23 PATCHES=(
24         "${FILESDIR}"/${PN}-1.2.2-gcc43.patch
27 src_configure() {
28         # fake resulting file from interactive configuration script
29         # using default resolution
30         cat <<- EOF > "${S}/splat.h" || die
31                 /* Parameters for 3 arc-second standard resolution mode of operation */
32                 #define MAXPAGES 9
33                 #define HD_MODE 0
34         EOF
35         if use hires; then
36                 # fake resulting file from interactive configuration script
37                 # using default resolution
38                 cat <<- EOF > "${S}/hires.h" || die
39                         /* Parameters for 3 arc-second hires resolution mode of operation */
40                         #define MAXPAGES 9
41                         #define HD_MODE 1
42         EOF
43         fi
46 src_compile() {
47         tc-export CC CXX
49         cp {splat,rfsplat}.cpp || die
50         emake LDLIBS="-lm -lbz2" -E "rfsplat: itwom3.0.o"
51         if use hires; then
52                 cp {hires,splat}.h || die
53                 cp {splat,rfsplat-hd}.cpp || die
54                 emake LDLIBS="-lm -lbz2" -E "rfsplat-hd: itwom3.0.o"
55         fi
57         cd utils || die
59         emake citydecoder usgs2sdf
60         emake LDLIBS=-lbz2 srtm2sdf
61         emake LDLIBS=-lm bearing
64 src_install() {
65         local SPLAT_LANG="english"
66         use l10n_es && SPLAT_LANG="spanish"
67         # splat binary
68         dobin rfsplat
70         use hires && dobin rfsplat-hd
72         # utilities
73         dobin utils/{citydecoder,usgs2sdf,srtm2sdf,postdownload,bearing}
74         newman docs/${SPLAT_LANG}/man/splat.man rfsplat.1
76         dodoc CHANGES README utils/fips.txt
77         newdoc utils/README README.UTILS
79         use doc && dodoc docs/${SPLAT_LANG}/{pdf/splat.pdf,postscript/splat.ps}
81         #sample data
82         docinto sample_data
83         dodoc -r sample_data/.
86 pkg_postinst() {
87         elog "The original SPLAT! command got renamed to 'rfsplat' to avoid"
88         elog "filename collision with app-portage/splat."
89         elog ""
90         elog "Be aware that it is still referenced as 'splat' in the documentation."