FAQ Search Today's Posts Mark Forums Read

» Linux Archive
Home
New Posts
Search
FAQ


Go Back   Linux Archive > Redhat > Fedora Development

 
 
LinkBack Thread Tools
 
Old 03-18-2008, 01:56 PM
Ralf Corsepius
 
Default Fwd: automatically modifying scriptlets (included files) at package build time

On Tue, 2008-03-18 at 16:33 +0200, Eddy Petrișor wrote:
> On 18/03/2008, Ralf Corsepius <rc040203@freenet.de> wrote:

> > You will want to work on copies of your SOURCEX's instead of SOURCEX
> > directly.
>
> I will dig into this, since I really dislike having outside scripts doing this.

I'd assume you to be pretty close to a functional solution and to be
facing issues with details of your implementation.

sed'ing files (Belows of $RPM_BUILD_ROOT) in %prep or %build is the
standard approach to such issues.

It's the basis of how running an autoconf-generated configure works (sed
a template (X.in) into a file (X))

Ralf




--
fedora-devel-list mailing list
fedora-devel-list@redhat.com
https://www.redhat.com/mailman/listinfo/fedora-devel-list
 
Old 03-18-2008, 01:56 PM
Ralf Corsepius
 
Default Fwd: automatically modifying scriptlets (included files) at package build time

On Tue, 2008-03-18 at 16:33 +0200, Eddy Petrișor wrote:
> On 18/03/2008, Ralf Corsepius <rc040203@freenet.de> wrote:

> > You will want to work on copies of your SOURCEX's instead of SOURCEX
> > directly.
>
> I will dig into this, since I really dislike having outside scripts doing this.

I'd assume you to be pretty close to a functional solution and to be
facing issues with details of your implementation.

sed'ing files (Belows of $RPM_BUILD_ROOT) in %prep or %build is the
standard approach to such issues.

It's the basis of how running an autoconf-generated configure works (sed
a template (X.in) into a file (X))

Ralf




--
fedora-devel-list mailing list
fedora-devel-list@redhat.com
https://www.redhat.com/mailman/listinfo/fedora-devel-list
 
Old 03-18-2008, 02:12 PM
"Eddy Petrișor"
 
Default Fwd: automatically modifying scriptlets (included files) at package build time

On 18/03/2008, Ralf Corsepius <rc040203@freenet.de> wrote:
>
> On Tue, 2008-03-18 at 16:33 +0200, Eddy Petrișor wrote:
> > On 18/03/2008, Ralf Corsepius <rc040203@freenet.de> wrote:
>
>
> > > You will want to work on copies of your SOURCEX's instead of SOURCEX
> > > directly.
> >
> > I will dig into this, since I really dislike having outside scripts doing this.
>
>
> I'd assume you to be pretty close to a functional solution and to be
> facing issues with details of your implementation.

Actually, I am stuck because it seems that the alteration happening in
the %prep phase either happens too late or happens on some temporary
files which do not end up in the binary rpm.

I suspect the later, since I see this in the build log:

+ . common.inf
++ VERS=2
++ SUBVERS=1
++ RELEASE=.i4.22
++ echo 2.1..i4.22
++ tr -s .
+ export THISVER=2.1.i4.22
+ THISVER=2.1.i4.22
+ echo 'This version (as sourced from the package) is: 2.1.i4.22'
This version (as sourced from the package) is: 2.1.i4.22
+ sed -i 's#^THISVER=.*#THISVER="2.1.i4.22"#'
/usr/src/redhat/SOURCES/common.pre.sh
+ sed -i 's#^THISVER=.*#THISVER="2.1.i4.22"#'
/usr/src/redhat/SOURCES/common.post.sh
+ exit 0
Executing(%install): /bin/sh -e /var/tmp/rpm-tmp.40197
+ umask 022
+ cd /usr/src/redhat/BUILD

> sed'ing files (Belows of $RPM_BUILD_ROOT) in %prep or %build is the
> standard approach to such issues.

But RPM_BUILD_ROOT refers to the contents of the package, while I need
to alter the meta part of the package.

> It's the basis of how running an autoconf-generated configure works (sed
> a template (X.in) into a file (X))

I already have this for the .deb packages, but I am fighting to port
this to .rpm, too.

--
Regards,
EddyP
=============================================
"Imagination is more important than knowledge" A.Einstein

--
fedora-devel-list mailing list
fedora-devel-list@redhat.com
https://www.redhat.com/mailman/listinfo/fedora-devel-list
 
Old 03-18-2008, 02:12 PM
"Eddy Petrișor"
 
Default Fwd: automatically modifying scriptlets (included files) at package build time

On 18/03/2008, Ralf Corsepius <rc040203@freenet.de> wrote:
>
> On Tue, 2008-03-18 at 16:33 +0200, Eddy Petrișor wrote:
> > On 18/03/2008, Ralf Corsepius <rc040203@freenet.de> wrote:
>
>
> > > You will want to work on copies of your SOURCEX's instead of SOURCEX
> > > directly.
> >
> > I will dig into this, since I really dislike having outside scripts doing this.
>
>
> I'd assume you to be pretty close to a functional solution and to be
> facing issues with details of your implementation.

Actually, I am stuck because it seems that the alteration happening in
the %prep phase either happens too late or happens on some temporary
files which do not end up in the binary rpm.

I suspect the later, since I see this in the build log:

+ . common.inf
++ VERS=2
++ SUBVERS=1
++ RELEASE=.i4.22
++ echo 2.1..i4.22
++ tr -s .
+ export THISVER=2.1.i4.22
+ THISVER=2.1.i4.22
+ echo 'This version (as sourced from the package) is: 2.1.i4.22'
This version (as sourced from the package) is: 2.1.i4.22
+ sed -i 's#^THISVER=.*#THISVER="2.1.i4.22"#'
/usr/src/redhat/SOURCES/common.pre.sh
+ sed -i 's#^THISVER=.*#THISVER="2.1.i4.22"#'
/usr/src/redhat/SOURCES/common.post.sh
+ exit 0
Executing(%install): /bin/sh -e /var/tmp/rpm-tmp.40197
+ umask 022
+ cd /usr/src/redhat/BUILD

> sed'ing files (Belows of $RPM_BUILD_ROOT) in %prep or %build is the
> standard approach to such issues.

But RPM_BUILD_ROOT refers to the contents of the package, while I need
to alter the meta part of the package.

> It's the basis of how running an autoconf-generated configure works (sed
> a template (X.in) into a file (X))

I already have this for the .deb packages, but I am fighting to port
this to .rpm, too.

--
Regards,
EddyP
=============================================
"Imagination is more important than knowledge" A.Einstein

--
fedora-devel-list mailing list
fedora-devel-list@redhat.com
https://www.redhat.com/mailman/listinfo/fedora-devel-list
 
Old 03-19-2008, 03:25 PM
"Eddy Petrișor"
 
Default Fwd: automatically modifying scriptlets (included files) at package build time

On 18/03/2008, Eddy Petrișor <eddy.petrisor@gmail.com> wrote:
> On 18/03/2008, Eddy Petrișor <eddy.petrisor@gmail.com> wrote:
> > On 18/03/2008, Ralf Corsepius <rc040203@freenet.de> wrote:
> > >
> > > On Tue, 2008-03-18 at 16:33 +0200, Eddy Petrișor wrote:
> > > > On 18/03/2008, Ralf Corsepius <rc040203@freenet.de> wrote:
> > >
> > >
> > > > > You will want to work on copies of your SOURCEX's instead of SOURCEX
> > > > > directly.
> > > >
> > > > I will dig into this, since I really dislike having outside scripts doing this.
> > >
> > >
> > > I'd assume you to be pretty close to a functional solution and to be
> > > facing issues with details of your implementation.
> >
> >
> > Actually, I am stuck because it seems that the alteration happening in
> > the %prep phase either happens too late or happens on some temporary
> > files which do not end up in the binary rpm.
> >
> > I suspect the later, since I see this in the build log:
> >
> > + . common.inf
> > ++ VERS=2
> > ++ SUBVERS=1
> > ++ RELEASE=.i4.22
> > ++ echo 2.1..i4.22
> > ++ tr -s .
> > + export THISVER=2.1.i4.22
> > + THISVER=2.1.i4.22
> > + echo 'This version (as sourced from the package) is: 2.1.i4.22'
> > This version (as sourced from the package) is: 2.1.i4.22
> > + sed -i 's#^THISVER=.*#THISVER="2.1.i4.22"#'
> > /usr/src/redhat/SOURCES/common.pre.sh
> > + sed -i 's#^THISVER=.*#THISVER="2.1.i4.22"#'
> > /usr/src/redhat/SOURCES/common.post.sh
> > + exit 0
>
>
> Actually the replace is made on the real
> /usr/src/redhat/SOURCES/common.post.sh, but it seems those files are
> already part of the running spec when I am doing the replacement.
>
> I didn't saw this because I was doing builds in a chroot by feeding
> the rpm inside that chroot a src.rpm.

I decided to use some outside script.

--
Regards,
EddyP
=============================================
"Imagination is more important than knowledge" A.Einstein

--
fedora-devel-list mailing list
fedora-devel-list@redhat.com
https://www.redhat.com/mailman/listinfo/fedora-devel-list
 

Thread Tools




All times are GMT. The time now is 01:58 PM.

VBulletin, Copyright ©2000 - 2010, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2007, Crawlability, Inc.
Copyright ©2007 - 2008, www.linux-archive.org