How can I build rpm binary for my embedded system? - linux

Please note that I am "not" looking to build an RPM package.
Rather, I am looking to build the rpm binary itself which I can run to install an RPM package on my system. I scoured through the web for any reference but almost all of the results were for creating an RPM package, rather than compiling 'rpm' binary.
Any pointers are appreciated.

Fedora's RPM Guide has an entire chapter dedicated to bootstrapping RPM on non-RPM OSs. A quick glance tells me it might be a good start.

Related

How to create RPMs under Windows only by useing install free binaries or .net?

I am looking for a lightweight method to create rpm packages under MS Windows environments.
Actually I use Cygwin. I generate the rpm by using cmake(cpack). For cmake I need to install gcc to bypass the compiler check. For the rpm generation I have the rpm & rpm-build packages installed. When I am checking the size of the Cygwin dir it is around 2.2GByte. Quite a lot for generating a "simple" rpm.
Is there a "better" way to generate RPMs? Maybe in .net etc.?
I know I'm a bit late to the party, but I've started the dotnet-packaging project, which allows you to create RPM and Debian packages on any platform that hosts .NET/.NET Core. So that includes Windows.
You can either use it as a library or as a .NET command-line utility (e.g. you could just run dotnet rpm on your project and it would create a RPM file for you).
https://github.com/qmfrederik/dotnet-packaging has the code and a getting started guide, let me know if that works.

Does an RPM require a compile phase?

I want to build an RPM of OpenCV for a distribution of Oracle Linux. I have been reading various guides to making an RPM (see http://www.ibm.com/developerworks/library/l-rpm1/), and from Fedora's documentation, I read the following:
The RPM system will automate the steps to create an application, as
long as you configure the RPM with the proper steps, such as which
make targets to run. Unfortunately, configuring the proper steps is
not always easy. So before trying to make an RPM, you need to figure
out how to build the application or library you plan to package into
an RPM. Once you have figured out how to build the application or
library, you can set up a reproducible build. The RPM system can then
automate this build.
From this I gather that RPM doesn't install prebuilt libraries and binaries, but builds them from source. However, my experience tells me that when I download packages that I am just installing prebuilt binaries. Is this correct?
There are two different things. You can package an application using
rpm system using a spec file
The spec file is the recipe for creating your application. Once you have a spec file. You can use it generate a src rpm or binary rpm. Binary rpm is the rpm that you were referring.
The spec file specifies how to build/package your rpm. We use rpmbuild command to build the rpm.
Now you can use rpm command to install/uninstall/upgrade the rpm package.
Please don't be confused between rpm, the package AND rpm system, the engine responsible for building the rpm

how to compile apache,mysql and php in linux

I have never used Linux OS. Want to know how we can start compiling Apache,Mysql and php in Linux and is it necessary to configure it.
I tried doing it by using cd/user/scr/httpd_2.0.09
Do we need to downloads the set up from google
Do yourself a favour and don't try to compile your own webserver etc. ;)
Aside from the fact that it's a lot of work to set up the tools for compiling, resolve dependencies, and debug possible errors, you will have to do the same procedure with every tiny update – instead of simply getting a new version via your package manager.
If you use a common distribution, install the packages required for the so-called LAMP stack, and configure them properly. That will be hard enough for starters.
If you're using Ubuntu, have a look here: https://help.ubuntu.com/community/ApacheMySQLPHP
Actually installing binaries from repositories is less painful than compiling, but if you really want so, you may install Gentoo or other source-based distributive. I've simply described compilation of MySQL 5.5 in my blog.
To compile packages on Debian based systems you need to install build-essential and cmake package (and maybe some other *-dev packages, which appears to be missing during source configure).
For example to compile MySQL 5.5 it is enough to run:
cmake . #yep, with dot. Will prepare your source according to your system
make
make install #will install compiled binaries to system

Port a debian package to YUM for CentOS

I have a project that runs on Debian and uses many packages provided from the Debian repositories.
Because of demand, I've looked into porting the project to CentOS, but found that many of the packages I require are completely missing - at least 10 dependencies would have to be compiled manually at install time on the users machine.
My question is, what is the best way to create an installer for the user's machine? Should I use automake tools (with the standard ./configure, make, make install), to compile the required libraries, or is this a non-standard approach. Note that my app doesn't actually need to be compiled since it is written in Python, so is it weird to do a "make", when you're not compiling your own app?
Should the configure script just warn the user that package X is missing, and let them handle the rest?
Should I roll my own dependency checker by runng pkg-config manually a few times for each library required, and exit if something is missing?
I'm quite new to this, so any tips to get me moving in the right direction are appreciated.
Edit: I am familiar with RPM and yum for red hat base distros, but CentOS is missing many multimedia packages that I require. An example of one of my package dependencies is "liquidsoap" which is a programmable audio engine: http://savonet.sourceforge.net/
This is available on Debian, but not Redhat/Centos
See this link on CentOS package management.
http://wiki.centos.org/PackageManagement/Yum
CentOS is redhat based and does not use .deb packages by default. However apt package management has been ported to tons of platforms, you may be able to use a port for centOS
If you use YUM whatever packages you need will be there for your application as redhat distros need all the same things that any other distro does.
EDIT: To get the details out of comments
Packages not available on the target platform either have to be built (possibly as a port) on the target platform and then shipped in the ported package (in this case YUM), or code needs to be modified and forked to use packages which already are available on the target platform. The choice depends on which is worse, or which is even possible given your constraints.

How to download/install pre-compiled Subversion binaries for Debian

Been trying to upgrade my subversion installation, but due to (what I believe) are limited rights (I'm using hosted Linux account), I'm not able to properly "./configure" and compile the source code (see posts Post1 and Post2 if very interested)
So, I'm thinking if I could just download pre-compiled binaries, the just might solve my problems. If you have better ideas - I'd love to hear that too!
NB: I'm not able to call aptitude or apt-get install subversion as suggested by subversion.tigris.com
I'm also interested in knowing how I would go about installing those pre-compiled binaries :)
You can extract the binaries from the deb package for your architecture (which you can download from here) using dpkg-deb -x.
So for example you can do this if you're on i386:
wget ftp://ftp.debian.org/debian/pool/main/s/subversion/subversion_1.5.4dfsg1-1_i386.deb
dpkg -x subversion_1.5.4dfsg1-1_i386.deb subversion
Of course you might have to do some tweaking to make it work. Extracting a package is not the same thing as installing it.
Look at the Debian list of SVN packages, I would assume the etch (stable) is the one you need.
Also see this thread on the same topic.

Resources