updated on Mon Jan 23 12:00:23 UTC 2012
[aur-mirror.git] / omnetpp4 / PKGBUILD
blob96e9c69121a5b8aa7c77f2480af206ae88b98f4f
1 # Maintainer: Oleg Smirnov <oleg.smirnov@gmail.com>
2 # Contributor: angrycore <angrycore@gmail.com>
3 pkgname="omnetpp4"
4 pkgver=4.1
5 pkgrel=3
6 pkgdesc="Component-based simulation package designed for modeling communication networks"
7 url="http://www.omnetpp.org"
8 license="Academic Public License"
9 depends=(tcl tk blt)
10 makedepends=(libxml2 bison flex)
11 arch=('i686' 'x86_64')
12 optdepends=('openmpi: message passing library for parallel simulation',
13   'openjdk6: Java runtime for using OMNeT++/OMNEST IDE')
14 install=${pkgname}.install
15 _pkgname="omnetpp"
16 source=(http://www.omnetpp.org/download/release/${_pkgname}-${pkgver}-src.tgz 'OMNeT ++.desktop')
17 md5sums=('acc78fbc9f4b6ca921d11fabcec55c44'
18          '4e51f984f1a7114ab1f0b6f88fa4e0bc')
19          
20 build() {
21         cd ${srcdir}/${_pkgname}-${pkgver}
22         PATH=${srcdir}/${_pkgname}-${pkgver}/bin:$PATH
23         LD_LIBRARY_PATH=${srcdir}/${_pkgname}-${pkgver}/lib:$LD_LIBRARY_PATH
24         
25         sed -i 's!OMNETPP_ROOT/images!OMNETPP_ROOT/images;/usr/share/omnetpp/images!' configure*
27         ./configure --prefix=/usr
29         sed -i 's!IDEDIR=.*!IDEDIR=/opt/omnetpp/ide!' src/utils/omnetpp src/utils/omnest
30         sed -i 's!osgi.instance.area.default=.*$!#osgi.instance.area.default=/usr/share/omnetpp/samples!g' ide/configuration/config.ini
32         make || return 1
33         
34         mkdir -p ${pkgdir}/usr/bin
35         install -m755 bin/* ${pkgdir}/usr/bin
37         sed "s|${srcdir}/${_pkgname}-${pkgver}|/usr|g" -i ${pkgdir}/usr/bin/opp_makemake
38         sed "s|OMNETPP_INCL_DIR=/usr/include|OMNETPP_INCL_DIR=/usr/include/omnetpp|" -i ${pkgdir}/usr/bin/opp_makemake
39         
40         mkdir -p ${pkgdir}/usr/lib
41         install lib/gcc/* ${pkgdir}/usr/lib
43         mkdir -p ${pkgdir}/usr/include/omnetpp
44         mkdir -p ${pkgdir}/usr/include/omnetpp/platdep
45         install -m644 include/*.h ${pkgdir}/usr/include/omnetpp
46         install -m644 include/platdep/*.h ${pkgdir}/usr/include/omnetpp/platdep
47         
48         install -d ${pkgdir}/usr/share/omnetpp/{images,doc,samples}
49         cp -R images/* ${pkgdir}/usr/share/omnetpp/images
50         cp -R doc/* ${pkgdir}/usr/share/omnetpp/doc
51         cp -R samples/* ${pkgdir}/usr/share/omnetpp/samples
53         install -d ${pkgdir}/usr/share/emacs/site-lisp
54         install -m644 contrib/emacs/ned-mode.el ${pkgdir}/usr/share/emacs/site-lisp
55         install -m644 contrib/emacs/ini-mode.el ${pkgdir}/usr/share/emacs/site-lisp
57         install -d ${pkgdir}/opt/omnetpp
58         cp -R ide ${pkgdir}/opt/omnetpp
59         
60         mkdir -p $pkgdir/usr/share/icons/
61         cp $srcdir/omnetpp-4.1/ide/icon.png $pkgdir/usr/share/icons/omnetpp.png
62         
63         mkdir -p $pkgdir/usr/share/applications/
64         cd $srcdir
65         cp 'OMNeT ++.desktop' $pkgdir/usr/share/applications/