LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 07-20-2006, 03:49 AM   #16
sailu_mvn
Member
 
Registered: Sep 2004
Location: Hyderabad
Distribution: FEDORA,REDHAT,HOST
Posts: 440

Original Poster
Blog Entries: 1

Rep: Reputation: 30

yeah thats helpful.But what exactly you mean by a wrapper. We cannot know when the rpm build takes which files...

Mushkil hein
 
Old 07-20-2006, 03:57 AM   #17
prozac
Member
 
Registered: Oct 2005
Location: Australia
Distribution: slackware 12.1
Posts: 753

Rep: Reputation: 32
Quote:
Originally Posted by sailu_mvn
yeah thats helpful.But what exactly you mean by a wrapper. We cannot know when the rpm build takes which files...

Mushkil hein
by wrapper i mean another program or script that uses rpmbuild inside itself for basic functionality and adding to it some enhancement that you would want. like in your case the basic functionality would be ultimately to build rpms and the added enhancement that the wrapper must provide is a progress bar of some kind.

one question? doesn't this satisfy your purpose?
Quote:
-v Print verbose information - normally routine progress messages
will be displayed.
..bahut mushkil hein
 
Old 07-20-2006, 04:44 AM   #18
sailu_mvn
Member
 
Registered: Sep 2004
Location: Hyderabad
Distribution: FEDORA,REDHAT,HOST
Posts: 440

Original Poster
Blog Entries: 1

Rep: Reputation: 30
the wrapper idea is ok. If I take rpmbuild as a wrapper itself, how do u suggest me to take the values. I mean the progress. How does that wraper determine the percentage f completion. Its not possible as size is important here.

-Thodi tho herapheri karni hein
 
Old 07-20-2006, 04:49 AM   #19
sailu_mvn
Member
 
Registered: Sep 2004
Location: Hyderabad
Distribution: FEDORA,REDHAT,HOST
Posts: 440

Original Poster
Blog Entries: 1

Rep: Reputation: 30
how does a rpm build happen (procedure please)

I want to know the rpm build procedure. I mean, what is done when a spec file is executed by rpmbuild command.
 
Old 07-20-2006, 04:51 AM   #20
Okie
Senior Member
 
Registered: Mar 2002
Location: Oklahoma
Posts: 1,154

Rep: Reputation: 187Reputation: 187
if you are working with a src.rpm it is just sourcecode being compiled
 
Old 07-20-2006, 04:54 AM   #21
prozac
Member
 
Registered: Oct 2005
Location: Australia
Distribution: slackware 12.1
Posts: 753

Rep: Reputation: 32
you know what-get the source of rpmbuild (is is available open source?, i am confused with the red hat thing license! surely its GPL i guess) and modify it for needed enhancement(s).
 
Old 07-20-2006, 04:56 AM   #22
sailu_mvn
Member
 
Registered: Sep 2004
Location: Hyderabad
Distribution: FEDORA,REDHAT,HOST
Posts: 440

Original Poster
Blog Entries: 1

Rep: Reputation: 30
its not that pretty simple. I want the entire build procedure. i will copy a sample spec. Can anyone tell me what happens?

Sample spec :

Summary: Media Player
Name: kplayer
Version: 0.5.3
License: GPL
Group: Development/Debuggers
Source:kplayer-%{version}.tar.bz2
Source1: klayer.desktop

BuildRoot: %{_tmppath}/%{name}-%{version}-root
#ExclusiveArch: i386
BuildArch: noarch


%description
kplayer for HOST
%prep
%setup -q
mkdir -p $RPM_BUILD_ROOT/usr/bin/
mkdir -p $RPM_BUILD_ROOT/usr/share/pixmaps/

%build
#cp -rf gflashplayer $RPM_BUILD_ROOT/usr/bin/
cp -rf flash.png $RPM_BUILD_ROOT/usr/share/pixmaps/

%install

#cp -rf gflashplayer $RPM_BUILD_ROOT/usr/bin/
cp -rf flash.png $RPM_BUILD_ROOT/usr/share/pixmaps/



install -d $RPM_BUILD_ROOT%{_desktopdir}
install %{SOURCE1} $RPM_BUILD_ROOT%{_desktopdir}

%clean
rm -rf $RPM_BUILD_ROOT

%files
%defattr(-, root, root)
%{_desktopdir}/*.desktop
/usr/bin/*
/usr/share/pixmaps/*
%changelog
* Thu Jun 02 2005 name emailhere
- built for
 
Old 07-20-2006, 04:57 AM   #23
sailu_mvn
Member
 
Registered: Sep 2004
Location: Hyderabad
Distribution: FEDORA,REDHAT,HOST
Posts: 440

Original Poster
Blog Entries: 1

Rep: Reputation: 30
let me try and get back with that. Thanx Prozac
 
Old 07-20-2006, 05:10 AM   #24
sailu_mvn
Member
 
Registered: Sep 2004
Location: Hyderabad
Distribution: FEDORA,REDHAT,HOST
Posts: 440

Original Poster
Blog Entries: 1

Rep: Reputation: 30
the idea of wrapper does not work. Actually, idea of thought.
The rpm log file is in /var/tmp.If the build is successful, it gives an exit status line 0 at the end. I am confused.
 
Old 07-20-2006, 05:11 AM   #25
prozac
Member
 
Registered: Oct 2005
Location: Australia
Distribution: slackware 12.1
Posts: 753

Rep: Reputation: 32
i would have helped you get the job done..alas i have never felt the neccesity of building rpm's myself. don't quite really know how to operate it for the purpose ;(
 
Old 07-20-2006, 05:14 AM   #26
prozac
Member
 
Registered: Oct 2005
Location: Australia
Distribution: slackware 12.1
Posts: 753

Rep: Reputation: 32
Linux exits with code 0 if the previous command completed successfully else it returns non-zero exit code. can you post some bits of the rpm log file you are talking about, maybe it holds the clue.
 
Old 07-20-2006, 05:18 AM   #27
sailu_mvn
Member
 
Registered: Sep 2004
Location: Hyderabad
Distribution: FEDORA,REDHAT,HOST
Posts: 440

Original Poster
Blog Entries: 1

Rep: Reputation: 30
my rpm log for building openoffice

#!/bin/sh

RPM_SOURCE_DIR="/usr/src/redhat/SOURCES"
RPM_BUILD_DIR="/usr/src/redhat/BUILD"
RPM_OPT_FLAGS="-O2 -g -pipe -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -m32 -march=i386 -mtune=pentium4 -fasynchronous-unwind-tables"
RPM_ARCH="i386"
RPM_OS="linux"
export RPM_SOURCE_DIR RPM_BUILD_DIR RPM_OPT_FLAGS RPM_ARCH RPM_OS
RPM_DOC_DIR="/usr/share/doc"
export RPM_DOC_DIR
RPM_PACKAGE_NAME="openoffice.org"
RPM_PACKAGE_VERSION="1.9.96"
RPM_PACKAGE_RELEASE="HOST1.0"
export RPM_PACKAGE_NAME RPM_PACKAGE_VERSION RPM_PACKAGE_RELEASE
RPM_BUILD_ROOT="/var/tmp/openoffice.org-1.9.96-root"
export RPM_BUILD_ROOT


set -x
umask 022
cd /usr/src/redhat/BUILD
cd SRC680_m96
LANG=C
export LANG
unset DISPLAY

echo build start time is `date`
if [ -z "$RPM_BUILD_NCPUS" ] ; then
if [ -x /usr/bin/getconf ] ; then
RPM_BUILD_NCPUS=$(/usr/bin/getconf _NPROCESSORS_ONLN)
if [ $RPM_BUILD_NCPUS -eq 0 ]; then
RPM_BUILD_NCPUS=1
fi
fi
fi
export LANG=en_US.UTF-8 # gcc#20629#
cd config_office
autoconf

CFLAGS="${CFLAGS:--O2 -g -pipe -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -m32 -march=i386 -mtune=pentium4 -fasynchronous-unwind-tables}" ; export CFLAGS ;
CXXFLAGS="${CXXFLAGS:--O2 -g -pipe -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -m32 -march=i386 -mtune=pentium4 -fasynchronous-unwind-tables}" ; export CXXFLAGS ;
FFLAGS="${FFLAGS:--O2 -g -pipe -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -m32 -march=i386 -mtune=pentium4 -fasynchronous-unwind-tables}" ; export FFLAGS ;
for i in $(find . -name config.guess -o -name config.sub) ; do
[ -f /usr/lib/rpm/redhat/$(basename $i) ] && /bin/rm -f $i && /bin/cp -fv /usr/lib/rpm/redhat/$(basename $i) $i ;
done ;
./configure --build=i686-redhat-linux-gnu --host=i686-redhat-linux-gnu \
--target=i386-redhat-linux-gnu \
--program-prefix= \
--prefix=/usr \
--exec-prefix=/usr \
--bindir=/usr/bin \
--sbindir=/usr/sbin \
--sysconfdir=/etc \
--datadir=/usr/share \
--includedir=/usr/include \
--libdir=/usr/lib \
--libexecdir=/usr/libexec \
--localstatedir=/var \
--sharedstatedir=/usr/com \
--mandir=/usr/share/man \
--infodir=/usr/share/info --with-java=gij --disable-crashdump --disable-epm --enable-libart --enable-symbols=SMALL --enable-gtk --enable-gnome-vfs --enable-openldap --enable-cups --enable-libsn --enable-fontconfig --disable-fontooo --with-system-libs --with-system-python --with-system-mozilla --with-system-boost --without-system-mspack --without-system-sablot --without-system-nas --without-system-sndfile --without-system-portaudio --without-system-db --without-fonts --with-lang="af ar bg ca cs cy da de el en-US es et eu fi fr gl gu-IN he hi-IN hu it ja ko lt ms nb nl nn pl pt pt-BR ru sk sl sv ta-IN th tr zh-CN zh-TW zu"
cd ..
./bootstrap
source Linux*Env.Set.sh
#force linker
export LINK=$CXX
#faster build
export nodep=true
#enable parallel build
export MAXPROCESS=$RPM_BUILD_NCPUS
#dmake has limit of 10 processes apparently
if [ $MAXPROCESS -gt 10 ]; then
export MAXPROCESS=10
fi
#we'll build with at least build -P2 so we can do something useful while
#helpcontent2 is wasting our time
export MAXBUILDS=$RPM_BUILD_NCPUS
if [ $MAXBUILDS -lt 2 ]; then
export MAXBUILDS=2
fi
#dance of the seven veils to get unpackaged install
export RPM=echo
export EPM=DUMMY
export PKGFORMAT="rpm -simple $RPM_BUILD_ROOT//usr/lib/openoffice.org1.9.96"
export BUILD_SPECIAL=1
cp /usr/src/redhat/SOURCES/db-3.2.9.patch berkeleydb
cp /usr/src/redhat/SOURCES/db-3.2.9.tar.gz berkeleydb/download
cd transex3/prj
build --all -P$MAXBUILDS
deliver
localize -m -x -l gu-IN -f /usr/src/redhat/SOURCES/GSI_gu-IN.sdf
localize -m -x -l ta-IN -f /usr/src/redhat/SOURCES/GSI_ta-IN.sdf
localize -m -x -l nn -f /usr/src/redhat/SOURCES/GSI_nn.sdf
localize -m -x -l nb -f /usr/src/redhat/SOURCES/GSI_nb.sdf
localize -m -x -l ar -f /usr/src/redhat/SOURCES/GSI_ar.sdf
cd ../..
cd instsetoo_native/util
if ! build --all -P$MAXBUILDS; then
unset MAXPROCESS
build --all
fi
echo build end time is `date`

echo start langpack install time is `date`
export MAXPROCESS=1
dmake ooolanguagepack
echo end langpack install time is `date`

# We don't need to carry around all the letter templates for all the languages
# in each langpack! In addition, all the bitmaps are the same!
pushd $RPM_BUILD_ROOT//usr/lib/openoffice.org1.9.96/share/template
mkdir -p wizard
for I in af ar bg ca cs cy da de el en-US es et eu fi fr gl gu-IN he hi-IN hu it ja ko lt ms nb nl nn pl pt pt-BR ru sk sl sv ta-IN th tr zh-CN zh-TW zu; do
cp -afl $I/wizard/bitmap wizard/
rm -rf $I/wizard/bitmap
ln -sf ../../wizard/bitmap $I/wizard/bitmap

if [ -d $I/wizard/letter/$I ]; then
mv -f $I/wizard/letter/$I ${I}_wizard_letter_${I}
rm -rf $I/wizard/letter/*
mv -f ${I}_wizard_letter_${I} $I/wizard/letter/$I
else
rm -rf $I/wizard/letter/*
fi
done
popd
cd ../..


exit 0
 
Old 07-20-2006, 05:21 AM   #28
sailu_mvn
Member
 
Registered: Sep 2004
Location: Hyderabad
Distribution: FEDORA,REDHAT,HOST
Posts: 440

Original Poster
Blog Entries: 1

Rep: Reputation: 30
are there any log files available when the rpm gets build
?
 
Old 07-20-2006, 05:39 AM   #29
unSpawn
Moderator
 
Registered: May 2001
Posts: 29,415
Blog Entries: 55

Rep: Reputation: 3594Reputation: 3594Reputation: 3594Reputation: 3594Reputation: 3594Reputation: 3594Reputation: 3594Reputation: 3594Reputation: 3594Reputation: 3594Reputation: 3594
Commands issued in the %build and %install phases depend on available (within source package) scripts like Makefiles. Within the build phase there is no interaction between rpm and subprocesses like make. Rpmbuild just decides to proceed based on the subprocess exit status. There is no progress reporting within rpmbuild. There is no progress reporting within make because it a) isn't there ;-p and b) it doesn't have any concept of progress it just executes stuff. Now I write my own spec files and I build custom rpms but you don't have to take my word for it when I say: you cannot make a generic progress reporting wrapper. It can't be done. (Or maybe that's an incentive for ppl to prove me wrong...) Maybe you can manage to make one tailored for your specific build process but probably (that needs you to run the process twice: once to measure and pick waypoints and once for a final build with reporting: kinda inefficient) that's likely to need tweakage once the source changes or when you change options.

Last edited by unSpawn; 07-20-2006 at 05:41 AM. Reason: //Have keybd, can't type.
 
Old 07-20-2006, 05:52 AM   #30
konsolebox
Senior Member
 
Registered: Oct 2005
Distribution: Gentoo, Slackware, LFS
Posts: 2,248
Blog Entries: 8

Rep: Reputation: 235Reputation: 235Reputation: 235
hey this might help:

Code:
startdate=$(date something)
expectedfinishdate=something too
buildscript_withlog &
pidofbuildscript=$!
while :; do
   wait $pidofbuildscript
   #continues when a signal is received, e.g. key pressed
   #kill -s 0 is just one, there are many other ways i forgot
   if kill -s 0 $pidofbuildscript; then
      #script is still running
      #print some stats e.g. do sedding with date, anything that
      #will make the output a percentage or anything you like
      #just play with the buidscript's log
      #continue
   else
      #buildscript died
      #can be build success or failure
      #you can do
      if cat log | grep "some success strings"; then
          #build successful
      else
          #build failed
      fi
      break
   fi
done
at least you have an idea now
 
  


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 Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
RPM-Build hkillen Linux - Software 4 06-27-2006 04:38 PM
Rpm-build abhijeetudas Linux - Software 3 12-06-2005 01:06 AM
build rpm file . bruse Linux - Newbie 4 09-11-2005 10:06 AM
cannot build source rpm/ rpm questions kpachopoulos Fedora 3 07-24-2005 09:15 AM
build rpm Santas Linux - Software 1 11-21-2003 05:45 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 03:40 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
Open Source Consulting | Domain Registration