app-misc/glimpse: new EAPI=6 revision with ISC license.
[gentoo.git] / app-misc / glimpse / glimpse-4.18.6-r1.ebuild
1 # Copyright 1999-2017 Gentoo Foundation
2 # Distributed under the terms of the GNU General Public License v2
3
4 EAPI=6
5
6 inherit flag-o-matic
7
8 DESCRIPTION="A index/query system to search a large set of files quickly"
9 HOMEPAGE="http://webglimpse.net/"
10 SRC_URI="http://webglimpse.net/trial/${P}.tar.gz"
11
12 LICENSE="ISC"
13 SLOT="0"
14 KEYWORDS="~alpha ~amd64 ~ia64 ~mips ~ppc ~ppc64 ~sparc ~x86 ~amd64-linux ~x86-linux ~ppc-macos ~x86-macos"
15 IUSE="static"
16
17 RDEPEND="!dev-libs/tre
18         !app-text/agrep"
19
20 PATCHES=( "${FILESDIR}/${PN}-4.18.6-makefile.patch" )
21
22 src_prepare() {
23         sed -i \
24                 -e "s:CC=.*:CC=$(tc-getCC):" \
25                 -e 's:-O3 -fomit-frame-pointer:$(OPTIMIZEFLAGS):' \
26                 dynfilters/Makefile.in \
27                 || die "removing -O3 failed"
28         sed -i \
29                 -e '/^CFLAGS/s:$: $(OPTIMIZEFLAGS):' \
30                 {agrep,compress,index}/Makefile.in \
31                 libtemplate/{template,util}/Makefile.in \
32                 || die "inserting OPTIMIZEFLAGS failed"
33         sed -i \
34                 -e 's:$(mandir):&/man1/:' \
35                 agrep/Makefile.in \
36                 || die "adding man1 to man install dir failed"
37
38         sed -i \
39                 -e '/^LDFLAGS/d' \
40                 {agrep,compress,index}/Makefile.in \
41                 || die "LDFLAGS sed failed"
42
43         default
44 }
45
46 src_configure() {
47         use static && append-ldflags -static
48         default
49 }
50
51 src_compile() {
52         # The OPTIMIZEFLAGS variable is our own, patched in...
53         emake OPTIMIZEFLAGS="${CFLAGS}"
54 }
55
56 src_install() {
57         # The build system is buggy; we get sandbox violations without this.
58         emake prefix="${ED}/usr" install
59 }