# Contributor: Steeve Chailloux # Maintainer: Stuart Cardall setglobal pkgname = 'logstash' setglobal pkgver = '5.4.1' setglobal pkgrel = '0' setglobal pkgdesc = '"A flexible, open source, data collection, parsing and enrichment pipeline'" setglobal url = '"http://logstash.net'" setglobal arch = '"noarch'" setglobal license = '"apache'" setglobal depends = '"openjdk8-jre-base java-jffi-native libc6-compat bash'" setglobal makedepends = $depends_dev setglobal install = ""$pkgname.pre-install"" setglobal pkgusers = '"logstash'" setglobal subpackages = ""$pkgname-doc"" setglobal options = '"!strip !check'" setglobal source = ""$pkgname-$pkgver.tar.gz::https://artifacts.elastic.co/downloads/$pkgname/$pkgname-$pkgver.tar.gz $pkgname.confd $pkgname.initd $pkgname.conf $pkgname.profile "" setglobal builddir = ""$(srcdir)/$(pkgname)-$(pkgver)"" proc build { return 0 } proc package { local datadir=/var/lib/logstash logdir=$datadir/logs confdir=/etc/logstash local homedir=/usr/share/logstash heapsize=150m cd $builddir # create the necessary dirs install -dm755 "$pkgdir/$homedir" || return 1 install -dm755 "$pkgdir/$logdir" || return 1 install -dm755 "$pkgdir/$datadir" || return 1 install -dm755 "$pkgdir/$confdir" || return 1 install -dm755 "$pkgdir/$confdir/conf.d" || return 1 # install scripts install -m755 -D "$srcdir"/$pkgname.initd \ "$pkgdir"/etc/init.d/$pkgname || return 1 install -m644 -D "$srcdir"/$pkgname.confd \ "$pkgdir"/etc/conf.d/$pkgname || return 1 install -m644 -D "$srcdir"/$pkgname.conf \ "$pkgdir/$confdir"/conf.d/ || return 1 install -m644 -D "$srcdir"/$pkgname.profile \ "$pkgdir"/etc/profile.d/logstash.sh || return 1 # copy files cp -r * "$pkgdir/$homedir/" || return 1 cp config/* "$pkgdir/$confdir/" || return 1 # move docs mkdir -p "$pkgdir"/usr/share/doc/logstash && cd $pkgdir find usr/share/logstash -maxdepth 1 -type f ! -name Gemfile* \ -name "[[:upper:]]*" -exec mv {} usr/share/doc/logstash/ ';' # remove files for windows find usr/share/logstash -type f -name *.bat -exec rm -f {} ';' find usr/share/logstash -type f -name *win32* -exec rm -f {} ';' find usr/share/logstash -type f -name *Win32* -exec rm -f {} ';' # remove bundled libjffi (we use Alpine's java-jffi-native) rm -rf "$pkgdir"/usr/share/logstash/vendor/jruby/lib/jni || return 1 # set default paths sed -i \ -e "s|# path.config:|path.config: $confdir/conf.d|" \ -e "s|# path.logs:|path.logs: $logdir|" \ -e "s|# path.data:|path.data: $datadir|" \ "$pkgdir/$confdir"/logstash.yml || return 1 # symlink so manual commands without -path.settings works rmdir "$pkgdir/$homedir"/data || return 1 ln -s $datadir "$pkgdir/$homedir"/data ln -s $logdir "$pkgdir/$homedir"/logs # reduce heap sizes sed -i \ -e "s|^-Xms.*|-Xms$heapsize|" \ -e "s|^-Xmx.*|-Xmx$heapsize|" \ "$pkgdir/$confdir"/jvm.options || return 1 } setglobal sha512sums = '"79429494f9499cb1ed8567b2ae00b8e1d0e692304d880f88e65198f04ad7e29b942614c299efe36d1d1a2e50ef63d6e15cc6a2204f005808c5f79940ed7ec601 logstash-5.4.1.tar.gz 94b18da3f0ef40f68118b27654563e7aa6dd4a3b90f0d8ad61a8be579d4be62c2bf1b192a32ee6140b81224343eeb442687539f6def1e725787b8cb96c0c70d1 logstash.confd 828684ea0b9faa53ac51f7fb22bf73d862dc058d605f27958db6a8efbd10f5463a0837fa88b62a3964582c72fdd7ece434057a540b0924eae1fae17b9d5887b4 logstash.initd 21609c8f44b31a5f298573be4b5c0fdcdc165e603a95c3626570fb6dd44dad114a74ee3f10fbd518f72b537a3d6bdcdbad09798c4bead0ee16f2a3b8e2b00ed3 logstash.conf 180349d57a6a48be9052649425a945a07cf5e194d0f32f83567b460936729a70244d73c3495f8a318a3b98ac99a2848cadfbee5bd017da803c68c5140b6cd29d logstash.profile'"