Drop $Id$ per council decision in bug #611234.
[gentoo.git] / dev-libs / kpathsea / kpathsea-6.2.0_p20140525.ebuild
1 # Copyright 1999-2017 Gentoo Foundation
2 # Distributed under the terms of the GNU General Public License v2
3
4 EAPI=5
5
6 inherit texlive-common eutils libtool prefix
7
8 TEXMFD_VERSION="6"
9
10 DESCRIPTION="Library implementing generic path searching, configuration, and TeX-specific file searching"
11 HOMEPAGE="http://tug.org/texlive/"
12 SRC_URI="mirror://gentoo/texlive-${PV#*_p}-source.tar.xz
13         mirror://gentoo/${PN}-texmf.d-${TEXMFD_VERSION}.tar.xz"
14
15 LICENSE="GPL-2"
16 SLOT="0/${PV%_p*}"
17 KEYWORDS="~alpha amd64 arm ~hppa ~ia64 ~mips ppc ~ppc64 ~s390 ~sh ~sparc x86 ~amd64-fbsd ~x86-fbsd ~amd64-linux ~x86-linux ~ppc-macos ~x64-macos ~x86-macos ~sparc-solaris ~x64-solaris ~x86-solaris"
18 IUSE="doc source static-libs"
19
20 DEPEND="!<app-text/texlive-core-2013
21         !app-text/ptex"
22 RDEPEND="${DEPEND}"
23
24 S=${WORKDIR}/texlive-${PV#*_p}-source/texk/${PN}
25
26 TL_VERSION=2014
27 EXTRA_TL_MODULES="kpathsea"
28 EXTRA_TL_DOC_MODULES="kpathsea.doc"
29
30 for i in ${EXTRA_TL_MODULES} ; do
31         SRC_URI="${SRC_URI} mirror://gentoo/texlive-module-${i}-${TL_VERSION}.tar.xz"
32 done
33
34 SRC_URI="${SRC_URI} doc? ( "
35 for i in ${EXTRA_TL_DOC_MODULES} ; do
36         SRC_URI="${SRC_URI} mirror://gentoo/texlive-module-${i}-${TL_VERSION}.tar.xz"
37 done
38 SRC_URI="${SRC_URI} ) "
39
40 TEXMF_PATH=/usr/share/texmf-dist
41
42 src_prepare() {
43         cd "${WORKDIR}/texlive-${PV#*_p}-source"
44         S="${WORKDIR}/texlive-${PV#*_p}-source" elibtoolize #sane .so versionning on gfbsd
45         cp "${FILESDIR}/texmf-update-r1" "${S}"/texmf-update
46         eprefixify "${S}"/texmf-update
47 }
48
49 src_configure() {
50         # Too many regexps use A-Z a-z constructs, what causes problems with locales
51         # that don't have the same alphabetical order than ascii. Bug #347798
52         # So we set LC_ALL to C in order to avoid problems.
53         export LC_ALL=C
54
55         # Disable largefile because it seems to cause problems on big endian 32 bits
56         # systems...
57         econf \
58                 --disable-largefile \
59                 $(use_enable static-libs static)
60 }
61
62 src_install() {
63         emake DESTDIR="${D}" web2cdir="${EPREFIX}/usr/share/texmf-dist/web2c" install
64         find "${D}" -name '*.la' -delete
65
66         dodir /usr/share # just in case
67         cp -pR "${WORKDIR}"/texmf-dist "${ED}/usr/share/" || die "failed to install texmf trees"
68         if use source ; then
69                 cp -pR "${WORKDIR}"/tlpkg "${ED}/usr/share/" || die "failed to install tlpkg files"
70         fi
71
72         # The default configuration expects it to be world writable, bug #266680
73         # People can still change it with texconfig though.
74         dodir /var/cache/fonts
75         fperms 1777 /var/cache/fonts
76
77         # Take care of fmtutil.cnf and texmf.cnf
78         dodir /etc/texmf/{fmtutil.d,texmf.d}
79
80         # Remove default texmf.cnf to ship our own, greatly based on texlive dvd's
81         # texmf.cnf
82         # It will also be generated from /etc/texmf/texmf.d files by texmf-update
83         rm -f "${ED}${TEXMF_PATH}/web2c/texmf.cnf"
84
85         insinto /etc/texmf/texmf.d
86         doins "${WORKDIR}/texmf.d/"*.cnf
87
88         # Remove fmtutil.cnf, it will be regenerated from /etc/texmf/fmtutil.d files
89         # by texmf-update
90         rm -f "${ED}${TEXMF_PATH}/web2c/fmtutil.cnf"
91
92         dosym /etc/texmf/web2c/fmtutil.cnf ${TEXMF_PATH}/web2c/fmtutil.cnf
93         dosym /etc/texmf/web2c/texmf.cnf ${TEXMF_PATH}/web2c/texmf.cnf
94
95         newsbin "${S}/texmf-update" texmf-update
96
97         # Keep it as that's where the formats will go
98         keepdir /var/lib/texmf
99
100         dodoc ChangeLog NEWS PROJECTS README
101 }
102
103 pkg_postinst() {
104         etexmf-update
105 }
106
107 pkg_postrm() {
108         etexmf-update
109 }