.spec file: creating an RPM: Files don't appear in designated paths
Linux - SoftwareThis 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
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
.spec file: creating an RPM: Files don't appear in designated paths
Code:
Name: foo
Summary: A bar of foo
Version: 1.0
Release: 334
License: GPL
Group: Amusements/Games
URL: http://foobar.net
Source0: %{name}-%{version}.tar.gz
Source1:start-foo
Buildroot: %{_tmppath}/%{name}-%{version}-%{release}-root
Requires: python >= 2.4
%description
A bar made up of 100% foo.
%prep
%setup -q -c
%install
rm -fr %{buildroot}
mkdir -p %{buildroot}/usr/share/games
mkdir -p %{buildroot}/usr/games/bin
%clean
rm -fr %{buildroot}
%files
%defattr(-,root,root)
%changelog
I'm trying to create a binary rpm. The data files are supposed to go in /usr/share/games and an execuatable shell script in /usr/games/bin. For some reason I can't find any files in /usr/share/games and I can't find start-foo in /usr/games/bin.
Is there anything missing in my code?
[EDIT]I can't find a solution on Google (probably because I don't know what my problem is )
Last edited by CPUFreak91; 07-19-2006 at 05:01 PM.
I think it would be easier for you if you post an actual spec file you work with (can test). If you run rpmbuild it no doubt will spit out informative messages. This rpm will contain no files (not even empty dirs since they're not mentioned in the files section).
[QUOTE=unSpawn]I think it would be easier for you if you post an actual spec file you work with (can test).
OK. The actual spec file follows:
Code:
Name: bibledave
Summary: A sidescroller game
Version: 0.6.6
Release: 2
License: GPL
Group: Amusements/Games
URL: http://bibledave.sourceforge.net
Source0: %{name}-%{version}.tar.gz
Source1:%{name}
Buildroot: %{_tmppath}/%{name}-%{version}-%{release}-root
Requires: python >= 2.4
%description
A sidescroller game written in python involving a crashed pilot, scattered Bibles and a deadline.
This is a community project of ChristianCoders.com -- a site that connects people interested in
Christian video games
%prep
%setup -q -c
%install
rm -fr %{buildroot}
mkdir -p %{buildroot}/usr/share/games
mkdir -p %{buildroot}/usr/games/bin
%clean
rm -fr %{buildroot}
%files
%defattr(-,root,root)
%changelog
Quote:
Originally Posted by unSpawn
If you run rpmbuild it no doubt will spit out informative messages. This rpm will contain no files (not even empty dirs since they're not mentioned in the files section).
I have run rpmbuild but I have not gotten any usefull files.
I also have noticed some people mentioning some rpmrc file. Should I create one?
So, how would I mention the files in the files section?
Thanks for your help so far
I have run rpmbuild but I have not gotten any usefull files.
Because the spec file doesn't do nothing yet ;-p
I also have noticed some people mentioning some rpmrc file. Should I create one?
You don't have to create (=copy from default) a ~/.rpmrc. You may want to build RPM's as unprivileged user to keep from poisoning your buildsystem. Set up your own ~/.rpmmacros. It deals with setting your local RPM root (%_topdir ~/somedir) under which you'll have the source, build, temp dirs, etc, etc. For details see the excellent IBM developerWorks: Building without root, patching software, and distributing RPMs. Other docs to read would be the RPM HOWTO and any distribution-specific RPM docs.
So, how would I mention the files in the files section?
Basically what you do first is unpack the tarball (in this case a zipfile so watch your source directive), read the README or INSTALL files, run configure with appropriate args, run make and "make -n install" to see where it all goes to.
0. Download and unpack bibledave and in the bibledave_v0.6.6 dir there's no default configure(.in) (and or Makefile) but a file called "run.sh" which executes the game (python main.py) and when done deletes any compiled files (rm *.pyc -f).
1. Also all files and dirs are used in the current structure so you can't have it installed in /usr/share/games or /usr/games/bin but in /usr/share/games/bibledave or /usr/games/bin/bibledave
2. with a symlink from say /usr/local/bin/bibledave to /usr/share/games/bibledave/run.sh.
3. Decide on which dir and make the run.sh a proper Bash script:
Code:
#!/bin/sh
cd /usr/share/games/bibledave
python main.py
rm *.pyc -f
exit 0
4. Before installing we need to remove the CVS entries, batch files, etc. cd into where you unpacked bibledave and:
and add the contents of spec_files to your spec file.
6. There's some more stuff but I guess it's time to finish off with a spec file, as always, YMMV(VM). Since LQ has a post limit I'll try and post in below. Edit: the spec file is too large. It will be available at this URI for aprox seven days from now.
Please note: the build process and spec file described with all the kludges and workarounds are definately NONSTANDARD. Do not use this unless you are forced to. Also it's better to use well-packaged source tarballs ( bug your maintainers about packaging standards).
Last edited by unSpawn; 07-20-2006 at 03:36 PM.
Reason: //spec file URI
For the most in-depth word on rpm, especially .spec files, see the book Maximum-RPM at the Red Hat website (somewhere under Documentation). You can read it on-line or download it.
+ /usr/bin/unzip -qq /home/therat/rpm/SOURCES/bibledave_v0.6.6.zip
(..)
/var/tmp/rpm-tmp.10768: line 36: cd: bibledave-0.6.6: No such file or directory
"unzip -l /home/therat/rpm/SOURCES/bibledave_v0.6.6.zip" and you'll notice the directoryname is different. That's why I said:
Well I fixed a few new errors on my own
I'm sure they are *your* errors because the rpm packaged w/o probs here.
... (huge list of duplicate names)
...well, yeah, OK, except for the duplicate names. But that won't keep rpm from building the package.
error: Installed (but unpackaged) file(s) found:
Sorry, you must have changed something because the rpm packaged w/o that specific prob here. IOW: find the differences.
BTW, are you going to be the rpm maintainer for that app?
Strange. I've started from the beginning, following your instructions to the letter and I come with errors (yes again ) This one feels familiar but I can't seem to solve it:
Code:
Executing(%prep): /bin/sh -e /var/tmp/rpm-tmp.96539
+ umask 022
+ cd /home/therat/rpm/BUILD
+ cd /home/therat/rpm/BUILD
+ rm -rf bibledave-0.6.6
+ /bin/gzip -dc /home/therat/rpm/SOURCES/bibledave-0.6.6.tar.gz
+ tar -xf -
+ STATUS=0
+ '[' 0 -ne 0 ']'
+ cd bibledave-0.6.6
+ exit 0
Executing(%build): /bin/sh -e /var/tmp/rpm-tmp.37510
+ umask 022
+ cd /home/therat/rpm/BUILD
+ cd bibledave-0.6.6
+ find . -type d -name CVS
+ xargs -iD rm -rf D
+ find . -type f -iname '*.bat' -o -iname '*.ico' -o -iname '*.nsi'
+ xargs -iF rm -f F
+ find . -type d
+ xargs -iX stat -c 'mkdir -p ${RPM_BUILD_ROOT}%n' X
+ sed -e 's/}\./}\/usr\/share\/games\/bibledave/g'
+ echo 'mkdir -p ${RPM_BUILD_ROOT}/usr/local/bin'
+ find . -type f
+ egrep -ve '(installer.sh|SF.Comic.Script)'
+ xargs -iX stat -c 'install %n ${RPM_BUILD_ROOT}%n' X
+ sed -e 's/}\./}\/usr\/share\/games\/bibledave/g'
+ exit 0
Executing(%install): /bin/sh -e /var/tmp/rpm-tmp.79485
+ umask 022
+ cd /home/therat/rpm/BUILD
+ cd bibledave-0.6.6
+ cat
+ sh ./installer.sh
+ rm -f ./installer.sh
+ install -m 0755 bibledave.x /home/therat/rpm/BUILD/bibledave/usr/local/bin/bibledave
+ install 'SF Comic Script.ttf' /home/therat/rpm/BUILD/bibledave/usr/share/games/bibledave
install: cannot stat `SF Comic Script.ttf': No such file or directory
error: Bad exit status from /var/tmp/rpm-tmp.79485 (%install)
I'll go over what I did. I copied your spec file to ~/bibledave.spec, Downloaded bibledave_v0.6.6.zip from SF.net, and unzipped it. Renamed the folder to bibledave-0.6.6. Tar'd and gziped the folder. Placed bibledave-0.6.6.tar.gz in ~/rpm/SOURCES. Then I ran rpmbuild -bb ~/bibledave.spec and got this error. Was there something I missed?
Last edited by CPUFreak91; 07-21-2006 at 02:36 PM.
* BTW, since you're the maintainer I think you would benefit from making a script that rearranges tarball contents (or downloads CVS), makes the spec file and builds the rpm once you get the hang of building an rpm. If you're interested in doing that we could build a script in this thread once all probs are fixed.
Executing(%install): /bin/sh -e /var/tmp/rpm-tmp.67919
+ umask 022
+ cd /home/therat/rpm/BUILD
+ cd bibledave-0.6.6
+ cat
+ sh ./installer.sh
+ rm -f ./installer.sh
+ install -m 0755 bibledave.x /home/therat/rpm/BUILD/bibledave/usr/local/bin/bibledave
/var/tmp/rpm-tmp.67919: line 37: unexpected EOF while looking for matching `"'
error: Bad exit status from /var/tmp/rpm-tmp.67919 (%install)
Any idea what might have cause this?
Quote:
Originally Posted by unSpawn
* BTW, since you're the maintainer I think you would benefit from making a script that rearranges tarball contents (or downloads CVS), makes the spec file and builds the rpm once you get the hang of building an rpm. If you're interested in doing that we could build a script in this thread once all probs are fixed.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.