How can I build an RPM package in a Debian based system? - packaging

I'd like to build packages using a build system (i.e. jenkins, travis, etc) but all I have are Ubuntu 12.04 VMs.
I've found this [1] instructions but mach does not support CentOS 7.0.
[1] http://blog.burghardt.pl/2008/12/how-to-build-rpm-packages-in-centos-chroot-on-debian/

http://mojo.codehaus.org/rpm-maven-plugin/ <- rpm plugin for the maven build system
sudo apt-get install rpm # for Ubuntu
Check out the command that it installs called rpmbuild.

Found it! There is actually a tool called rinse: "Rinse is a simple tool which is designed to carry out the installation of a new RPM-based distribution".
rinse --distribution="centos-7" --directory="/tmp/centos-7"
http://collab-maint.alioth.debian.org/rinse/

Related

How to create RPM package that uses setcap and works on both dnf/yum (fedora/redhat) and zypper (openSuse)

I'm developing an RPM package for a service that requires the command setcap for setting capabilities. The purpose of using setcap is to listen to port numbers below 1024.
RPM packages have a 'Requires' section that is a comma-separated list of other required packages, and in theory I can use that to make sure the target system installs the packages needed.
Now here's the problem:
setcap is available for Fedora in package libcap and for openSUSE in package libcap-progs.
the package libcap is not available on openSUSE, and libcap-progs is not available on Fedora.
Is it possible to create a single RPM package that installs setcap and works on both Fedora and openSUSE?
It's possible to write the following:
Requires: /usr/sbin/setcap
This will resolve on both Fedora and openSUSE to their corresponding library

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.

Redis desktop dependency on libicu52 for ubuntu12.04

I want to use a redis browser and I found redis-desktop-manager.
(http://redisdesktop.com/download)
I downloaded a deb file but it requested libicu52.
Frist. How can I install this one in Ubuntu12.04.
Second. I found later that it seems to support Ubuntu version 14+.
Would I run this on 12.04 version?
For the dependency of libicu52 Redis Desktop fail to install. You can follow bellow step:
Step 1: To download the libicu52 file. Run the command in the terminal:
wget http://security.ubuntu.com/ubuntu/pool/main/i/icu/libicu52_52.1-8ubuntu0.2_amd64.deb
Step 2: Install libicu52 by executing this command:
dpkg -i libicu52_52.1-8ubuntu0.2_amd64.deb
Now, Attempt once again to install redis-desktop-manager client from debian file, I believe now everything is fine ;)
FYI, redis-desktop-manager installs and runs perfectly on my 15.10 systems.
You can probably compile redis-desktop-manager from source on your system, using the libicu* version that comes with 12.04. I would also consider upgrading: 12.04 is no longer supported, has been replaced as an LTS by 14.04 and it generally far behind.
FWIW redis-desktop-manager installs and runs fine on my 15.04 and 15.10 systems.

I just installed graphite on my mac, but some fonts are huge

I just installed graphite on OSX, and managed to get the web app running this command:
python /opt/graphite/bin/run-graphite-devel-server.py /opt/graphite
I'll eventually move it to ubuntu, but in the mean time, some fonts are enormous:
Any thoughts on how to fix this?
I chased this down to an issue with the newest version of cairo. I removed cairo and installed 1.12.6. I posted the instructions here gist.github.com/relaxdiego/7539911
Its the cairocffi that handles the fonts and other display parameters. Sometimes installing only cairo doesn't work. In the above case you should always troubleshoot by ensuring proper and complete installation of the cairocffi package. By complete I mean all the dependencies for cairocffi.
The frequently required are:
1. libffi-devel (for rpm based operating systems)
sudo yum install libffi-devel
2. libffi-dev (for debian based operating systems)
sudo apt-get install libffi-dev
3. parse_lookup
sudo pip install parse_lookup
This is the Github page for cairocffi.

Configuration for Java binding for ZeroMQ (0MQ) with no root privileges on Linux

I am a novice with zeroMQ and I am stuck at binding ØMQ with java on a server running CentOS release 5.9.
Unfortunately, I do not have super user/root privileges on the server and am trying to install ØMQ as a normal user with restricted privileges. I have installed ØMQ by following instructions on http://www.zeromq.org/area:download
Make sure that libtool, autoconf, automake are installed.
Check whether uuid-dev package, uuid/e2fsprogs RPM or equivalent on your system is installed.
Unpack the .tar.gz source archive.
Run ./configure, followed by make.
Could not run the following obviously
To install ØMQ system-wide run sudo make install.
On Linux, run sudo ldconfig after installing ØMQ.
Then I attempted to install jzmq.
Cloned [git clone https://github.com/zeromq/jzmq.git]
Ran autogen.sh
Ran configure
At this point I get the following error
checking for ZeroMQ... no
checking zmq.h usability... no
checking zmq.h presence... no
checking for zmq.h... no
configure: error: cannot find zmq.h
As a result of the above error I am not able to run java tests and get error "no jzmq in java.library.path".
Can anybody help/direct me to how to get java binding for zeromq work when you dont have root privileges to install it? Its difficult to get IT department to install a new software on servers.
Appreciate your help.
Note: I do not have write permissions to /usr directory
Thanks
GBP
This can be overcome by adding --with-zeromq=/home/user/zeromq (installation directory of zeromq)
./configure --with-zeromq=/home/user/zeromq
Other steps include
export LD_LIBRARY_PATH=/home/user/zeromq/lib
You can also use JeroMQ (https://github.com/zeromq/jeromq) which is a pure Java implementation of ZeroMQ
I got this working by running autogen.sh on OEL 6 then running configure / compiling / installing on CentOS 5.9. I briefly looked into why autogen.sh was failing and the problem was the tool chain was too old. Since I had a more up-to-date system with a modern tool chain available running autogen.sh on something other than CentOS 5 was the easiest path for me. I'm sure it works fine with other modern Linux variants, I had OEL 6 at my finger tips.
I also did not have access to a standard directory for installation. To get that working I added zmq.jar to my class path, and the run-time linker needed to be able to find the zeromq and jzmq run-time libraries.
I faced the same issue on CentOS 6.5 and found that you need to install "gcc-c++" for this to work.
I used the following to install dependencies:
yum -y install jdk zeromq-devel unzip libtool gcc autoconf automake gcc-c++ python
Note that "jdk" comes from our private repository and it's same what can be downloaded from java.com
The following public repositories are installed on server:
atomic
Actually, I ended up having this same issue, and the following script worked for me, where I installed zeromq into ~ (so that I have ~/lib contains libzmq.a libzmq.la libzmq.so libzmq.so.3 libzmq.so.3.1.0 pkgconfig)
./autogen.sh ./configure --prefix=$HOME \ #because you don't have root privileges
--with-zeromq=$HOME --includedir=$HOME/include/ --libdir=$HOME/lib/
./make
./make -n install
#to check to see if it installs it to the right location
make install