Nl:Fedora RPM

From Gramps
Revision as of 09:20, 23 April 2007 by Erikdr (talk | contribs)
Jump to: navigation, search

De installatie pagina toont hoe je een werkende versie van Gramps kunt downloaden en installeren in het OS van je keuze. Voor de meeste gebruikers zal...

yum install gramps

alles doen wat nodig is voor de fedora distributie.

Deze pagina geeft een volledig andere methode die kan gebruikt worden door die gebruikers die een alternatieve versie van GRAMPS verkiezen. Deze methode kan zowel gebruikt worden om de SVN-versie te testen of om de laatste stabiele versie (2.2.7) te installeren.

Ontwikkelings-rpm

Het is best mogelijk dat de http://download.fedora.redhat.com/pub/fedora/linux/extras/development/testing rpm] werkt bij de huidige kernversie van Fedora.


De fc7 rpm zal ook werken in fc6 met enkele aanpassingen. works on the current core version of Fedora. For example, the fc7 rpm will run on fc6, with a few small issues.

Dit werkt meestal, maar is zeker niet de aangewezen methode. Want wanneer er ergens een probleem zou optreden, is het moeilijk te achterhalen waar het probleem ligt: misschien niet bij 'GRAMPS of de fedora-build, maar in de verschillenen tussen de fedora-versies. Je bent du op jezelf aangewezen om het probleem op te lossen en indien je een programmafout rapporteert moet je zeker zijn dat deze fout niet te wijten is aan de versieverschillen. Verwar de ontwikkelaars niet met die problemen die ze zelf niet kunnen oplossen.

Stel je hebt een werkende versie van GRAMPS, dan kun jee de ontwikkelings-rpm voor fc6 als volgt bekomen...

yum --enablerepo=extras-development update gramps

heb je echter nog geen versie van GRAMPS doe dan ...

yum --enablerepo=extras-development install gramps

Met de verschijning van fc7 zullen de extra paketten niet meer in een aparte bibliotheek te vinden zijn. Waarschijnlijk moet je dus yum --enablerepo=development install gramps, of iets dergelijks doen.

Om via de broncode een rpm aan te maken

Een betere methode is om de binaire rpm vanaf de broncode te bouwen. Dit laat toe om gramps op te bouwen door gebruik te maken van de pakketversies die geïnstalleerd zijn. De map [1] bevat de bron-rpm van de laatste ontwikkelings-build. Download dus deze rpm, installeer deze en bouw je eigen binair pakket door gebruik te maken van de bouwomgeving van deze fedora-distributie( in dit geval fc6).

De rpm bouwen als non-root (aangewezen methode

Installeer de bouwomgeving in een map van een normale gebruiker. su -c 'yum install rpmdevtools'

Login als een 'normale' gebruiker en doe rpmdev-setuptree . Dit zal op de achtergrond een boomstructuur 'rpmbuild/' aanmaken in de thuismap van de gebruiker (anders zou deze boomstructuur aangemaakt worden in usr/src/redhat)

Download de bron-rpm. In dit voorbeeld zal dit wget http://download.fedora.redhat.com/pub/fedora/linux/extras/development/SRPMS/gramps-2.2.4-3.fc7.src.rpm zijn, of gebruik je browser link

rpmbuild --rebuild gramps-2.2.4-3.fc7.src.rpm (een bijkomend pakket is misschien vereist - zie Bouwproblemen onderaan)

su -c 'yum localinstall /home/<user>/rpmbuild/RPMS/noarch/gramps-2.2.4-3.noarch.rpm' (gebruik yum om de rpm te instaleeren)

Bouwproblemen

Het bouwen kan afgebroken worden op fouten.... Ontbrekende afhankelijke pakketten nodig: het kan zijn dat er pakketten ontbreken die essentieel zijn voor het bouwen (heb jae al paketten 'gebouwd' op deze computer?)

Bovenover de normale bouwpaketten zijn volgende bijkomende paketten strikt nodig om de gramps-rpm aan te maken: desktop-file-utils, gettext, perl-XML-Parser, gnome-python2-canvas, gnome-python2-gconf, gnome-vfs2-devel, pygtk2-libglade, python-devel, scrollkeeper, en 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

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


%description
gramps (Genealogical Research and Analysis Management Programming
System) is a GNOME 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}


%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 || :
%{_bindir}/gtk-update-icon-cache --quiet %{_datadir}/icons/hicolor || :


%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 || :
%{_bindir}/gtk-update-icon-cache --quiet %{_datadir}/icons/hicolor || :


%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/hicolor/48x48/apps/%{name}.png
%{_datadir}/icons/gnome/48x48/mimetypes/*.png
%{_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
* 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 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.

#gpgcheck=1
gpgcheck=0

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