Changes

Jump to: navigation, search

Fedora RPM

192 bytes removed, 00:38, 1 October 2021
no edit summary
{{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...
yum install gramps
will be all that is needed for the [httphttps://fedoraproject.org/wiki/ fedoraFedora] distribution. This page details a different method and is for those users wanting an alternative version of grampsGramps, 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.
= 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. This is not a supported method, ie: if it breaks the error may not be with gramps or the fedora To 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).RPM ==
= To '''Always 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 installedpackages as an ordinary user. The [http://download.fedora.redhat.com/pub/fedora/linux/extras/development/SRPMS/|SRPMS] directory contains Never use the source rpm root account for the latest development buildbuilding packages. Download this rpm, install it and build your own binary using the fedora release (in this case fc6) youYou have been warned!'''re running, as the build environment.
== To Install the RPM build the rpm as nonenvironment tools: su -root (recommended method) ==c 'yum install rpmdevtools'
Install Run '''rpmdev-setuptree''' . This will silently create the build environment 'rpmbuild/' tree in the users home directory.'''su -c 'yum install rpmdevtools(instead of using ''usr/src/redhat'')
Login as a 'normal' user Download the most recent source RPM from the Fedora repository, and run '''rpmdevinstall it. rpm -setuptree''' iv gramps-XXX. This will silently create the 'rpmbuild/' tree in the users home directory (instead of using ''usr/src/redhat'').rpm
Download Copy the most recent gramps source rpm, for this example it will be kit to the '''wget&nbsp;<nowiki>http://download.fedora.redhat.com/pub/fedora/linux/extras/development/SRPMS/gramps-2.2.4-3.fc7.src.rpm<rpmbuild/nowiki>SOURCES''' or use your browser on the [http://downloaddirectory cp gramps-YYY.fedoratar.redhat.com/pub/fedora/linux/extrasgz ~/developmentrpmbuild/SRPMSSOURCES/gramps-2.2.4-3.fc7.src.rpm link]
Edit '''rpmbuild --rebuild /SPECS/gramps-2.2spec''' using an editor you're familiar with.4Change '''Version''' to the appropriate version number. Change '''Source0''' to point to your gramps-3YYY.fc7tar.srcgz.rpm(This is probably done automatically if you changed '''Version' (additional packages may be required at this step - see ''Problems correctly). To avoid confusing your private version with the any official versions, add a unique tag to '''Release'''. For example, assume you are trying to buildGramps 8.24 using unique tag '''mine'' below)', 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''su . Save the SPEC file and try to build the kit: rpmbuild -c 'yum localinstall /home/<user>ba ~/rpmbuild/RPMS/noarchSPECS/gramps-2.2.4-3spec It may need some additional tweaking before the build terminates correctly.noarch.rpm'''' (use yum to install the rpm)
=== Problems with the build ===
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 rpmRPM: 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.]
*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 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 rpmRPM. ({{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 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 irreplacableirreplaceable.'''
**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, 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 following acts out the 'rpmbuild/' tree in build process for the users home directory (instead of using ''usr/src/redhat''imaginary)8. In addition the dependencies listed above (under 'Problems with the build' need to be installed. Once this is done the gramps build can proceed25 pre-release from SVN.
The following acts out the build process for the 2 svn co https://gramps.2svn.5 presourceforge.net/svnroot/gramps/branches/gramps8 mv gramps8 gramps-release from SVN8.25 && cd gramps-8.25 ./autogen.sh
If this fails with '''svn co httpswhich://svn.sourceforge.net/svnroot/gramps/trunk/gramps2 ''' '''mv gramps2 grampsno gnome-2.2autogen.5 && cd gramps-2.2.5'sh ''follow the advice and execute
'''./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...
which I have so far ignored, with no ill effects.
The resulting directory now needs to be packaged as gramps-28.2.5.tar.gz '''cd ../''' '''tar cvf - gramps-2.2.5 | gzip -f9 > gramps-2.2.5.tar.gz''' '''mv gramps-2.2.525.tar.gz /home/<user>/rpmbuild/SOURCES/'''
''' cd .. tar cvf - gramps-8.25 | gzip -f9 > gramps-8.25.tar.gz mv gramps-8.25.tar.gz ~/rpmbuild/homeSOURCES/<user> 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''su t despair, go looking and try to solve the problem, if you succeed then modify the spec -c 'rpmbuild both yours and the one on this page -bb SPECS/grampsto suit.specIf you don'''' where gramps spec is t succeed, then ask as per the following filesuggestion 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 extras maintainers and has been extracted from the source file ''gramps-2.2.410-31.fc7fc9.src.rpm''. There may be It is worth looking for a more up todate to date file in a newer src package?packages, if available.
<pre>
Name: gramps
Version: 23.20.51Release: 11jv%{?dist}
Summary: Genealogical Research and Analysis Management Programming System
Group: Applications/Productivity
License: GPLGPLv2+
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: noarchPackager: Johan Vromans <[email protected]>
BuildRequires: desktop-file-utils
BuildRequires: gettext
BuildRequires: perl(XML::Parser)BuildRequires: gnome-python2-canvasBuildRequires: gnome-python2-gconfBuildRequires: gnome-vfs2-devel
BuildRequires: pygtk2-libglade
BuildRequires: python-devel
BuildRequires: scrollkeeperlibrsvg2-develBuildRequires: gnome-doc-utils intltool
Requires: gnome-python2-canvaslibrsvg2 Requires: gnome-python2-gconfRequires: gnome-python2-gnomevfsRequires: gnome-python2Requires: gnome-python2-gnomeprintRequires: gnome-python2-gtkspellRequires: ImageMagickRequires: freefont
Requires: pygtk2
Requires: pygtk2-libglade
Requires: rcs
Requires: python-reportlab graphvizRequires: graphviz xdgutils
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
%description
gramps (Genealogical Research and Analysis Management Programming
System) is a GNOME GTK based genealogy program supporting a Python
based plugin system.
%clean
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
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 || :
if [ -x %{_bindir}/gtk-update-icon-cache ]; then %{_bindir}/gtk-update-icon-cache --quiet %{_datadir}/icons/hicolor || :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
scrollkeeper-update -q || :
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 COPYING-DOCS FAQ NEWS TODO
%{_bindir}/%{name}
%{_datadir}/%{name}/
%{_datadir}/applications/fedora-%{name}.desktop
%{_datadir}/application-registry/%{name}.applications
%{_datadir}/omf/%{name}/
%{_datadir}/mime/packages/%{name}.xml
%{_datadir}/mime-info/*
%{_datadir}/icons/gnome/scalable/mimetypes/*.svg
%{_datadir}/pixmaps/%{name}.png
%{_sysconfdir}/gconf/schemas/%{name}.schemas
%{_mandir}/man1/%{name}.1.gz
%{_datadir}/gnome/help/%{name}/
%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.
</pre>
To install the succesful successful build, note the name of the noarch RPM that was written, and pass it to '''rpm -ivh''':
'''su sudo rpm -c 'yum localinstall /home/<user>ivh ~/rpmbuild/RPMS/noarch/gramps-2.2.5-1ZZZZ.noarch.rpm''''
or perhaps use localupdate? (see '''man yumZZZZ''') '''su -c 'yum localupdate /home/<user>/rpmbuild/RPMS/noarch/gramps-2will be something similar to 8.2.525-11mine.noarch.rpmfc9, depending on the actual content of the '''VersionTo bypass the signing process, ''and 'temporarily''Release' change the contents of ''/etc/yum.conf'' to disable (0) the gpgcheck.<pre>#gpgcheck=1gpgcheck=0</pre>and restore definitions from the SPEC file to its original state when finished.
= See also =
[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/TutorialsInstallation]][[Category:Developers/Packaging]]
1,483
edits

Navigation menu