summarylogtreecommitdiffstats
diff options
context:
space:
mode:
authorsl1pkn072015-06-08 20:20:30 +0200
committersl1pkn072015-06-08 20:20:30 +0200
commite60ab17017d329d328c5af7e997ff57ae672d1a6 (patch)
treec6b6bc3fcecd1b2364c0c1771aae01722fd0f74b
downloadaur-e60ab17017d329d328c5af7e997ff57ae672d1a6.tar.gz
Initial commit
-rw-r--r--.SRCINFO27
-rw-r--r--.gitignore8
-rw-r--r--PKGBUILD66
-rwxr-xr-xuhub.install41
-rw-r--r--uhub.service16
-rw-r--r--uhub.sysuser2
-rw-r--r--uhub.tmpfiles1
7 files changed, 161 insertions, 0 deletions
diff --git a/.SRCINFO b/.SRCINFO
new file mode 100644
index 000000000000..08d8ab70dbf3
--- /dev/null
+++ b/.SRCINFO
@@ -0,0 +1,27 @@
+pkgbase = uhub-git
+ pkgdesc = A hub for the ADC network. (GIT Version)
+ pkgver = 0.5.0.23.gdc80644
+ pkgrel = 1
+ url = http://www.uhub.org/
+ install = uhub.install
+ arch = i686
+ arch = x86_64
+ license = LGPL
+ makedepends = cmake
+ makedepends = git
+ depends = libsystemd
+ depends = python2
+ 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 = git+https://github.com/janvidar/uhub.git
+ source = uhub.service
+ source = uhub.tmpfiles
+ sha1sums = SKIP
+ sha1sums = a72699fb05ba6ad48a3ff0d18d8ef2904c29c6a5
+ sha1sums = fa06f77fe35eee8dea6c8d2be81486a2ecc35a5b
+
+pkgname = uhub-git
+
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..c58f13959d29
--- /dev/null
+++ b/PKGBUILD
@@ -0,0 +1,66 @@
+# Maintainer: Gustavo Alvarez <sl1pkn07@gmail.com>
+
+pkgname=uhub-git
+pkgver=0.5.0.23.gdc80644
+pkgrel=1
+pkgdesc="A hub for the ADC network. (GIT Version)"
+arch=('i686' 'x86_64')
+license=('LGPL')
+url="http://www.uhub.org/"
+depends=('libsystemd' 'python2')
+makedepends=('cmake' 'git')
+source=('git+https://github.com/janvidar/uhub.git'
+ 'uhub.service'
+ 'uhub.tmpfiles')
+sha1sums=('SKIP'
+ 'a72699fb05ba6ad48a3ff0d18d8ef2904c29c6a5'
+ 'fa06f77fe35eee8dea6c8d2be81486a2ecc35a5b')
+install="uhub.install"
+backup=('etc/uhub/motd.txt'
+ 'etc/uhub/plugins.conf'
+ 'etc/uhub/rules.txt'
+ 'etc/uhub/uhub.conf'
+ 'etc/uhub/users.conf')
+
+pkgver() {
+ cd uhub
+ echo "$(git describe --long --tags | tr - .)"
+}
+
+prepare() {
+ mkdir -p build
+ sed 's|/var/log/uhub.log|/var/log/uhub/uhub.log|g' \
+ -i uhub/doc/plugins.conf \
+ -i uhub/doc/init.d.RedHat/etc/logrotate.d/uhub
+ for i in $(find uhub/tools -type f -name '*.py'); do sed 's|python|python2|g' -i ${i}; done
+}
+
+build() {
+ cd build
+ cmake ../uhub \
+ -DCMAKE_BUILD_TYPE=Release \
+ -DCMAKE_INSTALL_PREFIX=/usr \
+ -DSYSTEMD_SUPPORT=ON
+ make
+}
+
+package() {
+ make -C build DESTDIR="${pkgdir}" install
+ install -Dm644 uhub/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/doc/init.d.RedHat/etc/logrotate.d/uhub "${pkgdir}/etc/logrotate.d/uhub"
+
+ install -Dm644 uhub/doc/uhub.1 "${pkgdir}/usr/share/man/man1/uhub.1"
+ install -Dm644 uhub/doc/uhub-passwd.1 "${pkgdir}/usr/share/man/man1/uhub-passwd.1"
+
+ install -Dm644 uhub/doc/architecture.txt "${pkgdir}/usr/share/doc/uhub/architecture.txt"
+ install -Dm644 uhub/doc/extensions.txt "${pkgdir}/usr/share/doc/uhub/extensions.txt"
+ install -Dm644 uhub/doc/getstarted.txt "${pkgdir}/usr/share/doc/uhub/getstarted.txt"
+
+ for i in $(find uhub/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