astrolog-5.40-r1.ebuild 2.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869
  1. # Copyright 1999-2013 Gentoo Foundation
  2. # Distributed under the terms of the GNU General Public License v2
  3. EAPI=4
  4. inherit toolchain-funcs
  5. DESCRIPTION="A many featured astrology chart calculation program"
  6. HOMEPAGE="http://www.astrolog.org/astrolog.htm"
  7. SRC_URI="http://www.astrolog.org/ftp/ast54unx.shr"
  8. LICENSE="astrolog"
  9. SLOT="0"
  10. KEYWORDS="amd64 ~ppc ~ppc64 x86"
  11. IUSE="X"
  12. DEPEND="X? ( x11-libs/libX11 )"
  13. RDEPEND="${DEPEND}"
  14. S="${WORKDIR}"
  15. src_unpack() {
  16. sh "${DISTDIR}"/ast54unx.shr || die
  17. }
  18. src_prepare() {
  19. # remove stripping of created binary, dump hardcoded CFLAGS,
  20. # respect CC (bug #243606), and CFLAGS (bug #240057)
  21. sed \
  22. -e 's:strip:#strip:' -e 's:^CFLAGS = :#CFLAGS = :' \
  23. -e 's:\tcc :\t$(CC) $(CFLAGS) $(LDFLAGS) :' \
  24. -i Makefile || die
  25. # we use /usr/share/astrolog for config and (optional) ephemeris-data-files
  26. sed -i -e "s:~/astrolog:/usr/share/astrolog:g" astrolog.h || die
  27. # if we use X, we need to add -L/usr/X11R6/lib to compile succesful
  28. #use X && sed -i -e "s:-lm -lX11:-lm -lX11 -L/usr/X11R6/lib:g" Makefile
  29. # if we do NOT use X, we disable it by removing the -lX11 from the Makefile
  30. # and remove the "#define X11" and "#define MOUSE" from astrolog.h
  31. use X || ( sed -i -e "s:-lm -lX11:-lm:g" Makefile
  32. sed -i -e "s:#define X11:/*#define X11:g" astrolog.h
  33. sed -i -e "s:#define MOUSE:/*#define MOUSE:g" astrolog.h )
  34. # any user may have an own astrolog configfile
  35. #sed -i -e "s:astrolog.dat:astrolog.dat:g" astrolog.h
  36. }
  37. src_compile() {
  38. emake CC="$(tc-getCC)" LDFLAGS="${LDFLAGS}"
  39. }
  40. src_install() {
  41. dobin astrolog
  42. dodoc Helpfile.540 README.1ST README.540 Update.540
  43. insinto /usr/share/astrolog
  44. doins astrolog.dat
  45. }
  46. pkg_postinst() {
  47. ewarn "There is a sample config file /usr/share/astrolog/astrolog.dat"
  48. ewarn "astrolog looks in current dir for a file astrolog.dat before"
  49. ewarn "using the file in /usr/share/astrolog"
  50. ewarn "If you want extended accuracy of astrolog's calculations you"
  51. ewarn "can emerge the optional package \"astrolog-ephemeris\" which"
  52. ewarn "needs ~4.7 MB additional diskspace for the ephemeris-files"
  53. }