FAQ Search Today's Posts Mark Forums Read
» Video Reviews

» Linux Archive

Linux-archive is a website aiming to archive linux email lists and to make them easily accessible for linux users/developers.


» Sponsor

» Partners

» Sponsor

Go Back   Linux Archive > Redhat > Fedora User

 
 
LinkBack Thread Tools
 
Old 03-24-2011, 12:00 AM
Steve Blackwell
 
Default Need help with rpmbuild

Specifically the install section. I'm not understanding how the
%install section works with the %files section.
I hope this is not considered OT.

Let's say I want my rpm to install the file "hello"
in /tmp on a target system. The %prep and %build sections work OK and
create my hello file in BUILD/hello-1. (Why BUILD/hello-1 and not just
BUILD I don't know but for now it doesn't matter.)

The install and files sections of my spec file look like this:
(Obviously %{name} is defined as hello)

%install
cp %{name} $RPM_BUILD_ROOT/

%files
%defattr(-,root,root,-)
/tmp/hello

%BuildRoot is defined (by default) to be
%(mktemp -ud %{_tmppath}/%{name}-%{version}-%{release}-XXXXXX)

What's with the XXXXX?
The cp works as expected but then an error occurs saying:

Extracting debug info ... blah ... blah...
...
error: File not
found: /home/steve/rpmbuild/BUILDROOT/hello-1-1.fc12.i386/tmp/hello

I feel like I'm missing the big picture here.
I'd appreciate any direct help or pointers to some good explanation.
I've read a bunch of docs but they have not helped in this case.

Thanks,
Steve

--
Changing lives one card at a time

http://www.send1cardnow.com
--
users mailing list
users@lists.fedoraproject.org
To unsubscribe or change subscription options:
https://admin.fedoraproject.org/mailman/listinfo/users
Guidelines: http://fedoraproject.org/wiki/Mailing_list_guidelines
 
Old 03-24-2011, 12:21 AM
Todd Zullinger
 
Default Need help with rpmbuild

Steve Blackwell wrote:
> Specifically the install section. I'm not understanding how the
> %install section works with the %files section.
> I hope this is not considered OT.
>
> Let's say I want my rpm to install the file "hello"
> in /tmp on a target system. The %prep and %build sections work OK and
> create my hello file in BUILD/hello-1. (Why BUILD/hello-1 and not just
> BUILD I don't know but for now it doesn't matter.)
>
> The install and files sections of my spec file look like this:
> (Obviously %{name} is defined as hello)
>
> %install
> cp %{name} $RPM_BUILD_ROOT/
>
> %files
> %defattr(-,root,root,-)
> /tmp/hello

The RPM_BUILD_ROOT should exactly mirror the direcotry structure you
want to have your package files installed into. If you want the file
in /tmp, then you would want to use $RPM_BUILD_ROOT/tmp as the
destination. You must create RPM_BUILD_ROOT/tmp. If it was me, I'd
use the install command to do this in one step:

%install
install -p -m755 -D %{name} RPM_BUILD_ROOT/tmp/%{name}

But you could just as easily use "mkdir -p RPM_BUILD_ROOT/tmp" before
your cp command.

> %BuildRoot is defined (by default) to be
> %(mktemp -ud %{_tmppath}/%{name}-%{version}-%{release}-XXXXXX)
>
> What's with the XXXXX?
> The cp works as expected but then an error occurs saying:

The X's are part of the mktemp template. They are replaced by random
characters when creating the tempdir.

> Extracting debug info ... blah ... blah...
> ...
> error: File not
> found: /home/steve/rpmbuild/BUILDROOT/hello-1-1.fc12.i386/tmp/hello

If you list /home/steve/rpmbuild/BUILDROOT/hello-1-1.fc12.i386 you
should see that there is no tmp dir there. The hello file will be in
that dir. It's ofetn helpful to add some verbosity to the commands in
your spec for debugging. For cp, use cp -v, same for install. That
will give you some helpful output when you run rpmbuild.

--
Todd OpenPGP -> KeyID: 0xBEAF0CE3 | URL: www.pobox.com/~tmz/pgp
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~~~~
There are two kinds of light - the glow that illuminates, and the
glare that obscures.
-- James Thurber

--
users mailing list
users@lists.fedoraproject.org
To unsubscribe or change subscription options:
https://admin.fedoraproject.org/mailman/listinfo/users
Guidelines: http://fedoraproject.org/wiki/Mailing_list_guidelines
 
Old 03-24-2011, 12:35 AM
Chris Smart
 
Default Need help with rpmbuild

On Thu, Mar 24, 2011 at 12:00 PM, Steve Blackwell <zephod@cfl.rr.com> wrote:
> Specifically the install section. I'm not understanding how the
> %install section works with the %files section.
> I hope this is not considered OT.

AFAIK, the %install section is what you're actually copying as the
contents of your package. You copy it from the location you extracted
the source %{_buildroot} into a temporary location %{builddir}.

The %files section tells the package manager what files belong to that
package, so everything that you put into the file %{builddir} should
also go into this list. This is important so that the package manager
knows how to manage the files.

-c
--
users mailing list
users@lists.fedoraproject.org
To unsubscribe or change subscription options:
https://admin.fedoraproject.org/mailman/listinfo/users
Guidelines: http://fedoraproject.org/wiki/Mailing_list_guidelines
 
Old 03-24-2011, 12:41 AM
JD
 
Default Need help with rpmbuild

On 03/23/2011 06:00 PM, Steve Blackwell wrote:
> Specifically the install section. I'm not understanding how the
> %install section works with the %files section.
> I hope this is not considered OT.
>
> Let's say I want my rpm to install the file "hello"
> in /tmp on a target system. The %prep and %build sections work OK and
> create my hello file in BUILD/hello-1. (Why BUILD/hello-1 and not just
> BUILD I don't know but for now it doesn't matter.)
>
> The install and files sections of my spec file look like this:
> (Obviously %{name} is defined as hello)
>
> %install
> cp %{name} $RPM_BUILD_ROOT/
>
> %files
> %defattr(-,root,root,-)
> /tmp/hello
>
> %BuildRoot is defined (by default) to be
> %(mktemp -ud %{_tmppath}/%{name}-%{version}-%{release}-XXXXXX)
>
> What's with the XXXXX?
> The cp works as expected but then an error occurs saying:
>
> Extracting debug info ... blah ... blah...
> ...
> error: File not
> found: /home/steve/rpmbuild/BUILDROOT/hello-1-1.fc12.i386/tmp/hello
>
> I feel like I'm missing the big picture here.
> I'd appreciate any direct help or pointers to some good explanation.
> I've read a bunch of docs but they have not helped in this case.
>
> Thanks,
> Steve
>
See these (long) URL's (sorry, my mail client broke each URL into 3 lines):

http://www.google.com/url?sa=t&source=web&cd=3&ved=0CCIQFjAC&url=http%3A %2F%2Flinuxtoolkit.blogspot.com%2F2010%2F06%2Frpmb uild-tutorial.html&ei=_5-KTde6MYWcsQPJ_9iZCA&usg=AFQjCNG6fz2MUt1tEkyrfAQYiG 3A4qKDCw

http://www.google.com/url?sa=t&source=web&cd=1&ved=0CBgQFjAA&url=http%3A %2F%2Frpmbuildtut.wordpress.com%2F&ei=_5-KTde6MYWcsQPJ_9iZCA&usg=AFQjCNFdo7a19lm9b5lr3MhGtK wlIQdqYA

Centos (RHEL) rpmbuild tutorial- Part 1
http://www.google.com/url?sa=t&source=web&cd=1&ved=0CBgQFjAA&url=http%3A %2F%2Fwww.lamolabs.org%2Fblog%2F164%2Fcentos-rpm-tutorial-1%2F&ei=5qCKTc_mFo30swPSwbCMCA&usg=AFQjCNFpI12G2I1 SVfesD6FXyZk9QbsWbg


Centos (RHEL) rpmbuild tutorial- Part 2
http://www.google.com/url?sa=t&source=web&cd=2&ved=0CB0QFjAB&url=http%3A %2F%2Fwww.lamolabs.org%2Fblog%2F169%2Fcentos-rpm-tutorial-2%2F&ei=5qCKTc_mFo30swPSwbCMCA&usg=AFQjCNENVHIcEkK 0Au9kFw9oqsx6Jfyjlw

--
users mailing list
users@lists.fedoraproject.org
To unsubscribe or change subscription options:
https://admin.fedoraproject.org/mailman/listinfo/users
Guidelines: http://fedoraproject.org/wiki/Mailing_list_guidelines
 
Old 03-24-2011, 12:47 AM
Ed Greshko
 
Default Need help with rpmbuild

On 03/24/2011 09:41 AM, JD wrote:
>
> See these (long) URL's (sorry, my mail client broke each URL into 3 lines):
>
> http://www.google.com/url?sa=t&source=web&cd=3&ved=0CCIQFjAC&url=http%3A %2F%2Flinuxtoolkit.blogspot.com%2F2010%2F06%2Frpmb uild-tutorial.html&ei=_5-KTde6MYWcsQPJ_9iZCA&usg=AFQjCNG6fz2MUt1tEkyrfAQYiG 3A4qKDCw

http://linuxtoolkit.blogspot.com/2010/06/rpmbuild-tutorial.html

> http://www.google.com/url?sa=t&source=web&cd=1&ved=0CBgQFjAA&url=http%3A %2F%2Frpmbuildtut.wordpress.com%2F&ei=_5-KTde6MYWcsQPJ_9iZCA&usg=AFQjCNFdo7a19lm9b5lr3MhGtK wlIQdqYA

http://rpmbuildtut.wordpress.com/

> Centos (RHEL) rpmbuild tutorial- Part 1
> http://www.google.com/url?sa=t&source=web&cd=1&ved=0CBgQFjAA&url=http%3A %2F%2Fwww.lamolabs.org%2Fblog%2F164%2Fcentos-rpm-tutorial-1%2F&ei=5qCKTc_mFo30swPSwbCMCA&usg=AFQjCNFpI12G2I1 SVfesD6FXyZk9QbsWbg

http://www.lamolabs.org/blog/164/centos-rpm-tutorial-1/

>
> Centos (RHEL) rpmbuild tutorial- Part 2
> http://www.google.com/url?sa=t&source=web&cd=2&ved=0CB0QFjAB&url=http%3A %2F%2Fwww.lamolabs.org%2Fblog%2F169%2Fcentos-rpm-tutorial-2%2F&ei=5qCKTc_mFo30swPSwbCMCA&usg=AFQjCNENVHIcEkK 0Au9kFw9oqsx6Jfyjlw
>

http://www.lamolabs.org/blog/169/centos-rpm-tutorial-2/

Would have been a bit cleaner....



--
Fry: I must be a robot. Why else would human women refuse to date me?
Leela: Oh, lots of reasons. 葛斯克 愛德華 / 台北市八德路四段

--
users mailing list
users@lists.fedoraproject.org
To unsubscribe or change subscription options:
https://admin.fedoraproject.org/mailman/listinfo/users
Guidelines: http://fedoraproject.org/wiki/Mailing_list_guidelines
 
Old 03-24-2011, 10:18 AM
Steve Blackwell
 
Default Need help with rpmbuild

On Wed, 23 Mar 2011 21:21:16 -0400
Todd Zullinger <tmz@pobox.com> wrote:

> Steve Blackwell wrote:
> > Specifically the install section. I'm not understanding how the
> > %install section works with the %files section.
> > I hope this is not considered OT.

>
> The RPM_BUILD_ROOT should exactly mirror the direcotry structure you
> want to have your package files installed into. If you want the file
> in /tmp, then you would want to use $RPM_BUILD_ROOT/tmp as the
> destination. You must create RPM_BUILD_ROOT/tmp. If it was me, I'd
> use the install command to do this in one step:
>
> %install
> install -p -m755 -D %{name} RPM_BUILD_ROOT/tmp/%{name}
>

Ah, Thanks. That helped. Now I need to lookup the syntax of the install
macro.
And thanks to Chris & JD too.

Steve


--
Changing lives one card at a time

http://www.send1cardnow.com
--
users mailing list
users@lists.fedoraproject.org
To unsubscribe or change subscription options:
https://admin.fedoraproject.org/mailman/listinfo/users
Guidelines: http://fedoraproject.org/wiki/Mailing_list_guidelines
 
Old 03-24-2011, 10:58 AM
Todd Zullinger
 
Default Need help with rpmbuild

On Mar 24, 2011 7:20 AM, "Steve Blackwell" <zephod@cfl.rr.com> wrote:

> Ah, Thanks. That helped. Now I need to lookup the syntax of the install

> macro.



The install I'm referring to here is a normal command, not a macro. Use man install.


--

Todd

--
users mailing list
users@lists.fedoraproject.org
To unsubscribe or change subscription options:
https://admin.fedoraproject.org/mailman/listinfo/users
Guidelines: http://fedoraproject.org/wiki/Mailing_list_guidelines
 
Old 03-30-2011, 03:31 AM
Steve Blackwell
 
Default Need help with rpmbuild

On Thu, 24 Mar 2011 07:58:02 -0400
Todd Zullinger <tmz@pobox.com> wrote:

> On Mar 24, 2011 7:20 AM, "Steve Blackwell" <zephod@cfl.rr.com> wrote:
> > Ah, Thanks. That helped. Now I need to lookup the syntax of the
> > install macro.
>
> The install I'm referring to here is a normal command, not a macro.
> Use man install.
>

I have got my rpm to build successfully but now I have a dependency
problem.

My app depends on python so I have a
Requires: python
line in the .spec file. Python is installed on my target system but the
python binary in located in /usr/bin as indicated by
$ rpm -qil python
When I try to install my rpm, it complains that it can't
find /usr/local/bin/python.

Any idea why my rpm is looking for python in all the wrong places?

Thanks,
Steve

--
Changing lives one card at a time

http://www.send1cardnow.com
--
users mailing list
users@lists.fedoraproject.org
To unsubscribe or change subscription options:
https://admin.fedoraproject.org/mailman/listinfo/users
Guidelines: http://fedoraproject.org/wiki/Mailing_list_guidelines
 
Old 03-30-2011, 06:25 AM
Panu Matilainen
 
Default Need help with rpmbuild

On 03/30/2011 06:31 AM, Steve Blackwell wrote:
> On Thu, 24 Mar 2011 07:58:02 -0400
> Todd Zullinger<tmz@pobox.com> wrote:
>
>> On Mar 24, 2011 7:20 AM, "Steve Blackwell"<zephod@cfl.rr.com> wrote:
>>> Ah, Thanks. That helped. Now I need to lookup the syntax of the
>>> install macro.
>>
>> The install I'm referring to here is a normal command, not a macro.
>> Use man install.
>>
>
> I have got my rpm to build successfully but now I have a dependency
> problem.
>
> My app depends on python so I have a
> Requires: python
> line in the .spec file. Python is installed on my target system but the
> python binary in located in /usr/bin as indicated by
> $ rpm -qil python
> When I try to install my rpm, it complains that it can't
> find /usr/local/bin/python.
>
> Any idea why my rpm is looking for python in all the wrong places?

One or more python scripts in your package contain this shebang:
#!/usr/local/bin/python

Rpm is right to complain: If you tried to execute that file, it would
fail because no such python interpreter exists on a normal Fedora
installation. You need to locate + patch those files to refer to the
system python path instead.

- Panu -
--
users mailing list
users@lists.fedoraproject.org
To unsubscribe or change subscription options:
https://admin.fedoraproject.org/mailman/listinfo/users
Guidelines: http://fedoraproject.org/wiki/Mailing_list_guidelines
 
Old 03-30-2011, 06:45 AM
Joe Zeff
 
Default Need help with rpmbuild

On 03/29/2011 11:25 PM, Panu Matilainen wrote:
> One or more python scripts in your package contain this shebang:
> #!/usr/local/bin/python
>
> Rpm is right to complain: If you tried to execute that file, it would
> fail because no such python interpreter exists on a normal Fedora
> installation. You need to locate + patch those files to refer to the
> system python path instead.

That's a fair amount of work. It's a lot easier if you run this command
as root:

ln /usr/bin/python /usr/local/bin/python

Because that makes link that the b0rken rpms can all use.
--
users mailing list
users@lists.fedoraproject.org
To unsubscribe or change subscription options:
https://admin.fedoraproject.org/mailman/listinfo/users
Guidelines: http://fedoraproject.org/wiki/Mailing_list_guidelines
 

Thread Tools




All times are GMT. The time now is 08:39 AM.

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