i-nex / I-Nex

System information tool written in gambas3, python, bash
http://i-nex.linux.pl/
174 stars 24 forks source link

Building and installing eloaders / I-Nex for CentOS 7 #13

Closed alphastar868 closed 8 years ago

alphastar868 commented 8 years ago

NOTE: This can now be done by building the RPM for the latest commit using the included SPEC file in the package. More details below:

Tested with CentOS 7.1.1503 with I-Nex 7.4.0 commit 3455715bbc and later

Recommeded: Setup a CentOS Environment for building RPMs; specifically, you will need to create the directories for RPM building _Note:_Step 8 below also accomplishes the same thing.

  1. Download the source code using the Download ZIP button on the I-Nex project page Save as ~/rpmbuild/SOURCES/I-Nex-master.zip
  2. Save the text for i-nex.spec (below) as ~/rpmbuild/SPECS/i-nex.spec
  3. Save the text for i-nex-7.4.0-lib64.patch (below) as ~/rpmbuild/SOURCES/i-nex-7.4.0-lib64.patch This fixes #11
  4. Save the text for i-nex-7.4.0-distro-quotes.patch (below) as ~/rpmbuild/SOURCES/i-nex-7.4.0-distro-quotes.patch This fixes #10
  5. Save the text for i-nex-7.4.0-spd-labelnames.patch (below) as ~/rpmbuild/SOURCES/i-nex-7.4.0-spd-labelnames.patch This fixes #12
  6. Save the text for i-nex-7.4.0-rpm-dpkg.patch (below) as ~/rpmbuild/SOURCES/i-nex-7.4.0-rpm-dpkg.patch This fixes #14
    • Optional: Follow the instructions at #16 to enable distro detection of CentOS on the System tab including i-nex-7.4.0-centos-logo.patch and centos.png.
  7. Install gambas3* from the Fedora Rawhide repo and libcpuid11 from brollylssj's Fedora 23 repo
  8. Verify that all the RPMs needed as Prerequisites and Required RPMs for Build Environment are installed as per the previous instructions
  9. Build the I-Nex for CentOS 7 RPMs with the command: rpmbuild -ba ~/rpmbuild/SPECS/i-nex.spec
  10. Install the new RPMs with the command: sudo yum install ~/rpmbuild/RPMS/noarch/i-nex-data-7.4.0-*.el7.centos.noarch.rpm ~/rpmbuild/RPMS/x86_64/i-nex-7.4.0-*.el7.centos.x86_64.rpm

i-nex-7.4.0-lib64.patch

--- I-Nex-master/I-Nex/i-nex/.src/FSystemInfo.class     2015-09-19 17:24:12.000000000 -0400
+++ I-Nex-7.4.0/I-Nex/i-nex/.src/FSystemInfo.class      2015-09-27 11:39:04.000000000 -0400
@@ -187,7 +187,7 @@
   cFile = New Collection

   aText.Add("[Libraries]")
-  For Each sDir In ["/lib", "/usr/lib"]
+  For Each sDir In ["/lib", "/usr/lib", "/lib64", "/usr/lib64"]
     For Each sFile In RDir(sDir, "", gb.File, False).Sort(gb.IgnoreCase)
       sFile = File.Name(sFile)
       For Each sPattern In cSearch

i-nex-7.4.0-distro-quotes.patch

--- I-Nex-master/I-Nex/i-nex/Data/screenfetch-dev       2015-09-19 17:24:12.000000000 -0400
+++ I-Nex-7.4.0/I-Nex/i-nex/Data/screenfetch-dev        2015-09-27 12:41:25.658612840 -0400
@@ -3374,6 +3374,8 @@
 NETTOOLS=$(ifconfig --version 2>&1 | grep tools | awk 'NR==1{print $NF}')
 WIRELESS_TOOLS=$(iwconfig --version 2>&1 | awk '(NR==1 && ($3 == "version")) {print $4}')

+distro=$(echo $distro | sed 's/\"//g')
+
 cat > ~/.i-nex/screenfetch.json <<EOF
 {
   "DE": "$DE",

i-nex-7.4.0-spd-labelnames.patch

--- I-Nex-master/I-Nex/i-nex/.src/MDecode_dimms.module  2015-10-01 05:29:33.781844202 -0400
+++ I-Nex-7.4.0/I-Nex/i-nex/.src/MDecode_dimms.module.new       2015-10-01 05:31:03.277023619 -0400
@@ -15,6 +15,11 @@
  Try Finfosys.ComboBox10.List = Dir("/sys/bus/i2c/drivers/eeprom/", "*-****")
  Try Finfosys.ComboBox10.Index = 0
+
+ If Finfosys.ComboBox10.Count = 0 Then
+  SETNULL()
+  FINALIZE()
+ Endif
 End

Public Sub _inits()

i-nex-7.4.0-rpm-dpkg.patch


--- I-Nex-master/I-Nex/i-nex/.src/Finfosys.class        2015-10-02 10:05:12.512531894 -0400
+++ I-Nex-7.4.0/I-Nex/i-nex/.src/Finfosys.class         2015-10-02 15:26:07.800809195 -0400
@@ -774,7 +774,9 @@

 Public Sub Button7_Click()
   Dim packages As String
+  If Exist("/var/lib/dpkg/status")
   Shell "grep \"^Status: install ok installed\" /var/lib/dpkg/status | wc -l" Wait To packages
+  Endif
   If ChkPrm.ChkExec("rpm") = True And IsNull(packages) = True Then
   Shell "rpm -qa | wc -l" Wait To packages
   Endif

i-nex.spec

See https://github.com/eloaders/I-Nex/blob/master/dists/redhat/i-nex.spec
eloaders commented 8 years ago

I applied patches for Centos: https://github.com/eloaders/I-Nex/commit/5813d16340787a2287513f65755b3caa9599ef86

alphastar868 commented 8 years ago

Great news - thanks!

Also, the specfile at https://github.com/eloaders/I-Nex/blob/master/dists/i-nex.spec is outdated, and should probably be updated with the info from my updated i-nex.spec (it is .txt only to allow for Github upload here):

i-nex.spec.txt

Also, README.md (Github homepage) should be updated to reflect Gambas 3.8.x changes. And last, but not least, a version bump (7.4.0.1?), to prompt the automated buildsystems and custom repositories that are generating I-Nex packages e.g. OpenSUSE, Fedora Copr, etc.

alphastar868 commented 8 years ago

See i-nex.spec for the latest changes to the specfile, and for building new commits (versions) after 5813d16.