rpm build with local Required: some_local_package.rpm - yum

Requires: in the spec files sets the package dependencies, but what will happen if the repo of the requirements is not in the repolist?
Is there a way to use pre downloaded rpm files and tell the rpmbuild that the dependencies should be installed from the local file like yum localinstall.

You're conflating rpm and yum when you mention repolist.
rpm is a lower level and only knows about RPM files
yum collects sets of RPMs into repositories and sits on top of RPM to handle dependencies
Now, to answer the question - rpmbuild does not need anything from the Requires field to build the RPM. If it does, then the RPMs should be listed as BuildRequires in the specfile and only be in Requires if the end user needs it to be installed to run the final product. For example, to build you might need foo-devel but at runtime you only need libfoo. Those should be declared appropriately.
Even if you fix the Requires vs. BuildRequires fields, it still won't help you - rpmbuild cannot install RPMs itself because you should never run rpmbuild as root. An error in a specfile can very easily nuke an entire machine if it's run as root.

Related

Installing / Building the newest version of Inkscape (v 1.2) on Linux Ubuntu 20.04

I am trying to install Inkscape 1.2beta on Linux Ubuntu 20.04. The website currently only offers an AppImage and a source tarball. Since I would like to access the newest features of Inkscape via the command line, I need to build and install the source tarball.
INSTALL.md states that I need all submodules and dependencies before install.
How do I find these dependencies to successfully build and install Inkscape?
This list should satisfy all required dependencies on Linux Ubuntu:
apt install
cmake
imagemagick
libdouble-conversion-dev
libgdl-3-dev
libagg-dev
libpotrace-dev
libboost-all-dev
libsoup2.4-dev
libgc-dev
libwpg-dev
poppler-utils
libpoppler-dev
libpoppler-glib-dev
libpoppler-private-dev
libvisio-dev libvisio-tools
libcdr-dev
libgtkmm-3.0-dev
libgspell-1-dev
libxslt-dev libxslt1-dev
libreadline6-dev
lib2geom-dev
lib2geom-dev is needed to solve error "<ieeefp.h> not found".
For building Inkscape:
Download source tarball for Inkscape v1.2 from inkscape.org and extract
cd <extracted inkscape directory>
mkdir build && cd build
cmake ..
make
make install
If you still get an error during cmake .., please comment below with the names of the missing modules in the error message.
The details on how to build Inkscape (and the dependencies) could be found in the repository itself, or Inkscape website (For completness, the steps are copied from the website here):
To obtain the latest source code, use the following command (downloads into a subdirectory of your current working directory called "inkscape" by default):
git clone --recurse-submodules https://gitlab.com/inkscape/inkscape.git
To update this code later, change into the download folder and use:
git pull --recurse-submodules && git submodule update
By default, git will download every branch and every commit. If you are on a slow machine, have limited disk space, or limited internet bandwidth, you can use shallow clone and single branch clone options to limit the amount of data it will download:
git clone --depth=1 --single-branch --recurse-submodules --shallow-submodule https://gitlab.com/inkscape/inkscape.git
Building Inkscape on Linux
Open a terminal at the root of the folder into which you downloaded the source code in the previous step.
Install build dependencies
Download and run the script to install everything required for compiling Inkscape (check script to see if your distribution is supported):
wget -v https://gitlab.com/inkscape/inkscape-ci-docker/-/raw/master/install_dependencies.sh -O install_dependencies.sh
bash install_dependencies.sh --recommended
Compile
To compile with CMake, do the following:
mkdir build
cd build
cmake .. -DCMAKE_INSTALL_PREFIX=${PWD}/install_dir -DCMAKE_C_COMPILER_LAUNCHER=ccache -DCMAKE_CXX_COMPILER_LAUNCHER=ccache
make -j8
make install
Notes:
Using ccache is optional but speeds up compilation.
The optional -j8 argument to make tells it to run 8 jobs in parallel. Feel free to adjust this to the number of hardware threads (physical cores) available on your computer.
The recommended -DCMAKE_INSTALL_PREFIX argument allows to specify a custom isolated installation location (in the example above install_dir/ inside the build folder). It avoids installation into system locations (where it could conflict with other versions of Inkscape) and allows running multiple versions of Inkscape in parallel. It will still use all the files (including the preferences.xml) that reside in the ~/.config/inkscape directory.
Run
Run it from the build directory:
install_dir/bin/inkscape

error: unpacking of archive failed: cpio: Bad magic when installing an rpm

I packaged an rpm using
make package
command, and copied the resulting rpm to another machine which has a company specific OS. Now when I try to install the rpm using
rpm --nodeps -i filename.rpm
I get the error the same as the one in the title.
So I ran
rpm -qa | grep rpm
on the machine used to build the rpm package, and got this:
rpm-4.8.0-37.el6.x86_64
rpm-devel-4.8.0-37.el6.x86_64
rpm-python-4.8.0-37.el6.x86_64
rpm-libs-4.8.0-37.el6.x86_64
rpm-build-4.8.0-37.el6.x86_64
redhat-rpm-config-9.0.3-51.el6.noarch
After a bit of investigation, I tried removing the redhat-rpm-config package and bam, rpm installation worked on the other machine. Now, this is a solution and all but I don't think I can just uninstall this package for every machine that we're going to use in creating the rpm. Is there any other way to ignore this redhat-rpm-config-9.0.3-51.el6.noarch when creating an rpm package using cmake?
What is the RPM version of the system you are installing on? Are its sources publicly available somewhere?
There could be various compatibility issues if you build binary RPMs using a newer RPM/distribution. In general, we build binary RPMs using the RPM and redhat-rpm-config versions in the buildroot (which is created by mock) itself, which matches the target RPM version, even if the build host has a newer RPM version.
If this is not an option for you, I would look at specific RPM features controlled by redhat-rpm-config. The one that sticks out to me immediately is payload compression:
# Use XZ compression for binary payloads
%_binary_payload w2.xzdio
Other changes include support for larger files, but this does not seem to be the issue here because it would not change by uninstalling the redhat-rpm-config package.
You very likely made binary RPM using rpmbuild on different OS than was the target OS. You should use "mock" for building the package.
dnf install mock
mock -r epel-6-x86_64 yourpackage.src.rpm
To solve "error: unpacking of archive failed: cpio: Bad magic" issue at RPM package installation on your machine:
1/ List rpm pkgs which are installed on the server machine (the machine on which the rpm pkg is generated):
$ rpm -qa | grep rpm
….
….
2/ If pkg redhat-rpm-config-9.0.3-51.el6.noarch is present in the given list, desinstall it:
$ rpm -e redhat-rpm-config-9.0.3-51.el6.noarch
3/ Generate now the pkg and tranfer it on your dev machine. Pkg installation should work.
Philippe.

Why is no package 'mono' found?

Attempting to install Banshee from source on a CentOS 7 machine (migrating from Ubuntu and I want to retain my playlists and settings).
./configure results in:
configure: error: Package requirements (mono >= 2.4.3) were not met:
No package 'mono' found
Consider adjusting the PKG_CONFIG_PATH environment variable if you
installed software in a non-standard prefix.
Alternatively, you may set the environment variables MONO_MODULE_CFLAGS
and MONO_MODULE_LIBS to avoid the need to call pkg-config.
See the pkg-config man page for more details.
which mono
/bin/mono
echo $PKG_CONFIG_PATH
/usr/local/lib/pkgconfig
but if I check for pkgconfig,
which pkgconfig
/usr/bin/which: no pkgconfig in (/usr/lib64/qt-3.3/bin:/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin:/root/bin)
yum provides pkgconfig
1:pkgconfig-0.27.1-4.el7.i686 : A tool for determining compilation options
Repo : base
yum install pkgconfig
Package 1:pkgconfig-0.27.1-4.el7.x86_64 already installed and latest version
A similar question was asked last year with no accepted answer. One of the answers pointed to a now non-existent page with a purported solution.
I believe pkg-config itself is working all right, configure is not complaining about that. What's missing is the entry for mono in the pkg-config database. Make sure you have mono.pc in /usr/local/lib/pkgconfig, or add wherever you have this file to PKG_CONFIG_PATH as instructed. On some linux distributions, development packages need to be separately installed, such as libmono-cil-dev on debian.

Where should .emscripten LLVM_ROOT and NODE_JS point to? (Mac OS X)

After downloading emscripten via
git clone git://github.com/kripken/emscripten.git
and running
./emcc
a .emscripten file is created in my user root.
==============================================================================
Welcome to Emscripten!
This is the first time any of the Emscripten tools has been run.
A settings file has been copied to ~/.emscripten, at absolute path: /Users/calvin/.emscripten
Please edit that file and change the paths to fit your system. Specifically,
make sure LLVM_ROOT and NODE_JS are correct.
This command will now exit. When you are done editing those paths, re-run it.
==============================================================================
I have llvm installed and nodejs installed via macports. So where should I change LLVM_ROOT and NODE_JS to point to?
running emsdk activate latest (after having run emsdk install latest, which takes a while) gets all of my aliases and such working, I've added it to my bash profile
Are the LLVM / Node.js commands accessible on your path? E.g. does running node or clang work?
If so, you can detect the paths you need from there. For LLVM_ROOT, you want the directory containing the LLVM binaries:
$ dirname `which llvm-config`
/usr/local/bin
For NODE_JS, you want the path to the node binary itself:
$ which node
/usr/local/bin/node
If this fails (because they are not on your path already), then try looking in /opt/local/bin. That's seems like the right place from the MacPorts docs (I don't use MacPorts myself).

Trying to get yum to install dependencies from own repo

I have created a yum repository on a machine I have. I have thrown certain RPM's into it and created the repo. On my second machine I am able to view these repos and the files in them by doing a yum list. The second part of this is I have done a spec file that creates an rpm that depends on all of the RPM's in this specific repo but when I do a yum install createdrpm it determines the correct dependencies, but does not install them from my own repo.
I have tried searching over the web for this, but no luck unfortunately. If someone can point me in the right direction that would be great.
Thanks
In the rpm spec file, the Requires section should list the package names that are shown in the yum repo, not the rpm filenames.
For example:
yum list | grep something
something.noarch v1.0
The rpm spec file should have:
Require: something >= 1.0