Port a debian package to YUM for CentOS - linux

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.

Related

Basic set of libraries in chroot (fedora linux)

I'm running an old version of my linux distro (fedora, but this is not very relevant) and for reasons which are completely irrelevant I'm not in a position to update it. However I do need a newer version of gcc and some other libraries than those supplied by my old distro.
I could compile a newer gcc and all the other libraries of course but I thought the simplest way would be to install a minimal set of packages from the latest distro version to a directory and then just chroot there. This way I'd take advantage of the binary packages present in the newest distro and all the infrastructure around it (like dependency installation, etc.) and I wouldn't need to compile everything from source.
My question is this: if I only would like to be able to compile with the most recent gcc and run those programs, what is the minimal set of packages I need? Since we are talking about fedora, what is the minimal set of rpms (beyond glibc and gcc)? Note that I don't need any X environment, networking, or anything like that, only the most basic terminal tools.
The minimal set varies depending on your user needs and what you're linking with. What I do when making a chroot environment is have a look at the distro I want to chroot and see if they have a base rpm/deb package that kickstarts everything. Then I install that in the chroot. From there I add libraries and applications as needed.
For an example where I create a chroot for RHEL on Arch see http://www.zenskg.net/wordpress/?p=267

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

How to install gcc onto a RedHat Enterprise 5 virtual machine?

I am trying to install gcc onto a linux RedHat Enterprise 5 virtual machine, and I have tried using a tar.gz package and also a rpm, and both methods give errors. The tar.gz says there is no c compiler found, and the rpm has dependencies that it can not find. Yum is available on this machine, however, there are no repositories found and I am still unsure of how to install the necessary repositories to get gcc installed. The end goal for installing gcc is to be able to install rsync, tcl, and the expect package for shell scripts. Any advice?
Your .tar.gz probably didn't work because it was the raw source code for GCC. The source for the compiler requires a compiler to build it — the classic chicken & egg problem. To get around this, you'd need to get a precompiled compiler for your system's architecture. GCC is not offered in a precompiled form by the FSF, as far as I know. If you're ever interested in actually trying to build a Linux system from the ground up like that, you might find Linux From Scratch interesting.
You'll probably not even need GCC to get rsync, tcl, etc. There are almost certainly pre-built packages available from yum repos for those tools. As #PeteyT said, RHEL uses a subscription to allow you to access packages using yum. You can learn more from the Red Hat Subscription Management Guide.
If you don't have a Red Hat subscription, you might be interested in CentOS, Scientific Linux and Fedora. As I understand it, CentOS and Scientific Linux are meant to be almost identical to RHEL. On the other hand, Fedora is a separate project owned by Red Hat (according to Wikipedia) which is an OS in its own right, and sometimes serves as a feeder to Red Hat products.
Once you have repos available, either via subscription or switching OSs, you should be able to simply run yum install rsync tcl expect to install rsync, tcl, and expect.
You might look at yum's docs for more about the various commands you can use with yum, and Red Hat's docs for more on package management in RHEL.

Linux standalone 'installation' of Postgresql

For easy deployment, I'd like to ship an installation of Postgres as part of the application. Is it possible to include an already compiled and runnable version of Postgres that can be launched as process? I was able to do such thing with a Windows and MacOS version, but haven't found anything about Linux on that matter yet. Perhaps someone has tried this before and can share some insights...
You haven't stated what linux OS you're using.
Assuming it's a Redhat variant why not package your application as an RPM package? You could then declare a dependency on the standard Postgres package which would be automatically installed yum. Same principle applies if you're using Debian based systems, just a different packaging format.
From the user's perspective the OS's native packaging format is always the easiest way to install your application. Just requires effort to package it properly.
You can find cross-platform binaries from these pages on PostgreSQL official website:
For easy GUI .run installers, use links provided at http://www.enterprisedb.com/products-services-training/pgdownload.
If your target machine has no X installed on it, or you want to automate installation process with shell scripts, then you can download RPM or Deb packages from http://community.openscg.com/se/postgresql/packages.jsp
I found these links on http://www.postgresql.org/download/linux/ubuntu/, under "Cross distribution packages" and "Graphical installer".
I quote from those pages:
Note: The cross distribution packages do not fully integrate with the platform-specific packaging systems.
You must have root priviliges to install these packages, however, none of your systems library files will be altered. The supporting libraries that these binaries require are included locally as part of the install. This is the "special sauce" that allows identical binaries to run on different linux distro's.

How to compile software into a re-installable form?

I am working through my 7th recompile of the same software. There are no pre-built packages available, and it's a long compile time. Is there a way to take what I compile and package it up so that I don't have to continually build it right from source?
EDIT: CentOS 6 for the OS if that matters.
You should have a look at CDE. From its website :
CDE (formerly known as CDEpack) automatically packages up the Code, Data, and Environment required to deploy and run your Linux programs on other machines without any installation or configuration. CDE is the easiest way to completely eliminate dependency hell.
So it will compile your program and include all the dependencies in the resulting package as well. The resulting package should be able to run on any modern x86 Linux distribution, so you won't have to continually build it right from source.
checkinstall, which is based on installwatch, is able to create various packages including .deb (Debian, Ubuntu, ...), .rpm (Red Hat, Fedora, SuSE, ...) and .tgz (Slackware) suitable for your distribution's package manager.

Resources