summaryrefslogtreecommitdiff
path: root/pcr/openhpi/PKGBUILD
blob: 7da1cc0558e4a626d59cf22e65db1777e997ee2e (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
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
# Maintainer (Parabola): Márcio Silva <coadde@lavabit.com>

pkgname=openhpi
pkgver=3.2.0
pkgrel=3
pkgdesc='Abstracted interface for managing computer hardware, typically chassis and rack based servers'
arch=(
  i686
  x86_64
  mips64el
)
url=http://www.$pkgname.org/
license=custom
depends=(
  libxml2
  net-snmp
)
options=(!libtool)
source=http://downloads.sourceforge.net/$pkgname/$pkgname-$pkgver.tar.gz
sha512sums=5a54ccc2279b3a608e2842dd3b4f01d7d483182ecd33d1d33186247cea15b62f1e0aea4eea1294cd6c3959a25424dc322cca73e516f4c8fd9d3a41a949d087ab

prepare() {
  cd $srcdir/$pkgname-$pkgver

  # fixing path
  sed -i 's|bin/sh|usr/bin/bash|;
         ' $(grep -rl bin/sh)
  sed -i 's|usr/sbin|usr/bin|;
         ' $(grep -rl usr/bin)
  sed -i 's| /bin| /usr/bin|;
         ' $(grep -rl ' /bin')
  sed -i 's| /sbin| /usr/bin|;
         ' $(grep -rl ' /sbin')
  sed -i 's|var/lock|run/lock|;
         ' $(grep -rl var/lock)
  sed -i 's|var/run|run|;
         ' $(grep -rl var/run)

  # remove Open Source term
  #sed -i 's|Open Source / ||;
  #        s|open source / ||;
  #        s|Open Source|Free Software|;
  #        s|open source|free software|;
  #       ' $(grep -ril 'open source')
  #sed -i 's|OpenSource / ||;
  #        s|opensource / ||;
  #        s|OpenSource|FreeSoftware|;
  #        s|opensource|freesoftware|;
  #       ' $(grep -ril opensource)

  # remove Linux term
  sed -i '/, Linux/ s|Linux|GNU/Linux|;
          /And Linux/ s|Linux|GNU/Linux|;
          /and Linux/ s|Linux|GNU/Linux|;
          /For Linux/ s|Linux|GNU/Linux|;
          /for Linux/ s|Linux|GNU/Linux|;
          /Like Linux/ s|Linux|GNU/Linux|;
          /like Linux/ s|Linux|GNU/Linux|;
          /Linux,/ s|Linux|GNU/Linux|;
          /Linux and/ s|Linux|GNU/Linux|;
          /Linux distribution/ s|Linux|GNU/Linux|;
          /Linux machine/ s|Linux|GNU/Linux|;
          /Linux operating/ s|Linux|GNU/Linux|;
          /Linux OS/ s|Linux|GNU/Linux|;
          /Linux specific/ s|Linux|GNU/Linux|;
          /Linux system/ s|Linux|GNU/Linux|;
          /Under Linux/ s|Linux|GNU/Linux|;
          /under Linux/ s|Linux|GNU/Linux|;
          /On Linux/ s|Linux|GNU/Linux|;
          /on Linux/ s|Linux|GNU/Linux|;
          s|GNU/GNU|GNU|;
          s|GNU/Linux kernel|Linux kernel|;
          s|GNU/Linux specific kernel|Linux specific kernel|;
         ' $(grep -rl Linux)
}

build() {
  cd $srcdir/$pkgname-$pkgver
  setarch $CARCH ./configure --prefix=/usr\
    --disable-static\
    --enable-clients\
    --enable-dynamic_simulator\
    --enable-ilo2_ribcl\
    --enable-ipmidirect\
    --enable-man\
    --enable-oa_soap\
    --enable-simulator\
    --enable-slave\
    --enable-snmp_bc\
    --enable-sysfs\
    --enable-test_agent\
    --enable-watchdog\
    --localstatedir=/var\
    --sbindir=/usr/bin\
    --sysconfdir=/etc
  setarch $CARCH make
}

package() {
  cd $srcdir/$pkgname-$pkgver
  setarch $CARCH make DESTDIR=$pkgdir install

  rm $pkgdir/etc/init.d/openhpid && rmdir $pkgdir/etc/init.d

  install -d $pkgdir/usr/lib/systemd/system
  echo '[Unit]'                                                           >  $pkgdir/usr/lib/systemd/system/openhpi.service
  echo 'Description=Enable OpenHPI service which is provided by openhpid' >> $pkgdir/usr/lib/systemd/system/openhpi.service
  echo 'After=network.target remote-fs.target'                            >> $pkgdir/usr/lib/systemd/system/openhpi.service
  echo ''                                                                 >> $pkgdir/usr/lib/systemd/system/openhpi.service
  echo '[Service]'                                                        >> $pkgdir/usr/lib/systemd/system/openhpi.service
  echo 'Type=forking'                                                     >> $pkgdir/usr/lib/systemd/system/openhpi.service
  echo 'ExecStart=/usr/bin/openhpid -c /etc/openhpi/openhpi.conf'         >> $pkgdir/usr/lib/systemd/system/openhpi.service
  echo ''                                                                 >> $pkgdir/usr/lib/systemd/system/openhpi.service
  echo '[Install]'                                                        >> $pkgdir/usr/lib/systemd/system/openhpi.service
  echo 'WantedBy=multi-user.target'                                       >> $pkgdir/usr/lib/systemd/system/openhpi.service
}

# vim:set ts=2 sw=2 et: