Skip to content

Instantly share code, notes, and snippets.

@samuelsadok
Created January 20, 2020 09:47
Show Gist options
  • Save samuelsadok/3d3f912558b93a78ddadaffcd52900b8 to your computer and use it in GitHub Desktop.
Save samuelsadok/3d3f912558b93a78ddadaffcd52900b8 to your computer and use it in GitHub Desktop.
# Maintainer: Yunhui Fu (yhfudev@gmail.com)
# Contributor: Julien Sopena (jsopena.archlinux@free.fr)
# Contributor: Oleg Smirnov (oleg.smirnov@gmail.com)
# Contributor: angrycore (angrycore@gmail.com)
# Contributor: Christophe Guéret (christophe.gueret@gmail.com)
# Contributor: oguzkagan <me at oguzkaganeren dot com dot tr>
#
pkgname="omnetpp"
pkgver=5.5.1
pkgrel=3
pkgdesc="Component-based simulation package designed for modeling communication networks"
url="http://www.omnetpp.org"
license=("Academic Public License")
depends=('tcl' 'openscenegraph' 'tk' 'blt' 'osgearth')
makedepends=('libxml2' 'bison' 'flex' 'openscenegraph' 'qt4' 'osgearth')
arch=('i686' 'x86_64')
optdepends=('openmpi: message passing library for parallel simulation',
'java-environment: Java runtime for using OMNeT++/OMNEST IDE')
install=${pkgname}.install
_pkgname="omnetpp"
DLAGENTS=(
"http::/usr/bin/wget --no-check-certificate -c -r -np -nd -H --referer https://omnetpp.org/ %u"
"https::/usr/bin/wget --no-check-certificate -c -r -np -nd -H --referer https://omnetpp.org/ %u"
)
source=(
omnetpp-5.5.1-src-linux.tgz::"https://github.com/omnetpp/omnetpp/releases/download/omnetpp-5.5.1/omnetpp-5.5.1-src-linux.tgz"
OMNeT++.desktop
)
md5sums=('f7abe260ff47ec02a665e287c653db86'
'4e51f984f1a7114ab1f0b6f88fa4e0bc')
build() {
cd ${srcdir}/${_pkgname}-${pkgver}
PATH=${srcdir}/${_pkgname}-${pkgver}/bin:$PATH
changeText1=". .\/configure.user"
changeText2=".\/configure.user"
LD_LIBRARY_PATH=${srcdir}/${_pkgname}-${pkgver}/lib:$LD_LIBRARY_PATH
sed -i 's!OMNETPP_ROOT/images!OMNETPP_ROOT/images;/usr/share/omnetpp/images!' configure*
sed -i '/for arg in \$ac_configure_args/,+8 d' configure
# Fix paths in Makefile.inc.in
sed "s|OMNETPP_IMAGE_PATH := .*|OMNETPP_IMAGE_PATH := ./bitmaps:./images:/usr/share/omnetpp/images|" -i Makefile.inc.in
./configure --prefix=/usr
sed -i 's!IDEDIR=.*!IDEDIR=/opt/omnetpp/ide!' src/utils/omnetpp src/utils/omnest
sed -i 's!osgi.instance.area.default=.*$!#osgi.instance.area.default=/usr/share/omnetpp/samples!g' ide/configuration/config.ini
make || return 1
}
package() {
cd ${srcdir}/${_pkgname}-${pkgver}
mkdir -p ${pkgdir}/usr/bin
install -m755 bin/* ${pkgdir}/usr/bin
sed "s|${srcdir}/${_pkgname}-${pkgver}|/usr|g" -i ${pkgdir}/usr/bin/opp_makemake
sed "s|Makefile.inc|../opt/omnetpp/Makefile.inc|" -i ${pkgdir}/usr/bin/opp_configfilepath
sed "s|OMNETPP_ROOT := .*|OMNETPP_ROOT := /opt/omnetpp|" -i Makefile.inc
sed "s|OMNETPP_BIN_DIR = .*|OMNETPP_BIN_DIR = /usr/bin|" -i Makefile.inc
sed "s|OMNETPP_LIB_DIR = .*|OMNETPP_LIB_DIR = /usr/lib|" -i Makefile.inc
sed "s|OMNETPP_DOC_DIR = .*|OMNETPP_DOC_DIR = /usr/share/omnetpp/doc|" -i Makefile.inc
mkdir -p ${pkgdir}/usr/lib
install lib/* ${pkgdir}/usr/lib
install -d ${pkgdir}/usr/share/omnetpp/{images,doc}
cp -R images/* ${pkgdir}/usr/share/omnetpp/images
cp -R doc/* ${pkgdir}/usr/share/omnetpp/doc
install -d ${pkgdir}/usr/share/emacs/site-lisp
install -m644 misc/emacs/ned-mode.el ${pkgdir}/usr/share/emacs/site-lisp
install -m644 misc/emacs/ini-mode.el ${pkgdir}/usr/share/emacs/site-lisp
install -d ${pkgdir}/opt/omnetpp
cp Makefile.inc ${pkgdir}/opt/omnetpp
cp -R samples ${pkgdir}/opt/omnetpp
cp -R ide ${pkgdir}/opt/omnetpp
cp -R src ${pkgdir}/opt/omnetpp
cp -R test ${pkgdir}/opt/omnetpp
cp -R include ${pkgdir}/opt/omnetpp
cp -R out ${pkgdir}/opt/omnetpp
touch ${pkgdir}/opt/omnetpp/ide/error.log
chmod a+rw ${pkgdir}/opt/omnetpp/ide/error.log
mkdir -p ${pkgdir}/usr/share/icons/
cp ${srcdir}/omnetpp-${pkgver}/ide/icon.png ${pkgdir}/usr/share/icons/omnetpp.png
mkdir -p ${pkgdir}/usr/share/applications/
cd ${srcdir}
cp OMNeT++.desktop ${pkgdir}/usr/share/applications/
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment