diff options
author | Angel Caido | 2015-10-06 12:45:54 -0400 |
---|---|---|
committer | Angel Caido | 2015-10-06 12:45:54 -0400 |
commit | cb69389079d20b816bf8ffcaff194ca4eb8703a3 (patch) | |
tree | a826dde3310c73d8a13cb57697f704fc92c23f4e | |
parent | 1f1a20974047a9fc4540f2d6d441933d23fd30c0 (diff) | |
download | aur-cb69389079d20b816bf8ffcaff194ca4eb8703a3.tar.gz |
Initial import
-rw-r--r-- | .SRCINFO | 57 | ||||
-rw-r--r-- | PKGBUILD | 121 | ||||
-rw-r--r-- | epoptes-client.install | 24 | ||||
-rw-r--r-- | epoptes-client.service | 7 | ||||
-rw-r--r-- | epoptes.install | 73 | ||||
-rw-r--r-- | epoptes.service | 14 |
6 files changed, 225 insertions, 71 deletions
@@ -1,6 +1,6 @@ pkgbase = epoptes-bzr pkgdesc = An opensource computer lab management and monitoring tool - pkgver = 0.5.7.426 + pkgver = 0.5.8.442 pkgrel = 1 url = https://code.launchpad.net/~epoptes/epoptes/trunk install = epoptes.install @@ -8,6 +8,26 @@ pkgbase = epoptes-bzr license = GPL3 makedepends = bzr makedepends = python2-distutils-extra + provides = epoptes + conflicts = epoptes + source = bzr+lp:epoptes + source = epoptes.service + source = epoptes-client.service + sha256sums = SKIP + sha256sums = ea47542b6c6e7a1f75a715927f3b7e13ea4ffd47ded7874c61c153e107c3313e + sha256sums = 97d2ea075e17c83be61dc05be4c410c087ab930c7dd4840a50e9459a8d46f97c + +pkgname = epoptes-bzr + depends = libfaketime + depends = adduser + depends = librsvg + depends = notification-daemon + depends = xfce4-notifyd + depends = openssl + depends = python + depends = python2-pyopenssl + depends = openssl + depends = pygtk depends = python2-dbus depends = python2-notify depends = python2-pycha-hg @@ -17,16 +37,29 @@ pkgbase = epoptes-bzr depends = python2-service-identity depends = python2-twisted depends = socat - provides = epoptes - conflicts = epoptes - source = bzr+lp:epoptes - source = epoptes-server.service - source = epoptes-client.service - source = epoptes-client - sha256sums = SKIP - sha256sums = 0dd8cc5255798a73f8b88ad8f34a4b7c7340f88dbab65d05d2a74843843c9403 - sha256sums = a7961919235f31a4a2059dda46bf1d0b3b5d20d06d1ce723804634de2443c20f - sha256sums = 64d27face12b754dd01e6b46b511aca11fa348779471d9b9c025cbaf5176aa4d + depends = x11vnc + depends = ssvnc + depends = iperf + depends = xterm -pkgname = epoptes-bzr +pkgname = epoptes-client-bzr + pkgdesc = An opensource computer lab management and monitoring tool - client side + install = epoptes-client.install + depends = iproute2 + depends = procps-ng + depends = python + depends = librsvg + depends = lib32-procps-ng + depends = bsdmainutils + depends = screen + depends = iperf + depends = pygtk + depends = socat + depends = x11vnc + depends = ssvnc + depends = openssl + depends = xterm + depends = ethtool + provides = epoptes-client + conflicts = epoptes-client @@ -1,36 +1,33 @@ # Maintainer : Angel_Caido <geussepe at gmail dot com> # Contributor : Sam Stuewe <halosghost at archlinux dot info> -_name=epoptes -pkgname="${_name}-bzr" -pkgver=0.5.7.426 +pkgname=(epoptes-bzr epoptes-client-bzr) +pkgbase=epoptes-bzr +pkgver=0.5.8.442 pkgrel=1 pkgdesc='An opensource computer lab management and monitoring tool' -makedepends=('bzr' 'python2-distutils-extra') +makedepends=(bzr python2-distutils-extra) url='https://code.launchpad.net/~epoptes/epoptes/trunk' -license=('GPL3') -depends=('python2-dbus' 'python2-notify' 'python2-pycha-hg' 'hicolor-icon-theme' 'python2-netifaces' 'python2-pyopenssl' 'python2-service-identity' 'python2-twisted' 'socat') -arch=('any') -conflicts=("${_name}") -provides=("${_name}") +license=(GPL3) +arch=(any) +conflicts=(epoptes) +provides=(epoptes) source=('bzr+lp:epoptes' - 'epoptes-server.service' - 'epoptes-client.service' - 'epoptes-client') + 'epoptes.service' + 'epoptes-client.service') sha256sums=('SKIP' - '0dd8cc5255798a73f8b88ad8f34a4b7c7340f88dbab65d05d2a74843843c9403' - 'a7961919235f31a4a2059dda46bf1d0b3b5d20d06d1ce723804634de2443c20f' - '64d27face12b754dd01e6b46b511aca11fa348779471d9b9c025cbaf5176aa4d') + 'ea47542b6c6e7a1f75a715927f3b7e13ea4ffd47ded7874c61c153e107c3313e' + '97d2ea075e17c83be61dc05be4c410c087ab930c7dd4840a50e9459a8d46f97c') -install="${_name}".install +install=epoptes.install pkgver () { - cd "${srcdir}/${_name}" - printf '%s.%s' "$(bzr tags --sort=time | tail -n1 | cut -d '-' -f1)" "$(bzr revno)" + cd "${srcdir}/epoptes" + printf '%s.%s' "$(bzr tags --sort=time | awk '{print $1}' | cut -d'-' -f1 | tail -n1)" "$(bzr revno)" } prepare () { - cd "${srcdir}/${_name}" + cd "${srcdir}/epoptes" sed -e 's/sbin/bin/g' \ -i setup.py for i in 'epoptes/ui/benchmark.py' \ @@ -63,13 +60,83 @@ prepare () { done } -package () { - cd "${srcdir}/${_name}" +package_epoptes-bzr () { + depends=(libfaketime + adduser + librsvg + notification-daemon + xfce4-notifyd + openssl + python + python2-pyopenssl + openssl + pygtk + python2-dbus + python2-notify + python2-pycha-hg + hicolor-icon-theme + python2-netifaces + python2-pyopenssl + python2-service-identity + python2-twisted + socat + x11vnc + ssvnc + iperf + xterm) + + cd "${srcdir}/epoptes" + python2 setup.py install --root="${pkgdir}/" --optimize=1 + mkdir -p "${pkgdir}/etc/default" + mkdir -p "${pkgdir}/usr/lib/systemd/system" + install -m 644 "${startdir}/epoptes.service" "${pkgdir}"/usr/lib/systemd/system/epoptes.service + install -m 644 "${startdir}/src/epoptes/debian/epoptes.default" "${pkgdir}"/etc/default/epoptes + rm "${pkgdir}/usr/bin/epoptes-client" + rm -r "${pkgdir}/etc/xdg" + rm -r "${pkgdir}/usr/share/epoptes-client" + rm -r "${pkgdir}/usr/share/ldm" + rm -r "${pkgdir}/usr/share/man/man8" + cp -dr --no-preserve=ownership "${startdir}/src/epoptes/epoptes" "${pkgdir}"/usr/share/pyshared + cp -dr --no-preserve=ownership "${startdir}/src/epoptes/twisted" "${pkgdir}"/usr/share/pyshared + +} + +package_epoptes-client-bzr () { + pkgdesc="An opensource computer lab management and monitoring tool - client side" + depends=(iproute2 + procps-ng + python + librsvg + lib32-procps-ng + bsdmainutils + screen + iperf + pygtk + socat + x11vnc + ssvnc + openssl + xterm + ethtool) + + conflicts=(epoptes-client) + provides=(epoptes-client) + install=epoptes-client.install + + cd "${srcdir}/epoptes" python2 setup.py install --root="${pkgdir}/" --optimize=1 - mkdir "${pkgdir}/usr/lib/systemd" - mkdir "${pkgdir}/usr/lib/systemd/system" - mkdir "${pkgdir}/etc/default" - install -m 644 "${startdir}/epoptes-client.service" "${pkgdir}"/usr/lib/systemd/system/epoptes-client.service - install -m 644 "${startdir}/epoptes-server.service" "${pkgdir}"/usr/lib/systemd/system/epoptes-server.service - install -m 644 "${startdir}/epoptes-client" "${pkgdir}"/etc/default/epoptes-client + mkdir -p "${pkgdir}/usr/lib/systemd/system" + mkdir -p "${pkgdir}/etc/default" + install -m 644 "${startdir}/src/epoptes/debian/epoptes-client.default" "${pkgdir}"/etc/default/epoptes + install -m 644 "${startdir}/epoptes-client.service" "${pkgdir}/usr/lib/systemd/system/epoptes-client.service" + rm "${pkgdir}/usr/bin/epoptes" + rm -r "${pkgdir}/usr/share/epoptes" + rm -r "${pkgdir}/usr/lib/python2.7" + rm -r "${pkgdir}/usr/share/applications" + rm -r "${pkgdir}/usr/share/doc" + rm -r "${pkgdir}/usr/share/icons" + rm -r "${pkgdir}/usr/share/locale" + rm -r "${pkgdir}/usr/share/ltsp" + rm -r "${pkgdir}/usr/share/man/man1" + mv "${pkgdir}/etc/default/epoptes" "${pkgdir}/etc/default/epoptes-client" } diff --git a/epoptes-client.install b/epoptes-client.install new file mode 100644 index 000000000000..2876ce6cd5bc --- /dev/null +++ b/epoptes-client.install @@ -0,0 +1,24 @@ +post_install() { + gtk-update-icon-cache -q -t -f usr/share/icons/hicolor + echo "The installation has finished. Please bare in mind you'll have to do the following before using Epoptes:" + echo "1.- You will have to run as root:" + echo " 'systemctl enable epoptes-client' to enable the Epoptes client daemon" + echo "2.- You may need to restart your system for everything to work." + echo "3.- If you don't want to restart your system, then [after doing all of the above] you will have to run as root:" + echo " 'systemctl start epoptes-client' to start the Epoptes client daemon." + echo "After all this you still have to log out and then log back in and now Epoptes should work without a problem." +} + +post_upgrade() { + systemctl daemon-reload +} + +pre_remove() { + systemctl stop epoptes-client.service + systemctl disable epoptes-client.service +} + +post_remove() { + rm /etc/default/epoptes-client + systemctl daemon-reload +} diff --git a/epoptes-client.service b/epoptes-client.service index 0e365c678f47..b52336130ae7 100644 --- a/epoptes-client.service +++ b/epoptes-client.service @@ -1,12 +1,9 @@ [Unit] Description=Epoptes-client system daemon -Wants=network-online.target -After=network-online.target +After=network.target [Service] -EnvironmentFile=-/etc/default/epoptes-client -ExecStartPre=/bin/sh -c "if ! [ -s /etc/epoptes/server.crt ]; then /usr/sbin/epoptes-client -c ${SERVER}; fi" ExecStart=/usr/sbin/epoptes-client [Install] -WantedBy=multi-user.target
\ No newline at end of file +WantedBy=multi-user.target diff --git a/epoptes.install b/epoptes.install index 8518fbf00a8d..d1f4fb506210 100644 --- a/epoptes.install +++ b/epoptes.install @@ -1,36 +1,55 @@ post_install() { - gtk-update-icon-cache -q -t -f usr/share/icons/hicolor - mkdir /etc/epoptes - openssl req -batch -x509 -nodes -newkey rsa:1024 -days 3652 -keyout /etc/epoptes/server.key -out /etc/epoptes/server.crt - chmod 600 /etc/epoptes/server.key - if grep -q "epoptes" /etc/group - then - "Group 'epoptes' already exists. Skipping group's creation." - else - groupadd epoptes - echo "Group 'epoptes' has been created." - fi - echo "The installation has finished. Please bare in mind you'll have to do the following before using Epoptes:" - echo "1.- You will have to add yourself to the 'epoptes' group." - echo "2.- You will have to run as root:" - echo " 'systemctl enable epoptes-server' to enable the Epoptes server Daemon." - echo " 'systemctl enable epoptes-client' to enable the Epoptes Client Daemon" - echo "3. You may need to restart your system for everything to work." - echo "4. If you don't want to restart your system, then [after doing all of the above] you will have to run as root:" - echo " 'systemctl start epoptes-server' to start the Epoptes server Daemon." - echo " 'systemctl start epoptes-client' to start the Epoptes server Daemon." - echo "After all this you still have to log out and then log back in and now Epoptes should work without a problem." + gtk-update-icon-cache -q -t -f usr/share/icons/hicolor + + if getent group epoptes + then + "Group 'epoptes' already exists. Skipping group's creation." + else + groupadd epoptes + echo "Group 'epoptes' has been added." + fi + + if ! [ -s /etc/epoptes/server.key ] || ! [ -s /etc/epoptes/server.crt ] + then + mkdir -p /etc/epoptes + + faketime '1970-01-01 00:00:00 UTC' \ + openssl req -batch -x509 -nodes -newkey rsa:1024 \ + -days $(($(date --utc +%s) / 86400 + 3652)) \ + -keyout /etc/epoptes/server.key \ + -out /etc/epoptes/server.crt + chmod 600 /etc/epoptes/server.key + fi + + echo "The installation has finished. Please bare in mind you'll have to do the following before using Epoptes:" + echo "1.- You will have to add yourself to the 'epoptes' group." + echo "2.- You will have to run as root:" + echo " 'systemctl enable epoptes' to enable the Epoptes server daemon." + echo "3.- You may need to restart your system for everything to work." + echo "4.- If you don't want to restart your system, then [after doing all of the above] you will have to run as root:" + echo " 'systemctl start epoptes' to start the Epoptes server daemon." + echo "After all this you still have to log out and then log back in and now Epoptes should work without a problem." } post_upgrade() { - systemctl daemon-reload + systemctl daemon-reload +} + +pre_remove() { + systemctl stop epoptes.service + systemctl disable epoptes.service } post_remove() { - rm -rf /etc/epoptes - rm /etc/default/epoptes-client - groupdel epoptes - systemctl daemon-reload - echo "Epoptes has been removed successfully." + rm -rf /etc/epoptes + + if getent group epoptes + then + groupdel epoptes + echo "Group 'epoptes' has been deteled." + else + echo "Group 'epoptes' doesn't exist. Skipping group's removal." + fi + systemctl daemon-reload } diff --git a/epoptes.service b/epoptes.service new file mode 100644 index 000000000000..74df4ad0694c --- /dev/null +++ b/epoptes.service @@ -0,0 +1,14 @@ +# TODO: If this is an LTSP client, then service only should run if EPOPTES=True in lts.conf + +[Unit] +Description=A twisted-based daemon that manages epoptes-client +After=syslog.target + +[Service] +Type=forking +PIDFile=/run/epoptes.pid +ExecStartPre=/bin/sh -c "if ! [ -s /etc/epoptes/server.key ] || ! [ -s /etc/epoptes/server.crt ]; then faketime '1970-01-01 00:00:00 UTC' openssl req -batch -x509 -nodes -newkey rsa:1024 -days $(($(date --utc +%s) / 86400 + 3652)) -keyout /etc/epoptes/server.key -out /etc/epoptes/server.crt; chmod 600 /etc/epoptes/server.key; fi" +ExecStart=/usr/bin/twistd --pidfile /run/epoptes.pid --logfile /var/log/epoptes.log epoptes + +[Install] +WantedBy=multi-user.target |