-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathfusioninventory-agent.spec
648 lines (488 loc) · 22.2 KB
/
fusioninventory-agent.spec
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
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
## Disabling debug package
## Can't build as noarch due to dmidecode requires
%global debug_package %{nil}
Name: fusioninventory-agent
Summary: FusionInventory agent
Group: Applications/System
License: GPLv2+
URL: http://fusioninventory.org/
Version: 2.6
Release: 1%{?dist}
Source0: https://github.com/fusioninventory/%{name}/releases/download/%{version}/FusionInventory-Agent-%{version}.tar.gz
Source1: %{name}.cron
Source10: %{name}.service
Requires: perl(:MODULE_COMPAT_%(eval "`%{__perl} -V:version`"; echo $version))
BuildRequires: perl-generators
BuildRequires: perl(ExtUtils::MakeMaker)
BuildRequires: systemd
Requires: perl-FusionInventory-Agent = %{version}-%{release}
Requires: cronie
%ifarch %{ix86} x86_64
Requires: dmidecode
%endif
Requires(post): systemd
Requires(preun): systemd
Requires(postun): systemd
# excluding internal requires and windows stuff
# excluding perl(setup) and windows stuff
%{?perl_default_filter}
%global __provides_exclude %{?__provides_exclude:%__provides_exclude|}^perl\\(setup\\)$
%global __requires_exclude %{?__requires_exclude:%__requires_exclude|}^perl\\(Win32|setup\\)$
%description
FusionInventory Agent is an application designed to help a network
or system administrator to keep track of the hardware and software
configurations of computers that are installed on the network.
This agent can send information about the computer to a OCS Inventory NG
or GLPI server with the FusionInventory for GLPI plugin.
You can add additional packages for optional tasks:
* fusioninventory-agent-task-network
Network Discovery and Inventory support
* fusioninventory-agent-inventory
Local inventory support for FusionInventory
* fusioninventory-agent-task-deploy
Software deployment support
* fusioninventory-agent-task-esx
vCenter/ESX/ESXi remote inventory
* fusioninventory-agent-task-collect
Custom information retrieval support
* fusioninventory-agent-task-wakeonlan
Wake o lan task
%package -n perl-FusionInventory-Agent
Summary: Libraries for Fusioninventory agent
BuildArch: noarch
Requires: perl(:MODULE_COMPAT_%(eval "`%{__perl} -V:version`"; echo $version))
Requires: perl(LWP)
Requires: perl(Net::CUPS)
Requires: perl(Net::SSLeay)
Requires: perl(Proc::Daemon)
Requires: perl(Socket::GetAddrInfo)
%description -n perl-FusionInventory-Agent
Libraries for Fusioninventory agent.
%package task-esx
Summary: FusionInventory plugin to inventory vCenter/ESX/ESXi
BuildArch: noarch
Requires: %{name} = %{version}-%{release}
%description task-esx
fusioninventory-agent-task-ESX ask the running service agent to inventory an
VMWare vCenter/ESX/ESXi server through SOAP interface
%package yum-plugin
Summary: Ask FusionInventory agent to send an inventory when yum exits
Group: System Environment/Base
BuildArch: noarch
Requires: yum
Requires: %{name}
%description yum-plugin
fusioninventory-agent-yum-plugin asks the running service agent to send an
inventory when yum exits.
This requires the service to be running with the --rpc-trust-localhost option.
%package task-network
Summary: NetDiscovery and NetInventory task for FusionInventory
Group: Applications/System
BuildArch: noarch
Requires: %{name} = %{version}-%{release}
%description task-network
fusioninventory-task-netdiscovery and fusioninventory-task-netinventory
%package task-deploy
Summary: Software deployment support for FusionInventory agent
Group: Applications/System
BuildArch: noarch
Requires: %{name} = %{version}-%{release}
Requires: perl(Archive::Extract)
%description task-deploy
This package provides software deployment support for FusionInventory-agent
%package task-wakeonlan
Summary: WakeOnLan task for FusionInventory
Group: Applications/System
BuildArch: noarch
Requires: %{name} = %{version}-%{release}
%description task-wakeonlan
fusioninventory-task-wakeonlan
%package task-inventory
Summary: Inventory task for FusionInventory
Group: Applications/System
Requires: %{name} = %{version}-%{release}
Requires: perl(Net::CUPS)
Requires: perl(Parse::EDID)
%description task-inventory
fusioninventory-task-inventory
%package task-collect
Summary: Custom information retrieval support for FusionInventory agent
Group: Applications/System
Requires: %{name} = %{version}-%{release}
%description task-collect
This package provides custom information retrieval support for
FusionInventory agent
%package cron
Summary: Cron for FusionInventory agent
Group: Applications/System
Requires: %{name} = %{version}-%{release}
%description cron
fusioninventory cron task
%prep
%setup -q -n FusionInventory-Agent-%{version}
sed \
-e "s/logger = .*/logger = syslog/" \
-e "s/logfacility = .*/logfacility = LOG_DAEMON/" \
-e 's|#include "conf\.d/"|include "conf\.d/"|' \
-i etc/agent.cfg
cat <<EOF | tee %{name}.conf
#
# Fusion Inventory Agent Configuration File
# used by hourly cron job to override the %{name}.cfg setup.
#
# /!\
# USING THIS FILE TO OVERRIDE SERVICE OPTIONS IS DEPRECATED!
# See %{_unitdir}/%{name}.service notice
#
# Add tools directory if needed (tw_cli, hpacucli, ipssend, ...)
PATH=/sbin:/bin:/usr/sbin:/usr/bin
# Global options (debug for verbose log, rpc-trust-localhost for yum-plugin)
OPTIONS="--debug "
# Mode, change to "cron" to activate
# - none (default on install) no activity
# - cron (inventory only) use the cron.hourly
OCSMODE[0]=none
# OCS Inventory or FusionInventory server URI
# OCSSERVER[0]=your.ocsserver.name
# OCSSERVER[0]=http://your.ocsserver.name/ocsinventory
# OCSSERVER[0]=http://your.glpiserveur.name/glpi/plugins/fusioninventory/
# corresponds with --local=%{_localstatedir}/lib/%{name}
# OCSSERVER[0]=local
# Wait before inventory (for cron mode)
OCSPAUSE[0]=120
# Administrative TAG (optional, must be filed before first inventory)
OCSTAG[0]=
EOF
%build
perl Makefile.PL \
PREFIX=%{_prefix} \
SYSCONFDIR=%{_sysconfdir}/fusioninventory \
LOCALSTATEDIR=%{_localstatedir}/lib/%{name} \
VERSION=%{version}-%{release}
make %{?_smp_mflags}
%install
make install DESTDIR=%{buildroot}
find %{buildroot} -type f -name .packlist -exec rm -f {} ';'
%{_fixperms} %{buildroot}/*
mkdir -p %{buildroot}%{_localstatedir}/lib/%{name}
mkdir -p %{buildroot}%{_sysconfdir}/fusioninventory/conf.d
mkdir -p %{buildroot}%{_sysconfdir}/systemd/system/%{name}.service.d
install -m 644 -D %{name}.conf %{buildroot}%{_sysconfdir}/sysconfig/%{name}
install -m 755 -Dp %{SOURCE1} %{buildroot}%{_sysconfdir}/cron.hourly/%{name}
install -m 644 -D %{SOURCE10} %{buildroot}%{_unitdir}/%{name}.service
# Yum plugin installation
install -m 644 -D contrib/yum-plugin/%{name}.py %{buildroot}%{_prefix}/lib/yum-plugins/%{name}.py
install -m 644 -D contrib/yum-plugin/%{name}.conf %{buildroot}%{_sysconfdir}/yum/pluginconf.d/%{name}.conf
%check
#make test
%post
%systemd_post fusioninventory-agent.service
%preun
%systemd_preun fusioninventory-agent.service
%postun
%systemd_postun_with_restart fusioninventory-agent.service
%files
%dir %{_sysconfdir}/fusioninventory
%config(noreplace) %{_sysconfdir}/fusioninventory/agent.cfg
%config(noreplace) %{_sysconfdir}/fusioninventory/conf.d
%config(noreplace) %{_sysconfdir}/fusioninventory/inventory-server-plugin.cfg
%config(noreplace) %{_sysconfdir}/fusioninventory/server-test-plugin.cfg
%config(noreplace) %{_sysconfdir}/fusioninventory/ssl-server-plugin.cfg
%config(noreplace) %{_sysconfdir}/fusioninventory/proxy-server-plugin.cfg
%config(noreplace) %{_sysconfdir}/fusioninventory/proxy2-server-plugin.cfg
%{_unitdir}/%{name}.service
%dir %{_sysconfdir}/systemd/system/%{name}.service.d
%{_bindir}/fusioninventory-agent
%{_bindir}/fusioninventory-injector
%{_mandir}/man1/fusioninventory-agent*
%{_mandir}/man1/fusioninventory-injector*
%dir %{_localstatedir}/lib/%{name}
%dir %{_datadir}/fusioninventory
%dir %{_datadir}/fusioninventory/lib
%dir %{_datadir}/fusioninventory/lib/FusionInventory
%dir %{_datadir}/fusioninventory/lib/FusionInventory/Agent
%dir %{_datadir}/fusioninventory/lib/FusionInventory/Agent/Task
%files -n perl-FusionInventory-Agent
%doc Changes LICENSE THANKS
#excluding sub-packages files
#%%exclude %%{_datadir}/fusioninventory/lib/FusionInventory/Agent/Task/*
%{_datadir}/fusioninventory
%files yum-plugin
%config(noreplace) %{_sysconfdir}/yum/pluginconf.d/%{name}.conf
%{_prefix}/lib/yum-plugins/%{name}.*
%files task-esx
%{_bindir}/fusioninventory-esx
%{_mandir}/man1/fusioninventory-esx.1*
%{_datadir}/fusioninventory/lib/FusionInventory/Agent/Task/ESX.pm
%{_datadir}/fusioninventory/lib/FusionInventory/Agent/SOAP
%files task-network
%{_bindir}/fusioninventory-netdiscovery
%{_bindir}/fusioninventory-netinventory
%{_mandir}/man1/fusioninventory-netdiscovery.1*
%{_mandir}/man1/fusioninventory-netinventory.1*
%{_datadir}/fusioninventory/lib/FusionInventory/Agent/Task/NetDiscovery.pm
%{_datadir}/fusioninventory/lib/FusionInventory/Agent/Task/NetInventory.pm
%files task-deploy
%{_datadir}/fusioninventory/lib/FusionInventory/Agent/Task/Deploy.pm
%{_datadir}/fusioninventory/lib/FusionInventory/Agent/Task/Deploy
%files task-wakeonlan
%{_bindir}/fusioninventory-wakeonlan
%{_mandir}/man1/fusioninventory-wakeonlan.1*
%{_datadir}/fusioninventory/lib/FusionInventory/Agent/Task/WakeOnLan.pm
%files task-inventory
%{_bindir}/fusioninventory-inventory
%{_bindir}/fusioninventory-remoteinventory
%{_mandir}/man1/fusioninventory-*inventory.1*
%{_datadir}/fusioninventory/lib/FusionInventory/Agent/Task/Inventory.pm
%{_datadir}/fusioninventory/lib/FusionInventory/Agent/Task/Inventory
%files task-collect
%{_datadir}/fusioninventory/lib/FusionInventory/Agent/Task/Collect.pm
%files cron
%{_sysconfdir}/cron.hourly/%{name}
%config(noreplace) %{_sysconfdir}/sysconfig/%{name}
%changelog
* Tue Dec 01 2020 Johan Cwiklinski jcwiklinski AT teclib DOT com> - 2.6-1
- Last upstream reelase
* Tue Dec 17 2019 Johan Cwiklinski jcwiklinski AT teclib DOT com> - 2.5.2-1
- Last upstream release
- Drop patch applied upstream
- Add missing configuration files
* Tue Jul 16 2019 Johan Cwiklinski <jcwiklinski AT teclib DOT com> - 2.5.1-2
- Apply upstream patch that fixes issues on EL6/7
* Mon Jul 08 2019 Johan Cwiklinski <jcwiklinski AT teclib DOT com> - 2.5.1-1
- Last upstream release
- Remove patches applied upstream
* Tue May 07 2019 Johan Cwiklinski <jcwiklinski AT teclib DOT com> - 2.5-4
- Add patch to fix SSL on with http modules
* Thu May 02 2019 Guillaume Bougard <gbougard AT teclib DOT com> - 2.5-3
- Add patches to fix agent HTTP server plugins integration
* Thu Apr 18 2019 Johan Cwiklinski <jcwiklinski AT teclib DOT com> - 2.5-2
- Re-add tasks files in main perl package, to solve dependencies issues on package
* Mon Apr 15 2019 Johan Cwiklinski <jcwiklinski AT teclib DOT com> - 2.5-1
- Last upstream release
- Tasks files were provided also in main perl package
- Apply upstream minor fixes patch
- task-wakeonlan is back (see https://github.com/fusioninventory/fusioninventory-agent/issues/495#issuecomment-435110369 about dependancy issue)
* Thu Mar 07 2019 Johan Cwiklinski <jcwiklinski AT teclib DOT com> - 2.4.3-2
- Fix for HTTPD server not listening
* Mon Feb 25 2019 Johan Cwiklinski <jcwiklinski AT teclib DOT com> - 2.4.3-1
- Last upstream release
* Wed Oct 03 2018 Johan Cwiklinski <jcwiklinski AT teclib DOT com> - 2.4.2-1
- Last upstream release
- Drop patch applied upstream
* Tue Jul 10 2018 Johan Cwiklinski <jcwiklinski AT teclib DOT com> - 2.4.1-3
- Add patch for Net-Ping issue on EL versions
* Tue Jul 10 2018 Johan Cwiklinski <jcwiklinski AT teclib DOT com> - 2.4.1-2
- Add upstream patch to fix wrong variable name
- Logrotate is no longer needed since we now use syslog
* Tue Jul 03 2018 Johan Cwiklinski <jcwiklinski AT teclib DOT com> - 2.4.1-1
- Last upstream release
* Mon Jan 15 2018 Johan Cwiklinski <jcwiklinski AT teclib DOT com> - 2.4-3
- Change logging according to upstream recommandations
* Thu Jan 11 2018 Johan Cwiklinski <jcwiklinski AT teclib DOT com> - 2.4-2
- Drop systemd override conf file, thits is no longer needed
* Thu Jan 11 2018 Johan Cwiklinski <jcwiklinski AT teclib DOT com> - 2.4-1
- Last upstream release
- Put cron stuff in a separate sub-package
- Provide conf.d configuration directory
* Mon Oct 16 2017 Johan Cwiklinski <jcwiklinski AT teclib DOT com> - 2.3.21-3
- Do not provides perl(setup); BZ #1485919 - thanks to E. Seyman
* Thu Aug 10 2017 Johan Cwiklinski <jcwiklinski AT teclib DOT com> - 2.3.21-2
- Fix missing provides issue on perl(setup)
- Last upstream release
- Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Mass_Rebuild
- Perl 5.26 re-rebuild of bootstrapped packages
* Tue Jun 06 2017 Johan Cwiklinski <jcwiklinski AT teclib DOT com> - 2.3.20-1
- Last upstream release
- Drop patches, upstream has provided fixes
- Perl 5.26 rebuild
- Fix building on Perl without '.' in @INC
* Mon Feb 20 2017 Johan Cwiklinski <jcwiklinski AT teclib DOT com> - 2.3.19-2
- Fix setup.pm values
* Sat Feb 18 2017 Johan Cwiklinski <johan AT x-tnd DOT be> - 2.3.19-1
- Last upstream release
* Thu Feb 09 2017 Johan Cwiklinski <jcwiklinski AT teclib DOT com> - 2.3.18-3
- Change systemd unit to not use fork mode
- Re-add options in sysconfig file to get cron mode running
* Wed Jun 22 2016 Johan Cwiklinski <johan AT x-tnd DOT be> - 2.3.18-2
- Add task-collect subpackage
- Change package source according to upstream recomendations
* Tue Jun 21 2016 Johan Cwiklinski <johan AT x-tnd DOT be> - 2.3.18-1
- Last upstream release
- Handle macros in comments to make rpmlint happy
- Cleanup comments
- Perl 5.24 rebuild
- Rebuilt for https://fedoraproject.org/wiki/Fedora_24_Mass_Rebuild
- new version
- Upstream switch to github, minor spec adaptation
- fix for #1240964
- Rebuilt for https://fedoraproject.org/wiki/Fedora_23_Mass_Rebuild
- Perl 5.22 rebuild
- commenting un-used BuildRequires
- update to 2.3.16
- adding BuildRequires needed by test
- arch build (due to dmidecode dependancy in x86_64)
- building as noarch
- fix description of subpackage
- using upstream systemd unit file
- new version and back in Fedora
- enhancing spec according to review
- new version
- new version
- updating spec according to fedora-review
- new version
- adding missing requires
- updating config file
- new version (bug fixes)
- new version
- new version
- enhancing spec according to Michael Schwendt review
- adding missing requires
- new version
- new version
- new version, reintroduction in fedora and epel
- cleanup of the spec (removing sysVinit stuff, old BuildRequires, old releases stuff)
- adding sub-packages for task-* (using Guillaume Rousse OBS spec as model https://build.opensuse.org/package/view_file/home:guillomovitch/fusioninventory-agent/fusioninventory-agent.spec)
- task-wakeonlan is excluded (dependancy issue)
- dump release
- version 2.2.4 fixes various bugs as described in
http://cpansearch.perl.org/src/FUSINV/FusionInventory-Agent-2.2.4/Changes
http://cpansearch.perl.org/src/FUSINV/FusionInventory-Agent-2.2.3/Changes
- Rebuilt for https://fedoraproject.org/wiki/Fedora_18_Mass_Rebuild
- Perl 5.16 rebuild
- no need for debuginfo (not really arch, fix #828960)
- yum plugin is also noarch
- make package "arch"
- requires dmidecode when available (x86)
- add sub-package perl-FusionInventory-Agent (noarch)
- update to 2.2.2
http://cpansearch.perl.org/src/FUSINV/FusionInventory-Agent-2.2.2/Changes
http://cpansearch.perl.org/src/FUSINV/FusionInventory-Agent-2.2.1/Changes
- filter private provides/requires
- update to 2.2.0
http://search.cpan.org/src/FUSINV/FusionInventory-Agent-2.2.0/Changes
- revert change in 2.2.0: don't loose arch information
see http://forge.fusioninventory.org/issues/1581
- update to 2.1.14
http://cpansearch.perl.org/src/FUSINV/FusionInventory-Agent-2.1.14/Changes
- Rebuilt for https://fedoraproject.org/wiki/Fedora_17_Mass_Rebuild
- update to 2.1.12
http://cpansearch.perl.org/src/FUSINV/FusionInventory-Agent-2.1.12/Changes
- upstream patch for http://forge.fusioninventory.org/issues/1161
- adapt filter
- Perl mass rebuild
- missing dist tag
- update to 2.1.9
http://cpansearch.perl.org/src/FUSINV/FusionInventory-Agent-2.1.9/Changes
- update to 2.1.9 from git
- improved init script for systemd
- improved comment for use with glpi-fusioninventory
- revert change for issue 656 which breaks compatibility
- update to 2.1.8
http://cpansearch.perl.org/src/FUSINV/FusionInventory-Agent-2.1.8/Changes
- add the yum-plugin sub-package
- update to 2.1.7
http://cpansearch.perl.org/src/FUSINV/FusionInventory-Agent-2.1.7/Changes
- update to 2.1.7 beta1
- fix perl filter on EL-6
- update to 2.1.6
http://cpansearch.perl.org/src/FUSINV/FusionInventory-Agent-2.1.6/Changes
- fix init script for multi-server in daemon mode
- workaround for http://forge.fusioninventory.org/issues/414
- update to 2.1.5
http://cpansearch.perl.org/src/FUSINV/FusionInventory-Agent-2.1.5/Changes
- add %%check
- update to 2.1.3
http://cpansearch.perl.org/src/FUSINV/FusionInventory-Agent-2.1.3/Changes
- update to 2.1.2
http://cpansearch.perl.org/src/FUSINV/FusionInventory-Agent-2.1.2/Changes
- update to 2.1.1
- update to git snaphost which fix EL issues
- fix init script
- adapt perl filter for recent/old fedora or EL
- update to 2.1
- switch download URL back to CPAN
- add %%{perl_vendorlib}/auto
- filter perl(Win32*) from Requires
- add patch (from git) to reopen the file logger if needed
- update to 2.0.6
- swicth download URL to forge
- update to 2.0.5
- git snapshot fix perl 5.8.8 (EL5) issue
- git snapshot fix daemon issue
- add FUSINVOPT for global options (p.e.--debug)
- add support for daemon mode
- info about perl-FusionInventory-Agent-Task-OcsDeploy
- spec cleanup
- french translation
- set Net::CUPS and Archive::Extract optionnal on RHEL4
- update to 2.0.4 which fixes important bugs when cron is used
- initial spec