LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices


Reply
  Search this Thread
Old 05-31-2011, 10:42 AM   #1
piooreq
LQ Newbie
 
Registered: May 2011
Posts: 3

Rep: Reputation: Disabled
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
 
Old 05-31-2011, 10:37 PM   #2
kbp
Senior Member
 
Registered: Aug 2009
Posts: 3,790

Rep: Reputation: 651Reputation: 651Reputation: 651Reputation: 651Reputation: 651Reputation: 651
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 ?
 
Old 06-01-2011, 02:19 AM   #3
piooreq
LQ Newbie
 
Registered: May 2011
Posts: 3

Original Poster
Rep: Reputation: Disabled
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
 
Old 06-01-2011, 06:40 AM   #4
kbp
Senior Member
 
Registered: Aug 2009
Posts: 3,790

Rep: Reputation: 651Reputation: 651Reputation: 651Reputation: 651Reputation: 651Reputation: 651
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
 
1 members found this post helpful.
Old 06-01-2011, 08:26 AM   #5
piooreq
LQ Newbie
 
Registered: May 2011
Posts: 3

Original Poster
Rep: Reputation: Disabled
Ok I'll try.
Thanks anyway for info!

Cheers,
Mariusz
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Create RPM Packages siva19185 Linux - Newbie 1 07-02-2008 10:59 AM
Compress and split a big sized file into smaller files hicham007 Programming 3 07-28-2005 08:56 PM
splitting one big file to smaller parts? minm Linux - Newbie 4 12-26-2004 03:05 AM
a good program for choping big mp3's into smaller ones? poiuytrewq Linux - Software 1 10-28-2004 06:06 PM
The big question, and a few smaller ones... redkazan Linux - Newbie 7 01-07-2004 02:09 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - General

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

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration