SUMMARY: RPM build for 4.0x

From: Adam Rigby (a.rigby@qut.edu.au)
Date: Tue Sep 03 2002 - 20:02:35 EDT


Thanks to Ian Mortimer for all his help in providing a solution. I haven't
tried the build option specified as time was short, but the binaries
supplied worked a treat.

Build:

The attached rpm spec file shows the steps needed to get it to
compile. Building required gcc and gnu make as well as a patch supplied by
Ian.

Binaries:
 From Ian (installed under /usr/local directory only)

Probably built on 4.0E or F and will run under F (Ian). I actually ran
them up on a 4.0d box which also worked. I'm guessing that any 4.0x
release would work. Will test this further in due course.

Thanks
Adam.

At 03:18 PM 22/08/2002 +1000, Adam Rigby wrote:
>Hi all,
>
>I have a problem in that I have been forced to implement RPM's on Tru64
>boxes of varying versions (4.0d - 5.1a). Now, RPM as a package manager
>only started being supported by the newhp from v5.1 up.
>
>My question is: Has anyone built RPM for a 4.0x OS release? If so, I'd
>very much like to here from you.
>
>Cheers
>Adam.

RPM Spec:
Summary: The Red Hat package management system.
Name: rpm
Version: 3.0.5
Release: 7
Group: System Environment/Base
Source: ftp://ftp.rpm.org/pub/rpm/dist/rpm-3.0.x/rpm-%{version}.tar.gz
Patch: %{name}-%{version}.patch
Copyright: GPL
BuildRoot: /var/tmp/%{name}-root
Prefix: /usr/local

%description
The Red Hat Package Manager (RPM) is a powerful command line driven
package management system capable of installing, uninstalling,
verifying, querying, and updating software packages. Each software
package consists of an archive of files along with information about
the package like its version, a description, etc.

%package devel
Summary: Development files for applications which will manipulate RPM packages.
Group: Development/Libraries
Prefix: %{prefix}

%description devel
This package contains the RPM C library and header files. These
development files will simplify the process of writing programs which
manipulate RPM packages and databases. These file are intended to
simplify the process of creating graphical package managers or any
other tools that need an intimate knowledge of RPM packages in order
to function.

This package should be installed if you want to develop programs that
will manipulate RPM packages and databases.

%prep
%setup -q
%patch -p1
ex lib/rpmrc.c <<-!
         /\/etc\/rpmrc/s??%{prefix}&?
         wq
!
ex lib/macro.c <<-!
         /\/usr\(\/lib\/rpm\/macros\)/s??%{prefix}\1?
         /\/etc\/rpm\/macros/s??%{prefix}&?
         wq
!

%build
varprefix=%{prefix}/var CFLAGS='-O2' LDFLAGS=-s ./configure \
         --prefix=%{prefix} --disable-nls --with-included-gettext \
         --disable-v1-packages
ex rpmrc <<-!
         /^macrofiles:/s?/etc?%{prefix}/etc?g
         wq
!

gmake

%install
rm -rf $RPM_BUILD_ROOT

gmake DESTDIR="$RPM_BUILD_ROOT" install

{ cd $RPM_BUILD_ROOT%{prefix}
   strip ./bin/rpm
   strip ./bin/rpm2cpio
}
gzip -9nf $RPM_BUILD_ROOT%{prefix}/man/man*/*

{ cd $RPM_BUILD_ROOT%{prefix}/lib/rpm
for f in $(grep -l /usr/lib/rpm *)
do
         ex $f <<-!
                 %g?/usr/lib/rpm?s??%{prefix}/lib/rpm?g
                 wq
         !
done
}

# Create header for virtual package spec.
cat > $RPM_BUILD_ROOT%{prefix}/lib/rpm/os-base-header.spec <<EOF
Summary: Dummy package to register what Tru64 Unix provides
Name: tru64
Version: 1.0
Release: 1
Group: System Environment/Base
Buildroot: /var/tmp/%{name}-root

EOF

%clean
# Don't clean so we can build a tar file for initial installs
#rm -rf $RPM_BUILD_ROOT

%files
%defattr(-,root,system)
%doc RPM-PGP-KEY CHANGES GROUPS doc/manual/*
%{prefix}/bin/rpm
%{prefix}/bin/rpm2cpio
%{prefix}/bin/gendiff
%{prefix}/lib/rpm
%{prefix}/lib/rpmrc
%{prefix}/lib/rpmpopt
%{prefix}/man/man1/*.1.gz
%{prefix}/man/man8/*.8.gz
%dir %{prefix}/var/lib/rpm

%files devel
%defattr(-,root,system)
%{prefix}/include/popt.h
%{prefix}/include/rpm
%{prefix}/lib/libpopt.a
%{prefix}/lib/libpopt.la
%{prefix}/lib/libpopt.so
%{prefix}/lib/libpopt.so.0.0.0
%{prefix}/lib/librpm.a
%{prefix}/lib/librpm.la
%{prefix}/lib/librpm.so
%{prefix}/lib/librpm.so.*
%{prefix}/lib/librpmbuild.a
%{prefix}/lib/librpmbuild.la
%{prefix}/lib/librpmbuild.so
%{prefix}/lib/librpmbuild.so.*
%{prefix}/man/man3/*.3.gz



This archive was generated by hypermail 2.1.7 : Sat Apr 12 2008 - 10:48:51 EDT