[opensuse-buildservice] Build serve noob, and need help with a rpm spec file
I am writing a text based fantasy RPG in perl and figured that having it on the build service would not hurt. I have already created the project, and tried for a couple of times to get it to build correctly but I was unable to get it correct. The url for my project is https://build.opensuse.org/package/show?package=Kenesis&project=home%3Avendion I have been reading the wiki on using the build service, but I can't find anything that helps me, I'm sure there is something helpfull 50+ link in but right now don't have the time the craw though every link I see. BTW: as the subject says I am new to the build service, been on opensuse@opensuse.org for a while.
On Tue, Apr 29, 2008 at 11:18:50AM -0400, Adam Jimerson wrote:
I am writing a text based fantasy RPG in perl and figured that having it on the build service would not hurt. I have already created the project, and tried for a couple of times to get it to build correctly but I was unable to get it correct. The url for my project is https://build.opensuse.org/package/show?package=Kenesis&project=home%3Avendion These lines from the build log contain the problem:
+ cd kenesis-0.1alpha2 /var/tmp/rpm-tmp.21840: line 29: cd: kenesis-0.1alpha2: No such file or directory
RPM unpacks your tarball, and then expects a directory called kenesis-0.1alpha2 to change into. There it would start executing your %build section. You tarball, however, does not contain a directory, but the files of your project at the top-level. So the solution is, create a tarball which contains a directory, and try again. -- Sonja Krause-Harder (skh@suse.de) SUSE Research & Development ----------------------------------------------------------------- SUSE Linux Products GmbH GF: Markus Rex, HRB 16746 (AG Nuernberg) --------------------------------------------------------------------- To unsubscribe, e-mail: opensuse-buildservice+unsubscribe@opensuse.org For additional commands, e-mail: opensuse-buildservice+help@opensuse.org
On Tue, Apr 29, 2008 at 05:46:44PM +0200, Sonja Krause-Harder wrote:
So the solution is, create a tarball which contains a directory, and try again.
After looking at your spec file, one more comment ;-) You do: %prep %setup tar xjvf %{name}-%{version}.tar.gz The last line is not needed (and will throw another error), because this is what the %setup macro already does - unpack the sources and change into the unpacked directory. The respective section in the RPM documentation is: http://www.rpm.org/max-rpm-snapshot/s1-rpm-inside-macros.html Good luck, rpm is a b*** to learn. -- Sonja Krause-Harder (skh@suse.de) SUSE Research & Development ----------------------------------------------------------------- SUSE Linux Products GmbH GF: Markus Rex, HRB 16746 (AG Nuernberg) --------------------------------------------------------------------- To unsubscribe, e-mail: opensuse-buildservice+unsubscribe@opensuse.org For additional commands, e-mail: opensuse-buildservice+help@opensuse.org
* Sonja Krause-Harder [2008-04-29 17:46]:
So the solution is, create a tarball which contains a directory, and try again.
Don't modify upstream tarballs. That's confusing. Just use the %setup -c (create directory) option. Bernhard --------------------------------------------------------------------- To unsubscribe, e-mail: opensuse-buildservice+unsubscribe@opensuse.org For additional commands, e-mail: opensuse-buildservice+help@opensuse.org
On Tue, Apr 29, 2008 at 06:03:33PM +0200, Bernhard Walle wrote:
* Sonja Krause-Harder [2008-04-29 17:46]:
So the solution is, create a tarball which contains a directory, and try again.
Don't modify upstream tarballs. That's confusing. Just use the %setup -c (create directory) option.
Correct, but if I understood the original poster correctly, he is upstream. :) -- Sonja Krause-Harder (skh@suse.de) SUSE Research & Development ----------------------------------------------------------------- SUSE Linux Products GmbH GF: Markus Rex, HRB 16746 (AG Nuernberg) --------------------------------------------------------------------- To unsubscribe, e-mail: opensuse-buildservice+unsubscribe@opensuse.org For additional commands, e-mail: opensuse-buildservice+help@opensuse.org
On Tuesday 29 April 2008 12:06:13 pm Sonja Krause-Harder wrote:
On Tue, Apr 29, 2008 at 06:03:33PM +0200, Bernhard Walle wrote:
* Sonja Krause-Harder [2008-04-29 17:46]:
So the solution is, create a tarball which contains a directory, and try again.
Don't modify upstream tarballs. That's confusing. Just use the %setup -c (create directory) option.
Correct, but if I understood the original poster correctly, he is upstream. :)
Yea I am the original author of the program, I'm about as upstream as it gets XD. Thanks for the help, and I can see that RPM are a pain to make.
* Adam Jimerson [2008-04-29 14:14]:
and I can see that RPM are a pain to make.
Why? It's *always* a good idea to package the source tarball in a way that the tarball creates one toplevel directory. Bernhard --------------------------------------------------------------------- To unsubscribe, e-mail: opensuse-buildservice+unsubscribe@opensuse.org For additional commands, e-mail: opensuse-buildservice+help@opensuse.org
On Tuesday 29 April 2008 02:25:00 pm Bernhard Walle wrote:
* Adam Jimerson [2008-04-29 14:14]:
and I can see that RPM are a pain to make.
Why? It's *always* a good idea to package the source tarball in a way that the tarball creates one toplevel directory.
Bernhard
Yea, that is usually how I do it, but don't know why I didn't do it for that one. The reason I say that they are a pain to make is because its not easy to pick up. Ok I ran into anther problem this time it is in the %install section, everything is fine until it is told to create this hardlink: + ln /var/tmp/kenesis-0.1alpha2-build/usr/kenesis-0.1alpha2/kenesis.pl /usr/bin/kenesis ln: creating hard link `/usr/bin/kenesis' => `/var/tmp/kenesis-0.1alpha2-build/usr/kenesis-0.1alpha2/kenesis.pl': Permission denied error: Bad exit status from /var/tmp/rpm-tmp.56635 (%install) RPM build errors: Bad exit status from /var/tmp/rpm-tmp.56635 (%install) mount: can't find / in /etc/fstab or /etc/mtab md: stopping all md devices. xenbus_dev_shutdown: device/console/0: Initialising != Connected, skipping System halted. is that not allowed?
Adam Jimerson escribió:
ln /var/tmp/kenesis-0.1alpha2-build/usr/kenesis-0.1alpha2/kenesis.pl /usr/bin/kenesis
also FYI., I assume the rpm package name is "kenesis" and the rpm version tag is "0.1alpha2" if so, keep in mind that you shouldnt version your packages this way, rpm has no notion of "alpha", "beta" , "rc" so usually 0.1alpha2 will be newer than 0.1 release ;-) I suggest you use 0.1.alphaN , 0.1.RCN to name both your tarballs and the rpm version number. -- "Progress is possible only if we train ourselves to think about programs without thinking of them as pieces of executable code.” - Edsger W. Dijkstra Cristian Rodríguez R. Platform/OpenSUSE - Core Services SUSE LINUX Products GmbH Research & Development http://www.opensuse.org/
Adam Jimerson napsal(a):
Ok I ran into anther problem this time it is in the %install section, everything is fine until it is told to create this hardlink: + ln /var/tmp/kenesis-0.1alpha2-build/usr/kenesis-0.1alpha2/kenesis.pl /usr/bin/kenesis ln: creating hard link `/usr/bin/kenesis' => `/var/tmp/kenesis-0.1alpha2-build/usr/kenesis-0.1alpha2/kenesis.pl': Permission denied error: Bad exit status from /var/tmp/rpm-tmp.56635 (%install)
1) In %install, you can only create files within the %buildroot temporary directory. The build doesn't run as root. 2) Are you sure you want to use a hardlink here? There's no guarantee that /usr/kenesis-0.1alpha2/ and /usr/bin/ will be on the same filesystem... Michal --------------------------------------------------------------------- To unsubscribe, e-mail: opensuse-buildservice+unsubscribe@opensuse.org For additional commands, e-mail: opensuse-buildservice+help@opensuse.org
Michal Marek escribió:
2) Are you sure you want to use a hardlink here? There's no guarantee that /usr/kenesis-0.1alpha2/ and /usr/bin/ will be on the same filesystem...
and /usr/kenesis-0.1alpha2/* seems a wrong installation path.. Adam, care to share your spec file with us ? -- "Progress is possible only if we train ourselves to think about programs without thinking of them as pieces of executable code.” - Edsger W. Dijkstra Cristian Rodríguez R. Platform/OpenSUSE - Core Services SUSE LINUX Products GmbH Research & Development http://www.opensuse.org/
On Tuesday 29 April 2008 02:57:27 pm Michal Marek wrote:
1) In %install, you can only create files within the %buildroot temporary directory. The build doesn't run as root.
That would explain the Permission denied
2) Are you sure you want to use a hardlink here? There's no guarantee that /usr/kenesis-0.1alpha2/ and /usr/bin/ will be on the same filesystem...
Any suggestions on where and how to add the files the the system?
Adam Jimerson napsal(a):
On Tuesday 29 April 2008 02:57:27 pm Michal Marek wrote:
2) Are you sure you want to use a hardlink here? There's no guarantee that /usr/kenesis-0.1alpha2/ and /usr/bin/ will be on the same filesystem...
Any suggestions on where and how to add the files the the system?
I suggest to use a symlink. And as Cristian pointed out, /usr/myprogram is not a "good" installation path as per the FHS. Use either /usr/share/myprogram, /usr/lib/myprogram or %_libdir/myprogram (= /usr/lib64/myprogram on x86_64). Michal --------------------------------------------------------------------- To unsubscribe, e-mail: opensuse-buildservice+unsubscribe@opensuse.org For additional commands, e-mail: opensuse-buildservice+help@opensuse.org
On Tuesday 29 April 2008 03:22:28 pm Cristian Rodríguez wrote:
Michal Marek escribió:
2) Are you sure you want to use a hardlink here? There's no guarantee that /usr/kenesis-0.1alpha2/ and /usr/bin/ will be on the same filesystem...
and /usr/kenesis-0.1alpha2/* seems a wrong installation path.. Adam, care to share your spec file with us ?
Sure, I had a link to my project but that is long gone. I can go ahead and say there might be a lot of things wrong with my spec https://build.opensuse.org/package/show?package=Kenesis&project=home%3Avendion Free free to make fun of any noobish mistakes that I have made with the spec file.
On Tue, 29 Apr 2008, Adam Jimerson wrote:
On Tuesday 29 April 2008 03:22:28 pm Cristian Rodríguez wrote:
Michal Marek escribió:
2) Are you sure you want to use a hardlink here? There's no guarantee that /usr/kenesis-0.1alpha2/ and /usr/bin/ will be on the same filesystem...
and /usr/kenesis-0.1alpha2/* seems a wrong installation path.. Adam, care to share your spec file with us ?
Sure, I had a link to my project but that is long gone. I can go ahead and say there might be a lot of things wrong with my spec
https://build.opensuse.org/package/show?package=Kenesis&project=home%3Avendion
Free free to make fun of any noobish mistakes that I have made with the spec file.
Well, actually RPM is a painful system, but not because of the problems you mention, but because of design issues (e.g. it uses line comments, but does not removed comments before macro expansion - thus making commented macros impossible - and so on). Your current spec failure: ln $RPM_BUILD_ROOT/usr/%{name}-%{version}/kenesis.pl /usr/bin/kenesis Actually you have the right idea, but the wrong method: The %{buildroot} or $RPM_BUILD_ROOT means a seperate directory, which equals the final system. Everthing therein must be as in the final system, whereas every access to the files must be prefix with the path. So your link must be ln -s /usr/%{name}-%{version}/kenesis.pl $RPM_BUILD_ROOT/usr/bin/kenesis a) use softlink b) the link target (i.e. the destination the link points to) must be without prefix c) the link itself must be with, as it is in the buildroot. BTW: Is there a good reason to include the version number in the path. As you do a link to /usr/bin you cannot install packages in parallel anyway. Avoid changes in the paths, when they are unneccessary. P.S. As said above, I would suggest /usr/share/%{name} as path and I'm pretty sure RPM has already a macro pointing to that directory. Ciao -- http://www.dstoecker.eu/ (PGP key available)
On Wed, 30 Apr 2008 08:29:04 +0200 (CEST), Dirk Stoecker wrote:
P.S. As said above, I would suggest /usr/share/%{name} as path and I'm pretty sure RPM has already a macro pointing to that directory.
Quite :) There is _datadir that points to _prefix/share (see /usr/lib/rpm/macros) so you'd have to use %{_datadir}/%{name}. Philipp --------------------------------------------------------------------- To unsubscribe, e-mail: opensuse-buildservice+unsubscribe@opensuse.org For additional commands, e-mail: opensuse-buildservice+help@opensuse.org
On Tuesday 29 April 2008 17:18:50 wrote Adam Jimerson:
I am writing a text based fantasy RPG in perl and figured that having it on the build service would not hurt. I have already created the project, and tried for a couple of times to get it to build correctly but I was unable to get it correct. The url for my project is https://build.opensuse.org/package/show?package=Kenesis&project=home%3Avend ion
I have been reading the wiki on using the build service, but I can't find anything that helps me, I'm sure there is something helpfull 50+ link in but right now don't have the time the craw though every link I see.
BTW: as the subject says I am new to the build service, been on opensuse@opensuse.org for a while.
just a general remark, for generic packaging questions, we do have the opensuse-packaging@opensuse.org mailing list. bye adrian -- Adrian Schroeter SUSE LINUX Products GmbH, GF: Markus Rex, HRB 16746 (AG Nürnberg) email: adrian@suse.de --------------------------------------------------------------------- To unsubscribe, e-mail: opensuse-buildservice+unsubscribe@opensuse.org For additional commands, e-mail: opensuse-buildservice+help@opensuse.org
participants (8)
-
Adam Jimerson
-
Adrian Schröter
-
Bernhard Walle
-
Cristian Rodríguez
-
Dirk Stoecker
-
Michal Marek
-
Philipp Thomas
-
Sonja Krause-Harder