summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: dbd18295db4fc1a45d1a0d7adf7c5d6a088522d2 (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
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
# Maintainer : Raphaël Doursenaud <rdoursenaud@gpcsolutions.fr>
# Previous Maintainer : kuri <sysegv at gmail dot com>
# Contributor : Kevin C <kiven at kiven dot fr>
# Contributor: Alex 'AdUser' Z
pkgname=fusioninventory-agent
_pkgname="FusionInventory-Agent"
pkgver=2.3.18
pkgrel=1
pkgdesc="An application for keeping track of the hardware and software"
arch=(any)
url="http://fusioninventory.org"
_watch="https://github.com/fusinv/fusioninventory-agent/releases"
license=('GPL')
depends=(
  'perl>=5.8'
  'perl-file-which'
  # Provides LWP::UserAgent
  'perl-libwww>=5.8'
  'perl-net-ip'
  'perl-text-template'
  'perl-universal-require'
  'perl-xml-treepp>=0.26'
)
makedepends=(
  'perl-http-proxy'
  'perl-http-server-simple'
  # FIXME: not in AUR
  # 'perl-http-server-simple-authen'
  'perl-io-socket-ssl'
  # Provides IO::Capture::Stderr
  'perl-io-captureoutput'
  'perl-ipc-run'
  'perl-test-compile'
  'perl-test-deep'
  'perl-test-exception'
  'perl-test-mockmodule'
  # FIXME: not in AUR
  # 'perl-test-more>=0.93'
  'perl-test-nowarnings'
  'perl-lwp-protocol-https'
  'perl-test-mockobject'
  'perl-json'
  'perl-net-snmp'
# Deploy
  # FIXME: not in AUR
  # 'perl-test-http-server-simple'
  'perl-poe-component-client-ping'
)

optdepends=(
# Global
  'perl-compress-zlib: message compression'
  'perl-http-daemon: web interface'
  'perl-io-socket-ssl>=1.14: HTTPS support'
  'perl-lwp-protocol-https: HTTPS support'
  'perl-proc-daemon: daemon mode'
  'perl-proc-pid-file: daemon mode'

# Inventory
  'perl-parse-edid: Inventory EDID data parsing'
  # Doesn't build ATM
  # 'perl-net-cups>=0.60: Inventory printers detection'
  # let's use patched version
  'perl-net-cups-cups16>=0.60: Inventory printers detection'
  'dmidecode: Inventory DMI data retrieval'
  # Provides lspci
  'pciutils: Inventory PCI bus scanning (lspci)'
  'hdparm: Inventory additional disk drive info retrieval'
  'read-edid: Inventory EDID data access'
  # Provides ssh-keyscan
  'openssh: Inventory host SSH public key retrieval (ssh-keyscan)'

# Deploy
  'perl-archive-extract: Deploy'
  # Provided by Perl
  # 'perl-digest-sha: Deploy'
  'perl-file-copy-recursive: Deploy'
  'perl-json: Deploy'
  # Provided by perl-uri
  # 'perl-uri-escape: Deploy'
  'perl-uri: Deploy'
  'perl-poe-component-client-ping: Deploy'

# Network
  'perl-net-snmp: Network inventory'
  # FIXME: not in AUR
  # 'perl-net-nbname:Network'
  # provided by perl
  # 'perl-thread-queue>=2.0.1'
  'perl-crypt-des: Network inventory SNMPv3 support'
  'nmap: Network discovery'

# Wake-On-Lan
  # provided by perl-net-write
  # 'perl-net-write-layer2: Wake on Lan'
  'perl-net-write: Wake on Lan ethernet method support'
)
source=("https://github.com/fusioninventory/fusioninventory-agent/releases/download/${pkgver}/${_pkgname}-${pkgver}.tar.gz"
  'fusioninventory-agent.service'
  'fusioninventory-agent.config')
md5sums=('caffff2fe695b2262529aa7541f1b94a'
         'cd0d59b266a41977f51d9e99ecca8cd5'
         '7cce12647a737aadcdd79dee4575aff3')

build() {
  cd "${srcdir}/${_pkgname}-${pkgver}"

  perl Makefile.PL \
    PREFIX="/usr" \
    SYSCONFDIR="/etc/fusioninventory" \
    LOCALSTATEDIR="/var/lib/fusioninventory-agent"

  make
}

# FIXME :
# needs at least HTTP::Server::Simple:Authen
# and certainly Test::More and Test::HTTP::Server::Simple
#check() {
#  cd "${srcdir}/${_pkgname}-${pkgver}"
#
#  make test
#}

package() {
  cd "${srcdir}/${_pkgname}-${pkgver}"
  make install DESTDIR="${pkgdir}/"
  install -D -m644 ${srcdir}/fusioninventory-agent.service \
    ${pkgdir}/usr/lib/systemd/system/fusioninventory-agent.service
  mv ${pkgdir}/etc/fusioninventory/agent.cfg \
     ${pkgdir}/etc/fusioninventory/agent.cfg.default
  install -D -m644 ${srcdir}/fusioninventory-agent.config \
    ${pkgdir}/etc/conf.d/fusioninventory-agent
  mkdir -p "${pkgdir}/var/lib/fusioninventory-agent"
}