[Ocfs2-test-devel] [PATCH 09/11] ocfs2-test: Changed python_common files to allow RPM install.

Marcos E. Matsunaga Marcos.Matsunaga at oracle.com
Fri Oct 31 07:31:11 PDT 2008


See my comments below.

Regards,

Marcos Eduardo Matsunaga

Oracle USA
Linux Engineering

“The statements and opinions expressed here are my own and do not
necessarily represent those of Oracle Corporation.”



tristan.ye wrote:
> On Thu, 2008-10-30 at 12:32 -0700, Marcos Matsunaga wrote:
>   
>> The Makefile, Config.make and setup.sh need to be adapted to allow
>> RPM install, specially in the way that it does deal with the configuration
>> of the config.sh and config.py files and the install directory.
>>
>> Signed-off-by: Marcos Matsunaga <Marcos.Matsunaga at oracle.com>
>> ---
>>  programs/python_common/Config.make |    9 +++++++--
>>  programs/python_common/Makefile    |    2 ++
>>  programs/python_common/setup.sh    |   16 +++++++++++-----
>>  3 files changed, 20 insertions(+), 7 deletions(-)
>>
>> diff --git a/programs/python_common/Config.make b/programs/python_common/Config.make
>> index 0121532..04384b3 100644
>> --- a/programs/python_common/Config.make
>> +++ b/programs/python_common/Config.make
>> @@ -5,9 +5,14 @@ CONFIG_SCRIPT := setup.sh
>>  
>>  CURDIR = $(shell pwd)
>>  
>> -config-script: $(CONFIG_SCRIPT)
>> +ifdef RPM_BUILD_ROOT
>> +INSTALLDIR = /usr/local
>> +endif
>> +
>> +config-script: $(CONFIG_SCRIPT) 
>> +
>>  ifdef CONFIG_SCRIPT
>> -	$(SHELL) $(CURDIR)/$(CONFIG_SCRIPT) $(DESTDIR)
>> +	$(SHELL) $(CURDIR)/$(CONFIG_SCRIPT) $(DESTDIR) $(INSTALLDIR)
>>  endif
>>  
>>  	mkdir -p  $(DESTDIR)/workfiles $(DESTDIR)/log
>> diff --git a/programs/python_common/Makefile b/programs/python_common/Makefile
>> index 68493ca..a85deee 100644
>> --- a/programs/python_common/Makefile
>> +++ b/programs/python_common/Makefile
>> @@ -10,6 +10,8 @@ SUBDIRS =
>>  
>>  DIST_FILES = 	config_py.skel \
>>  		config_shell.skel \
>> +		Config.make \
>> +		setup.sh \
>>  		o2tf.py \
>>  		single_run.sh \
>>  		multiple_run.sh \
>> diff --git a/programs/python_common/setup.sh b/programs/python_common/setup.sh
>> index 21f77f1..45ba6e1 100755
>> --- a/programs/python_common/setup.sh
>> +++ b/programs/python_common/setup.sh
>> @@ -18,8 +18,8 @@
>>  # Boston, MA 021110-1307, USA.
>>  
>>  #
>> -if [ $# -ne 1 ]; then
>> -   echo -e 'Usage: $0 <DESTDIR>';
>> +if [ $# -ne 1 -a $# -ne 2 ]; then
>> +   echo -e 'Usage: $0 <DESTDIR> [INSTALLDIR]';
>>     exit 1;
>>  fi;
>>  
>> @@ -34,14 +34,20 @@ else
>>  	else
>>  		MPIDIR=/usr/bin
>>  	fi
>> -fi
>> +fi;
>> +
>> +if [ $# -eq 1 ]; then
>> +	INSTALLDIR=DESTDIR;
>>     
> 	   should be INSTALLDIR=$[1} here?
>   
Yes.. Made the change.
>> +else
>> +	INSTALLDIR=${2};
>> +fi;
>>  
>>  BINDIR=${1}/bin
>>     
> 	should be BINDIR=${INSTALLDIR}/bin here?
>   
No. This is the location where the config.py/config.sh will be
pre-installed for the RPM generation. The installdir is where the RPM
will install the programs. BINDIR was actually a bad name. I'm changing
it to make it less confuse.
>> -sed "s;<DESTDIR>;${1};g" ${BINDIR}/config_py.skel >  ${BINDIR}/config.py
>> +sed "s;<DESTDIR>;${INSTALLDIR};g" ${BINDIR}/config_py.skel >  ${BINDIR}/config.py
>>  mv ${BINDIR}/config.py  ${BINDIR}/config_py.skel
>>  sed "s;<MPIDIR>;${MPIDIR};g" ${BINDIR}/config_py.skel >  ${BINDIR}/config.py
>>  #
>> -sed "s;<DESTDIR>;${1};g" ${BINDIR}/config_shell.skel >  ${BINDIR}/config.sh
>> +sed "s;<DESTDIR>;${INSTALLDIR};g" ${BINDIR}/config_shell.skel >  ${BINDIR}/config.sh
>>  mv ${BINDIR}/config.sh ${BINDIR}/config_shell.skel
>>  sed "s;<MPIDIR>;${MPIDIR};g" ${BINDIR}/config_shell.skel >  ${BINDIR}/config.sh
>>  rm -f ${BINDIR}/config_py.skel ${BINDIR}/config_shell.skel
>>     
>
>   
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://oss.oracle.com/pipermail/ocfs2-test-devel/attachments/20081031/90ec3f29/attachment.html 


More information about the Ocfs2-test-devel mailing list