Discussion:
rpmbuild questions
Dave Pawson
2008-10-12 10:23:14 UTC
Permalink
New to rpm's in general. I'm trying to help out with Klavaro,
currently about 4 versions behind
the Sourceforge version. FC9 has 1.1



$ rpm -qa klavaro
klavaro-1.0.1-1.el5.rf.i386

current version is 1.1.6


I've attempted a spec file, from the sources at
http://klavaro.sourceforge.net/en/
and it seems to be partially working.

I'm stuck on debugging it though.

I've built /usr/src/redhat/RPMS/i386/klavaro-debuginfo-1.1.6-1.fc9.i386.rpm

Questions.

How to find out if this is up to standard?
How to properly test it please?
I'm running FC9 on an i386 arch (I think!)

spec file below

%define version 1.1.6
%define dist
%define _tmppath /tmp
%define release 1



Name: klavaro
Version: %{version}
Release: 1%{?dist}
Summary: Klavaro
Prefix: /usr
Provides: klavaro
Group: Applications/Multimedia
License: gpl v2
URL: http://klavaro.sourceforge.net/en/
Source0: klavaro-%{version}.tar.bz2
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)

#BuildRequires: -
#Requires: -

%description
is just another free touch typing tutor program. Built by %{packager}

%prep
%setup -q


%build
%configure
make %{?_smp_mflags}


%install
rm -rf $RPM_BUILD_ROOT
make install DESTDIR=$RPM_BUILD_ROOT


%clean
rm -rf $RPM_BUILD_ROOT


%files
%defattr(-,root,root,-)
/usr/bin/klavaro
/usr/bin/klavaro_helper
/usr/share/klavaro/*
/usr/share/locale/*
/usr/share/man/*

%doc



%changelog
--
Dave Pawson
XSLT XSL-FO FAQ.
Docbook FAQ.
http://www.dpawson.co.uk
Michael A. Peters
2008-10-12 12:09:01 UTC
Permalink
Post by Dave Pawson
New to rpm's in general. I'm trying to help out with Klavaro,
currently about 4 versions behind
the Sourceforge version. FC9 has 1.1
$ rpm -qa klavaro
klavaro-1.0.1-1.el5.rf.i386
current version is 1.1.6
I've attempted a spec file, from the sources at
http://klavaro.sourceforge.net/en/
and it seems to be partially working.
I'm stuck on debugging it though.
I've built /usr/src/redhat/RPMS/i386/klavaro-debuginfo-1.1.6-1.fc9.i386.rpm
Questions.
How to find out if this is up to standard?
How to properly test it please?
I'm running FC9 on an i386 arch (I think!)
spec file below
%define version 1.1.6
%define dist
%define _tmppath /tmp
%define release 1
Don't define %dist and %_tmppath in the spec file.
They should be defined in the users .rpmmacros file.

In the vast majority of cases, it is better to define version and
release directly in the
Post by Dave Pawson
Name: klavaro
Version: %{version}
Release: 1%{?dist}
Summary: Klavaro
Prefix: /usr
Don't define Prefix - except maybe for relocatable packages
Post by Dave Pawson
Provides: klavaro
That is not necessary since it is the same as the package name
Post by Dave Pawson
Group: Applications/Multimedia
License: gpl v2
If you want to keep rpmlint happy - that should be

License: GPLv2
Post by Dave Pawson
URL: http://klavaro.sourceforge.net/en/
Source0: klavaro-%{version}.tar.bz2
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
#BuildRequires: -
#Requires: -
%description
is just another free touch typing tutor program. Built by %{packager}
The packager should not be in the description. If a user really wants to
know, they can query the RPM database.
Post by Dave Pawson
%prep
%setup -q
%build
%configure
make %{?_smp_mflags}
%install
rm -rf $RPM_BUILD_ROOT
make install DESTDIR=$RPM_BUILD_ROOT
%clean
rm -rf $RPM_BUILD_ROOT
%files
%defattr(-,root,root,-)
/usr/bin/klavaro
/usr/bin/klavaro_helper
since you used %configure - those should be

%{_bindir}/klavaro
%{_bindir}/klavaro_helper
Post by Dave Pawson
/usr/share/klavaro/*
Should ve

%{_datadir}/klavaro

That way - the rpm owns the directory and all its contents
Post by Dave Pawson
/usr/share/locale/*
That's a big nono.

Up in the top of the spec - do

BuildRequires: gettext

Then in the install section -

%find_lang %{name}

Then for %files -

%files -f %{name}.lang
Post by Dave Pawson
/usr/share/man/*
That will result in the package owning directories it shouldn't.
Should be

%{_mandir}/man1/*
etc.
Post by Dave Pawson
%doc
%doc usually goes just after the %defattr(-,root,root,-) though it
doesn't have to.

It shouldn't be empty though, at a minimal it should have the GPL
(typically called COPYING in the source tarball) - but if there is a
README, ChangeLog, etc. - those should also be packaged with %doc

Since you are using fedora - see
http://fedoraproject.org/wiki/Packaging/Guidelines
Dave Pawson
2008-10-12 15:39:58 UTC
Permalink
Post by Michael A. Peters
Since you are using fedora - see
http://fedoraproject.org/wiki/Packaging/Guidelines
Thanks Michael. I'll try a re-run!
Lots to think about.

regards
--
Dave Pawson
XSLT XSL-FO FAQ.
Docbook FAQ.
http://www.dpawson.co.uk
Loading...