'shntool' package unavailable

Hi @leeuw,

Good suggestion; here we go:

 
  1. set up a rpm build enviroment (info source: HowTos/SetupRpmBuildEnvironment )

1.1) open a command line terminal and switch to root (notice the # sign of the prompter: # for root, $ for a regular user)

su

enter your root password here, as root, enable the powertools repository:

yum install dnf-plugins-core
yum config-manager --set-enabled powertools

1.2) now proceed to set the build environment:

yum install rpm-build
yum install redhat-rpm-config

and finally exit the root account and get back to your regular user

exit

as regular user:

mkdir -p ~/rpmbuild/{BUILD,RPMS,SOURCES,SPECS,SRPMS}
echo '%_topdir %(echo $HOME)/rpmbuild' > ~/.rpmmacros

now get back to root and install the compile tools:

su

enter again your root password, then:

yum install make
yum install gcc gcc-c++

1.3) as root we also need to install wget:

yum install wget

exit from root back to your regular user account:

exit
  1. search for the package we wish to install, as @joebeasley suggested:

2.1) open a browser, go to https://pkgs.org/ and search for “shntool”. Open “Fedora 34” tab and click on the “shntool-3.0.10-27.fc34.x86_64.rpm” link. Scroll down to “Download” section and copy the link for the source (code) of the rpm package. We will use this link to download the src.rpm package.

  1. As regular user (not root !), download the src.rpm file; type in the command line terminal:
cd /tmp
wget https://download-ib01.fedoraproject.org/pub/fedora/linux/updates/34/Everything/SRPMS/Packages/s/shntool-3.0.10-27.fc34.src.rpm 
  1. install the source in the rpm build environment we just created before (as regular user, definitely NOT as root !)
rpm -ivh shntool-3.0.10-27.fc34.src.rpm
  1. proceed to the compilation (aka rpm building from source)
cd ~/rpmbuild/SPECS

where you find the “specifications” file for the rpm we wish to build ( shntool.spec ) and launch the compilation:

rpmbuild -ba shntool.spec

Oops, it complains about the lack of “autoconf” and “automake”… No problem, let’s install them

  1. Install the required dependencies (as root), then switch back to a regular user:
su
yum install autoconf automake
exit
  1. After installing the required dependencies, let’s’ try once again the compilation (as a regular user: NEVER build rpms as root !!!)
rpmbuild -ba shntool.spec

This step should end up without errors;

  1. the rpm package we built is located in:
cd ~/rpmbuild/RPMS/x86_64
ls -l

8.1) we can safely remove the “debug” packages:

rm *debug*
  1. and finally install our rpm (as root)
su
yum install ./shntool-3.0.10-25.el8.x86_64.rpm
exit
  1. after exiting root, enjoy shntool compiled by yourself
shntool -v

Regards,
Bogdan

Later edit:
If you wish to remove shntool you installed, just run (as root)

yum remove shntool

The procedure is very clean as long as you deal with rpms and not with “make install” or “make uninstall” tricks (these last two are not really recommended unless you know very well what you are doing).

1 Like