gatling-0.13.ebuild 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061
  1. # Copyright 1999-2014 Gentoo Foundation
  2. # Distributed under the terms of the GNU General Public License v2
  3. EAPI="4"
  4. inherit eutils toolchain-funcs user
  5. DESCRIPTION="High performance web server"
  6. HOMEPAGE="http://www.fefe.de/gatling/"
  7. SRC_URI="http://dl.fefe.de/${P}.tar.bz2"
  8. LICENSE="GPL-2"
  9. SLOT="0"
  10. KEYWORDS="~amd64 ~x86"
  11. IUSE="ssl diet"
  12. REQUIRED_USE="ssl? ( !diet )"
  13. DEPEND=">=dev-libs/libowfat-0.25[diet=]
  14. diet? ( dev-libs/dietlibc )
  15. ssl? ( dev-libs/openssl )"
  16. RDEPEND="${DEPEND}"
  17. src_prepare() {
  18. rm Makefile # leaves us with GNUmakefile
  19. epatch "${FILESDIR}/${P}-compile.patch"
  20. }
  21. src_compile() {
  22. local DIET=
  23. use diet && DIET='/usr/bin/diet'
  24. local targets='gatling'
  25. use ssl && targets+=' tlsgatling'
  26. emake DIET="${DIET}" CC="$(tc-getCC)" \
  27. CFLAGS="${CFLAGS} -I${ROOT}usr/include/libowfat" \
  28. LDFLAGS="${LDFLAGS}" prefix=/usr ${targets} \
  29. || die "emake ${targets} failed"
  30. }
  31. src_install() {
  32. doman gatling.1 || die "installing manpage failed"
  33. newconfd "${FILESDIR}/gatling.confd" gatling || die
  34. newinitd "${FILESDIR}/gatling.initd-2" gatling || die
  35. dodoc README.{ftp,http} || die "installing docs failed"
  36. dobin gatling || die "installing gatling binary failed"
  37. use ssl && {
  38. dodoc README.tls || die "installing docs failed"
  39. dobin tlsgatling || die "installing tlsgatling binary failed"
  40. }
  41. }
  42. pkg_setup() {
  43. ebegin "Creating gatling user and group"
  44. enewgroup gatling
  45. enewuser ${PN} -1 -1 /var/www/localhost ${PN}
  46. }