b0ae833
%bcond_without  log4cplus
b0ae833
%bcond_without  examples
0d06789
Koji 73156ac
Name:           libstatgrab
b0ae833
Epoch:          1
44da095
Version:        0.92
f9854d9
Release:        6%{?dist}
b0ae833
Summary:        A library that provides cross platform access to statistics of the system
Koji 73156ac
License:        LGPLv2+
Koji 73156ac
URL:            http://www.i-scream.org/libstatgrab
Koji 73156ac
Source0:        http://ftp.i-scream.org/pub/i-scream/%{name}/%{name}-%{version}.tar.gz
b0ae833
# REJECTED due to Solaris or whatever linking issue,
b0ae833
# thus we cope with pkgconfig manually.
b0ae833
# See: https://github.com/i-scream/libstatgrab/pull/70
b0ae833
Source1:        libstatgrab.pc.in
801f749
BuildRequires:  autoconf
801f749
BuildRequires:  automake
801f749
BuildRequires:  libtool
b0ae833
%if %{with log4cplus}
b0ae833
BuildRequires:  log4cplus-devel
b0ae833
%endif
b0ae833
BuildRequires:  ncurses-devel
b0ae833
# Tests.
90b8dfc
BuildRequires:  perl-generators
7f872f8
BuildRequires:  perl(App::Prove)
b0ae833
BuildRequires:  perl(Config)
b0ae833
BuildRequires:  perl(Data::Dumper)
b0ae833
BuildRequires:  perl(File::Spec)
b0ae833
BuildRequires:  perl(File::Temp)
b0ae833
BuildRequires:  perl(File::Basename)
b0ae833
BuildRequires:  perl(FindBin)
b0ae833
BuildRequires:  perl(Getopt::Long)
b0ae833
BuildRequires:  perl(IPC::Cmd)
30f10b9
BuildRequires:  perl(lib)
b0ae833
BuildRequires:  perl(Pod::Usage)
b0ae833
BuildRequires:  perl(strict)
b0ae833
BuildRequires:  perl(Test::More)
b0ae833
BuildRequires:  perl(vars)
b0ae833
BuildRequires:  perl(warnings)
8522736
BuildRequires: make
0d06789
0d06789
%description
0d06789
Libstatgrab is a library that provides cross platform access to statistics
b0ae833
about the system on which it's running. It's written in C and presents a
b0ae833
selection of useful interfaces which can be used to access key system
b0ae833
statistics. The current list of statistics includes CPU usage, memory
b0ae833
utilisation, disk usage, process counts, network traffic, disk I/O, and more.
0d06789
b0ae833
The current list of supported and tested platforms includes FreeBSD, Linux,
b0ae833
NetBSD, OpenBSD, Solaris, DragonFly BSD, HP-UX and AIX.
0d06789
Koji 73156ac
%package        devel
b0ae833
Summary:        Development files for %{name}
634063c
Requires:       %{name}%{?_isa} = %{epoch}:%{version}-%{release}
0d06789
Koji 73156ac
%description    devel
b0ae833
This package contains libraries, header files and manpages for
b0ae833
developing applications that use libstatgrab.
0d06789
b0ae833
%if %{with examples}
Koji 73156ac
%package        examples
Koji 73156ac
Summary:        The example files from %{name}
Koji 73156ac
License:        GPLv2+
634063c
Requires:       %{name}%{?_isa} = %{epoch}:%{version}-%{release}
0d06789
Koji 73156ac
%description    examples
0d06789
This package contains various examples used to show how
0d06789
to develop libstatgrab based applications.
b0ae833
%endif
b0ae833
b0ae833
%package -n     saidar
b0ae833
Summary:        System information real-time monitor
b0ae833
License:        GPLv2+
b0ae833
b0ae833
%description -n saidar
b0ae833
Saidar is a curses-based interface to viewing the current state of the
b0ae833
system.
b0ae833
b0ae833
%package -n     statgrab
b0ae833
Summary:        Sysctl-style interface to the statistics from libstatgrab
b0ae833
License:        GPLv2+
b0ae833
b0ae833
%description -n statgrab
b0ae833
Statgrab gives a sysctl-style interface to the statistics gathered by
b0ae833
libstatgrab. This extends the use of libstatgrab to people writing scripts or
b0ae833
anything else that can't easily make C function calls. Included with statgrab
b0ae833
is a script to generate an MRTG configuration file to use statgrab.
b0ae833
7f3c422
# TODO: F23+2 must drop -tools-compat?
7f3c422
%package        tools-compat
b0ae833
Summary:        Transition package for statgrab-tools
b0ae833
Obsoletes:      statgrab-tools < 1:0.91-0
b0ae833
Requires:       statgrab%{?_isa} = %{epoch}:%{version}-%{release}
b0ae833
Requires:       saidar%{?_isa} = %{epoch}:%{version}-%{release}
b0ae833
7f3c422
%description    tools-compat
b0ae833
This package only exists to help transition statgrab-tools users to the new
b0ae833
package split. It will be removed after 2 distribution release cycles, please
b0ae833
do not reference it or depend on it in any way.
0d06789
0d06789
%prep
0d06789
%setup -q
b0ae833
# Instead of wasting several lines to install these programs, makefile hack
b0ae833
# will save the time.
b0ae833
sed -i 's|noinst_PROGRAMS|bin_PROGRAMS|g' examples/Makefile*
10f6d96
# Place log files underneath /var/log.
10f6d96
sed -i 's|@localstatedir@|@localstatedir@/log|g;s|.log4cplus|.log|g' *.properties.in
0d06789
0d06789
%build
b0ae833
cp -pf %{S:1} .
b0ae833
autoreconf -fiv
b0ae833
# Changing to asciidoc            --enable-man-build
b0ae833
%configure --with-ncurses      \
b0ae833
%if %{with log4cplus}
b0ae833
           --with-log4cplus    \
b0ae833
%endif
b0ae833
%if %{with examples}
b0ae833
           --enable-examples   \
b0ae833
%endif
b0ae833
           --disable-static
b0ae833
b0ae833
%make_build
0d06789
0d06789
%install
b0ae833
%make_install
b0ae833
%if %{with examples}
b0ae833
%make_install -C examples/
b0ae833
%endif
b0ae833
# Use %%doc instead.
b0ae833
rm -frv %{buildroot}%{_docdir}
b0ae833
# Drop libtool archive.
b0ae833
find %{buildroot} -name '*.la' -delete -print
b0ae833
7f3c422
mkdir -p %{buildroot}%{_docdir}/%{name}-tools-compat/
7f3c422
cat <<'EOF' >> %{buildroot}%{_docdir}/%{name}-tools-compat/README.Fedora
7f3c422
This package only exists to help transition statgrab-tools users to the new
7f3c422
package split. the structure of the transition is:
7f3c422
7f3c422
└── statgrab-tools --> └── %{name}-tools-compat
7f3c422
                           ├── saidar
7f3c422
                           └── statgrab
7f3c422
7f3c422
In the past prior to Fedora 24, libstatgrab had only 1 package for 2 programs
7f3c422
with different usage, while putting them inside one package seems reasonable,
7f3c422
however in order to reduce the size of the package, we decided to halve the
7f3c422
original package, now users can choose which to install, saidar or statgrab.
7f3c422
7f3c422
Note this compat package will be removed after 2 distribution release cycles,
7f3c422
please do not reference it or depend on it in any way.
7f3c422
7f3c422
Yours,
7f3c422
libstatgrab maintainers
7f3c422
EOF
7f3c422
b0ae833
%check
b0ae833
make check
0d06789
f6f6440
%ldconfig_scriptlets
0d06789
0d06789
%files
b0ae833
%license COPYING.LGPL
0d06789
%{_libdir}/*.so.*
0d06789
0d06789
%files devel
b0ae833
%doc AUTHORS NEWS PLATFORMS README
Koji 73156ac
%doc examples/*.c
0d06789
%{_libdir}/*.so
0d06789
%{_includedir}/*.h
Koji 73156ac
%{_libdir}/pkgconfig/%{name}.pc
0d06789
%{_mandir}/*/sg_*
0d06789
b0ae833
%if %{with examples}
0d06789
%files examples
b0ae833
%license COPYING
0d06789
%{_bindir}/cpu_usage
0d06789
%{_bindir}/disk_traffic
b0ae833
%{_bindir}/filesys_snapshot
0d06789
%{_bindir}/load_stats
0d06789
%{_bindir}/network_iface_stats
0d06789
%{_bindir}/network_traffic
0d06789
%{_bindir}/os_info
0d06789
%{_bindir}/page_stats
0d06789
%{_bindir}/process_snapshot
0d06789
%{_bindir}/process_stats
0d06789
%{_bindir}/user_list
b0ae833
%{_bindir}/valid_filesystems
0d06789
%{_bindir}/vm_stats
b0ae833
%endif
0d06789
7f3c422
%files tools-compat
7f3c422
%{_docdir}/%{name}-tools-compat/README.Fedora
7f3c422
b0ae833
%files -n saidar
b0ae833
%license COPYING
Koji 73156ac
%{_bindir}/saidar
b0ae833
%if %{with log4cplus}
10f6d96
%config(noreplace) %{_sysconfdir}/saidar.properties
b0ae833
%endif
Koji 73156ac
%{_mandir}/*/saidar*
Koji 73156ac
b0ae833
%files -n statgrab
b0ae833
%license COPYING
b0ae833
%{_bindir}/statgrab*
b0ae833
%if %{with log4cplus}
10f6d96
%config(noreplace) %{_sysconfdir}/statgrab.properties
b0ae833
%endif
b0ae833
%{_mandir}/*/*statgrab*
b0ae833
0d06789
%changelog
f9854d9
* Sun Nov 29 18:49:18 JST 2020 Mamoru TASAKA <mtasaka@fedoraproject.org> - 1:0.92-6
f9854d9
- Rebuild for new log4cplus
f9854d9
63733e4
* Sat Aug 01 2020 Fedora Release Engineering <releng@fedoraproject.org> - 1:0.92-5
63733e4
- Second attempt - Rebuilt for
63733e4
  https://fedoraproject.org/wiki/Fedora_33_Mass_Rebuild
63733e4
1ed194b
* Tue Jul 28 2020 Fedora Release Engineering <releng@fedoraproject.org> - 1:0.92-4
1ed194b
- Rebuilt for https://fedoraproject.org/wiki/Fedora_33_Mass_Rebuild
1ed194b
30f10b9
* Wed Apr 01 2020 Jitka Plesnikova <jplesnik@redhat.com> - 1:0.92-3
30f10b9
- Add perl(lib) for tests
30f10b9
18da230
* Wed Jan 29 2020 Fedora Release Engineering <releng@fedoraproject.org> - 1:0.92-2
18da230
- Rebuilt for https://fedoraproject.org/wiki/Fedora_32_Mass_Rebuild
18da230
44da095
* Sun Aug 18 2019 Tim Orling <ticotimo@gmail.com> - 1:0.92-1
44da095
- Update to 0.92 (rhbz 1742062)
44da095
8dc810f
* Thu Jul 25 2019 Fedora Release Engineering <releng@fedoraproject.org> - 1:0.91-12
8dc810f
- Rebuilt for https://fedoraproject.org/wiki/Fedora_31_Mass_Rebuild
8dc810f
07b9a00
* Fri Feb 01 2019 Fedora Release Engineering <releng@fedoraproject.org> - 1:0.91-11
07b9a00
- Rebuilt for https://fedoraproject.org/wiki/Fedora_30_Mass_Rebuild
07b9a00
76e41f9
* Fri Jul 13 2018 Fedora Release Engineering <releng@fedoraproject.org> - 1:0.91-10
76e41f9
- Rebuilt for https://fedoraproject.org/wiki/Fedora_29_Mass_Rebuild
76e41f9
54d84f9
* Wed Feb 07 2018 Fedora Release Engineering <releng@fedoraproject.org> - 1:0.91-9
54d84f9
- Rebuilt for https://fedoraproject.org/wiki/Fedora_28_Mass_Rebuild
54d84f9
384e22b
* Thu Aug 03 2017 Fedora Release Engineering <releng@fedoraproject.org> - 1:0.91-8
384e22b
- Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Binutils_Mass_Rebuild
384e22b
d1c2ae3
* Wed Jul 26 2017 Fedora Release Engineering <releng@fedoraproject.org> - 1:0.91-7
d1c2ae3
- Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Mass_Rebuild
d1c2ae3
7f872f8
* Thu Feb 16 2017 Ralf Corsépius <corsepiu@fedoraproject.org> - 1:0.91-6
7f872f8
- Add BR: perl(App::Prove) (Fix F26FTBFS).
7f872f8
5d00a14
* Fri Feb 10 2017 Fedora Release Engineering <releng@fedoraproject.org> - 1:0.91-5
5d00a14
- Rebuilt for https://fedoraproject.org/wiki/Fedora_26_Mass_Rebuild
5d00a14
d993ec7
* Mon Apr 18 2016 Tomas Hozza <thozza@redhat.com> - 1:0.91-4
d993ec7
- Rebuild against log4cplus 1.2.0
d993ec7
b8b8911
* Thu Feb 04 2016 Fedora Release Engineering <releng@fedoraproject.org> - 1:0.91-3
b8b8911
- Rebuilt for https://fedoraproject.org/wiki/Fedora_24_Mass_Rebuild
b8b8911
7f3c422
* Sat Sep 19 2015 Christopher Meng <rpm@cicku.me> - 1:0.91-2
7f3c422
- Fix upgrade path of statgrab-tools
7f3c422
b0ae833
* Sun Jul 26 2015 Christopher Meng <rpm@cicku.me> - 1:0.91-1
b0ae833
- Update to 0.91
b0ae833
65040cb
* Wed Jun 17 2015 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1:0.17-8.2
65040cb
- Rebuilt for https://fedoraproject.org/wiki/Fedora_23_Mass_Rebuild
65040cb
f835068
* Sun Aug 17 2014 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1:0.17-7.2
f835068
- Rebuilt for https://fedoraproject.org/wiki/Fedora_21_22_Mass_Rebuild
f835068
65f2bda
* Sat Jun 07 2014 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1:0.17-6.2
65f2bda
- Rebuilt for https://fedoraproject.org/wiki/Fedora_21_Mass_Rebuild
65f2bda
634063c
* Tue Sep 17 2013 Oliver Falk <oliver@linux-kernel.at> - 1:0.17-5.2
634063c
- Fix requires (epoch)
634063c
634063c
* Tue Sep 17 2013 Oliver Falk <oliver@linux-kernel.at> - 1:0.17-5.1
634063c
- Fix BZ#1008491 - too many broken deps
634063c
Koji 73156ac
* Fri Aug 16 2013 Christopher Meng <rpm@cicku.me> - 0.90-2
Koji 73156ac
- SPEC Cleanup.
Koji 73156ac
- Remove unneeded Requires.
Koji 73156ac
0a01cd9
* Tue Aug 13 2013 Oliver Falk <oliver@linux-kernel.at> - 0.90-1
0a01cd9
- Update
0a01cd9
- Should fix BZ#925891
0a01cd9
bbc10e5
* Sat Aug 03 2013 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.17-6
bbc10e5
- Rebuilt for https://fedoraproject.org/wiki/Fedora_20_Mass_Rebuild
bbc10e5
fac5422
* Wed Jul 17 2013 Petr Pisar <ppisar@redhat.com> - 0.17-5
fac5422
- Perl 5.18 rebuild
fac5422
1001324
* Thu Feb 14 2013 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.17-4
1001324
- Rebuilt for https://fedoraproject.org/wiki/Fedora_19_Mass_Rebuild
1001324
8a01568
* Thu Jul 19 2012 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.17-3
8a01568
- Rebuilt for https://fedoraproject.org/wiki/Fedora_18_Mass_Rebuild
8a01568
bfdeb4c
* Fri Jan 13 2012 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.17-2
bfdeb4c
- Rebuilt for https://fedoraproject.org/wiki/Fedora_17_Mass_Rebuild
bfdeb4c
11f377a
* Sun Apr 10 2011 Sven Lankes <sven@lank.es> - 0.17-1
11f377a
- new upstream release 
11f377a
29f5ee4
* Tue Feb 08 2011 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.16-6
29f5ee4
- Rebuilt for https://fedoraproject.org/wiki/Fedora_15_Mass_Rebuild
29f5ee4
14c1d12
* Thu Jan 27 2011 Oliver Falk <oliver@linux-kernel.at> 0.16-5
14c1d12
- Rebuild for new perl-5.12.3
14c1d12
ee45f7a
* Fri Feb 12 2010 Oliver Falk <oliver@linux-kernel.at> 0.16-4
ee45f7a
- Disable building of static libs #556075
ee45f7a
38003c0
* Sat Jul 25 2009 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.16-3
38003c0
- Rebuilt for https://fedoraproject.org/wiki/Fedora_12_Mass_Rebuild
38003c0
0cf5532
* Wed Feb 25 2009 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.16-2
0cf5532
- Rebuilt for https://fedoraproject.org/wiki/Fedora_11_Mass_Rebuild
0cf5532
9e86ab9
* Thu Mar 20 2008 Oliver Falk <oliver@linux-kernel.at> 0.16-1
9e86ab9
- Update
9e86ab9
1e6950a
* Wed Feb 13 2008 Patrick "Jima" Laughton <jima@beer.tclug.org> 0.15-2
1e6950a
- Bump-n-build for GCC 4.3
1e6950a
ed4d6fe
* Mon Aug 20 2007 Patrick "Jima" Laughton <jima@beer.tclug.org> 0.15-1
ed4d6fe
- New upstream version
ed4d6fe
- License clarification
ed4d6fe
- Fixed License tags for statgrab-tools and libstatgrab-examples
ed4d6fe
- Fix for rpath (problem found in previous versions, as well)
ed4d6fe
b9f5879
* Wed Jan 24 2007 Patrick "Jima" Laughton <jima@beer.tclug.org> 0.14-1
b9f5879
- New upstream version
b9f5879
- Minor cleanup for rpmlint warning
b9f5879
fa1bbc3
* Wed Oct 04 2006 Patrick "Jima" Laughton <jima@beer.tclug.org> 0.13-3
fa1bbc3
- Bump-n-build
fa1bbc3
258e607
* Tue Sep 19 2006 Patrick "Jima" Laughton <jima@beer.tclug.org>	- 0.13-2
258e607
- Bump for FC6 rebuild
258e607
Koji 73156ac
* Thu Apr 20 2006 Oliver Falk <oliver@linux-kernel.at> - 0.13-1
5604e5b
- Update
5604e5b
Koji 73156ac
* Wed Aug 10 2005 Oliver Falk <oliver@linux-kernel.at> - 0.12-1
e82d780
- Update
e82d780
- Added saidar manpage
e82d780
Koji 73156ac
* Fri Jul 08 2005 Oliver Falk <oliver@linux-kernel.at> - 0.11.1-3
0d06789
- Included examples/*.c in doc
0d06789
0d06789
* Wed Jul  6 2005 Tom "spot" Callaway <tcallawa@redhat.com> 0.11.1-2
0d06789
- a lot of fixes for Fedora Extras
0d06789
Koji 73156ac
* Thu May 19 2005 Oliver Falk <oliver@linux-kernel.at> - 0.11.1-1.1
0d06789
- Specfile cleanup
0d06789
Koji 73156ac
* Sun Apr 03 2005 Oliver Falk <oliver@linux-kernel.at> - 0.11.1-1
0d06789
- Update
0d06789
Koji 73156ac
* Fri Mar 25 2005 Oliver Falk <oliver@linux-kernel.at> - 0.11-2.1
0d06789
- Fix rpmlint warnings
0d06789
Koji 73156ac
* Tue Feb 15 2005 Oliver Falk <oliver@linux-kernel.at> - 0.11-2
0d06789
- Don't require coreutils. They are normally installed on Fedora, but
0d06789
  not available on RH 8, where the tools are usually also installed.
0d06789
  Yes, rebuilding with nodeps would also do it, but it's not fine...
0d06789
Koji 73156ac
* Tue Feb 15 2005 Oliver Falk <oliver@linux-kernel.at> - 0.11-1
0d06789
- Initial build for Fedora Core