1 # Maintainer: Julien Nicoulaud <julien.nicoulaud@gmail.com>
2 # Source: https://github.com/nicoulaj/archlinux-packages
3 pkgname=gatling-stress-tool-git # Name collision with https://aur.archlinux.org/packages.php?ID=7159
7 pkgdesc="An optimized stress test tool."
9 url="http://gatling-tool.org"
11 depends=('java-environment>=6' 'bash' 'desktop-file-utils')
12 makedepends=(git maven)
13 install=${_pkgname}.install
15 backup=(opt/${_pkgname}/conf/gatling.conf
16 opt/${_pkgname}/conf/logback.xml)
17 provides=(gatling-stress-tool)
18 conflicts=(gatling-stress-tool)
20 _gitroot=git://github.com/excilys/gatling.git
24 msg2 "Connecting to GIT server...."
25 if [ -d "${srcdir}/${_gitname}" ] ; then
26 ( cd "${srcdir}/${_gitname}" && git pull origin )
27 msg2 "The local files are updated."
29 git clone $_gitroot "${srcdir}/${_gitname}"
33 cd "${srcdir}/${_gitname}"
36 clean install || return 1
38 msg2 "Generate scripts for /etc/profile.d..."
39 cat <<EOF > "${srcdir}"/${_pkgname}.profile.d.sh
40 export GATLING_HOME=/opt/${_pkgname}
42 cat <<EOF > "${srcdir}"/${_pkgname}.profile.d.csh
43 setenv GATLING_HOME "/opt/${_pkgname}"
46 msg2 "Generate desktop application entry for recorder..."
47 cat > "${srcdir}/recorder.desktop" << EOF
51 TryExec=${_pkgname}-recorder
52 Exec=${_pkgname}-recorder %u
53 Icon=/opt/gatling/assets/style/logo.png
56 Categories=Application;Utility;
61 msg2 "Unpacking assembly..."
63 tar xvzf "${srcdir}"/${_gitname}/gatling-bundle/target/gatling-bundle-*-SNAPSHOT-bundle.tar.gz
65 msg2 "Install the assembly at /opt/${_pkgname}..."
66 install -dm755 "${pkgdir}/opt/${_pkgname}"
67 cp -a "${srcdir}"/gatling-bundle-*-SNAPSHOT/* "${pkgdir}/opt/${_pkgname}"
69 msg2 "Set up the GATLING_HOME environment variable in /etc/profile.d..."
70 install -Dm755 "${srcdir}/${_pkgname}.profile.d.sh" "${pkgdir}/etc/profile.d/${_pkgname}.sh"
71 install -Dm755 "${srcdir}/${_pkgname}.profile.d.csh" "${pkgdir}/etc/profile.d/${_pkgname}.csh"
73 msg2 "Install links to documentation resources at /usr/share/doc/${_pkgname}..."
74 install -dm755 "${pkgdir}/usr/share/doc/${_pkgname}"
75 ln -s /opt/${_pkgname}/user-files "${pkgdir}/usr/share/doc/${_pkgname}/"
77 msg2 "Install links to configuration files at /etc/${_pkgname}..."
78 install -dm755 "${pkgdir}/etc/${_pkgname}"
79 ln -s /opt/${_pkgname}/conf/${_pkgname}.conf "${pkgdir}/etc/${_pkgname}/${_pkgname}.conf"
80 ln -s /opt/${_pkgname}/conf/logback.xml "${pkgdir}/etc/${_pkgname}/logback.xml"
82 msg2 "Install executables in /usr/bin..."
83 install -dm755 "${pkgdir}/usr/bin"
84 ln -s /opt/${_pkgname}/bin/${_pkgname}.sh "${pkgdir}/usr/bin/${_pkgname}"
85 ln -s /opt/${_pkgname}/bin/recorder.sh "${pkgdir}/usr/bin/${_pkgname}-recorder"
87 msg2 "Install a desktop application entry for the recorder at /usr/share/applications..."
88 install -Dm644 "${srcdir}/recorder.desktop" "${pkgdir}/usr/share/applications/${_pkgname} recorder.desktop"
90 msg2 "Fix some permissions..."
91 find "${pkgdir}/opt/${_pkgname}" -type d -exec chmod 755 {} \;
92 find "${pkgdir}/opt/${_pkgname}" -name "*.jar" -type f -exec chmod 644 {} \;
95 # vim:set ts=2 sw=2 et: