1 # Maintainer: Julien Nicoulaud <julien.nicoulaud@gmail.com>
2 # Source: https://github.com/nicoulaj/archlinux-packages
3 pkgname=gatling-stress-tool # Name collision with https://aur.archlinux.org/packages.php?ID=7159
7 pkgdesc="An optimized stress test tool."
9 url="https://github.com/excilys/gatling"
11 depends=('java-environment>=6' 'bash' 'desktop-file-utils')
12 install=${_pkgname}.install
14 source=("${_pkgname}-${pkgver}.tar.gz::https://github.com/downloads/excilys/${_pkgname}/${_pkgname}-charts-highcharts-${pkgver}-bundle.tar.gz")
15 md5sums=('f7036cdb9a47a226001478723f103668')
18 msg2 "Generate scripts for /etc/profile.d..."
19 cat <<EOF > "${srcdir}"/${_pkgname}.profile.d.sh
20 export GATLING_HOME=/opt/${_pkgname}
22 cat <<EOF > "${srcdir}"/${_pkgname}.profile.d.csh
23 setenv GATLING_HOME "/opt/${_pkgname}"
26 msg2 "Generate executable script for recorder..."
27 cat > "${srcdir}/${_pkgname}-recorder.sh" << EOF
29 "\$JAVA_HOME/bin/java" -jar "\$GATLING_HOME/recorder/${_pkgname}-recorder-${pkgver}.jar" "\$@"
32 msg2 "Generate desktop application entry for recorder..."
33 cat > "${srcdir}/${_pkgname} recorder.desktop" << EOF
37 TryExec=${_pkgname}-recorder
38 Exec=${_pkgname}-recorder %u
39 Icon=/opt/gatling/assets/style/logo.png
42 Categories=Application;Utility;
47 msg2 "Install the assembly at /opt/${_pkgname}..."
48 install -dm755 "${pkgdir}/opt/${_pkgname}"
49 cp -a "${srcdir}"/${_pkgname}-charts-highcharts-${pkgver}/* "${pkgdir}/opt/${_pkgname}"
51 msg2 "Set up the GATLING_HOME environment variable in /etc/profile.d..."
52 install -Dm755 "${srcdir}/${_pkgname}.profile.d.sh" "${pkgdir}/etc/profile.d/${_pkgname}.sh"
53 install -Dm755 "${srcdir}/${_pkgname}.profile.d.csh" "${pkgdir}/etc/profile.d/${_pkgname}.csh"
55 msg2 "Install links to documentation resources at /usr/share/doc/${_pkgname}..."
56 install -dm755 "${pkgdir}/usr/share/doc/${_pkgname}"
57 ln -s /opt/${_pkgname}/user-files "${pkgdir}/usr/share/doc/${_pkgname}/"
59 msg2 "Install links to configuration files at /etc/${_pkgname}..."
60 install -dm755 "${pkgdir}/etc/${_pkgname}"
61 ln -s /opt/${_pkgname}/conf/${_pkgname}.conf "${pkgdir}/etc/${_pkgname}/${_pkgname}.conf"
62 ln -s /opt/${_pkgname}/conf/logback.xml "${pkgdir}/etc/${_pkgname}/logback.xml"
64 msg2 "Install links to executables in /usr/bin..."
65 install -dm755 "${pkgdir}/usr/bin"
66 ln -s /opt/${_pkgname}/bin/${_pkgname}.sh "${pkgdir}/usr/bin/${_pkgname}"
68 msg2 "Install an executable for the recorder at /usr/bin/${pkgname}..."
69 install -Dm755 "${srcdir}/${_pkgname}-recorder.sh" "${pkgdir}/usr/bin/${_pkgname}-recorder"
71 msg2 "Install a desktop application entry for the recorder at /usr/share/applications..."
72 install -Dm644 "${srcdir}/${_pkgname} recorder.desktop" "${pkgdir}/usr/share/applications/${_pkgname} recorder.desktop"
74 msg2 "Fix some permissions..."
75 chmod +x "${pkgdir}/opt/${_pkgname}/bin/${_pkgname}.sh"
78 # vim:set ts=2 sw=2 et: