[opensuse] rpmbuild in 11.2 vs 11.1
![](https://seccdn.libravatar.org/avatar/7946a5581e1e0b25e548f2b41c69d273.jpg?s=120&d=mm&r=g)
The rpm command I used in the past (up to and including 11.1) no longer works. I am not sure what the change is. I build rpms from an alternate directory. This is mainly so I do not need to deal with permissions in the system-wide place. My command is: rpmbuild --define "_topdir /home/roger/source.18.00/Package.Linux/rpm" \ --define _rpmfilename %%{NAME}-%%{VERSION}-%%{ARCH}.rpm \ --quiet \ -bb \ --rmspec /usr/src/packages/SOURCES/RSofT_Convert.spec /home/roger/source.18.00/Package.Linux/rpm is the alternate directory. I get a message that this file cannot be found: /home/roger/source.18.00/Package.Linux/rpm/BUILDROOT/RSofT_Convert-18.00-18.00.i386/home/roger/source.18.00/Package.Linux/rpm/RSofT_Convert-18.00.tgz It seems the odd part is the /home/roger/source.18.00/Package.Linux/rpm/BUILDROOT/RSofT_Convert-18.00-18.00.i386 at the start. This worked in 11.1. Any clue where to start looking? My spec file is: Summary: RSofT File Conversion Utilities Name: RSofT_Convert Version: 18.00 Release: 18.00 Group: Application/RSofT/Measurement URL: http://www.opq.se Vendor: Ramb�ll Sverige AB. RST/OPQ, Krukmakargatan 21, 118 51 Stockholm, Sweden Packager: roger@opq.se License: Proprietary Prefix: /home/roger/source.18.00/Package.Linux/rpm %description RSofT File Conversion Utilities %files %attr(755, root, root) /home/roger/source.18.00/Package.Linux/rpm/RSofT_Convert-18.00.tgz -- Roger Oberholtzer OPQ Systems / Ramböll RST Ramböll Sverige AB Krukmakargatan 21 P.O. Box 17009 SE-104 62 Stockholm, Sweden Office: Int +46 10-615 60 20 Mobile: Int +46 70-815 1696 -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org For additional commands, e-mail: opensuse+help@opensuse.org
![](https://seccdn.libravatar.org/avatar/bc67c2666cfb0f5c7770293291610cc9.jpg?s=120&d=mm&r=g)
On Mon, Nov 30, 2009 at 11:34:02AM +0100, Roger Oberholtzer wrote:
The rpm command I used in the past (up to and including 11.1) no longer works. I am not sure what the change is. I build rpms from an alternate directory. This is mainly so I do not need to deal with permissions in the system-wide place. My command is:
rpmbuild --define "_topdir /home/roger/source.18.00/Package.Linux/rpm" \ --define _rpmfilename %%{NAME}-%%{VERSION}-%%{ARCH}.rpm \ --quiet \ -bb \ --rmspec /usr/src/packages/SOURCES/RSofT_Convert.spec
/home/roger/source.18.00/Package.Linux/rpm is the alternate directory.
I get a message that this file cannot be found:
/home/roger/source.18.00/Package.Linux/rpm/BUILDROOT/RSofT_Convert-18.00-18.00.i386/home/roger/source.18.00/Package.Linux/rpm/RSofT_Convert-18.00.tgz
It seems the odd part is the /home/roger/source.18.00/Package.Linux/rpm/BUILDROOT/RSofT_Convert-18.00-18.00.i386 at the start.
This worked in 11.1. Any clue where to start looking? My spec file is:
rpm-4.7 has a default Buildroot set for all packages. You'll have to copy the file into the buildroot in the %install section: mkdir -p $RPM_BUILD_ROOT/home/roger/source.18.00/Package.Linux/rpm cp /home/roger/source.18.00/Package.Linux/rpm/RSofT_Convert-18.00.tgz $RPM_BUILD_ROOT/home/roger/source.18.00/Package.Linux/rpm (If you want the specfile to work for < 11.2 as well you'll also have to add a "Buildroot: %{_tmppath}/%{name}-%{version}-build" line.) (Btw, it looks quite odd that you copy some file from the system.) Cheers, Michael. -- Michael Schroeder mls@suse.de SUSE LINUX Products GmbH, GF Markus Rex, HRB 16746 AG Nuernberg main(_){while(_=~getchar())putchar(~_-1/(~(_|32)/13*2-11)*13);} -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org For additional commands, e-mail: opensuse+help@opensuse.org
![](https://seccdn.libravatar.org/avatar/7946a5581e1e0b25e548f2b41c69d273.jpg?s=120&d=mm&r=g)
On Mon, 2009-11-30 at 11:47 +0100, Michael Schroeder wrote:
rpm-4.7 has a default Buildroot set for all packages. You'll have to copy the file into the buildroot in the %install section:
mkdir -p $RPM_BUILD_ROOT/home/roger/source.18.00/Package.Linux/rpm cp /home/roger/source.18.00/Package.Linux/rpm/RSofT_Convert-18.00.tgz $RPM_BUILD_ROOT/home/roger/source.18.00/Package.Linux/rpm
(If you want the specfile to work for < 11.2 as well you'll also have to add a "Buildroot: %{_tmppath}/%{name}-%{version}-build" line.)
I did these changes on 11.2, and they work. Thanks. I also tried the suggestion for < 11.2 (< rpm 4.7, I guess): Summary: RSofT File Conversion Utilities Name: RSofT_Convert Version: 18.00 Release: 18.00 Group: Application/RSofT/Measurement URL: http://www.opq.se Vendor: Ramb�ll Sverige AB. RST/OPQ, Krukmakargatan 21, 118 51 Stockholm, Sweden Packager: roger@opq.se License: Proprietary Prefix: /home/roger/source.18.00/Package.Linux/rpm Buildroot: %{_tmppath}/%{name}-%{version}-build %description RSofT File Conversion Utilities %install mkdir -p $RPM_BUILD_ROOT/home/roger/source.18.00/Package.Linux/rpm cp /home/roger/source.18.00/Package.Linux/rpm/RSofT_Convert-18.00.tgz \ $RPM_BUILD_ROOT/home/roger/source.18.00/Package.Linux/rpm %files %attr(755, root, root) \ /home/roger/source.18.00/Package.Linux/rpm/RSofT_Convert-18.00.tgz and I get the following: + umask 022 + cd /home/roger/source.18.00/Package.Linux/rpm/BUILD /var/tmp/rpm-tmp.48011: line 21: cd: /home/roger/source.18.00/Package.Linux/rpm/BUILD: No such file or directory error: Bad exit status from /var/tmp/rpm-tmp.48011 (%install)
(Btw, it looks quite odd that you copy some file from the system.)
You mean the .spec file? Yeah. I saw that. I think this is from the days before rpmbuild. I will be investigating our use of rpmbuild. I have always had trouble setting up an RPM to install files in the RPM into a relocatable location. And to have the RPM resolve sym links when making the RPM. So I do this via a tar file and an install script. Not my favorite solution. Perhaps I need to see what has changed in rpm since we first made out current 'solution'. I suspect rpm has some of the flexibility that used to be lacking. -- Roger Oberholtzer OPQ Systems / Ramböll RST Ramböll Sverige AB Krukmakargatan 21 P.O. Box 17009 SE-104 62 Stockholm, Sweden Office: Int +46 10-615 60 20 Mobile: Int +46 70-815 1696 -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org For additional commands, e-mail: opensuse+help@opensuse.org
![](https://seccdn.libravatar.org/avatar/bc67c2666cfb0f5c7770293291610cc9.jpg?s=120&d=mm&r=g)
On Mon, Nov 30, 2009 at 12:40:10PM +0100, Roger Oberholtzer wrote:
On Mon, 2009-11-30 at 11:47 +0100, Michael Schroeder wrote:
rpm-4.7 has a default Buildroot set for all packages. You'll have to copy the file into the buildroot in the %install section:
mkdir -p $RPM_BUILD_ROOT/home/roger/source.18.00/Package.Linux/rpm cp /home/roger/source.18.00/Package.Linux/rpm/RSofT_Convert-18.00.tgz $RPM_BUILD_ROOT/home/roger/source.18.00/Package.Linux/rpm
(If you want the specfile to work for < 11.2 as well you'll also have to add a "Buildroot: %{_tmppath}/%{name}-%{version}-build" line.)
I did these changes on 11.2, and they work. Thanks. I also tried the suggestion for < 11.2 (< rpm 4.7, I guess): [...] and I get the following:
+ umask 022 + cd /home/roger/source.18.00/Package.Linux/rpm/BUILD /var/tmp/rpm-tmp.48011: line 21: cd: /home/roger/source.18.00/Package.Linux/rpm/BUILD: No such file or directory error: Bad exit status from /var/tmp/rpm-tmp.48011 (%install)
That's because you redefined _topdir on the command line and _topdir must have a BUILD directory. But you said that it worked up to 11.1, so I guess you didn't change _topdir before. Cheers, Michael. -- Michael Schroeder mls@suse.de SUSE LINUX Products GmbH, GF Markus Rex, HRB 16746 AG Nuernberg main(_){while(_=~getchar())putchar(~_-1/(~(_|32)/13*2-11)*13);} -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org For additional commands, e-mail: opensuse+help@opensuse.org
![](https://seccdn.libravatar.org/avatar/7946a5581e1e0b25e548f2b41c69d273.jpg?s=120&d=mm&r=g)
On Mon, 2009-11-30 at 13:48 +0100, Michael Schroeder wrote:
On Mon, Nov 30, 2009 at 12:40:10PM +0100, Roger Oberholtzer wrote:
On Mon, 2009-11-30 at 11:47 +0100, Michael Schroeder wrote:
rpm-4.7 has a default Buildroot set for all packages. You'll have to copy the file into the buildroot in the %install section:
mkdir -p $RPM_BUILD_ROOT/home/roger/source.18.00/Package.Linux/rpm cp /home/roger/source.18.00/Package.Linux/rpm/RSofT_Convert-18.00.tgz $RPM_BUILD_ROOT/home/roger/source.18.00/Package.Linux/rpm
(If you want the specfile to work for < 11.2 as well you'll also have to add a "Buildroot: %{_tmppath}/%{name}-%{version}-build" line.)
I did these changes on 11.2, and they work. Thanks. I also tried the suggestion for < 11.2 (< rpm 4.7, I guess): [...] and I get the following:
+ umask 022 + cd /home/roger/source.18.00/Package.Linux/rpm/BUILD /var/tmp/rpm-tmp.48011: line 21: cd: /home/roger/source.18.00/Package.Linux/rpm/BUILD: No such file or directory error: Bad exit status from /var/tmp/rpm-tmp.48011 (%install)
That's because you redefined _topdir on the command line and _topdir must have a BUILD directory. But you said that it worked up to 11.1, so I guess you didn't change _topdir before.
The command line is unchanged from 11.1. _topdir is set the same as before. On 11.1 and earlier, I needed _topdir as you see it. Do you mean I should not be using it? Just love rpm :) -- Roger Oberholtzer OPQ Systems / Ramböll RST Ramböll Sverige AB Krukmakargatan 21 P.O. Box 17009 SE-104 62 Stockholm, Sweden Office: Int +46 10-615 60 20 Mobile: Int +46 70-815 1696 -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org For additional commands, e-mail: opensuse+help@opensuse.org
![](https://seccdn.libravatar.org/avatar/bc67c2666cfb0f5c7770293291610cc9.jpg?s=120&d=mm&r=g)
On Mon, Nov 30, 2009 at 01:53:09PM +0100, Roger Oberholtzer wrote:
On Mon, 2009-11-30 at 13:48 +0100, Michael Schroeder wrote:
On Mon, Nov 30, 2009 at 12:40:10PM +0100, Roger Oberholtzer wrote:
On Mon, 2009-11-30 at 11:47 +0100, Michael Schroeder wrote:
rpm-4.7 has a default Buildroot set for all packages. You'll have to copy the file into the buildroot in the %install section:
mkdir -p $RPM_BUILD_ROOT/home/roger/source.18.00/Package.Linux/rpm cp /home/roger/source.18.00/Package.Linux/rpm/RSofT_Convert-18.00.tgz $RPM_BUILD_ROOT/home/roger/source.18.00/Package.Linux/rpm
(If you want the specfile to work for < 11.2 as well you'll also have to add a "Buildroot: %{_tmppath}/%{name}-%{version}-build" line.)
I did these changes on 11.2, and they work. Thanks. I also tried the suggestion for < 11.2 (< rpm 4.7, I guess): [...] and I get the following:
+ umask 022 + cd /home/roger/source.18.00/Package.Linux/rpm/BUILD /var/tmp/rpm-tmp.48011: line 21: cd: /home/roger/source.18.00/Package.Linux/rpm/BUILD: No such file or directory error: Bad exit status from /var/tmp/rpm-tmp.48011 (%install)
That's because you redefined _topdir on the command line and _topdir must have a BUILD directory. But you said that it worked up to 11.1, so I guess you didn't change _topdir before.
The command line is unchanged from 11.1. _topdir is set the same as before. On 11.1 and earlier, I needed _topdir as you see it. Do you mean I should not be using it?
I don't know. It's just that rpm defines _builddir to be %{_topdir}/BUILD, that's why you get the error message. Cheers, Michael. -- Michael Schroeder mls@suse.de SUSE LINUX Products GmbH, GF Markus Rex, HRB 16746 AG Nuernberg main(_){while(_=~getchar())putchar(~_-1/(~(_|32)/13*2-11)*13);} -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org For additional commands, e-mail: opensuse+help@opensuse.org
![](https://seccdn.libravatar.org/avatar/7946a5581e1e0b25e548f2b41c69d273.jpg?s=120&d=mm&r=g)
On Mon, 2009-11-30 at 14:15 +0100, Michael Schroeder wrote:
I don't know. It's just that rpm defines _builddir to be %{_topdir}/BUILD, that's why you get the error message.
It seems that if I could define RPM_BUILD_ROOT to be either an empty string, or "/", I could get similar behavior on all systems. But it seems there is an explicit test for this, and rpm complains that I cannot set buildroot to this. Did I say I love rpm? Was I mad? -- Roger Oberholtzer OPQ Systems / Ramböll RST Ramböll Sverige AB Krukmakargatan 21 P.O. Box 17009 SE-104 62 Stockholm, Sweden Office: Int +46 10-615 60 20 Mobile: Int +46 70-815 1696 -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org For additional commands, e-mail: opensuse+help@opensuse.org
![](https://seccdn.libravatar.org/avatar/7946a5581e1e0b25e548f2b41c69d273.jpg?s=120&d=mm&r=g)
On Mon, 2009-11-30 at 15:09 +0100, Roger Oberholtzer wrote:
On Mon, 2009-11-30 at 14:15 +0100, Michael Schroeder wrote:
I don't know. It's just that rpm defines _builddir to be %{_topdir}/BUILD, that's why you get the error message.
It seems that if I could define RPM_BUILD_ROOT to be either an empty string, or "/", I could get similar behavior on all systems. But it seems there is an explicit test for this, and rpm complains that I cannot set buildroot to this.
Did I say I love rpm? Was I mad?
Is there some way to find out, in a bash script, what rpm will use for RPM_BUILD_ROOT? I know about the rpm --rcfile command, but that is lots to parse to fine this. Isn't there a direct way to find this value? -- Roger Oberholtzer OPQ Systems / Ramböll RST Ramböll Sverige AB Krukmakargatan 21 P.O. Box 17009 SE-104 62 Stockholm, Sweden Office: Int +46 10-615 60 20 Mobile: Int +46 70-815 1696 -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org For additional commands, e-mail: opensuse+help@opensuse.org
![](https://seccdn.libravatar.org/avatar/8df291265238395e793d45e1e572336d.jpg?s=120&d=mm&r=g)
On Tue, 1 Dec 2009 00:47:45 Roger Oberholtzer wrote:
On Mon, 2009-11-30 at 15:09 +0100, Roger Oberholtzer wrote:
On Mon, 2009-11-30 at 14:15 +0100, Michael Schroeder wrote:
I don't know. It's just that rpm defines _builddir to be %{_topdir}/BUILD, that's why you get the error message.
It seems that if I could define RPM_BUILD_ROOT to be either an empty string, or "/", I could get similar behavior on all systems. But it seems there is an explicit test for this, and rpm complains that I cannot set buildroot to this.
Did I say I love rpm? Was I mad?
Is there some way to find out, in a bash script, what rpm will use for RPM_BUILD_ROOT? I know about the rpm --rcfile command, but that is lots to parse to fine this. Isn't there a direct way to find this value?
Does rpm --rcfile | grep 'RPM_BUILD_ROOT' work? Just asking because I've had zero success with rpmbuild since upgrading to 11.0... -- =================================================== Rodney Baker VK5ZTV rodney.baker@iinet.net.au =================================================== -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org For additional commands, e-mail: opensuse+help@opensuse.org
![](https://seccdn.libravatar.org/avatar/7946a5581e1e0b25e548f2b41c69d273.jpg?s=120&d=mm&r=g)
On Wed, 2009-12-02 at 00:06 +1030, Rodney Baker wrote:
rpm --rcfile | grep 'RPM_BUILD_ROOT'
That was my first thought. The command rpmbuild --showrc | grep RPM_BUILD_ROOT prints 55 lines. Sure, one could continue parsing. But I bet it changes every third rotation of an unnamed moon of Saturn. rpm is indeed a moving target. Backward compatibility and rpm can never be mentioned in the same sentence. Or book. I think much of this stems from there being too many names for the same thing. The basic concepts are not clearly set out. Of course, as with a any complicated program, once you get your mind around it, you may see some logic. Of course, by that time your brain is good for little else :) -- Roger Oberholtzer OPQ Systems / Ramböll RST Ramböll Sverige AB Krukmakargatan 21 P.O. Box 17009 SE-104 62 Stockholm, Sweden Office: Int +46 10-615 60 20 Mobile: Int +46 70-815 1696 -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org For additional commands, e-mail: opensuse+help@opensuse.org
participants (3)
-
Michael Schroeder
-
Rodney Baker
-
Roger Oberholtzer