Fedora RPM

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