Blob Blame Raw
# https://github.com/i-nex/I-Nex/commit/0c10102578e7c762674eaf9460b0903d76f151db
%global commit0 0c10102578e7c762674eaf9460b0903d76f151db
%global shortcommit0 %(c=%{commit0}; echo ${c:0:7})
%global gver .%{gitdate}git%{shortcommit0}
%global gitdate 20170703

Name:           i-nex
Version:        7.6.0
Release:        9%{gver}%{?dist}
Summary:        System information tool like hardinfo, sysinfo
License:        GPLv3 and LGPLv3
URL:            https://github.com/eloaders/I-Nex
Source0:        https://github.com/i-nex/I-Nex/archive/%{commit0}.tar.gz#/%{name}-%{shortcommit0}.tar.gz
# https://github.com/i-nex/I-Nex/issues/80
Source1:        %{name}.appdata.xml
# https://github.com/i-nex/I-Nex/issues/81
Patch0:         %{name}-Makefile.patch

ExcludeArch:    aarch64 %arm ppc64le ppc64 s390x
 
BuildRequires:  gambas3-devel
BuildRequires:  ImageMagick
BuildRequires:  ImageMagick-devel
BuildRequires:  git
BuildRequires:  gcc-c++
BuildRequires:  autoconf
BuildRequires:  make
BuildRequires:  redhat-lsb
BuildRequires:  automake
BuildRequires:  libappstream-glib
BuildRequires:  gambas3-gb-image
BuildRequires:  gambas3-gb-qt5
BuildRequires:  gambas3-gb-form
BuildRequires:  gambas3-gb-desktop
BuildRequires:  gambas3-gb-form-dialog >= 3.5.0
BuildRequires:  gambas3-gb-form-stock
BuildRequires:  gambas3-gb-gui >= 3.5.0
BuildRequires:  gambas3-gb-qt5-ext >= 3.5.0
BuildRequires:  gambas3-gb-settings
BuildRequires:  pkgconfig
BuildRequires:  libcpuid-devel >= 0.2.1
BuildRequires:  pkgconfig(libprocps)
BuildRequires:  pkgconfig(x11)
BuildRequires:  pkgconfig(gl)
BuildRequires:  pkgconfig(xext)
BuildRequires:  pciutils
BuildRequires:  procps
BuildRequires:  desktop-file-utils
Requires:       gambas3-gb-gtk
Requires:       gambas3-gb-desktop
Requires:       gambas3-gb-settings
Requires:       gambas3-gb-form-dialog
Requires:       gambas3-gb-qt5 >= 3.5.0
Requires:       gambas3-gb-qt5-ext >= 3.5.0
Requires:       gambas3-gb-form-mdi
Requires:       gambas3-gb-form-stock
Requires:       redhat-lsb
Requires:       mesa-demos 
Requires:       xorg-x11-server-utils
Requires:       gambas3-gb-dbus
Requires:       gambas3-runtime
Requires:       gambas3-gb-image
Requires:       gambas3-gb-gtk
Requires:       gambas3-gb-form
Requires:       util-linux
Requires:       procps-ng
Requires:       coreutils
Requires:       pciutils
Requires:       libcpuid
Requires:       gambas3-runtime
Requires:       gambas3-gb-gui >= 3.5.0
Requires:       net-tools
Requires:       procps-ng
Requires:       pastebinit
Requires:       procps-ng

%description
i-nex - System information tool like hardinfo, sysinfo.
I-Nex is an application that gathers information for hardware 
components available on your system and displays it using an 
user interface similar to the popular Windows tool CPU-Z.

I-Nex can display information for the following components: CPU, 
GPU, Motherboard, Sound, Hard disks, RAM, Network and USB as well 
as some system info like the hostname, Linux distribution and 
version, Xorg, GCC, GLX versions and Linux Kernel info.


%prep
%autosetup -p1 -n I-Nex-%{commit0}
# make it dynamic
sed -i -e 's|^STATIC.*|STATIC = false|' i-nex.mk
sed -i -e 's|^UDEV_RULES_DIR.*|UDEV_RULES_DIR = /usr/lib/udev/rules.d|' i-nex.mk
 
# A hack to be able to run the program via the name execution. Thanks openSuse!
#+ some info tools are under *sbin
cat > %{name}.sh <<HERE
#!/bin/sh

export LIBOVERLAY_SCROLLBAR=0 PATH=/sbin:/usr/sbin:\$PATH
exec %{_bindir}/%{name}.gambas
HERE

#using system's pastebinit
sed -i \
       '\|/usr/share/i-nex/pastebinit/|s|/usr/share/i-nex/pastebinit/||' \
       I-Nex/i-nex/.src/Reports/MPastebinit.module
cp I-Nex/i-nex/logo/i-nex.0.4.x.png %{name}.png
sed -e 's|env LIBOVERLAY_SCROLLBAR=0 /usr/bin/i-nex.gambas|i-nex|' \
         -e '/^Icon=/s|=.*|=%{name}|' debian/%{name}.desktop > %{name}.desktop

# remove empty line
sed -i -e '1,1d' debian/i-nex-library.desktop

%build
cd I-Nex
autoreconf -fiv
%configure
cd ..
%make_build

%install
%make_install

# A hack to be able to run the program via the name execution.
install -D -m 755 %{name}.sh %{buildroot}%{_bindir}/%{name}

# Let's use %%doc macro.
rm -rf %{buildroot}%{_datadir}/doc/%{name}

# Let's use system's `pastebinit`.
rm -rf %{buildroot}%{_datadir}/%{name}/pastebinit

chmod 0644 %{buildroot}/%{_udevrulesdir}/i2c_smbus.rules 
mv %{buildroot}/%{_udevrulesdir}/i2c_smbus.rules %{buildroot}/%{_udevrulesdir}/50-i2c_smbus.rules

install -Dm644 %{S:1} %{buildroot}/%{_datadir}/appdata/%{name}.appdata.xml

%check
desktop-file-validate %{buildroot}%{_datadir}/applications/*.desktop
appstream-util validate-relax --nonet %{buildroot}/%{_datadir}/appdata/%{name}.appdata.xml

%files
%doc README.md
%license debian/copyright
%{_bindir}/i-nex
%{_bindir}/i-nex.gambas
%{_bindir}/i-nex-edid
%{_datadir}/applications/i-nex.desktop
%{_udevrulesdir}/50-i2c_smbus.rules
%{_datadir}/applications/i-nex-library.desktop
%{_datadir}/appdata/%{name}.appdata.xml
%{_mandir}/man1/i-nex.1.*
%{_mandir}/man1/i-nex.gambas.1.*
%{_mandir}/man1/i-nex-edid.1.*
%{_datadir}/pixmaps/i-nex-16.png
%{_datadir}/pixmaps/i-nex-32.png
%{_datadir}/pixmaps/i-nex-128.png
%{_datadir}/pixmaps/i-nex.png

%changelog
* Tue Oct 08 2019 Petr Viktorin <pviktori@redhat.com> - 7.6.0-9.20170703git0c10102
- Remove unused dependency python2-configobj

* Thu Jul 25 2019 Fedora Release Engineering <releng@fedoraproject.org> - 7.6.0-8.20170703git0c10102
- Rebuilt for https://fedoraproject.org/wiki/Fedora_31_Mass_Rebuild

* Fri Feb 01 2019 Fedora Release Engineering <releng@fedoraproject.org> - 7.6.0-7.20170703git0c10102
- Rebuilt for https://fedoraproject.org/wiki/Fedora_30_Mass_Rebuild

* Fri Jul 13 2018 Fedora Release Engineering <releng@fedoraproject.org> - 7.6.0-6.20170703git0c10102
- Rebuilt for https://fedoraproject.org/wiki/Fedora_29_Mass_Rebuild

* Thu Mar 15 2018 Martin Gansser <martinkg@fedoraproject.org> - 7.6.0-5.20170703git0c10102
- Update Python 2 dependency declarations to new packaging standard

* Wed Feb 07 2018 Fedora Release Engineering <releng@fedoraproject.org> - 7.6.0-4.20170703git0c10102
- Rebuilt for https://fedoraproject.org/wiki/Fedora_28_Mass_Rebuild

* Mon Oct 23 2017 Martin Gansser <martinkg@fedoraproject.org> - 7.6.0-3.20170703git0c10102
- Delete BR hicolor-icon-theme not needed
- Use udev macro %%{_udevrulesdir}
- Add BR libappstream-glib
- Add %%{name}-Makefile.patch to fix install pixmap
- Add ExcludeArch: aarch64 %%arm ppc64le ppc64 s390x

* Mon Oct 23 2017 Martin Gansser <martinkg@fedoraproject.org> - 7.6.0-2.20170703git0c10102
- Use udev macro %%{_udevrulesdir}
- RR hicolor-icon-theme not needed
- Add an AppData file. See https://fedoraproject.org/wiki/Packaging:AppData
- Add gitdate for snapshot release

* Wed Sep 27 2017 Martin Gansser <martinkg@fedoraproject.org> - 7.6.0-1.20170703git0c10102 
-Initial build