summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: 889bb99a30ccf06c499f5e346cade8d72f8359b2 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
# Maintainer: Gustavo Alvarez <sl1pkn07@gmail.com>

pkgname=uhub-git
pkgver=0.5.0.26.g90d05c9
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.sysuser'
        'uhub.service'
        'uhub.tmpfiles'
        )
sha256sums=('SKIP'
            'dfb3d51d95ef90e49b62cfa49d6a2cef58fb1f119f1d357f76ab1953000e5079'
            '4bf39c6265d53e1b08385c8e339c9d7b4449637c29688b1bcd2091e5c2b6c9df'
            '36645ca1faeb2e1bf12edf736c68e8b70c12aa6dbe3f710acc7823d1addb9050'
            )
install=uhub-git.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
}