RPM Help

devzero2000 pinto.elia at gmail.com
Tue Jul 27 09:13:57 UTC 2010


On Mon, Jul 26, 2010 at 8:26 PM, James R Maxwell <jrmaxwell at raytheon.com> wrote:
> We are currently using Sun Solaris Packaging to deliver to our customer. We
> will be transitioning to x86 red hat linux and I am investigating RPM.
> Currently we use clearcase and we produce derived objects (mostly exe and
> libs) and data files for delivery and installation. In much of the material
> I have seen about RPM there is a %build portion in the package. We will not
> need to build on the receiving system only install. Does anyone have an
> example of an rpm that only does the installation part of the process? Also
> are there other packaging tools for linux even if they involve cost? I will
> need to do a small trade study.
I know pkgadd techno for producing package : i am an old SVR4 admin. I
can tell you that in general, these packaging technologies are born to
produce closed-source package (with pkgmap, pkgmk, prototype and
friend) not integrated with the sources of a project/tool: rpm
instead, as dpkg and others, was born to distribute packages created
from pristine source (e.g. upstream). But it is not difficult at all
to produce a binary package if you wish, with little effort  :

1 - build (it is dangerous  to be root in doing this )a tarball with
the final localtion  e.g.

mkdir -p myprog
cd myprog
mkdir {etc,bin}
touch etc/xxx.conf
..... (just for example)

cd myprog
tar -cvf myprog-1.0.tar  myprog

2 - create an myprog-1.0.lis  (similar to a pkgmap) with something like



cat <<EOF > f.sh
#!/bin/bash

[ ! -d "$1" ] && { echo "ERROR : $0 directory" >&2 ; exit 1 ; }
find "$1" -type f -printf '%%attr(%m,%u,%g) %p\n'
find "$1" -type l -printf '%p\n'
find "$1" -mindepth 0 -type d -printf '%%dir %%attr(%m,%u,%g) %p\n'
EOF
chmod +rx f.sh

./f.sh myprog | | sed 's at myprog@@g' | sed -e '/\/$/d' -e '/ $/d'  >
myprog-1.0.lis (put some refinement here: prefix with
%config(noreplace) the conf file for example, the ownership, drop bin
etc ecc. that your package not own)

3 - the SPEC ( the info that SUN prototype want go here more or less)
. Just for example

#########################################
%define name     myprog
%define version  1.0
%define release  1
#################################################
Name:           %{name}
Version:        %{version}
Release:        %{release}
Group:          System Environment/Base
License:        GPL
BuildArch:      noarch
BuildRoot:      %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
Summary: %{name}
Source:        %{name}-%{version}.tar

%description
%{summary}

%prep

%setup -q -c

%build
#empty
%install
rm -rf %{buildroot}

cp -ap %{name} %{buildroot}


%clean
%{__rm} -rf %{buildroot}

#
%files
%defattr(-,root,root,-)
%config(noreplace) %attr(644,root,root) /etc/xxx.conf
%attr(755,root,root) /bin/hello.sh

%changelog
* Thu May  4 2006 xxxx <x.x at xxxx.com> - 1.0-1
  - initial build

IMHO, it will be simple to put in a general script. I have packaged
many closed source product in this way

hth


More information about the Rpm-list mailing list