gnucap-0.35.20091207.ebuild 2.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081
  1. # Copyright 1999-2013 Gentoo Foundation
  2. # Distributed under the terms of the GNU General Public License v2
  3. EAPI="2"
  4. inherit multilib toolchain-funcs
  5. SNAPSHOTDATE="${P##*.}"
  6. MY_PV="${PN}-${SNAPSHOTDATE:0:4}-${SNAPSHOTDATE:4:2}-${SNAPSHOTDATE:6:2}"
  7. DESCRIPTION="GNUCap is the GNU Circuit Analysis Package"
  8. SRC_URI="http://www.gnucap.org/devel/${MY_PV}.tar.gz
  9. http://www.gnucap.org/devel/${MY_PV}-models-bsim.tar.gz
  10. http://www.gnucap.org/devel/${MY_PV}-models-jspice3-2.5.tar.gz
  11. http://www.gnucap.org/devel/${MY_PV}-models-ngspice17.tar.gz
  12. http://www.gnucap.org/devel/${MY_PV}-models-spice3f5.tar.gz"
  13. HOMEPAGE="http://www.gnucap.org/"
  14. IUSE="examples"
  15. SLOT="0"
  16. LICENSE="GPL-2"
  17. KEYWORDS="amd64 ppc x86"
  18. DEPEND=""
  19. RDEPEND=""
  20. S="${WORKDIR}/${MY_PV}"
  21. src_prepare() {
  22. # No need to install COPYING and INSTALL
  23. sed -i \
  24. -e 's: COPYING INSTALL::' \
  25. -e 's:COPYING history INSTALL:history:' \
  26. doc/Makefile.in || die "sed failed"
  27. if ! use examples ; then
  28. sed -i \
  29. -e 's:examples modelgen:modelgen:' \
  30. Makefile.in || die "sed failed"
  31. fi
  32. sed -i -e 's:CFLAGS = -O2 -g:CPPFLAGS +=:' \
  33. -e '/CCFLAGS =/i\CFLAGS += $(CPPFLAGS)' \
  34. -e 's:CCFLAGS = $(CFLAGS):CXXFLAGS += $(CPPFLAGS):' \
  35. -e 's:LDFLAGS = :LDFLAGS += :' \
  36. -e 's:CCFLAGS:CXXFLAGS:' \
  37. -e "s:../Gnucap:${S}/src:" \
  38. models-*/Make2 || die "sed failed"
  39. sed -i -e "s:strchr(str2, '|'):const_cast<char*>(strchr(str2, '|')):" \
  40. {src,modelgen}/ap_match.cc || die "sed failed"
  41. tc-export CC CXX
  42. }
  43. src_compile () {
  44. emake || die "Compilation failed"
  45. for PLUGIN_DIR in models-* ; do
  46. cd "${S}/${PLUGIN_DIR}"
  47. emake CC=$(tc-getCC) CCC=$(tc-getCXX) || die "Compilation failed in ${PLUGIN_DIR}"
  48. done
  49. }
  50. src_install () {
  51. emake DESTDIR="${D}" install || die "Installation failed"
  52. insopts -m0755
  53. for PLUGIN_DIR in models-* ; do
  54. insinto /usr/$(get_libdir)/gnucap/${PLUGIN_DIR}
  55. cd "${S}/${PLUGIN_DIR}"
  56. for PLUGIN in */*.so ; do
  57. newins ${PLUGIN} ${PLUGIN##*/} \
  58. || die "Installation of ${PLUGIN_DIR}/${PLUGIN} failed"
  59. done
  60. done
  61. }
  62. pkg_postinst() {
  63. elog "Documentation for development releases is now available at :"
  64. elog " http://wiki.gnucap.org/dokuwiki/doku.php?id=gnucap:manual"
  65. }