Pastebin launched a little side project called VERYVIRAL.com, check it out ;-) Want more features on Pastebin? Sign Up, it's FREE!
Guest

omnetpp 4.2.2 PKGBUILD

By: a guest on Aug 18th, 2012  |  syntax: None  |  size: 2.83 KB  |  views: 127  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1. # Maintainer: Julien Sopena (jsopena.archlinux@free.fr)
  2. # Contributor: Oleg Smirnov (oleg.smirnov@gmail.com)
  3. # Contributor: angrycore (angrycore@gmail.com)
  4. # Contributor: Christophe Guéret (christophe.gueret@gmail.com)
  5. pkgname="omnetpp"
  6. pkgver=4.2.2
  7. pkgrel=1
  8. pkgdesc="Component-based simulation package designed for modeling communication networks"
  9. url="http://www.omnetpp.org"
  10. license="Academic Public License"
  11. depends=(tcl tk blt)
  12. makedepends=(libxml2 bison flex)
  13. arch=('i686' 'x86_64')
  14. optdepends=('openmpi: message passing library for parallel simulation',
  15.   'openjdk6: Java runtime for using OMNeT++/OMNEST IDE')
  16. install=${pkgname}.install
  17. _pkgname="omnetpp"
  18. source=(http://omnetpp.org/omnetpp/doc_download/2245-omnet-422-source--ide-tgz 'OMNeT ++.desktop')
  19. md5sums=('8ec7dd033ed9edd50d3941e69caaa3c7'
  20.          '4e51f984f1a7114ab1f0b6f88fa4e0bc')
  21.          
  22. build() {
  23.         cd ${srcdir}/${_pkgname}-${pkgver}
  24.         PATH=${srcdir}/${_pkgname}-${pkgver}/bin:$PATH
  25.         LD_LIBRARY_PATH=${srcdir}/${_pkgname}-${pkgver}/lib:$LD_LIBRARY_PATH
  26.        
  27.         sed -i 's!OMNETPP_ROOT/images!OMNETPP_ROOT/images;/usr/share/omnetpp/images!' configure*
  28.  
  29.         ./configure --prefix=/usr
  30.  
  31.         sed -i 's!IDEDIR=.*!IDEDIR=/opt/omnetpp/ide!' src/utils/omnetpp src/utils/omnest
  32.         sed -i 's!osgi.instance.area.default=.*$!#osgi.instance.area.default=/usr/share/omnetpp/samples!g' ide/configuration/config.ini
  33.  
  34.         sed -i "s/#include <string>/#include <string>\n#include <unistd.h>/" src/utils/abspath.cc
  35.  
  36.         make || return 1
  37.        
  38.         mkdir -p ${pkgdir}/usr/bin
  39.         install -m755 bin/* ${pkgdir}/usr/bin
  40.  
  41.         sed "s|${srcdir}/${_pkgname}-${pkgver}|/usr|g" -i ${pkgdir}/usr/bin/opp_makemake
  42.         sed "s|OMNETPP_INCL_DIR=/usr/include|OMNETPP_INCL_DIR=/usr/include/omnetpp|" -i ${pkgdir}/usr/bin/opp_makemake
  43.        
  44.         mkdir -p ${pkgdir}/usr/lib
  45.         install lib/gcc/* ${pkgdir}/usr/lib
  46.  
  47.         mkdir -p ${pkgdir}/usr/include/omnetpp
  48.         mkdir -p ${pkgdir}/usr/include/omnetpp/platdep
  49.         install -m644 include/*.h ${pkgdir}/usr/include/omnetpp
  50.         install -m644 include/platdep/*.h ${pkgdir}/usr/include/omnetpp/platdep
  51.        
  52.         install -d ${pkgdir}/usr/share/omnetpp/{images,doc,samples}
  53.         cp -R images/* ${pkgdir}/usr/share/omnetpp/images
  54.         cp -R doc/* ${pkgdir}/usr/share/omnetpp/doc
  55.         cp -R samples/* ${pkgdir}/usr/share/omnetpp/samples
  56.  
  57.         install -d ${pkgdir}/usr/share/emacs/site-lisp
  58.         install -m644 contrib/emacs/ned-mode.el ${pkgdir}/usr/share/emacs/site-lisp
  59.         install -m644 contrib/emacs/ini-mode.el ${pkgdir}/usr/share/emacs/site-lisp
  60.  
  61.         install -d ${pkgdir}/opt/omnetpp
  62.         cp -R ide ${pkgdir}/opt/omnetpp
  63.         touch ${pkgdir}/opt/omnetpp/ide/error.log
  64.         chmod a+rw ${pkgdir}/opt/omnetpp/ide/error.log
  65.        
  66.         mkdir -p ${pkgdir}/usr/share/icons/
  67.         cp ${srcdir}/omnetpp-${pkgver}/ide/icon.png ${pkgdir}/usr/share/icons/omnetpp.png
  68.        
  69.         mkdir -p ${pkgdir}/usr/share/applications/
  70.         cd ${srcdir}
  71.         cp 'OMNeT ++.desktop' ${pkgdir}/usr/share/applications/
  72. }