LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - General (https://www.linuxquestions.org/questions/linux-general-1/)
-   -   How to create two smaller RPM packages instead one big? (https://www.linuxquestions.org/questions/linux-general-1/how-to-create-two-smaller-rpm-packages-instead-one-big-883744/)

piooreq 05-31-2011 10:42 AM

How to create two smaller RPM packages instead one big?
 
Hi,
Could you pls advise me how I need to modify SPEC file to create two RPM packages instead of one big?

Cheers,
Mariusz

kbp 05-31-2011 10:37 PM

Not without further information, we'll need to see the current spec file at a minimum. Can you provide more detail on why you want this package split ?

piooreq 06-01-2011 02:19 AM

Hi,
The thing is that my RPM is 2.3 GB and I've limit > 2 GB so I need to create two smaller RPM packages instead of one big. My SPEC file is pretty long (below):

# Package-specific
%define oraenv rac
%define orapart rdbms
%define major 11
%define middle 2
%define minor 0
%define patchlevel 2.0
%define namepatch test3
#%define oraver %{major}%{middle}%{minor}%{patchlevel}%{namepatch}

# standard locations
%define orabase /ORA/dbs01/oracle
%define orabase_perm 755
%define orahome %{orabase}/product/rdbms
%define orainventory %{orahome}/oraInventory

# users and groups needed
%define orauser oracle
%define orauid 1286
%define oragroup ci
%define oragid 1016
%define orahomedir %{orabase}/home

# system tools
%define perl /usr/bin/perl
%define shell /bin/sh

# rpm-specific
%define __os_install_post %{nil}
%define debug_package %{nil}
%define _prefix /
%define _unpackaged_files_terminate_build 0

# All versions
Version: %{major}.%{middle}.%{minor}.%{patchlevel}.%{namepatch}
Summary: oracle-%{oraenv}%{orapart}
Name: oracle-%{oraenv}%{orapart}
Release: 1
License: Commercial
Group: Applications/Databases
Vendor: Oracle Corporation, USA
Packager: piooreq
URL: http://www.oracle.com
Source0: %{name}-%{version}.tar.gz
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-buildroot

AutoReqProv: no
Requires: binutils >= 2.15.92.0.2 compat-libstdc++-33 >= 3.2.3 elfutils-libelf >= 0.97 elfutils-libelf-devel >= 0.97 expat >= 1.95.7 gcc >= 3.4.6 gcc-c++ >= 3.4.6 glibc >= 2.3.4-2.41 glibc-common >= 2.3.4 glibc-devel >= 2.3.4 glibc-headers >= 2.3.4 libaio >= 0.3.105 libaio-devel >= 0.3.105 libgcc >= 3.4.6 libstdc++ >= 3.4.6 libstdc++-devel >= 3.4.6 make >= 3.80 numactl >= 0.6.4.x86_64 /bin/ksh sysstat >= 5.0.5 oracle-crs >= %{major}.%{middle}

%description

ORACLE RDBMS Software Component with RAC option.

Original version: 11.2.0.2.0
Patch set applied: none

# devel-specific
%package devel
Summary: oracle-%{oraenv}%{orapart}-devel
Group: Applications/Databases
Requires: oracle-%{oraenv}%{orapart}

%description devel

Backup files of the patches for ORACLE RDMS Software Component with RAC option.

%prep
%setup -q -n %{name}

%build

%install

rm -rf %{buildroot}
mkdir -p %{buildroot}%{_prefix}
#
# install the oracle files
#
mkdir -p %{buildroot}%{_prefix}/%{orahome}
cp -a %{orapart}/* %{buildroot}%{_prefix}/%{orahome}/
chmod 0750 %{buildroot}%{_prefix}/%{orahome}/clone/bin/clone.pl
export PERL5LIB=%{buildroot}%{_prefix}/%{orahome}/perl/lib
mkdir -p %{buildroot}%{_prefix}/%{orahome}/.patch_storage

%clean
rm -rf %{buildroot}

%files

%defattr(-,%{orauser},%{oragroup},-)
%{_prefix}/%{orahome}/*

%files devel

%defattr(-,%{orauser},%{oragroup},-)
%{_prefix}/%{orahome}/.patch_storage

%preun

%postun

%pre

# ci group is necessary for cloning, adding it if not present
echo "Checking %{oragroup} group..."
getent group %{oragroup} > /dev/null || /usr/sbin/groupadd -f -o -g %{oragid} %{oragroup}

# oracle user is necessary for cloning, adding it if not present
echo "Checking %{orauser} account..."
getent passwd %{orauser} > /dev/null || /usr/sbin/useradd -M -o -r -d %{orahomedir} -s /bin/bash -c "Oracle Support" -u %{orauid} -g %{oragroup} %{orauser}
mkdir -p %{orahomedir}
chown %{orauser}:%{oragroup} %{orahomedir}

exit 0

%post

#
# Pre-cloning steps
#

# directories and permissions
echo "Fixing permissions..."
mkdir -p %{orabase}
chown %{orauser}:%{oragroup} %{orabase}

# clean oraInventory
echo "Cleaning oraInventory..."
find %{orainventory} -type f -exec rm {} \;

# clean system-wide oraInst.loc and create new one
echo "Cleaning system-wide oraInst.loc..."
[ -f /etc/oraInst.loc ] && mv /etc/oraInst.loc /etc/oraInst.loc.bak

echo "Creating temporary oraInst.loc..."
# TODO mktemp!
echo "inventory_loc=%{orainventory}" > /tmp/oraInst.loc
echo "inst_group=%{oragroup}" >> /tmp/oraInst.loc

#
# Cloning
#

# clone oracle racrdbms and cleanup backup files as user oracle
echo "Cloning RACRDBMS..."
su --login %{orauser} --command='%{perl} %{orahome}/clone/bin/clone.pl -silent ORACLE_BASE=%{orabase} ORACLE_HOME=%{orahome} ORACLE_HOME_NAME=OraDb11g_home1 -O"-invPtrLoc /tmp/oraInst.loc" LOCAL_NODE=`uname -n` -O"-crsLocation %{orabase}/%{gridhome}/" ; find %{orahome} -name *.ouibak -exec rm -f {} \; ' # TODO fix CRS!

#
# Post-cloning steps
#

# the (in)famous root.sh
echo "Running root.sh..."
%{shell} %{orahome}/root.sh

# fix permissions back
#echo "Fixing permissions..."
#chown root.root %{orabase}
#chown %{orauser}:%{oragroup} %{orabase}/%{orapart}
#chmod 0755 %{orabase}/%{orapart}

# cleanup
echo "Cleaning up..."
rm /usr/local/bin/oraenv /usr/local/bin/dbhome /usr/local/bin/coraenv
rm /tmp/oraInst.loc

# use direct NFS
echo "Linking direct NFS libs..."
su --login %{orauser} --command='cd %{orahome}/lib && mv libodm11.so libodm11.so_bak && ln -s libnfsodm11.so libodm11.so'

# check error messages during linking process
echo "Checking linking process..."
egrep 'Failed to (create|link)' %{orainventory}/logs/cloneActions`date +"%Y-%m-%d"`*.log \
&& echo 'WARNING - failures detected during the linking process, CHECK the above messages!'

echo "Installation finished."

exit 0

%changelog
* Tue May 17 2011 Test new standard parameters
* Fri Apr 29 2011 Production version after extensive testing. No changes.
* Thu Mar 31 2011 Test build

Cheers,
Mariusz

kbp 06-01-2011 06:40 AM

I suppose you'll need to break it up by directory, try to determine if there is any logical separation that you can use. Larger packages (4GB) are available from rpm 4.6 so you'll be able to recombine it in the future

Ref: http://www.rpm.org/wiki/Releases/4.6...packagesupport

piooreq 06-01-2011 08:26 AM

Ok I'll try.
Thanks anyway for info!

Cheers,
Mariusz


All times are GMT -5. The time now is 05:07 PM.