Difference between revisions of "Fedora rpm"

From Gramps
Jump to: navigation, search
Line 1: Line 1:
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

Revision as of 02:49, 23 April 2007

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 the rpm works on the current core version of Fedora. For example, the fc7 rpm will run on fc6, with a few small issues. 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).

Assuming you have an existing version of gramps installed, then to install the development rpm for fc6...

yum --enablerepo=extras-development update gramps

if you don't have any version installed, then install it using...

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.

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 [1] 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.

To build the rpm as non-root (recommended method)

Install the build environment in the users directory. 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)

Download the source rpm, for this example it will be wget http://download.fedora.redhat.com/pub/fedora/linux/extras/development/SRPMS/gramps-2.2.4-3.fc7.src.rpm or use your browser on the 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)

su -c 'yum localinstall /home/<user>/rpmbuild/RPMS/noarch/gramps-2.2.4-3.noarch.rpm' (use yum to install the rpm)

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.

  • 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 [2] 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

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 irreplacable.
    • 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. 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 2.2.5 pre-release from SVN.

svn co https://svn.sourceforge.net/svnroot/gramps/trunk/gramps2

mv gramps2 gramps-2.2.5 && cd gramps-2.2.5


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

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
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

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

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/

su -c 'rpmbuild -bb SPECS/gramps.spec' where gramps spec is the following file.

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 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?

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

Group:          Applications/Productivity
License:        GPL
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

BuildRequires:  desktop-file-utils
BuildRequires:  gettext
BuildRequires:	perl(XML::Parser)
BuildRequires:  gnome-python2-canvas
BuildRequires:  gnome-python2-gconf
BuildRequires:  gnome-vfs2-devel
BuildRequires:  pygtk2-libglade
BuildRequires:  python-devel
BuildRequires:  scrollkeeper
BuildRequires:	gnome-doc-utils

Requires:       gnome-python2-canvas
Requires:       gnome-python2-gconf
Requires:       gnome-python2-gnomevfs
Requires:       gnome-python2
Requires:	gnome-python2-gnomeprint
Requires:	gnome-python2-gtkspell
Requires:       ImageMagick
Requires:	freefont
Requires:       pygtk2
Requires:       pygtk2-libglade
Requires:       rcs
Requires:	python-reportlab
Requires:	graphviz

Requires(pre): 	GConf2
Requires(post): desktop-file-utils
Requires(post): scrollkeeper
Requires(post): GConf2
Requires(preun):  GConf2
Requires(postun): desktop-file-utils
Requires(postun): scrollkeeper

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

%setup -q

%configure --disable-schemas-install --disable-scrollkeeper --disable-mime-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   	\

rm -rf ${RPM_BUILD_ROOT}

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 || :

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-mime-database %{_datadir}/mime &> /dev/null || :
touch --no-create %{_datadir}/icons/hicolor || :
%{_bindir}/gtk-update-icon-cache --quiet %{_datadir}/icons/hicolor || :

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 || :

scrollkeeper-update -q || :
update-desktop-database &> /dev/null ||:
update-mime-database %{_datadir}/mime &> /dev/null || :
touch --no-create %{_datadir}/icons/hicolor || :
%{_bindir}/gtk-update-icon-cache --quiet %{_datadir}/icons/hicolor || :

%files -f %{name}.lang

* Wed Dec 27 2006 Brian Pepple <bpepple@fedoraproject.org> - 2.2.4-3
- Add requires on gnome-python2-gtkspell & freefont.

* Tue Dec 26 2006 Brian Pepple <bpepple@fedoraproject.org> - 2.2.4-2
- Add gramp.png to files.

* Tue Dec 26 2006 Brian Pepple <bpepple@fedoraproject.org> - 2.2.4-1
- Update to 2.2.4.

* Fri Dec  8 2006 Brian Pepple <bpepple@fedoraproject.org> - 2.2.3-2
- Rebuild against new python.

* Mon Nov 27 2006 Brian Pepple <bpepple@fedoraproject.org> - 2.2.3-1
- Update to 2.2.3.
- Add scalable mimetype icons to files section.

* Sat Nov  4 2006 Brian Pepple <bpepple@fedoraproject.org> - 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 <bpepple@fedoraproject.org> - 2.0.11-5
- Don't ghost *.pyo files.

* Sat Sep  2 2006 Brian Pepple <bpepple@fedoraproject.org> - 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 <bdpepple@ameritech.net> - 2.0.11-3
- Update to 2.0.11.
- Drop INSTALL, README & ChangeLog documentation.
- Ghost .pyo files.

* Sat Mar 11 2006 Brian Pepple <bdpepple@ameritech.net> - 2.0.10-3
- Remove Utility category from desktop file.
- Update scriptlets.

* Tue Feb 28 2006 Brian Pepple <bdpepple@ameritech.net> - 2.0.10-2
- Update to 2.0.10.

* Thu Feb 16 2006 Brian Pepple <bdpepple@ameritech.net> - 2.0.9-6
- Remove unnecessary BR (gnome-python2-gnomevfs, pygtk2, gnome-python2, GConf2). 

* Mon Feb 13 2006 Brian Pepple <bdpepple@ameritech.net> - 2.0.9-5
- rebuilt for new gcc4.1 snapshot and glibc changes

* Sat Jan 28 2006 Brian Pepple <bdpepple@ameritech.net> - 2.0.9-4
- Add require for shared-mime-info.
- Remove mime.cache.
- Use python-abi.

* Wed Dec 14 2005 Brian Pepple <bdpepple@ameritech.net> - 2.0.9-3
- Add requires for gnome-python2-gnomeprint.

* Tue Dec 13 2005 Brian Pepple <bdpepple@ameritech.net> - 2.0.9-2
- Make noarch. (#170974)
- Update to 2.0.9.

* Wed Sep  7 2005 Brian Pepple <bdpepple@ameritech.net> - 2.0.8-2
- Update to 2.0.8.

* Wed Aug 17 2005 Brian Pepple <bdpepple@ameritech.net> - 2.0.6-3
- Specify ver for python-reportlab.

* Mon Aug 15 2005 Brian Pepple <bdpepple@ameritech.net> - 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 <bdpepple@ameritech.net> - 2.0.5-1
- Update to 2.0.5.

* Wed Jun 29 2005 Brian Pepple <bdpepple@ameritech.net> - 2.0.4-1
- Update to 2.0.4.

* Sat Jun 18 2005 Brian Pepple <bdpepple@ameritech.net> - 2.0.3-1
- Update to 2.0.3.
- Add dist tag.

* Sat May 21 2005 Brian Pepple <bdpepple@ameritech.net> - 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:
- 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 succesful build,

su -c 'yum localinstall /home/<user>/rpmbuild/RPMS/noarch/gramps-2.2.5-1.noarch.rpm'

or perhaps use localupdate? (see man yum)

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.


and restore the file to its original state when finished.

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