wiki:RPM

Version 16 (modified by dmisev, 4 years ago) (diff)

--

Introduction

RPM is a Red Hat package manager format. It is used by Red Hat Enterprise Linux, Fedora, CentOS, Scientific Linux, etc. It is also accepted with modifications by SUSE, Mandrake, Mageia, Alt Linux, etc.

The main alternative to RPM is DEB from Debian. DEB is also used in Ubuntu. The RPM is selected as the primary package format because the most popular Enterprise distribution is RHEL. DEB format will be investigated later.

Developing RPM

Though there are common rules for RPM each distribution has its own slightly modified guidelines for packaging. The RPM package for rasdaman is developed on Scientific Linux 6x (currently 6.1). The package itself - rasdaman-*.rpm - is an archive that includes binaries and other needed files in the same directory structure that is created during installation from sources with some exceptions. The receipt for package creation is called specfile. The specfile for rasdaman rasdaman.spec is located in spec subdirectory in sourcetree.

The general specfile structure has been described many times. The specfile for rasdaman defines several packages:

Binary packages

rasdaman-X.Y.Z-R.dist.arch.rpm The main package with the server
rasdaman-docs-X.Y.Z-R.dist.arch.rpm documentation and manuals
rasdaman-examples-X.Y.Z-R.dist.arch.rpm example images and utilities for them
rasdaman-petascope-X.Y.Z-R.dist.arch.rpm petascope
rasdaman-rasview-X.Y.Z-R.dist.arch.rpm rasview graphical front-end (former rview)
rasdaman-rasgeo-X.Y.Z-R.dist.arch.rpm gdal importer

Development packages

rasdaman-devel-X.Y.Z-R.dist.arch.rpm headers and libraries needed to develop applications that use rasdaman

Source packages

rasdaman-X.Y.Z-R.dist.src.rpm this package is sufficient for other distributions and OS versions (that have RPM) for building native package. It includes the actual source archive used for building and specfile.

Current parameters

Version (of rasdaman) X.Y.Z = 8.4.0
Release (of RPM for the above version of software not rasdaman itself) R = 0
Distro (for Scientific Linux 6x. Fedora defines 'fc16') dist = el6
Architecture arch = i386 x86_64

Differences from default source-based install

Prefix /usr
Docs /usr/share/rasdaman/doc
Config /etc/rasdaman
Log /var/log/rasdaman
petascope/src/main/resources/settings.properties patched to remove password from metauser and set its user name to 'rasdaman'
petascope/Makefile patched not to call setupdb on make install
petascope/db needed contents is copied to /usr/share/rasdaman/petascope
init script rasdaman from init subdirectory in sourcetree is installed to /etc/rc.d/init.d.
create_db.sh, start_rasdaman.sh, stop_rasdaman.sh removed from bin, this is all managed by the above init script
insertdemo.sh renamed to /usr/bin/rasdaman_insertdemo.sh
rview removed
/lib is automatically substituted to '/lib64' at build time if it's a 64bit system, due to RPM knowledge about the file structure in target distro.

This resembles the default file structure for system wide installation

Building RPM

Prerequisites are to be installed such as rmpdev packages. The first time you want to build an RPM (and only then, ie: once) call

rpmdev-setuptree

Then, assuming rasdaman was cloned in the current working directory, do the following (substituting rasdaman-X.Y.Z.tar.gz by the tar file created by make dist):

cd ~
cd rasdaman
autoreconf -fi
./configure
make dist
cp rasdaman-X.Y.Z.tar.gz rpmbuild/SOURCES
cp rasdaman/spec/rasdaman.spec rpmbuild/SPECS
cp rasdaman/init/rasmgr.init.in rpmbuild/SOURCES
rpmbuild -ba rpmbuild/SPECS/rasdaman.spec

Common errors:

  • Not everything is included in the archive during make dist
    • Check if all sources and headers are mentioned in Makefile.am. Check if all other needed files are mentioned as EXTRA_DIST. Special care is to be taken with docs and java sources.
  • Install paths changed from the previous successful RPM build and files are 'not found' or 'not packaged'.
    • Check %files sections in spec.

Installation of RPM

For the moment there are no public yum repos that include rasdaman. To install locally build or manually downloaded package run

su -c "yum --nogpgcheck localinstall ~user/rpmbuild/RPMS/arch/rasdaman-*"

Change path according to your setup.

What happens during installation of the package:

  • The user 'rasdaman' is created with home directory '/var/lib/rasdaman'.
  • The contents of the package is unpacked.
  • The init script is registered with chkconfig.

Default things should work now.

Running from RPM

As efforts were made to make rasdaman to operate as any other server this part shouldn't be hard. Before starting rasdaman for the first time:

service rasdaman initdb
service rasdaman initpetascopedb

When updating the RPM packages:

service rasdaman updatedb
service rasdaman updatepetascopedb

Then rasdaman can be started:

service rasdaman start

Check what is actually running:

service rasdaman status

To make rasdaman start automatically on boot:

chkconfig rasdaman on

At this moment you should have RASBASE. Try to insert examples:

rasdaman_insertdemo.sh
petascope_insertdemo.sh

The following files influence operation of rasdaman:

/etc/rasdaman/rasmgr.conf
/etc/rasdaman/petascope.properties
/etc/rasdaman/log4j.properties
/etc/sysconfig/rasdaman
/var/lib/rasdaman/rasmgr.auth

/var/lib/rasdaman/rasmgr.auth and /etc/rasdaman/rasmgr.conf are covered in rasdaman's documentation.

/etc/sysconfig/rasdaman is sourced from init script and can contain the following variables:

(NAME = default)

RASMGR = /usr/bin/rasmgr
RASMGR = /usr/bin/rasdl
RASCONTROL = /usr/bin/rascontrol
PIDFILE = /var/run/rasdaman.pid
LOCKFILE = /var/lock/subsys/rasdaman
WAIT_FOR_CHILDREN = 5
RASSERVERS = "-all"
RASADMIN = rasadmin:d293a15562d3e70b6fdc5ee452eaed40
RASDIR = /var/lib/rasdaman
RASLOGDIR = /var/log/rasdaman
RASSHELL = /bin/bash
PETASCOPE_PATH = /usr/share/rasdaman/petascope
PETASCOPE_SETTINGS = /var/lib/tomcat6/webapps/petascope/WEB-INF/classes/petascope.properties

Next steps

Once it's stable and well tested, next steps are

  • Setup a public yum repository that will serve up-to-date rasdaman RPMs (in sync with the git repository)
  • Propagate rasdaman to the Enterprise Linux Community (ticket:79)

Credits

Written by Konstantin Kozlov kozlov@…