diff options
author | sl1pkn07 | 2015-06-08 20:18:17 +0200 |
---|---|---|
committer | sl1pkn07 | 2015-06-08 20:18:17 +0200 |
commit | 393b0b93caae620360ffad1dc70c9b0d71b01ed1 (patch) | |
tree | 8d8705bf392759fbc327e8cd530408dfbd24fc85 | |
download | aur-393b0b93caae620360ffad1dc70c9b0d71b01ed1.tar.gz |
Initial commit
-rw-r--r-- | .SRCINFO | 28 | ||||
-rw-r--r-- | .gitignore | 8 | ||||
-rw-r--r-- | PKGBUILD | 66 | ||||
-rwxr-xr-x | uhub.install | 41 | ||||
-rw-r--r-- | uhub.service | 16 | ||||
-rw-r--r-- | uhub.sysuser | 2 | ||||
-rw-r--r-- | uhub.tmpfiles | 1 |
7 files changed, 162 insertions, 0 deletions
diff --git a/.SRCINFO b/.SRCINFO new file mode 100644 index 000000000000..fd59c4e5fb77 --- /dev/null +++ b/.SRCINFO @@ -0,0 +1,28 @@ +pkgbase = uhub + pkgdesc = A hub for the ADC network. + pkgver = 0.5.0 + pkgrel = 4 + url = http://www.uhub.org/ + install = uhub.install + arch = i686 + arch = x86_64 + license = GPL + makedepends = cmake + depends = python2 + depends = libsystemd + backup = etc/uhub/motd.txt + backup = etc/uhub/plugins.conf + backup = etc/uhub/rules.txt + backup = etc/uhub/uhub.conf + backup = etc/uhub/users.conf + source = http://www.extatic.org/downloads/uhub/uhub-0.5.0-src.tar.bz2 + source = uhub.service + source = uhub.tmpfiles + source = uhub.sysuser + sha1sums = f9ef93efd605b13aa3d8d93ae2cb3229b463d2bf + sha1sums = a72699fb05ba6ad48a3ff0d18d8ef2904c29c6a5 + sha1sums = fa06f77fe35eee8dea6c8d2be81486a2ecc35a5b + sha1sums = e964b2e946a5662f61f806d0181c8b83834ac688 + +pkgname = uhub + diff --git a/.gitignore b/.gitignore new file mode 100644 index 000000000000..22ec94595907 --- /dev/null +++ b/.gitignore @@ -0,0 +1,8 @@ +* +!.gitignore +!.SRCINFO +!PKGBUILD +!uhub.service +!uhub.tmpfiles +!uhub.sysuser +!uhub.install diff --git a/PKGBUILD b/PKGBUILD new file mode 100644 index 000000000000..e6a885f10e25 --- /dev/null +++ b/PKGBUILD @@ -0,0 +1,66 @@ +# Maintainer: Gustavo Alvarez <sl1pkn07@gmail.com> +# contributor: Yoran Heling <info@yorhel.nl> +# Contributor: Lex Black <autumn-wind@web.de> + +pkgname=uhub +pkgver=0.5.0 +pkgrel=4 +pkgdesc="A hub for the ADC network." +arch=('i686' 'x86_64') +license=('GPL') +url="http://www.uhub.org/" +depends=('python2' 'libsystemd') +makedepends=('cmake') +source=("http://www.extatic.org/downloads/uhub/${pkgname}-${pkgver}-src.tar.bz2" + 'uhub.service' + 'uhub.tmpfiles' + 'uhub.sysuser') +sha1sums=('f9ef93efd605b13aa3d8d93ae2cb3229b463d2bf' + 'a72699fb05ba6ad48a3ff0d18d8ef2904c29c6a5' + 'fa06f77fe35eee8dea6c8d2be81486a2ecc35a5b' + 'e964b2e946a5662f61f806d0181c8b83834ac688') +backup=('etc/uhub/motd.txt' + 'etc/uhub/plugins.conf' + 'etc/uhub/rules.txt' + 'etc/uhub/uhub.conf' + 'etc/uhub/users.conf') +install=uhub.install + +prepare() { + mkdir -p build + sed 's|/var/log/uhub.log|/var/log/uhub/uhub.log|g' \ + -i "uhub-${pkgver}/doc/plugins.conf" \ + -i "uhub-${pkgver}/doc/init.d.RedHat/etc/logrotate.d/uhub" + for i in $(find "uhub-${pkgver}/tools" -type f -name '*.py'); do sed 's|python|python2|g' -i ${i}; done +} + +build() { + cd build + cmake "../uhub-${pkgver}" \ + -DCMAKE_BUILD_TYPE=Release \ + -DCMAKE_INSTALL_PREFIX=/usr \ + -DSYSTEMD_SUPPORT=ON + make +} + +package() { + make -C build DESTDIR="${pkgdir}" install + install -Dm644 "uhub-${pkgver}/doc/users.conf" "${pkgdir}/etc/uhub/users.conf" + touch "${pkgdir}/etc/uhub/motd.txt" + + install -Dm644 ../uhub.service "${pkgdir}/usr/lib/systemd/system/uhub.service" + install -Dm644 ../uhub.tmpfiles "${pkgdir}/usr/lib/tmpfiles.d/uhub.conf" + install -Dm644 ../uhub.sysuser "${pkgdir}/usr/lib/sysusers.d/uhub.conf" + + install -Dm644 "uhub-${pkgver}/doc/init.d.RedHat/etc/logrotate.d/uhub" "${pkgdir}/etc/logrotate.d/uhub" + + install -Dm644 "uhub-${pkgver}/doc/uhub.1" "${pkgdir}/usr/share/man/man1/uhub.1" + install -Dm644 "uhub-${pkgver}/doc/uhub-passwd.1" "${pkgdir}/usr/share/man/man1/uhub-passwd.1" + + install -Dm644 "uhub-${pkgver}/doc/architecture.txt" "${pkgdir}/usr/share/doc/uhub/architecture.txt" + install -Dm644 "uhub-${pkgver}/doc/extensions.txt" "${pkgdir}/usr/share/doc/uhub/extensions.txt" + install -Dm644 "uhub-${pkgver}/doc/getstarted.txt" "${pkgdir}/usr/share/doc/uhub/getstarted.txt" + + cd "uhub-${pkgver}" + for i in $(find tools -type f); do install -Dm755 ${i} "${pkgdir}/usr/share/uhub/${i}"; done +} diff --git a/uhub.install b/uhub.install new file mode 100755 index 000000000000..919084d81f6c --- /dev/null +++ b/uhub.install @@ -0,0 +1,41 @@ +all_off="$(tput sgr0)" +bold="${all_off}$(tput bold)" +yellow="${bold}$(tput setaf 3)" +blue="${bold}$(tput setaf 4)" +green="${bold}$(tput setaf 2)" + +_instructions() { + printf "${yellow}==>${all_off} ${bold}ATENTION:${all_off}\n" + printf "${blue} ->${all_off} Please run: '${bold}sudo uhub-passwd /etc/uhub/users.db create${all_off}' to create users database.\n" +} + +post_install() { + post_upgrade $1 + + _instructions +} + +post_upgrade() { + + systemd-sysusers uhub.conf + + systemd-tmpfiles --create uhub.conf + + install -dm744 -o uhub -g uhub /var/log/uhub + install -dm744 -o uhub -g uhub /var/lib/uhub +} + +post_remove() { + paths=(/etc/uhub /var/lib/uhub /var/log/uhub) + + first=true + for path in ${paths[@]}; do + if [ -d $path ]; then + if $first; then + first=false + printf "${green}==>${all_off} ${bold}Leftover Paths:${all_off}\n" + fi + printf "${blue} -> ${all_off} ${bold}$path${all_off}\n" + fi + done +} diff --git a/uhub.service b/uhub.service new file mode 100644 index 000000000000..24d922d88329 --- /dev/null +++ b/uhub.service @@ -0,0 +1,16 @@ +[Unit] +Description=uHub ADC hub Server +Documentation=man:uhub(1) +After=network.target + +[Service] +Type=simple +User=uhub +ExecStart=/usr/bin/uhub -p /run/uhub/uhub.pid +ExecReload=/usr/bin/uhub -C ; \ + /bin/kill -HUP $MAINPID +StandardError=journal + +[Install] +WantedBy=multi-user.target + diff --git a/uhub.sysuser b/uhub.sysuser new file mode 100644 index 000000000000..2a379e105a26 --- /dev/null +++ b/uhub.sysuser @@ -0,0 +1,2 @@ +g uhub - - - +u uhub - "uHub DC Hub" /var/lib/uhub diff --git a/uhub.tmpfiles b/uhub.tmpfiles new file mode 100644 index 000000000000..c548637bbd94 --- /dev/null +++ b/uhub.tmpfiles @@ -0,0 +1 @@ +d /run/uhub 0755 uhub uhub |