rpmbuild - 2nd package - I'm stuck!

Place to discuss Fedora and/or Red Hat

rpmbuild - 2nd package - I'm stuck!

Postby Ice9 » Fri Apr 02, 2004 6:37 am

When you built the RPM with that unpackaged_files* flag do the files listed actually get included in the RPM? I would think they wouldn't. If you want them included add them to the files section. They look like files that should be included to me, but I'm not sure about that. Personally, I would not add that flag to my macros system wide macros file. In fact I wouldn't add it at all if it will cause important files to not get included in the RPM.


Ok, I managed to create a krusader package with the files included and it didn't give me the unpackaged files error anymore.

So I went on to my second attempt which is to create an rpm for basket.
Now, included in the krusader tarball was a krusader.spec file which I based myself upon to create the spec file for my rpm package.
In the basket tarball there is no spec file at all and I haven't been able to find any rpm's even for other distro's to extract a spec file from (only one rpm for SuSE and it was created by checkinstall and didn't seem to include a spec file either).

./configure make make install are all fine but when I execute
rpmbuild -ba yc_basket.spec
I get this
Code: Select all
make[2]: Leaving directory `/home/ycluckers/redhat/BUILD/basket-0.4/src'
make[1]: Leaving directory `/home/ycluckers/redhat/BUILD/basket-0.4/src'
make[1]: Entering directory `/home/ycluckers/redhat/BUILD/basket-0.4'
make[2]: Entering directory `/home/ycluckers/redhat/BUILD/basket-0.4'
make[2]: Nothing to be done for `install-exec-am'.
make[2]: Nothing to be done for `install-data-am'.
make[2]: Leaving directory `/home/ycluckers/redhat/BUILD/basket-0.4'
make[1]: Leaving directory `/home/ycluckers/redhat/BUILD/basket-0.4'
+ KDEDIR=/var/tmp/basket-buildroot/usr
+ kde_minidir=/var/tmp/basket-buildroot/usr/share/icons/mini
+ /usr/lib/rpm/redhat/find-lang.sh /var/tmp/basket-buildroot basket
No translations found for basket in /var/tmp/basket-buildroot
error: Bad exit status from /var/tmp/rpm-tmp.26352 (%install)


RPM build errors:
    Bad exit status from /var/tmp/rpm-tmp.26352 (%install)


Here's the spec file if it's of any use

Code: Select all
%define name   basket
%define version 0.4
%define release RH9_KDE_3.2.1

Name: %{name}
Summary: Convenient desktop storing device.
Version: %{version}
Release: RH9_KDE_3.2.1
Source: basket-0.4.0.tar.gz
Group: Utilities/System
BuildRoot: %{_tmppath}/%{name}-buildroot
URL: http://les83plus.fr.st/sebastien.laout/basket
Copyright: GPL
Prefix: /usr
Requires: kdelibs

%description
BasKet is a desktop organization tool inspired by DropDrawers (from www.sigsoftware.com). It uses baskets and drawers for organizing various objects, such as text, URLs, images, sounds, or other documents. Objects in a basket can be edited, copied, moved, dragged, and so on. This allows you to stay organized and free your desktop, or to take notes with various types of content (not only text) in an easy way.

%prep
rm -rf $RPM_BUILD_ROOT

%setup -q -n %name-%version

%build
export CFLAGS=$RPM_OPT_FLAGS
export CXXFLAGS=$RPM_OPT_FLAGS

%configure
make %{_smp_mflags}

%install
rm -rf %{buildroot}
%makeinstall
KDEDIR=$RPM_BUILD_ROOT%{_prefix} kde_minidir=$RPM_BUILD_ROOT%{_miconsdir}

%find_lang %{name}

%clean
rm -rf %{buildroot}

%post -p /sbin/ldconfig

%postun -p /sbin/ldconfig

%defattr(-,root,root)
%doc README AUTHORS ChangeLog TODO COPYING basket.lsm
%doc %{_datadir}/doc/HTML/en/*
%_bindir/*
%_datadir/applnk/Applications/Utilities/basket.desktop

%dir %_datadir/apps/basket/
%_datadir/apps/basket/*.rc

%dir %_datadir/apps/basket/icons/
%dir %_datadir/apps/basket/icons/hicolor/
%dir %_datadir/apps/basket/icons/hicolor/16x16/
%dir %_datadir/apps/basket/icons/hicolor/16x16/apps/
%_datadir/apps/basket/icons/hicolor/16x16/apps/*.png

%dir %_datadir/apps/basket/icons/hicolor/32x32/
%dir %_datadir/apps/basket/icons/hicolor/32x32/apps/
%_datadir/apps/basket/icons/hicolor/32x32/apps/*.png

%changelog
* Thu Apr 1 2004 Ice9
- My second rpm attempt.


I have tried numerous things like removing the
%find_lang %{name}
but then it complains about not finding a basket.lang file .... :?

Is there anything in the makefile I can use to track down where this error comes from?
I tried to look into it but it's kinda huge and I don't speak "programmer" very well yet ...
:wink:
Ice9
guru
guru
 
Posts: 577
Joined: Thu Jan 09, 2003 12:40 am
Location: Belgium

Postby Void Main » Fri Apr 02, 2004 8:58 pm

User avatar
Void Main
Site Admin
Site Admin
 
Posts: 5705
Joined: Wed Jan 08, 2003 5:24 am
Location: Tuxville, USA

Postby Ice9 » Sat Apr 03, 2004 1:27 am

thanks :)
When I compare both spec files I don't see that many differences, mainly in the datadir section and you left out the %find_lang
When I did that it compalined about not finding the file basket.lang

I'll try to compile it on my RH9 laptop to see if it works now.

Edit: The package built now, but again I have a bunch of unpackaged files??
How come you didn't?

And I'm not sure I quite understand what the problem was ....
Was it caused by the datadir paths?
Ice9
guru
guru
 
Posts: 577
Joined: Thu Jan 09, 2003 12:40 am
Location: Belgium

Postby Void Main » Sat Apr 03, 2004 8:39 am

If you look at the patch (or just do a "diff" on the two spec files) you will see what I did to fix that.

1 - you had no "%files" tag for the %files section
2 - basket.lsm is in the "src" directory, not in the main directory so I changed "basket.lsm" to "src/basket.lsm"
3 - I changed several other lines in the %files section that were wrong

I don't know if you how to read a diff/patch file but any line that starts with a "-" in the first column are lines I deleted. Any line that starts with a "+" are lines that I added. My basket*.src.rpm will not build on your system?

Also, if you look at your failure message you will see it refer to a file in the /var/tmp directory, in your initial message this file would have been called "rpm-tmp.26352. This is a shell script that is automatically generated by the rpmbuild process. It is used to actually build the software and gather the files to bundle the RPM. It can be very helpful in figuring out what is wrong with your spec file.

It is sometimes helpful to look at the script to see where it failed. Then ask youself, what is different about this script than what I would have done in a manual installation? In this case it was gathering language files and expected to find some. Well, the package doesn't include any so I noticed you had the %findlang RPM tag in your spec file so I just removed it.

As far as the files section you should have found the install directory structure under /var/tmp/basket-buildroot. I did this:

Code: Select all
$ cd /var/tmp/basket-buildroot
$ find


which produced this list:

Code: Select all
./usr/bin/basket
./usr/share/applnk/Utilities/basket.desktop
./usr/share/apps/basket/basketui.rc
./usr/share/doc/HTML/en/basket/common
./usr/share/doc/HTML/en/basket/index.cache.bz2
./usr/share/doc/HTML/en/basket/index.docbook
./usr/share/doc/basket-0.4
./usr/share/doc/basket-0.4/AUTHORS
./usr/share/doc/basket-0.4/COPYING
./usr/share/doc/basket-0.4/ChangeLog
./usr/share/doc/basket-0.4/INSTALL
./usr/share/doc/basket-0.4/NEWS
./usr/share/doc/basket-0.4/README
./usr/share/doc/basket-0.4/TODO
./usr/share/doc/basket-0.4/basket.lsm
./usr/share/icons/hicolor/16x16/apps
./usr/share/icons/hicolor/16x16/apps/basket.png
./usr/share/icons/hicolor/32x32/apps
./usr/share/icons/hicolor/32x32/apps/basket.png


I just made sure there were statements in the %files section of the spec file that matched the above list of files (without the leading "." and replacing the parts that have rpm build variables.

There may be better ways to do all of this but this is the way I currently do everything not knowing of a definitive, comprehensive, and up to date RPM building tutorial. I know people have written books on building RPMs but I have never had a chance to read one.
User avatar
Void Main
Site Admin
Site Admin
 
Posts: 5705
Joined: Wed Jan 08, 2003 5:24 am
Location: Tuxville, USA

Postby Ice9 » Sun Apr 04, 2004 1:47 am

Thanks for the explanation Void Main.


Edit: The package built now, but again I have a bunch of unpackaged files??
How come you didn't?

When I did $ rpmbuild -ba I had a bunch of unpackaged files found so it didn't actually build, contrary to what I said.
I included them in the %files section but then I received an error stating that some files weren't found.

It turns out tha when I changed my spec file to match yours I forgot to change
Code: Select all
%_datadir/apps/basket/icons/hicolor/16x16/apps/basket.png
%_datadir/apps/basket/icons/hicolor/32x32/apps/basket.png
to
Code: Select all
%_datadir/icons/hicolor/16x16/apps/basket.png
%_datadir/icons/hicolor/32x32/apps/basket.png


So I did some additional reading and found out that %bindir refers to /usr/bin and %datadir refers to /usr/share.
This cleared up a lot.
I checked the paths in my Install dir and found out that the icons were located in a different location than what my spec file specified, changed that and then the package built ok.

Like you said there is no definitive, comprehensive rpm building tutorial, there are bits and pieces all over the place but nothing complete and comprehensive for a non-programmer type like myself.

I downloade Maximum RPM and plan on reading that.
If it can help me figuring out the construction of a spec file, the syntax and everything else I'll try to write some howto that is actually readable and understandable for the common mortal :wink:

Like always you were a big help Void, thanks.
I'll come back with more if I'm stuck on something else. :D
Ice9
guru
guru
 
Posts: 577
Joined: Thu Jan 09, 2003 12:40 am
Location: Belgium

Postby Void Main » Sun Apr 04, 2004 8:03 am

Ice9 wrote:It turns out tha when I changed my spec file to match yours I forgot to change
Code: Select all
%_datadir/apps/basket/icons/hicolor/16x16/apps/basket.png
%_datadir/apps/basket/icons/hicolor/32x32/apps/basket.png
to
Code: Select all
%_datadir/icons/hicolor/16x16/apps/basket.png
%_datadir/icons/hicolor/32x32/apps/basket.png



You should use the "diff" command. It will save you a lot of time. After you made your changes and it still didn't work you could have done a diff between mine and yours and saw that there were still changes to be made.

So I did some additional reading and found out that %bindir refers to /usr/bin and %datadir refers to /usr/share.


Just as an FYI, those variables are defined in /usr/lib/rpm/macros.

I checked the paths in my Install dir and found out that the icons were located in a different location than what my spec file specified, changed that and then the package built ok.


Again, the diff command would have pointed that out pronto. :)

I downloade Maximum RPM and plan on reading that.
If it can help me figuring out the construction of a spec file, the syntax and everything else I'll try to write some howto that is actually readable and understandable for the common mortal


That would be very cool. Glad you got it working!
User avatar
Void Main
Site Admin
Site Admin
 
Posts: 5705
Joined: Wed Jan 08, 2003 5:24 am
Location: Tuxville, USA


Return to Fedora/Red Hat

Who is online

Users browsing this forum: No registered users and 1 guest

cron