RPM packaging and readily avilable Fedora 11 packages

9 views
Skip to first unread message

Adrian Perez de Castro

unread,
Aug 22, 2009, 10:02:41 AM8/22/09
to frogr...@googlegroups.com

Hello!

I have been reading the Fedora/RedHat packaging guidelines, and some
how-tos about RPM packaging. It was easier than I thought to come up
with a .spec file with build rules for use with rpmbuild :-D

I followed the Fedora packaging guidelines [1], and the packages pass
the tests made by rpmlint successfully.

Spec files and RPM packages:
http://people.igalia.com/aperez/files/frogr/

Build instructions:

1. Install needed packages (including rpmdevtools!)

2. rpmdev-setuptree

3.a. To build from the source RPM:
- cd ~/rpmbuild/SRPMS
- wget http://people.igalia.com/aperez/files/frogr/frogr-0.1.1-1.fc11.src.rpm
- rpmbuild --rebuild frogr-0.1.1-1.fc11.src.rpm

3.b. To build from the tarball and spec file:
- cd ~/rpmbuild/SOURCES
- wget http://frogr.googlecode.com/files/%{name}-%{version}.tar.bz2
- cd ~/rpmbuild/SPECS
- wget http://people.igalia.com/aperez/files/frogr/frogr.spec
- rpmbuild -ba frogr.spec

Done! Packages will be under ~/rpmbuild/RPMS/${arch}/ and ~/rpmbuild/SRPMS

As a final note, I think it would be valuable to include the frogr.spec
file in the source tree and tarballs (like the "debian/" subtree), because
if frogr.spec is in tarballs, a packager can do:

rpmbuild -ta frogr-X.Y.Z.tar.bz2

And rpmbuild will extract the frogr.spec from the tarball and perform all
needed steps automatically in a single command.

Cheers,

--
Adrian Perez de Castro <ape...@igalia.com>
Igalia - Free Software Engineering

frogr.spec
signature.asc

Mario Sanchez Prada

unread,
Aug 23, 2009, 6:21:34 PM8/23/09
to frogr...@googlegroups.com
Adrian Perez de Castro wrote:
> Hello!
>
> I have been reading the Fedora/RedHat packaging guidelines, and some
> how-tos about RPM packaging. It was easier than I thought to come up
> with a .spec file with build rules for use with rpmbuild :-D
>
> I followed the Fedora packaging guidelines [1], and the packages pass
> the tests made by rpmlint successfully.
>
> Spec files and RPM packages:
> http://people.igalia.com/aperez/files/frogr/
>
> Build instructions:
>
> 1. Install needed packages (including rpmdevtools!)
>
> 2. rpmdev-setuptree
>
> 3.a. To build from the source RPM:
> - cd ~/rpmbuild/SRPMS
> - wget http://people.igalia.com/aperez/files/frogr/frogr-0.1.1-1.fc11.src.rpm
> - rpmbuild --rebuild frogr-0.1.1-1.fc11.src.rpm
>
> 3.b. To build from the tarball and spec file:
> - cd ~/rpmbuild/SOURCES
> - wget http://frogr.googlecode.com/files/%{name}-%{version}.tar.bz2
> - cd ~/rpmbuild/SPECS
> - wget http://people.igalia.com/aperez/files/frogr/frogr.spec
> - rpmbuild -ba frogr.spec
>
> Done! Packages will be under ~/rpmbuild/RPMS/${arch}/ and ~/rpmbuild/SRPMS

I can't test all this stuff in my system, but I trust you it works, so
thanks a lot, it's great stuff indeed.

> As a final note, I think it would be valuable to include the frogr.spec
> file in the source tree and tarballs (like the "debian/" subtree), because
> if frogr.spec is in tarballs, a packager can do:
>
> rpmbuild -ta frogr-X.Y.Z.tar.bz2
>
> And rpmbuild will extract the frogr.spec from the tarball and perform all
> needed steps automatically in a single command.
>

I like the idea of adding the .spec file to the source tree but do not
like very much adding it to the tarball created with "make dist". I'd
rather to keep the tarball "clean" from any distro-specific file keeping
only source code needed to build and run the system.

So, I'd push the .spec file, but not modify Makefile.am at all :-)

Btw, it would be great if you could provide a rpm for uploading to the
"downloads" tab in the project web page. Something like
frogr_0.1.1-0fc11_i386.rpm I guess should be fine.

At last just a question: I'm not an expert (not even a newbie) in rpm
packages, but reading the .spec file you sent I wonder if it's packing
up the xml files providing the UI stuff for gtkbuilder... can you
confirm then that everything needed is in place in the rpm package
before pushing your file?

Thanks!
Mario

Mario Sanchez Prada

unread,
Aug 24, 2009, 5:06:59 AM8/24/09
to frogr...@googlegroups.com
Mario Sanchez Prada wrote:
> [...]

> I like the idea of adding the .spec file to the source tree but do not
> like very much adding it to the tarball created with "make dist". I'd
> rather to keep the tarball "clean" from any distro-specific file keeping
> only source code needed to build and run the system.
>
> So, I'd push the .spec file, but not modify Makefile.am at all :-)
>
> Btw, it would be great if you could provide a rpm for uploading to the
> "downloads" tab in the project web page. Something like
> frogr_0.1.1-0fc11_i386.rpm I guess should be fine.

Forget about this. I've created one on my own through a FC11
installation in my KVM.

Already uploaded to the downloads section in the project web, btw.

> At last just a question: I'm not an expert (not even a newbie) in rpm
> packages, but reading the .spec file you sent I wonder if it's packing
> up the xml files providing the UI stuff for gtkbuilder... can you
> confirm then that everything needed is in place in the rpm package
> before pushing your file?

Forget about this as well. While creating the package I've checked the
gtkbuilder files are actually packaged. I'll commit your patch then to
the git repo as soon as possible, although updated for packaging the 0.2
version which is the current development line in master.

Thanks a lot!
Mario

Mario Sanchez Prada

unread,
Aug 24, 2009, 5:12:34 AM8/24/09
to frogr...@googlegroups.com
Mario Sanchez Prada wrote:
> [...]
> Forget about this as well. While creating the package I've checked the
> gtkbuilder files are actually packaged. I'll commit your patch then to
> the git repo as soon as possible, although updated for packaging the 0.2
> version which is the current development line in master.
>
Hmmm just some last questions about the spec file before pushing...

> Name: frogr
> Version: 0.1.1
> Summary: Flickr Remote Organizer for GNOME
> Release: 1%{?dist}

Would it be possible to use Release number '0' (to be coherent with
packages for ubuntu and debian) ?

> [...]
> BuildRequires: flickcurl-devel, gtk2-devel > 2.12, glib2-devel,
> libxml2-devel
>
> Requires: gtk2 > 2.12

Would'nt it be needed to put flickcurl and libxml2 deps here as well?

Thanks!
Mario

Mario Sanchez Prada

unread,
Aug 24, 2009, 5:30:09 AM8/24/09
to frogr...@googlegroups.com
Mario Sanchez Prada wrote:
> Mario Sanchez Prada wrote:
>> [...]
>> Forget about this as well. While creating the package I've checked the
>> gtkbuilder files are actually packaged. I'll commit your patch then to
>> the git repo as soon as possible, although updated for packaging the 0.2
>> version which is the current development line in master.
>>
> Hmmm just some last questions about the spec file before pushing...
>
>> Name: frogr
>> Version: 0.1.1
>> Summary: Flickr Remote Organizer for GNOME
>> Release: 1%{?dist}
>
> Would it be possible to use Release number '0' (to be coherent with
> packages for ubuntu and debian) ?

(once again) forget about this :-)

Mario

Adrian Perez de Castro

unread,
Aug 24, 2009, 5:50:27 AM8/24/09
to frogr...@googlegroups.com
On Mon, 24 Aug 2009 11:06:59 +0200, Mario wrote:

>
> Mario Sanchez Prada wrote:
> > [...]
>

> > Btw, it would be great if you could provide a rpm for uploading to the
> > "downloads" tab in the project web page. Something like
> > frogr_0.1.1-0fc11_i386.rpm I guess should be fine.
>
> Forget about this. I've created one on my own through a FC11
> installation in my KVM.
>
> Already uploaded to the downloads section in the project web, btw.

Wow! That was blazingly fast :-O



> > At last just a question: I'm not an expert (not even a newbie) in rpm
> > packages, but reading the .spec file you sent I wonder if it's packing
> > up the xml files providing the UI stuff for gtkbuilder... can you
> > confirm then that everything needed is in place in the rpm package
> > before pushing your file?
>
> Forget about this as well. While creating the package I've checked the
> gtkbuilder files are actually packaged. I'll commit your patch then to
> the git repo as soon as possible, although updated for packaging the 0.2
> version which is the current development line in master.

Yes, wildcards work nicely in the %files section.

:D

signature.asc

Adrian Perez de Castro

unread,
Aug 24, 2009, 6:01:44 AM8/24/09
to frogr...@googlegroups.com

rpmbuild will autodiscovers the needed requirements of dynamic
libraries by inspecting the binaries of the created package, so the
only entries which must be listed are:

* Packages for which a specific version is required. In this case for
Frogr we are sure that we need gtk 2.12 at least.

* If a program executes external binaries, the packages which provide
them must be listed because they cannot be discovered by inspecting
dynamic linking.

That was a quick summary of the package guidelines WRT dependencies. As
a matter of fact, you can check with:

$ rpm -qR frogr
gtk2 > 2.12
libatk-1.0.so.0()(64bit)
libc.so.6()(64bit)
libc.so.6(GLIBC_2.2.5)(64bit)
libcairo.so.2()(64bit)
libflickcurl.so.0()(64bit)
libfontconfig.so.1()(64bit)
libfreetype.so.6()(64bit)
libgdk-x11-2.0.so.0()(64bit)
libgdk_pixbuf-2.0.so.0()(64bit)
libgio-2.0.so.0()(64bit)
libglib-2.0.so.0()(64bit)
libgmodule-2.0.so.0()(64bit)
libgobject-2.0.so.0()(64bit)
libgthread-2.0.so.0()(64bit)
libgtk-x11-2.0.so.0()(64bit)
libpango-1.0.so.0()(64bit)
libpangocairo-1.0.so.0()(64bit)
libpangoft2-1.0.so.0()(64bit)
libxml2.so.2()(64bit)
rpmlib(CompressedFileNames) <= 3.0.4-1
rpmlib(FileDigests) <= 4.6.0-1
rpmlib(PayloadFilesHavePrefix) <= 4.0-1
rtld(GNU_HASH)

...so it looks like the autodiscovery thing works as expected :D

signature.asc

Mario Sanchez Prada

unread,
Aug 24, 2009, 6:04:01 AM8/24/09
to frogr...@googlegroups.com
Adrian Perez de Castro wrote:
> [...]

> rpmbuild will autodiscovers the needed requirements of dynamic
> libraries by inspecting the binaries of the created package, so the
> only entries which must be listed are:
>
> * Packages for which a specific version is required. In this case for
> Frogr we are sure that we need gtk 2.12 at least.

Then flickcurl and glib should be written down there. We need glib >
2.16 and flickcurl > 1.0.

> * If a program executes external binaries, the packages which provide
> them must be listed because they cannot be discovered by inspecting
> dynamic linking.

Thanks!
Mario

Adrian Perez de Castro

unread,
Aug 24, 2009, 6:15:00 AM8/24/09
to frogr...@googlegroups.com
On Mon, 24 Aug 2009 12:04:01 +0200, Mario wrote:

> Adrian Perez de Castro wrote:
> > [...]
> > rpmbuild will autodiscovers the needed requirements of dynamic
> > libraries by inspecting the binaries of the created package, so the
> > only entries which must be listed are:
> >
> > * Packages for which a specific version is required. In this case for
> > Frogr we are sure that we need gtk 2.12 at least.
>
> Then flickcurl and glib should be written down there. We need glib >
> 2.16 and flickcurl > 1.0.

I did not wrote down that version requirements initially, because
Fedora 11 has all newer versions, but thinking a bit further, it is
good that you added them just in case someone re-uses frogr.spec for an
older Fedora release or for any other RPM based distribution.

I have seen that you added frogr.spec in the repo. Thanks!

signature.asc

Adrian Perez de Castro

unread,
Aug 24, 2009, 6:24:46 AM8/24/09
to frogr...@googlegroups.com

P.S: Forgot to mention that I have built a x86_64 package with the
additions you made in the spec file. You can pick it up here:
http://people.igalia.com/aperez/files/frogr/frogr-0.1.1-1.fc11.x86_64.rpm
(I suppose you may want to upload it to the project page :P)

signature.asc

Mario Sanchez Prada

unread,
Aug 24, 2009, 7:08:59 AM8/24/09
to frogr...@googlegroups.com
Adrian Perez de Castro wrote:
> [...]
> P.S: Forgot to mention that I have built a x86_64 package with the
> additions you made in the spec file. You can pick it up here:
> http://people.igalia.com/aperez/files/frogr/frogr-0.1.1-1.fc11.x86_64.rpm
> (I suppose you may want to upload it to the project page :P)

Thanks! Could you please rebuild the package with release number 0? That
way we would be techincally uploading a pre-release and leave the
concept of release for when the app (hopefully) gets packaged by the
distribution itself (then it would become release 1)

As soon as you send me the file I'd upload it to the project page.

Thanks
Mario

Adrian Perez de Castro

unread,
Aug 24, 2009, 8:41:02 AM8/24/09
to frogr...@googlegroups.com
signature.asc

Mario Sanchez Prada

unread,
Aug 24, 2009, 8:47:54 AM8/24/09
to frogr...@googlegroups.com
Adrian Perez de Castro wrote:
> On Mon, 24 Aug 2009 13:08:59 +0200, Mario wrote:
>
>> Adrian Perez de Castro wrote:
>>> [...]
>>> P.S: Forgot to mention that I have built a x86_64 package with the
>>> additions you made in the spec file. You can pick it up here:
>>> http://people.igalia.com/aperez/files/frogr/frogr-0.1.1-1.fc11.x86_64.rpm
>>> (I suppose you may want to upload it to the project page :P)
>> Thanks! Could you please rebuild the package with release number 0? That
>> way we would be techincally uploading a pre-release and leave the
>> concept of release for when the app (hopefully) gets packaged by the
>> distribution itself (then it would become release 1)
>>
>> As soon as you send me the file I'd upload it to the project page.
>
> Here you are:
> http://people.igalia.com/aperez/files/frogr/frogr-0.1.1-0.fc11.x86_64.rpm
>
Uploaded to the downloads section.

Thanks!
Mario

Reply all
Reply to author
Forward
0 new messages