Definite's Extractor

My findings on Life, Linux, Open Source, and so on.

Category Archives: epel

Fedora Packaging: resolving /usr/bin/../bin/../lib/bfd-plugins/LLVMgold.so: wrong ELF class: ELFCLASS32

When I provide an update to barrier-2.4.0, I encountered:

/usr/bin/../bin/../lib/bfd-plugins/LLVMgold.so: wrong ELF class: ELFCLASS32

Barrier uses CMake to build. It called ar and ranlib during the build, however, wrong plugins was invoked and caused the above error.

While the above error can be avoided by adding option --plugin , however, CMake does not have an easy way to do that. Fortunately, gcc provides gcc-ar and gcc-ranlib wrappers that point to the correct plugins. So I inserted the commands that point to gcc-ar and gcc-ranlib in the section %prep with:

sed -i.use-gcc-ar -e '/include (CheckIncludeFiles)/ i set(CMAKE_AR "/usr/bin/gcc-ar")' CMakeLists.txt
sed -i.use-gcc-ranlib -e '/include (CheckIncludeFiles)/ i set(CMAKE_RANLIB "/usr/bin/gcc-ranlib")' CMakeLists.txt

The build worked.

How to get the active title of an X program

I have scripts that will utilise the SFDC case number, but why type it manually when the computer can do it?

Firstly, you need to have xdotool installed, for RHEL or CentOS Stream, it is in EPEL. I have tried xprop and xwininfo, but they do not accept search with WM_Class

Secondly, get the WM_Class of the X program, usually it is just the program name. If you are unsure, open that X program, then run xprog and click at the X program, then search WM_CLASS amongst the output.

Thirdly, for X program that has multiple tabs, make sure you activate the tab you want.

Now, to get the active title of firefox:

for i in $(xdotool search --onlyvisible --class firefox); do xdotool getwindowname $i; done

Two titles will be shown like:

Firefox
The actual title

For me, I am only interest in the number which are in the beginning of the title, so my command is:

for i in $(xdotool search --onlyvisible --class firefox); do xdotool getwindowname $i; done | sed -rne '/^[0-9]+/ s/^([0-9]+).*$/\1/p'

Build in epel8 branch with fedpkg

This article assumes you have commit right to the package, but you don’t have the epel8 branch in https://src.fedoraproject.org/rpms/YourPackage

  1. PKG=<YourPackage>
  2. fedpkg clone $PKG # if you have not done this
  3. cd $PKG # if you have not done this
  4. git branch epel8
  5. # Make the branch work with epel8
  6. git commit
  7. git push –set-upstream origin epel8
  8. fedpkg build
  9. Go to bodhi and create -> New update

Enjoy!

nodejs/npm yum repo for EL7

The nodejs and npm in EL7 is too old, so I borrowed the  to latest nodejs spec from  rawhide. Long story short, the result is at:

https://copr.fedorainfracloud.org/coprs/dchen/nodejs/

Please read the disclaimer and do follow the installation instruction if you choose to proceed. I don’t usually put the disclaimer like that but you need to know that:

  1. The build dependency of nodejs include openssl-1.0.2, but EL7 only shipped with 1.0.1, yet nodejs can run with openssl-1.0.1.
  2. openssl-libs is an important package, without it,  yum, curl and rpm URL install won’t work, so restore it is a bit tricky. The instruction is, however, written in the copr page.

Longer story:

To build this copr, following dependencies need to go in as well:

  1. libuv
  2. crypto-policies
  3. openssl-1.0.2

libuv is piece of cake. But crypto-policies and openssl bring the worst packager nightmare: circular dependency. After F23, crypto-policies require openssl-devel to build, yet openssl require crypto-policies to run.

I eventually dug out crypto-policies from F21 and built it, thus broke the circular dependency and finished the build.

RHEL 7 mock build with staff_selinux

By default, mock won’t work with staff_selinux mode in RHEL 7. The instruction from Fedora is mostly correct, but insufficient for staff_selinux. This is because:

  1. /usr/bin/mock is now a sym-link to /usr/bin/consolehelper, thus consolehelper permission should be also allowed.
  2. The Fedora mock policy module does not have the types like staff_consolehelper_t.

There are a lot more reasons, but long story short, I have edited a policy file (PackageMaintainers_MockTricks_mock.te) that should covered the most mock usage. My SELinux skill quickly build up by editing that file. 🙂

Time for script that setup the mock, assuming you are running as root:

# getting dependencies
yum -y install selinux-policy-devel policycoreutils-python mock

# Download policy files
wget https://fedoraproject.org/w/uploads/2/2f/PackageMaintainers_MockTricks_mock.if
wget https://fedoraproject.org/w/uploads/7/73/PackageMaintainers_MockTricks_mock.fc
wget https://dchen.fedorapeople.org/files/PackageMaintainers_MockTricks_mock.te

# Build and install
make -f /usr/share/selinux/devel/Makefile
semodule -i PackageMaintainers_MockTricks_mock.pp

That’s it.

But just in case you are still getting SELinux AVC denials, you can get around yourself by using following scripts:

grep -E -e "(mock|consolehelper)" /var/log/audit/audit.log | audit2allow -M my_mock
semodule -i my_mock.pp

cmake-fedora-2.4.3 is released

cmake-fedora consists CMake modules and scripts that simplify and automate the release process for software package, especially for Fedora and EPEL.

Even if you are not using CMake on your packages, you can still using following scripts to simplify your package chores. For examples, if you want your packages to be build in koji and submit to bodhi in all active branches like rawhide, f23, f22, f21, simply run

cmake-fedora-fedpkg <SRPM>

It builds the SRPM on all the active branches, skip the already built ones, then submit them to bodhi.

dchen’s apache-maven is updated to 3.3.3 for el7 and el6

The repo is located at:

https://repos.fedorapeople.org/dchen/apache-maven/

To install this for from yum:

cd /etc/yum.repos.d; sudo wget https://repos.fedorapeople.org/dchen/apache-maven/epel-apache-maven.repo

Enlightenment 0.19.9 and EFL 1.15.1 is ready for RHEL and CentOS 7

I have update the Enlightenment E19 to

  • enlightenment-0.19.9
  • efl-1.15.1
  • elementry-1.15.1

And packages that depend on efl are rebuilt.

In my enlightenment repo, I also put xscreensaver and required dependency.

Note that the packages I built supports neither wayland nor SCIM.

Enlightenment 0.19.7, EFL 1.14.2 for Fedora and RHEL are available in enlightement-19-no-wayland

Enlightenment 0.19.7

EFL 1.14.2

And terminology 0.8.0 rebuild for EFL 1.14.2 are available in my enlightenment repo.

Note that the packages I built supports neither wayland nor SCIM.

Enlightenment E19 on RHEL 7

I quite like Enlightenment and Terminology. However, they are not available on RHEL 7.

Thus I’ve made a copr repo  for RHEL7.

Note that I disable couples of things to make it work in RHEL 7.

  • Wayland support: See https://bugzilla.redhat.com/show_bug.cgi?id=1214597
  • SCIM: I don’t want to port SCIM in RHEL 7, normally you can use IBus for input methods.
  • vlc: This cannot be in copr, nor do I have time to build it.
    It is a pity, as you won’t able to see some fancy features provided by EFL filemanager and terminology.