# Copyright 1999-2004 Gentoo Technologies, Inc. # Distributed under the terms of the GNU General Public License v2 # $Header: $ DESCRIPTION="A non-interactive application for producing graphs and charts" HOMEPAGE="http://ploticus.sourceforge.net" SRC_URI="http://ploticus.sourceforge.net/download/pl221src.tar.gz" LICENSE="GPL-2" SLOT=0 KEYWORDS="~x86" IUSE="gd gd-external flash gif no-locale no-cpulimit svg svgz truetype X" DEPEND="media-libs/libpng gd-external? ( >=media-libs/libgd-1.84 media-libs/jpeg ) flash? ( =media-libs/ming-0.2a ) truetype? ( =media-libs/freetype-2* ) X? ( virtual/x11 )" S=${WORKDIR}/pl221src/src src_unpack() { unpack ${A} # Fixes a problem with NOX11. epatch ${FILESDIR}/pl221-fixes.patch # Changes the install directory and comments all flash and gd-related # options. (These options will be selectively uncommented later.) epatch ${FILESDIR}/pl221-makefile.patch } src_compile() { # ploticus may be compiled using the external libgd, a libgd provided with # the package, or no gd support at all. if use gd-external; then # PNG and JPEG are supported by default. GD18LIBS="-lgd -lpng -lz -ljpeg" # Note that truetype works only with the external gd lib. if use truetype; then GD18LIBS="${GD18LIBS} -lfreetype" sed -ie 's/# GDFREETYPE = -DGDFREETYPE$/GDFREETYPE = -DGDFREETYPE/' Makefile else sed -ie 's/# GDFREETYPE = $/GDFREETYPE =/' Makefile fi # Set the graphics formats support. sed -ie 's/# ZFLAG = -DWZ/ZFLAG = -DWZ/' Makefile sed -ie "s,\# GD18LIBS = -lgd -lpng -lz -ljpeg,GD18LIBS = ${GD18LIBS}," Makefile # Use the external libgd. sed -ie 's/# GD18H =/GD18H =/' Makefile sed -ie 's/# ploticus: plgd18 $/ploticus: plgd18/' Makefile elif use gd; then # Determine graphics formats (gif and png) to support. if use gif; then # Use the internal libgd (png and gif). # Note that gif works only with the internal gd. sed -ie 's/# EXE = pl plpng/EXE = pl plpng/' Makefile sed -ie 's/# GD16LIBS = -lpng -lz/GD16LIBS = -lpng -lz/' Makefile sed -ie 's/# GD16H =/GD16H =/' Makefile sed -ie 's/# ploticus: pl plpng $/ploticus: pl plpng/' Makefile else # Use the internal libgd (png only). sed -ie 's/# PLPNG = pl/PLPNG = pl/' Makefile sed -ie 's/# GD16LIBS = -lpng -lz/GD16LIBS = -lpng -lz/' Makefile sed -ie 's/# GD16H =/GD16H =/' Makefile sed -ie 's/# ZFLAG = -DWZ/ZFLAG = -DWZ/' Makefile sed -ie 's/# ploticus: plpng $/ploticus: plpng/' Makefile fi else # No support for libgd at all. # Note that gif and truetype do not work without gd. sed -ie 's/# ploticus: plnogd $/ploticus: plnogd/' Makefile sed -ie 's/# NOGDFLAG = -DNOGD/NOGDFLAG = -DNOGD/' Makefile fi # Support for non-roman alphabets and collation. (Enabled by default.) if ! use no-locale; then sed -ie 's/# LOCALEOBJ = localef.o/LOCALEOBJ = localef.o/' Makefile sed -ie 's/# LOCALE_FLAG = -DLOCALE/LOCALE_FLAG = -DLOCALE/' Makefile fi # Support for compressed or uncompressed svg. svgz implies svg. If the # external gd library is used, the svgz format will always be available if # ploticus was compiled with support for svg (even if the svgz flag was not # specified and even if the -svgz flag was used). if use svgz; then sed -ie 's/# ZLIB = -lz/ZLIB = -lz/' Makefile sed -ie 's/# ZFLAG = -DWZ/ZFLAG = -DWZ/' Makefile elif ! use svg; then sed -ie 's/# NOSVGFLAG = -DNOSVG/NOSVGFLAG = -DNOSVG/' Makefile fi # Support for X11 output. if ! use X; then sed -ie 's/# NOXFLAG = -DNOX11/NOXFLAG = -DNOX11/' Makefile sed -ie 's/# XLIBS =/XLIBS =/' Makefile sed -ie 's/# XOBJ =/XOBJ =/' Makefile fi # Support for Flash output. if use flash; then sed -ie 's/# MING = -lming/MING = -lming/' Makefile else sed -ie 's/# NOSWFFLAG = -DNOSWF/NOSWFFLAG = -DNOSWF/' Makefile fi # Support for limiting CPU utilization. (Enabled by default.) if use no-cpulimit; then sed -ie 's/# NORLIMFLAG = -DNORLIMIT/NORLIMFLAG = -DNORLIMIT/' Makefile fi emake || die } src_install() { mkdir -p ${D}usr/bin make install DESTDIR=${D} || die insinto /usr/share/${PN}/prefabs doins ${WORKDIR}/pl221src/prefabs/* insinto /usr/share/${PN}/testsuite doins ${WORKDIR}/pl221src/pltestsuite/* insinto /etc/env.d doins ${FILESDIR}/11ploticus }