Difference between revisions of "Fedora RPM"

From Gramps
Jump to: navigation, search
m (Development rpm)
 
(22 intermediate revisions by 6 users not shown)
Line 1: Line 1:
{{languages}}
+
{{languages|Fedora RPM}}
 +
{{stub}}
  
 
The [[installation]] page details how to download and install a working version of '''Gramps''' to your operating system of choice.  For most users...
 
The [[installation]] page details how to download and install a working version of '''Gramps''' to your operating system of choice.  For most users...
 
  yum install gramps
 
  yum install gramps
will be all that is needed for the [http://fedoraproject.org/wiki/ fedora] distribution. This page details a different method and is for those users wanting an alternative version of gramps, this may be to test a SVN version or to install the latest stable version.
+
will be all that is needed for the [https://fedoraproject.org/wiki/ Fedora] distribution. This page details a different method and is for those users wanting an alternative version of Gramps, this may be to test a SVN version or to install the latest stable version.
  
= Development rpm =
+
= Development RPM =
It may be possible that the [http://download.fedora.redhat.com/pub/fedora/linux/extras/development/testing rpm] works on the current core version of Fedora. For example, the fc7 rpm will run on fc6, with a few small issues. The fc8 version has been verified with Fedora 8 and 9. This usually works, but it is not a supported method, ie: if it breaks the error may not be with gramps or the fedora build, but with the differences between fedora versions. In other words you're on your own with trouble shooting, and if you do report a bug then be sure that it isn't to do with the version mismatch - don't confuse the developers/builders with introduced problems (one's outside their control).
+
It may be possible that next to the standard Fedora RPM there's a newer version available for development testing.
  
Assuming you have an existing version of gramps installed, then to install the development rpm for fc6...
+
Assuming you have an existing version of Gramps installed, you can try to install from the following repositories:
  yum --enablerepo=extras-development update gramps
+
  yum --enablerepo=updates-testing update gramps
 +
yum --enablerepo=development update gramps
  
if you don't have any version installed, then '''install''' it using...  
+
If you don't have any version installed, then use '''install''' instead of '''update'''.  
yum --enablerepo=extras-development install gramps
 
  
With the release of fc7, extras will apparently no longer exist as a seperate repository. This package will no doubt be found using '''yum --enablerepo=development install gramps''', or similar.
+
For Fedora versions 6 and older, the development repository is called '''extras-development'''.
  
= To build the rpm from source =
+
= To build the RPM from source =
A better approach to installing the binary rpm is to build the package from source, this will build gramps using the package versions that you have installed. The [http://download.fedora.redhat.com/pub/fedora/linux/extras/development/SRPMS/|SRPMS] directory contains the source rpm for the latest development build. Download this rpm, install it and build your own binary using the fedora release (in this case fc6) you're running, as the build environment.
+
An alternative approach to installing the binary RPM is to build the package from source, this will build Gramps using the package versions that you have installed. For this, you need the Gramps source kit and a so called '''SPEC''' file. It is usually easiest to download the most recent Gramps source RPM (SRPM) from the Fedora repositories, extract the SPEC file, adjust it for the new version, and try to build a new RPM.
  
== To build the rpm as non-root (recommended method) ==
+
== To build the RPM ==
  
Install the build environment in the users directory.
+
'''Always build packages as an ordinary user. Never use the root account for building packages. You have been warned!'''
'''su -c 'yum install rpmdevtools''''
 
  
Login as a 'normal' user and run '''rpmdev-setuptree'''  . This will silently create the 'rpmbuild/' tree in the users home directory (instead of using ''usr/src/redhat'')
+
Install the RPM build environment tools:
 +
su -c 'yum install rpmdevtools'
  
Download the source rpm, for this example it will be 
+
Run '''rpmdev-setuptree'''  . This will silently create the 'rpmbuild/' tree in the users home directory (instead of using ''usr/src/redhat'')
'''wget&nbsp;<nowiki>http://download.fedora.redhat.com/pub/fedora/linux/extras/development/SRPMS/gramps-2.2.4-3.fc7.src.rpm</nowiki>''' or use your browser on the [http://download.fedora.redhat.com/pub/fedora/linux/extras/development/SRPMS/gramps-2.2.4-3.fc7.src.rpm link]
 
  
'''rpmbuild --rebuild gramps-2.2.4-3.fc7.src.rpm''' (additional packages may be required at this step - see  ''Problems with the build'' below)
+
Download the most recent source RPM from the Fedora repository, and install it.
 +
rpm -iv gramps-XXX.src.rpm
  
'''su -c 'yum localinstall /home/<user>/rpmbuild/RPMS/noarch/gramps-2.2.4-3.noarch.rpm'''' (use yum to install the rpm)
+
Copy the most recent gramps source kit to the '''rpmbuild/SOURCES''' directory
 +
cp gramps-YYY.tar.gz ~/rpmbuild/SOURCES/
 +
 
 +
Edit '''rpmbuild/SPECS/gramps.spec''' using an editor you're familiar with. Change '''Version''' to the appropriate version number. Change '''Source0''' to point to your gramps-YYY.tar.gz. (This is probably done automatically if you changed '''Version''' correctly). To avoid confusing your private version with any official versions, add a unique tag to '''Release'''. For example, assume you are trying to build Gramps 8.24 using unique tag '''mine''', and you have copied gramps-8.24.tar.gz to the SOURCES directory, the first lines of the SPEC file should be like this:
 +
Name:          gramps
 +
Version:        8.24
 +
Release:        1mine%{?dist}
 +
...
 +
URL:            http://gramps.sourceforge.net/
 +
Source0:        http://download.sourceforge.net/%{name}/%{name}-%{version}.tar.gz
 +
 
 +
More information on the SPEC file can be found in the next section, 'To build an RPM from SVN'.
 +
 
 +
Save the SPEC file and try to build the kit:
 +
rpmbuild -ba ~/rpmbuild/SPECS/gramps.spec
 +
 
 +
It may need some additional tweaking before the build terminates correctly.
  
 
=== Problems with the build ===
 
=== Problems with the build ===
Line 37: Line 54:
 
Missing dependencies: These dependencies may be related to the build environment (have you built packages from source, on this machine, before?)
 
Missing dependencies: These dependencies may be related to the build environment (have you built packages from source, on this machine, before?)
  
In addition to the normal build tools, these additional packages are needed to build the gramps rpm: desktop-file-utils, gettext, perl-XML-Parser, gnome-python2-canvas, gnome-python2-gconf, gnome-vfs2-devel, pygtk2-libglade, python-devel, scrollkeeper, and gnome-doc-utils
+
In addition to the normal build tools, these additional packages are needed to build the gramps RPM: desktop-file-utils, gettext, perl-XML-Parser, gnome-python2-canvas, gnome-python2-gconf, gnome-vfs2-devel, pygtk2-libglade, python-devel, scrollkeeper, and gnome-doc-utils
  
 
Build errors: such as ''unpackaged files'' etc: The remedy for any of these errors will vary depending on circumstances, ie; there are no easy answers.  '''Read the error message carefully''', copy a relevant part of the message string, and search the net. The chances are very good that the problem has been encountered before and a solution exists. If that fails and you're still keen,  try the [http://sourceforge.net/mail/?group_id=25770|gramps mailing lists.]
 
Build errors: such as ''unpackaged files'' etc: The remedy for any of these errors will vary depending on circumstances, ie; there are no easy answers.  '''Read the error message carefully''', copy a relevant part of the message string, and search the net. The chances are very good that the problem has been encountered before and a solution exists. If that fails and you're still keen,  try the [http://sourceforge.net/mail/?group_id=25770|gramps mailing lists.]
  
*adding the following line on top of the spec file, /usr/src/redhat//SPEC/gramps.spec: ''%define _unpackaged_files_terminate_build 0'' is a temporary solution provided from the  [http://www.rpm.org/hintskinks/unpackaged-files/|rpm.org] lists. Remember, the file will still need packaging, the difference is the build will complete, or the next error will abort it. You'll just be a step closer to knowing how to fix it, or phrasing the question ;-)
+
= To build an RPM from SVN =
 
 
= To build an rpm from SVN =
 
  
 
'''Caveat emptor:'''
 
'''Caveat emptor:'''
  
*Some assumptions have been made here, the prime one being that you have any needed devel packages installed, and therefore a system that can actually build from source. If you don't have one - yet - then continue on and hopefully your system will give enough clues so that you can get to the final stage, and build an rpm. (Ah! and please update this page to suit, or notify the mailing list).
+
*Some assumptions have been made here, the prime one being that you have any needed devel packages installed, and therefore a system that can actually build from source. If you don't have one - yet - then continue on and hopefully your system will give enough clues so that you can get to the final stage, and build an RPM. ({{man menu|Ah! and please update this page to suit, or notify the mailing list}}).
*A secondary assumption is that your happy to install '''over''' your existing gramps installation? This is the SVN (bleeding edge) package and things may break. The flip side to that problem is that once they're reported they'll be fixed and goodness will prevail!
+
*A secondary assumption is that your happy to install '''over''' your existing Gramps installation? This is the SVN (bleeding edge) package and things may break. The flip side to that problem is that once they're reported they'll be fixed and goodness will prevail!
*And with that in mind, '''backup''' your database first. '''Don't work on that which is irreplacable.'''  
+
*And with that in mind, '''backup''' your database first. '''Don't work on that which is irreplaceable.'''  
 
**Happy Bug Hunting!
 
**Happy Bug Hunting!
  
If this is the first build on this machine then the following installation may be required, to install the build environment in the users directory.
+
If this is the first build on this machine then install the build environment in the users directory, as described in the previous section.
'''su -c 'yum install rpmdevtools''''
 
  
then login as a 'normal' user and run '''rpmdev-setuptree'''  . This will silently create the 'rpmbuild/' tree in the users home directory (instead of using ''usr/src/redhat''). In addition the dependencies listed above (under 'Problems with the build' need to be installed. Once this is done the gramps build can proceed.
+
The following acts out the build process for the (imaginary) 8.25 pre-release from SVN.
  
The following acts out the build process for the 2.2.5 pre-release from SVN.
+
svn co https://gramps.svn.sourceforge.net/svnroot/gramps/branches/gramps8
 +
mv gramps8 gramps-8.25 && cd gramps-8.25
 +
./autogen.sh
  
'''svn co https://gramps.svn.sourceforge.net/svnroot/gramps/branches/gramps22 '''
+
If this fails with ''which: no gnome-autogen.sh '' follow the advice and execute
  
'''mv gramps2 gramps-2.2.5 && cd gramps-2.2.5'''
+
su -c 'yum -y install gnome-common
 
 
'''./autogen.sh'''
 
 
 
If this fails with ''which: no gnome-autogen.sh '' follow the advice and execute
 
'''su -c 'yum -y install gnome-common''''
 
  
 
If it again fails, but with...
 
If it again fails, but with...
Line 95: Line 106:
 
which I have so far ignored, with no ill effects.
 
which I have so far ignored, with no ill effects.
  
The resulting directory now needs to be packaged as gramps-2.2.5.tar.gz
+
The resulting directory now needs to be packaged as gramps-8.25.tar.gz
 
 
'''cd ../'''
 
 
 
'''tar cvf - gramps-2.2.5 | gzip -f9 > gramps-2.2.5.tar.gz'''
 
 
 
'''mv gramps-2.2.5.tar.gz /home/<user>/rpmbuild/SOURCES/'''
 
  
'''cd /home/<user>/rpmbuild/'''
+
cd ..
 +
tar cvf - gramps-8.25 | gzip -f9 > gramps-8.25.tar.gz
 +
mv gramps-8.25.tar.gz ~/rpmbuild/SOURCES/
 +
cd ~rpmbuild/
 +
rpmbuild -bb SPECS/gramps.spec
  
'''su -c 'rpmbuild -bb SPECS/gramps.spec''''  where gramps spec is the following file.
+
An example gramps.spec is shown below. This one works for 3.0.1 on Fedora 8 and 9, it may not work on other versions/releases - whatever.  If it doesn't see above (ie: don't despair, go looking and try to solve the problem, if you succeed then modify the spec - both yours and the one on this page - to suit. If you don't succeed, then ask as per the suggestion above.)
  
But first a word about the spec file, this one works for 2.2.4 and 2.2.5 on fedora core 6, it may not work on other versions/releases - whatever.  If it doesn't see above (ie: don't despair, go looking and try to solve the problem, if you succeed then modify the spec - both yours and the one on this page - to suit. If you don't succeed, then ask as per the suggestion above.)
+
This spec file is a minor adaption of the one used by the fedora maintainers and has been extracted from the source file ''gramps-2.2.10-1.fc9.src.rpm''. It is worth looking for a more up to date file in newer src packages, if available.
This spec file is a minor adaption of the one used by the fedora extras maintainers and has been extracted from the source file ''gramps-2.2.4-3.fc7.src.rpm''. There may be a more up todate file in a newer src package?
 
  
 
<pre>
 
<pre>
Line 121: Line 129:
 
Source0:        http://download.sourceforge.net/%{name}/%{name}-%{version}.tar.gz
 
Source0:        http://download.sourceforge.net/%{name}/%{name}-%{version}.tar.gz
 
BuildRoot:      %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
 
BuildRoot:      %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
BuildArch: noarch
+
BuildArch:     noarch
Packager: Johan Vromans <[email protected]>
+
Packager:       Johan Vromans <[email protected]>
  
 
BuildRequires:  desktop-file-utils
 
BuildRequires:  desktop-file-utils
 
BuildRequires:  gettext
 
BuildRequires:  gettext
BuildRequires: perl(XML::Parser)
+
BuildRequires: perl(XML::Parser)
BuildRequires:  gnome-python2-canvas
 
BuildRequires:  gnome-python2-gconf
 
BuildRequires:  gnome-vfs2-devel
 
 
BuildRequires:  pygtk2-libglade
 
BuildRequires:  pygtk2-libglade
 
BuildRequires:  python-devel
 
BuildRequires:  python-devel
BuildRequires:  scrollkeeper
+
BuildRequires:  librsvg2-devel
BuildRequires: gnome-doc-utils
+
BuildRequires: intltool
  
Requires:      gnome-python2-canvas
+
Requires:      librsvg2
Requires:      gnome-python2-gconf
+
Requires:      freefont
Requires:      gnome-python2-gnomevfs
 
Requires:      gnome-python2
 
Requires: gnome-python2-gnomeprint
 
Requires: gnome-python2-gtkspell
 
Requires:      ImageMagick
 
Requires: freefont
 
 
Requires:      pygtk2
 
Requires:      pygtk2
 
Requires:      pygtk2-libglade
 
Requires:      pygtk2-libglade
 
Requires:      rcs
 
Requires:      rcs
Requires: python-reportlab
+
Requires:       graphviz
Requires: graphviz
+
Requires:       xdgutils
  
Requires(pre): GConf2
 
 
Requires(post): desktop-file-utils
 
Requires(post): desktop-file-utils
Requires(post): scrollkeeper
 
Requires(post): GConf2
 
Requires(preun):  GConf2
 
 
Requires(postun): desktop-file-utils
 
Requires(postun): desktop-file-utils
Requires(postun): scrollkeeper
 
  
  
 
%description
 
%description
 
gramps (Genealogical Research and Analysis Management Programming
 
gramps (Genealogical Research and Analysis Management Programming
System) is a GNOME based genealogy program supporting a Python
+
System) is a GTK based genealogy program supporting a Python
 
based plugin system.
 
based plugin system.
  
Line 191: Line 185:
 
%clean
 
%clean
 
rm -rf ${RPM_BUILD_ROOT}
 
rm -rf ${RPM_BUILD_ROOT}
 
 
%pre
 
if [ "$1" -gt 1 ]; then
 
    export GCONF_CONFIG_SOURCE=`gconftool-2 --get-default-source`
 
    gconftool-2 --makefile-uninstall-rule \
 
      %{_sysconfdir}/gconf/schemas/%{name}.schemas >/dev/null || :
 
fi
 
  
  
 
%post
 
%post
export GCONF_CONFIG_SOURCE=`gconftool-2 --get-default-source`
 
gconftool-2 --makefile-install-rule \
 
  %{_sysconfdir}/gconf/schemas/%{name}.schemas > /dev/null || :
 
scrollkeeper-update -q -o %{_datadir}/omf/%{name} || :
 
 
update-desktop-database &> /dev/null ||:
 
update-desktop-database &> /dev/null ||:
 
update-mime-database %{_datadir}/mime &> /dev/null || :
 
update-mime-database %{_datadir}/mime &> /dev/null || :
Line 213: Line 195:
 
fi
 
fi
  
 
%preun
 
if [ "$1" -eq 0 ]; then
 
    export GCONF_CONFIG_SOURCE=`gconftool-2 --get-default-source`
 
    gconftool-2 --makefile-uninstall-rule \
 
      %{_sysconfdir}/gconf/schemas/%{name}.schemas > /dev/null || :
 
fi
 
  
  
 
%postun
 
%postun
scrollkeeper-update -q || :
 
 
update-desktop-database &> /dev/null ||:
 
update-desktop-database &> /dev/null ||:
 
update-mime-database %{_datadir}/mime &> /dev/null || :
 
update-mime-database %{_datadir}/mime &> /dev/null || :
Line 430: Line 404:
 
</pre>
 
</pre>
  
To install the succesful build,  
+
To install the successful build, note the name of the noarch RPM that was written, and pass it to '''rpm -ivh''':
  
'''su -c 'yum localinstall /home/<user>/rpmbuild/RPMS/noarch/gramps-2.2.5-1.noarch.rpm''''
+
sudo rpm -ivh ~/rpmbuild/RPMS/noarch/gramps-ZZZZ.noarch.rpm
  
or perhaps use localupdate? (see '''man yum''')
+
'''ZZZZ''' will be something similar to 8.25-1mine.fc9, depending on the actual content of the '''Version''' and '''Release''' definitions from the SPEC file.
 
 
'''su -c 'yum localupdate /home/<user>/rpmbuild/RPMS/noarch/gramps-2.2.5-1.noarch.rpm''''
 
 
 
To bypass the signing process, '''temporarily''' change the contents of ''/etc/yum.conf'' to disable (0) the gpgcheck.
 
<pre>
 
#gpgcheck=1
 
gpgcheck=0
 
</pre>
 
and restore the file to its original state when finished.
 
  
 
= See also =
 
= See also =
Line 452: Line 417:
 
[http://fedoranews.org/tchung/rpmbuild/ HOWTO: How to create rpmbuild directory], and [http://myy.helia.fi/~karte/linux/doc/rpm-build-as-user.html RPM Building as a User]
 
[http://fedoranews.org/tchung/rpmbuild/ HOWTO: How to create rpmbuild directory], and [http://myy.helia.fi/~karte/linux/doc/rpm-build-as-user.html RPM Building as a User]
  
 +
* [https://www.centos.org/docs/5/html/Deployment_Guide-en-US/s1-rpm-using.html 10.2. Using RPM] -  CentOS
 +
 +
==See also==
 +
* [[Linux:Build from source]]
 +
* [[OpenSUSE RPM]]
  
 
[[Category:Developers/Installation]]
 
[[Category:Developers/Installation]]
 
[[Category:Developers/Packaging]]
 
[[Category:Developers/Packaging]]

Latest revision as of 00:38, 1 October 2021

Gramps-notes.png

This article's content is incomplete or a placeholder stub.
Please update or expand this section.


The installation page details how to download and install a working version of Gramps to your operating system of choice. For most users...

yum install gramps

will be all that is needed for the Fedora distribution. This page details a different method and is for those users wanting an alternative version of Gramps, this may be to test a SVN version or to install the latest stable version.

Development RPM

It may be possible that next to the standard Fedora RPM there's a newer version available for development testing.

Assuming you have an existing version of Gramps installed, you can try to install from the following repositories:

yum --enablerepo=updates-testing update gramps
yum --enablerepo=development update gramps

If you don't have any version installed, then use install instead of update.

For Fedora versions 6 and older, the development repository is called extras-development.

To build the RPM from source

An alternative approach to installing the binary RPM is to build the package from source, this will build Gramps using the package versions that you have installed. For this, you need the Gramps source kit and a so called SPEC file. It is usually easiest to download the most recent Gramps source RPM (SRPM) from the Fedora repositories, extract the SPEC file, adjust it for the new version, and try to build a new RPM.

To build the RPM

Always build packages as an ordinary user. Never use the root account for building packages. You have been warned!

Install the RPM build environment tools:

su -c 'yum install rpmdevtools'

Run rpmdev-setuptree . This will silently create the 'rpmbuild/' tree in the users home directory (instead of using usr/src/redhat)

Download the most recent source RPM from the Fedora repository, and install it.

rpm -iv gramps-XXX.src.rpm

Copy the most recent gramps source kit to the rpmbuild/SOURCES directory

cp gramps-YYY.tar.gz ~/rpmbuild/SOURCES/

Edit rpmbuild/SPECS/gramps.spec using an editor you're familiar with. Change Version to the appropriate version number. Change Source0 to point to your gramps-YYY.tar.gz. (This is probably done automatically if you changed Version correctly). To avoid confusing your private version with any official versions, add a unique tag to Release. For example, assume you are trying to build Gramps 8.24 using unique tag mine, and you have copied gramps-8.24.tar.gz to the SOURCES directory, the first lines of the SPEC file should be like this:

Name:           gramps
Version:        8.24
Release:        1mine%{?dist}
...
URL:            http://gramps.sourceforge.net/
Source0:        http://download.sourceforge.net/%{name}/%{name}-%{version}.tar.gz

More information on the SPEC file can be found in the next section, 'To build an RPM from SVN'.

Save the SPEC file and try to build the kit:

rpmbuild -ba ~/rpmbuild/SPECS/gramps.spec

It may need some additional tweaking before the build terminates correctly.

Problems with the build

The build may abort with an error.... Missing dependencies: These dependencies may be related to the build environment (have you built packages from source, on this machine, before?)

In addition to the normal build tools, these additional packages are needed to build the gramps RPM: desktop-file-utils, gettext, perl-XML-Parser, gnome-python2-canvas, gnome-python2-gconf, gnome-vfs2-devel, pygtk2-libglade, python-devel, scrollkeeper, and gnome-doc-utils

Build errors: such as unpackaged files etc: The remedy for any of these errors will vary depending on circumstances, ie; there are no easy answers. Read the error message carefully, copy a relevant part of the message string, and search the net. The chances are very good that the problem has been encountered before and a solution exists. If that fails and you're still keen, try the mailing lists.

To build an RPM from SVN

Caveat emptor:

  • Some assumptions have been made here, the prime one being that you have any needed devel packages installed, and therefore a system that can actually build from source. If you don't have one - yet - then continue on and hopefully your system will give enough clues so that you can get to the final stage, and build an RPM. (Ah! and please update this page to suit, or notify the mailing list).
  • A secondary assumption is that your happy to install over your existing Gramps installation? This is the SVN (bleeding edge) package and things may break. The flip side to that problem is that once they're reported they'll be fixed and goodness will prevail!
  • And with that in mind, backup your database first. Don't work on that which is irreplaceable.
    • Happy Bug Hunting!

If this is the first build on this machine then install the build environment in the users directory, as described in the previous section.

The following acts out the build process for the (imaginary) 8.25 pre-release from SVN.

svn co https://gramps.svn.sourceforge.net/svnroot/gramps/branches/gramps8
mv gramps8 gramps-8.25 && cd gramps-8.25
./autogen.sh

If this fails with which: no gnome-autogen.sh follow the advice and execute

su -c 'yum -y install gnome-common

If it again fails, but with...

checking for intltool >= 0.25...
  testing intltoolize... not found.
...
...
...
Checking for forbidden M4 macros...
***Error***: some autoconf macros required to build gramps
  were not found in your aclocal path, or some forbidden
  macros were found.  Perhaps you need to adjust your
  ACLOCAL_FLAGS?

then su -c 'yum -y install intltool'

In my case this succesfully ran to completion, except for the following suggestion

Please add the files
  codeset.m4 gettext.m4 glibc21.m4 iconv.m4 isc-posix.m4 lcmessage.m4
  progtest.m4
from the /usr/share/aclocal directory to your autoconf macro directory
or directly to your aclocal.m4 file.
You will also need config.guess and config.sub, which you can get from
ftp://ftp.gnu.org/pub/gnu/config/.

which I have so far ignored, with no ill effects.

The resulting directory now needs to be packaged as gramps-8.25.tar.gz

cd ..
tar cvf - gramps-8.25 | gzip -f9 > gramps-8.25.tar.gz
mv gramps-8.25.tar.gz ~/rpmbuild/SOURCES/
cd ~rpmbuild/
rpmbuild -bb SPECS/gramps.spec

An example gramps.spec is shown below. This one works for 3.0.1 on Fedora 8 and 9, it may not work on other versions/releases - whatever. If it doesn't see above (ie: don't despair, go looking and try to solve the problem, if you succeed then modify the spec - both yours and the one on this page - to suit. If you don't succeed, then ask as per the suggestion above.)

This spec file is a minor adaption of the one used by the fedora maintainers and has been extracted from the source file gramps-2.2.10-1.fc9.src.rpm. It is worth looking for a more up to date file in newer src packages, if available.

Name:           gramps
Version:        3.0.1
Release:        1jv%{?dist}
Summary:        Genealogical Research and Analysis Management Programming System

Group:          Applications/Productivity
License:        GPLv2+
URL:            http://gramps.sourceforge.net/
Source0:        http://download.sourceforge.net/%{name}/%{name}-%{version}.tar.gz
BuildRoot:      %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
BuildArch:      noarch
Packager:       Johan Vromans <[email protected]>

BuildRequires:  desktop-file-utils
BuildRequires:  gettext
BuildRequires:  perl(XML::Parser)
BuildRequires:  pygtk2-libglade
BuildRequires:  python-devel
BuildRequires:  librsvg2-devel
BuildRequires:  intltool

Requires:       librsvg2 
Requires:       freefont
Requires:       pygtk2
Requires:       pygtk2-libglade
Requires:       rcs
Requires:       graphviz
Requires:       xdgutils

Requires(post): desktop-file-utils
Requires(postun): desktop-file-utils


%description
gramps (Genealogical Research and Analysis Management Programming
System) is a GTK based genealogy program supporting a Python
based plugin system.


%prep
%setup -q


%build
%configure --disable-schemas-install --disable-scrollkeeper --disable-mime-install
make


%install
rm -rf ${RPM_BUILD_ROOT}
%makeinstall GNOME_DATADIR="${RPM_BUILD_ROOT}%{_datadir}"
#Remove duplicate doc
rm -f ${RPM_BUILD_ROOT}%{_datadir}/%{name}/COPYING

mkdir -p $RPM_BUILD_ROOT%{_datadir}/icons/hicolor/48x48/apps/
cp -p $RPM_BUILD_ROOT%{_datadir}/%{name}/images/%{name}.png $RPM_BUILD_ROOT%{_datadir}/icons/hicolor/48x48/apps/

%find_lang %{name}

desktop-file-install --vendor fedora --delete-original  \
  --dir ${RPM_BUILD_ROOT}%{_datadir}/applications   	\
  ${RPM_BUILD_ROOT}%{_datadir}/applications/%{name}.desktop


%clean
rm -rf ${RPM_BUILD_ROOT}


%post
update-desktop-database &> /dev/null ||:
update-mime-database %{_datadir}/mime &> /dev/null || :
touch --no-create %{_datadir}/icons/hicolor || :
if [ -x %{_bindir}/gtk-update-icon-cache ]; then
  %{_bindir}/gtk-update-icon-cache --quiet %{_datadir}/icons/hicolor || :
fi



%postun
update-desktop-database &> /dev/null ||:
update-mime-database %{_datadir}/mime &> /dev/null || :
touch --no-create %{_datadir}/icons/hicolor || :
if [ -x %{_bindir}/gtk-update-icon-cache ]; then
  %{_bindir}/gtk-update-icon-cache --quiet %{_datadir}/icons/hicolor || :
fi


%files -f %{name}.lang
%defattr(-,root,root,-)
%doc AUTHORS COPYING FAQ NEWS TODO
%{_bindir}/%{name}
%{_datadir}/%{name}/
%{_datadir}/applications/fedora-%{name}.desktop
%{_datadir}/application-registry/%{name}.applications
%{_datadir}/mime/packages/%{name}.xml
%{_datadir}/mime-info/*
%{_datadir}/icons/hicolor/48x48/apps/%{name}.png
%{_datadir}/icons/gnome/48x48/mimetypes/*.png
%{_datadir}/icons/gnome/scalable/mimetypes/*.svg
%{_datadir}/pixmaps/%{name}.png
%{_mandir}/man1/%{name}.1.gz


%changelog
* Thu Sep 18 2008 Johan Vromans <[email protected]> - 3.0.1-1jv
- Update to 3.0.1

* Mon Jan 14 2008 Brian Pepple <[email protected]> - 2.2.10-1
- Update to 2.2.10.

* Sun Oct 28 2007 Brian Pepple <[email protected]> - 2.2.9-1
- Update to 2.2.9.
- Update gtk icon scriptlet.

* Sun Aug  5 2007 Brian Pepple <[email protected]> - 2.2.8-5
- Update license tag.

* Sun Jun 10 2007 Brian Pepple <[email protected]> - 2.2.8-4
- Drop requires on yelp.

* Sat Jun  9 2007 Brian Pepple <[email protected]> - 2.2.8-3
- Remove depreciated desktop file categories, and add category on gtk.

* Sat Jun  9 2007 Brian Pepple <[email protected]> - 2.2.8-2
- Add requires on yelp. (#243399)

* Mon May 28 2007 Brian Pepple <[email protected]> - 2.2.8-1
- Update to 2.2.8.

* Fri May 18 2007 Brian Pepple <[email protected]> - 2.2.7-1
- Update to 2.2.7.

* Mon Jan 29 2007 Brian Pepple <[email protected]> - 2.2.6-1
- Update to 2.2.6.

* Sun Jan 28 2007 Brian Pepple <[email protected]> - 2.2.5-1
- Update to 2.2.5.

* Wed Dec 27 2006 Brian Pepple <[email protected]> - 2.2.4-3
- Add requires on gnome-python2-gtkspell & freefont.

* Tue Dec 26 2006 Brian Pepple <[email protected]> - 2.2.4-2
- Add gramp.png to files.

* Tue Dec 26 2006 Brian Pepple <[email protected]> - 2.2.4-1
- Update to 2.2.4.

* Fri Dec  8 2006 Brian Pepple <[email protected]> - 2.2.3-2
- Rebuild against new python.

* Mon Nov 27 2006 Brian Pepple <[email protected]> - 2.2.3-1
- Update to 2.2.3.
- Add scalable mimetype icons to files section.

* Sat Nov  4 2006 Brian Pepple <[email protected]> - 2.2.2-1
- Update to 2.2.2.
- Add scriptlet for gtk+ icon cache.
- Disable scrollkeeper & mime-install in configure.
- Simplify files since we are no longer ghosting *.pyo files.
- Drop X-Fedora desktop category.
- Add BR on gnome-doc-utils.

* Wed Sep  6 2006 Brian Pepple <[email protected]> - 2.0.11-5
- Don't ghost *.pyo files.

* Sat Sep  2 2006 Brian Pepple <[email protected]> - 2.0.11-4
- Rebuild for FC6.
- Remove requires on python, it's no longer needed.
- Use --disable-schemas-install to config.
- Add BR for perl(XML::Parser).

* Mon May  1 2006 Brian Pepple <[email protected]> - 2.0.11-3
- Update to 2.0.11.
- Drop INSTALL, README & ChangeLog documentation.
- Ghost .pyo files.

* Sat Mar 11 2006 Brian Pepple <[email protected]> - 2.0.10-3
- Remove Utility category from desktop file.
- Update scriptlets.

* Tue Feb 28 2006 Brian Pepple <[email protected]> - 2.0.10-2
- Update to 2.0.10.

* Thu Feb 16 2006 Brian Pepple <[email protected]> - 2.0.9-6
- Remove unnecessary BR (gnome-python2-gnomevfs, pygtk2, gnome-python2, GConf2). 

* Mon Feb 13 2006 Brian Pepple <[email protected]> - 2.0.9-5
- rebuilt for new gcc4.1 snapshot and glibc changes

* Sat Jan 28 2006 Brian Pepple <[email protected]> - 2.0.9-4
- Add require for shared-mime-info.
- Remove mime.cache.
- Use python-abi.

* Wed Dec 14 2005 Brian Pepple <[email protected]> - 2.0.9-3
- Add requires for gnome-python2-gnomeprint.

* Tue Dec 13 2005 Brian Pepple <[email protected]> - 2.0.9-2
- Make noarch. (#170974)
- Update to 2.0.9.

* Wed Sep  7 2005 Brian Pepple <[email protected]> - 2.0.8-2
- Update to 2.0.8.

* Wed Aug 17 2005 Brian Pepple <[email protected]> - 2.0.6-3
- Specify ver for python-reportlab.

* Mon Aug 15 2005 Brian Pepple <[email protected]> - 2.0.6-2
- Update to 2.0.6.
- Bump minimum ver for python.
- Add requires for python-reportlab & graphviz for reports.

* Wed Jul  6 2005 Brian Pepple <[email protected]> - 2.0.5-1
- Update to 2.0.5.

* Wed Jun 29 2005 Brian Pepple <[email protected]> - 2.0.4-1
- Update to 2.0.4.

* Sat Jun 18 2005 Brian Pepple <[email protected]> - 2.0.3-1
- Update to 2.0.3.
- Add dist tag.

* Sat May 21 2005 Brian Pepple <[email protected]> - 2.0.0-1
- Update to 2.0.0.
- Add mime info.
- Use more macros.

* Fri Apr  7 2005 Michael Schwendt <mschwendt[AT]users.sf.net>
- rebuilt

* Sun Feb 06 2005 Phillip Compton <pcompton[AT]proteinmedia.com - 1.0.10-1
- 1.0.10.

* Sun Nov 28 2004 Phillip Compton <pcompton[AT]proteinmedia.com - 1.0.8-3
- Version bump.

* Sat Nov 13 2004 Phillip Compton <pcompton[AT]proteinmedia.com - 1.0.8-0.fdr.2
- Spec cleanup.

* Sat Nov 06 2004 Phillip Compton <pcompton[AT]proteinmedia.com - 1.0.8-0.fdr.1
- 1.0.8.

* Wed Aug 18 2004 Phillip Compton <pcompton[AT]proteinmedia.com> - 0:1.0.7-0.fdr.1
- Update to 1.0.7.

* Sat Jul 31 2004 Phillip Compton <pcompton[AT]proteinmedia.com> - 0:1.0.5-0.fdr.1
- Update to 1.0.5.

* Wed Jul 21 2004 Phillip Compton <pcompton[AT]proteinmedia.com> - 0:1.0.4-0.fdr.1
- Update to 1.0.4.

* Thu Apr 22 2004 Phillip Compton <pcompton[AT]proteinmedia.com> - 0:1.0.3-0.fdr.1
- Update to 1.0.3.

* Tue Apr 20 2004 Phillip Compton <pcompton[AT]proteinmedia.com> - 0:1.0.2-0.fdr.2
- Dropped unneccessary BuildReqs.
- Removed Requires(foo,bar) notation.

* Tue Apr 13 2004 Phillip Compton <pcompton[AT]proteinmedia.com> - 0:1.0.2-0.fdr.1
- Update to 1.0.2.
- Using upstream desktop entry.

* Sat Feb 28 2004 Phillip Compton <pcompton[AT]proteinmedia.com> - 0:1.0.1.0-0.fdr.1
- Update to 1.0.1.

* Mon Jan 12 2004 Phillip Compton <pcompton[AT]proteinmedia.com> - 0:0.98.0-0.fdr.1
- Update to 0.98.0.

* Sat Nov 22 2003 Phillip Compton <pcompton[AT]proteinmedia.com> - 0:0.95-0.fdr.5
- dropped smp_mflags.

* Fri Nov 21 2003 Phillip Compton <pcompton[AT]proteinmedia.com> - 0:0.95-0.fdr.4
- Req gnome-python2.

* Mon Nov 17 2003 Phillip Compton <pcompton[AT]proteinmedia.com> - 0:0.95-0.fdr.3
- BuildReq gnome-python2.

* Mon Nov 10 2003 Phillip Compton <pcompton[AT]proteinmedia.com> - 0:0.95-0.fdr.2
- Modifications to desktop entry.
- Reqs ImageMagick and rcs.

* Fri Oct 10 2003 Phillip Compton <pcompton[AT]proteinmedia.com> - 0:0.95-0.fdr.1
- Initial RPM release.

To install the successful build, note the name of the noarch RPM that was written, and pass it to rpm -ivh:

sudo rpm -ivh ~/rpmbuild/RPMS/noarch/gramps-ZZZZ.noarch.rpm

ZZZZ will be something similar to 8.25-1mine.fc9, depending on the actual content of the Version and Release definitions from the SPEC file.

See also

An alternative? spec file dags spec - 2.2.3

To rpmbuild as non root HOWTO: How to create rpmbuild directory, and RPM Building as a User

See also