Linux standalone 'installation' of Postgresql - linux

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.

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.

What is the difference between installing apache from "yum install httpd" and "source"?

1) What is the difference between installing apache from "yum install httpd" and "source" ?
2) Why both installation methods create different path for httpd.conf file?
3) Are we doing source installations for specific requirements?
Installation from Source:
tar xvfz httpd-2.2.17.tar.gz --> ./configure --enable-ssl --enable-so --> make --> make install
Installation using YUM:
yum instll httpd
Please help me.
Thanks in advance
-Shishir
1) What is the differnce between installing apache from "yum install
httpd" and "source" ?
Installing distributor-provided package (eg. by yum) means installing precompiled, almost-ready-to-use binary version of application, whereas installation by source means building application from source, which involves compiling program source code into binary code.
Most notable differences are:
Building from source provides more flexibility - often applications can be configured to be built with different features. For example, you can decide whether you want to build Apache with support for SSL and whether you want to include support for PHP scripting and so on. On the other hand, binary packages are sometimes split into several packages, for example Apache modules (such as mod_php) can be installed as separate modules.
Installing from source is usually much more time consuming while installing binary package involves mainly copying files and running installation scripts.
Most often, latest versions of applications are provided in source form only - there is time gap before application is packaged and made available in repositories. On the other hand, application installed from repository will be automatically updated by package manager, while applications installed from source will have to be updated manually.
Installing binary packages need only package manager, whareas installing from source required working toolchain, mostly make, compilers (eg. gcc) and development version of third-party libraries.
Package manager handles dependencies for you. For example, Apache needs libapr, Apache Portable Runtime. When you install Apache using package manager, it installs libapr automatically for you. When you build from source, you have to install libapr first.
2) Why both installation methods create different path for httpd.conf
file?
Because different distributions have different guidelines for filesystem layout. RedHat packages follow RedHat guidelines, Debian packages follow Debian guidelines.
Source packages follow some "generic" guidelines.
3) Are we doing source installations for specific requirements?
That may be one reason for doing so. See point 1.

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 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.

Centralized Installer

I am looking for an installer for my product. My requirement is that from one Node (Physical Machine) I should be able to install the software on multiple machines (Node). My product is a HA platform that needs to be installed on multiple Linux machines to form a cluster. Is there any installers that can do this free or paid. Currently we are developing on Linux, going forward we may need to support other Unix type OS.
Thanking you in advance
Package your product appropriately for the distribution (e.g. deb package) and use the standard management tools for the platform. Many simplicity-oriented people use
for node in $nodes; do ssh $node sudo apt-get install $package; done
and there is a host of cluster management software out there, one of which you are probably using.
I don't know if there is an "installer" the way you use in Windows machines. However you can create packages depending on your system. For Debian like systems you can create .deb packages, and for Red Hat style you can create .rpm packages.
The way the packages are created is to specify a correct installation path for files and pre-install & post-install scripts to execute when you install the files. Also you can set dependencies on your package, so that if you require some important library, the deb/rpm installer won't install your package until the required library is installed.
Hope that makes sense with my broken English:)

Resources