Bonjour.

J'aimerai me faire un rpm de yum-presto avec la traduction (cela n'existe pas)

Je précise que c'est juste un test pour voir si je suis capable de le faire.

Les plugins de yum ne sont pas internationalisés, sauf yum-rhn-plugin.

je suis donc partie de ces plugins, et j'ai réussi à implémenter la traduction.

mais j'ai un soucis lors de la création du rpm:
[dominique@localhost ~]$ rpmbuild -ba rpmbuild/SPECS/yum-presto.spec
Exécution_de(%prep): /bin/sh -e /var/tmp/rpm-tmp.MZamwz
+ umask 022
+ cd /home/dominique/rpmbuild/BUILD
+ LANG=C
+ export LANG
+ unset DISPLAY
+ cd /home/dominique/rpmbuild/BUILD
+ rm -rf yum-presto-0.7.1
+ /usr/bin/bzip2 -dc /home/dominique/rpmbuild/SOURCES/yum-presto-0.7.1.tar.bz2
+ /bin/tar -xf -
+ STATUS=0
+ '[' 0 -ne 0 ']'
+ cd yum-presto-0.7.1
+ /bin/chmod -Rf a+rX,u+w,g-w,o-w .
+ exit 0
Exécution_de(%build): /bin/sh -e /var/tmp/rpm-tmp.5VfNmg
+ umask 022
+ cd /home/dominique/rpmbuild/BUILD
+ cd yum-presto-0.7.1
+ LANG=C
+ export LANG
+ unset DISPLAY
+ make -f Makefile.yum-presto
for d in po; do make PYTHON=python -C $d; [ $? = 0 ] || exit 1 ; done
make[1]: Entering directory `/home/dominique/rpmbuild/BUILD/yum-presto-0.7.1/po'
make[1]: Nothing to be done for `all'.
make[1]: Leaving directory `/home/dominique/rpmbuild/BUILD/yum-presto-0.7.1/po'
+ exit 0
Exécution_de(%install): /bin/sh -e /var/tmp/rpm-tmp.GBVjhX
+ umask 022
+ cd /home/dominique/rpmbuild/BUILD
+ '[' /home/dominique/rpmbuild/BUILDROOT/yum-presto-0.7.1-1.fc16.x86_64 '!=' / ']'
+ rm -rf /home/dominique/rpmbuild/BUILDROOT/yum-presto-0.7.1-1.fc16.x86_64
++ dirname /home/dominique/rpmbuild/BUILDROOT/yum-presto-0.7.1-1.fc16.x86_64
+ mkdir -p /home/dominique/rpmbuild/BUILDROOT
+ mkdir /home/dominique/rpmbuild/BUILDROOT/yum-presto-0.7.1-1.fc16.x86_64
+ cd yum-presto-0.7.1
+ LANG=C
+ export LANG
+ unset DISPLAY
+ rm -rf /home/dominique/rpmbuild/BUILDROOT/yum-presto-0.7.1-1.fc16.x86_64
+ make -f Makefile.yum-presto install VERSION=0.7.1-1.fc16 PREFIX=/home/dominique/rpmbuild/BUILDROOT/yum-presto-0.7.1-1.fc16.x86_64
for d in po; do make PYTHON=python -C $d; [ $? = 0 ] || exit 1 ; done
make[1]: Entering directory `/home/dominique/rpmbuild/BUILD/yum-presto-0.7.1/po'
make[1]: Nothing to be done for `all'.
make[1]: Leaving directory `/home/dominique/rpmbuild/BUILD/yum-presto-0.7.1/po'
for p in presto.py ; do \
        install -m 644 $p /home/dominique/rpmbuild/BUILDROOT/yum-presto-0.7.1-1.fc16.x86_64//usr/share/yum-plugins//$p; \
done
python -c "import compileall; compileall.compile_dir('/home/dominique/rpmbuild/BUILDROOT/yum-presto-0.7.1-1.fc16.x86_64//usr/share/yum-plugins/', 1, '', 1)"
Listing /home/dominique/rpmbuild/BUILDROOT/yum-presto-0.7.1-1.fc16.x86_64//usr/share/yum-plugins/ ...
Compiling /home/dominique/rpmbuild/BUILDROOT/yum-presto-0.7.1-1.fc16.x86_64//usr/share/yum-plugins/presto.py ...
for d in po; do make PYTHON=python PREFIX=`cd /home/dominique/rpmbuild/BUILDROOT/yum-presto-0.7.1-1.fc16.x86_64; pwd` -C $d install; [ $? = 0 ] || exit 1; done
make[1]: Entering directory `/home/dominique/rpmbuild/BUILD/yum-presto-0.7.1/po'
mkdir -p /home/dominique/rpmbuild/BUILDROOT/yum-presto-0.7.1-1.fc16.x86_64/usr/share
installing fr.gmo as /home/dominique/rpmbuild/BUILDROOT/yum-presto-0.7.1-1.fc16.x86_64/usr/share/locale/fr/LC_MESSAGES/yum-presto.mo
make[1]: Leaving directory `/home/dominique/rpmbuild/BUILD/yum-presto-0.7.1/po'
+ /usr/lib/rpm/find-lang.sh /home/dominique/rpmbuild/BUILDROOT/yum-presto-0.7.1-1.fc16.x86_64 yum-presto
+ /usr/lib/rpm/find-debuginfo.sh --strict-build-id /home/dominique/rpmbuild/BUILD/yum-presto-0.7.1
+ '[' noarch = noarch ']'
+ case "${QA_CHECK_RPATHS:-}" in
+ /usr/lib/rpm/check-buildroot
+ /usr/lib/rpm/redhat/brp-compress
+ /usr/lib/rpm/redhat/brp-strip-static-archive /usr/bin/strip
+ /usr/lib/rpm/brp-python-bytecompile /usr/bin/python 1
+ /usr/lib/rpm/redhat/brp-python-hardlink
+ /usr/lib/rpm/redhat/brp-java-repack-jars
Processing files: yum-presto-0.7.1-1.fc16.noarch
erreur: Fichier non trouvé par la substitution: /home/dominique/rpmbuild/BUILDROOT/yum-presto-0.7.1-1.fc16.x86_64/usr/lib/python2.7/site-packages/*
erreur: Fichier non trouvé par la substitution: /home/dominique/rpmbuild/BUILDROOT/yum-presto-0.7.1-1.fc16.x86_64/usr/lib/yum-plugins/presto.py*
Exécution_de(%doc): /bin/sh -e /var/tmp/rpm-tmp.3TMuSE
+ umask 022
+ cd /home/dominique/rpmbuild/BUILD
+ cd yum-presto-0.7.1
+ DOCDIR=/home/dominique/rpmbuild/BUILDROOT/yum-presto-0.7.1-1.fc16.x86_64/usr/share/doc/yum-presto-0.7.1
+ export DOCDIR
+ /bin/mkdir -p /home/dominique/rpmbuild/BUILDROOT/yum-presto-0.7.1-1.fc16.x86_64/usr/share/doc/yum-presto-0.7.1
+ cp -pr README /home/dominique/rpmbuild/BUILDROOT/yum-presto-0.7.1-1.fc16.x86_64/usr/share/doc/yum-presto-0.7.1
+ cp -pr COPYING /home/dominique/rpmbuild/BUILDROOT/yum-presto-0.7.1-1.fc16.x86_64/usr/share/doc/yum-presto-0.7.1
+ cp -pr ChangeLog /home/dominique/rpmbuild/BUILDROOT/yum-presto-0.7.1-1.fc16.x86_64/usr/share/doc/yum-presto-0.7.1
+ exit 0


Erreur de construction de RPM:
    Fichier non trouvé par la substitution: /home/dominique/rpmbuild/BUILDROOT/yum-presto-0.7.1-1.fc16.x86_64/usr/lib/python2.7/site-packages/*
    Fichier non trouvé par la substitution: /home/dominique/rpmbuild/BUILDROOT/yum-presto-0.7.1-1.fc16.x86_64/usr/lib/yum-plugins/presto.py*
[dominique@localhost ~]$ 
le fichier yum-presto.spec:
%{!?python_sitelib: %define python_sitelib %(%{__python} -c "from distutils.sysconfig import get_python_lib; print get_python_lib()")}

Summary: Presto plugin for yum
Name: yum-presto
Version: 0.7.1
Release: 1%{?dist}
License: GPLv2+
Group: Development/Tools
Source: http://www.lesbg.com/jdieter/presto/%{name}-%{version}.tar.bz2
URL: http://www.lesbg.com/jdieter/presto/
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
BuildArch: noarch
BuildRequires: python-setuptools-devel
BuildRequires: intltool
BuildRequires: gettext
Requires: python >= 2.4, yum >= 3.0, deltarpm >= 3.4-2

%description
Yum-presto is a plugin for yum that looks for deltarpms rather than rpms
whenever they are available.  This has the potential of saving a lot of
bandwidth when downloading updates.

A Deltarpm is the difference between two rpms.  If you already have foo-1.0
installed and foo-1.1 is available, yum-presto will download the deltarpm
for foo-1.0 => 1.1 rather than the full foo-1.1 rpm, and then build the full 
foo-1.1 package from your installed foo-1.0 and the downloaded deltarpm.

%prep
%setup -q

%build
make -f Makefile.yum-presto

%install
rm -rf $RPM_BUILD_ROOT
make -f Makefile.yum-presto install VERSION=%{version}-%{release} PREFIX=$RPM_BUILD_ROOT

%find_lang %{name}

%clean
rm -rf $RPM_BUILD_ROOT

%files -f %{name}.lang
%defattr(-,root,root,-)
%doc README 
%doc COPYING
%doc ChangeLog
%{python_sitelib}/*
/usr/lib/yum-plugins/presto.py*
%config(noreplace) %{_sysconfdir}/yum/pluginconf.d/presto.conf

%changelog
* Fri Oct 14 2011 Jonathan Dieter <jdieter@lesbg.com> - 0.7.1-1
- Fix display bug when presto removes one deltarpm when running yum clean all
  (#735649)
............................................................................................
Je n'ai pas mis tous les changelog, ce n'est pas ça qui pose problème

Dons je suis bloqué et je ne comprend pas cette erreur :
Erreur de construction de RPM:
    Fichier non trouvé par la substitution: /home/dominique/rpmbuild/BUILDROOT/yum-presto-0.7.1-1.fc16.x86_64/usr/lib/python2.7/site-packages/*
    Fichier non trouvé par la substitution: /home/dominique/rpmbuild/BUILDROOT/yum-presto-0.7.1-1.fc16.x86_64/usr/lib/yum-plugins/presto.py*
Une aide serai la bienvenue (cela fait 3 jours que je cherche...)
Re...
Bon j'ai trouvé ce qui ne fonctionnai pas.

Voici le nouveau spec :
Summary: Presto plugin for yum
Name: yum-presto
Version: 0.7.1
Release: 2%{?dist}
License: GPLv2+
Group: Development/Tools
Source: http://www.lesbg.com/jdieter/presto/%{name}-%{version}.tar.bz2
URL: http://www.lesbg.com/jdieter/presto/
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
BuildArch: noarch
BuildRequires: python-setuptools-devel
BuildRequires: intltool
BuildRequires: gettext
Requires: python >= 2.4, yum >= 3.0, deltarpm >= 3.4-2

%description
Yum-presto is a plugin for yum that looks for deltarpms rather than rpms
whenever they are available.  This has the potential of saving a lot of
bandwidth when downloading updates.

A Deltarpm is the difference between two rpms.  If you already have foo-1.0
installed and foo-1.1 is available, yum-presto will download the deltarpm
for foo-1.0 => 1.1 rather than the full foo-1.1 rpm, and then build the full 
foo-1.1 package from your installed foo-1.0 and the downloaded deltarpm.

%prep
%setup -q

%build
make -f Makefile.yum-presto

%install
rm -rf $RPM_BUILD_ROOT
make -f Makefile.yum-presto install VERSION=%{version}-%{release} PREFIX=$RPM_BUILD_ROOT

%find_lang %{name}

%clean
rm -rf $RPM_BUILD_ROOT

%files -f %{name}.lang
%defattr(-,root,root,-)
%doc README 
%doc COPYING
%doc ChangeLog
%dir /var/lib/up2date
%{_datadir}/yum-plugins/presto.py*
%config(noreplace) %{_sysconfdir}/yum/pluginconf.d/presto.conf

%changelog
* Fri Mar 01 2012 Dominique Bribanick <chepioq@gmail.com> - 0.7.1-2
- Internatiolization yum-presto 

* Fri Oct 14 2011 Jonathan Dieter <jdieter@lesbg.com> - 0.7.1-1
- Fix display bug when presto removes one deltarpm when running yum clean all
  (#735649)

* Thu Jul  7 2011 Jonathan Dieter <jdieter@lesbg.com> - 0.7.0-1
- Don't download prestodelta.xml when its size is larger than the updated rpms
- Only download prestodelta.xml when doing updates (#664864)
- Other small fixes (#572553, #677379, #678588)

* Tue Feb 08 2011 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.6.2-3
- Rebuilt for https://fedoraproject.org/wiki/Fedora_15_Mass_Rebuild

* Thu Jul 22 2010 David Malcolm <dmalcolm@redhat.com> - 0.6.2-2
- Rebuilt for https://fedoraproject.org/wiki/Features/Python_2.7/MassRebuild

* Thu Dec 10 2009 Jonathan Dieter <jdieter@lesbg.com> - 0.6.2-1
- Register package name with yum
- Remove multiple cleanup messages (#524633)

* Thu Sep 17 2009 Jonathan Dieter <jdieter@lesbg.com> - 0.6.1-1
- Fix bug in attempting to read deltainfo.xml

* Sat Sep 12 2009 Jonathan Dieter <jdieter@lesbg.com> - 0.6.0-1
- Change savings sentence to be more grammatically correct (#517014)
- Support reading deltainfo.xml files as well as prestodelta.xml
- Cleanup delta packages on yum clean all (#504854)

* Mon Jul 27 2009 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.5.0-2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_12_Mass_Rebuild

* Fri May  1 2009 Jonathan Dieter <jdieter@lesbg.com> - 0.5.0-1
- Remove patches (now upstream)
- Reduce summary to one-line sentence

* Thu Apr 30 2009 James Antill <james@fedoraproject.org> - 0.4.5-8
- Fix total for current filename (stupid python threading).

* Wed Apr 29 2009 James Antill <james@fedoraproject.org> - 0.4.5-7
- Fix total to not overflow into rebuild

* Tue Apr 28 2009 James Antill <james@fedoraproject.org> - 0.4.5-6
- Add total progress data to delta downloads
- Fix stats. to account for the fact not everything has a delta
- Allow delta downloads to be configurable on savings

* Sun Apr 26 2009 James Antill <james@fedoraproject.org> - 0.4.5-5
- Added cleanup patch from upstream.
- Adds progress for rebuilding.

* Wed Mar 11 2009 James Antill <james@fedoraproject.org> - 0.4.5-4
- Added speedup patch from upstream.

* Wed Feb 25 2009 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.4.5-3
- Rebuilt for https://fedoraproject.org/wiki/Fedora_11_Mass_Rebuild

* Sat Nov 29 2008 Ignacio Vazquez-Abrams <ivazqueznet+rpm@gmail.com> - 0.4.5-2
- Rebuild for Python 2.6

* Thu Apr 10 2008 Jonathan Dieter <jdieter@lesbg.com> - 0.4.5-1
- Fix bug in showing savings

* Mon Apr  7 2008 Jonathan Dieter <jdieter@lesbg.com> - 0.4.4-1
- Show savings
- Use setuptools for installation
- Get Python Egg stuff working for F9

* Sat Nov 17 2007 Jonathan Dieter <jdieter@lesbg.com> - 0.4.3-1
- Fix README so it is now accurate for 0.4.x
- Fix a small bug that caused AVC denials when SELinux is enabled

* Fri Sep 28 2007 Jonathan Dieter <jdieter@lesbg.com> - 0.4.2-1
- Fix a couple of typos that caused yum to hang if certain error paths were
  hit.

* Sun Aug  5 2007 Jonathan Dieter <jdieter@lesbg.com> - 0.4.1-1
- Applied small patch by Luke Macken to fix problems when not run directly
  from yum.
- Fix for situation where repository may be removed and then added again

* Wed Jul 11 2007 Jonathan Dieter <jdieter@lesbg.com> - 0.4.0-1
- Complete rewrite (thanks, Jeremy)
- Many features removed in preparation for inclusion in Fedora 8

* Tue May  1 2007 Jonathan Dieter <jdieter@lesbg.com> - 0.3.10-1
- Use new -a option to deltarpm to only check against a certain architecture.
  This allows us to work completely correctly on x86_64.
- Add "*" to repository of deltarpm as it *doesn't* screw up depsolving.

* Sun Apr 15 2007 Jonathan Dieter <jdieter@lesbg.com> - 0.3.9-1
- Modifications to make yum-presto compatible with both FC6 and Rawhide
- Many other bugfixes - see ChangeLog

* Fri Apr  6 2007 Jonathan Dieter <jdieter@lesbg.com> - 0.3.8-1
- Small bugfix

* Thu Apr  5 2007 Jonathan Dieter <jdieter@lesbg.com> - 0.3.7-1
- Conf file cleanup

* Thu Apr  5 2007 Jonathan Dieter <jdieter@lesbg.com> - 0.3.6-1
- Housecleaning in preparation for Extras

* Wed Apr  4 2007 Jonathan Dieter <jdieter@lesbg.com> - 0.3.5-1
- Fix many small bugs
- Improve logging
- Use full path to yum-plugins rather than macro to fix x86_64 bug

* Tue Apr  3 2007 Jonathan Dieter <jdieter@lesbg.com> - 0.3.4-1
- Build rpms in separate thread to help performance
- Fix miscellaneous spec file errors

* Fri Mar 30 2007 Jonathan Dieter <jdieter@lesbg.com> - 0.3.3-1
- Upstream changed way the presto.xml.gz stores sequence information

* Fri Mar 30 2007 Jonathan Dieter <jdieter@lesbg.com> - 0.3.2-2
- Take ownership of %%{_datadir}/presto

* Thu Mar 29 2007 Jonathan Dieter <jdieter@lesbg.com> - 0.3.2-1
- Changes to remove rpmlint complaints

* Thu Mar 29 2007 Jonathan Dieter <jdieter@lesbg.com> - 0.3.1-1
- Fix minor bug with importing public gpg keys.
- Update README

* Wed Mar 28 2007 Jonathan Dieter <jdieter@lesbg.com> - 0.3.0-1
- Take over downloading of deltarpms so we can fallback to
  yum if the building of the rpm fails.

* Mon Mar 26 2007 Jonathan Dieter <jdieter@lesbg.com> - 0.2.9-1
- Added logging to /var/log/presto.log
- Fixed crash bug
- Properly exit when unable to apply deltarpm
- Do a full (slow) MD5 check when checking to see if
  delta will apply cleanly

* Sat Mar 24 2007 Jonathan Dieter <jdieter@lesbg.com> - 0.2.3-1
- Rebase to upstream

* Fri Mar 23 2007 Jonathan Dieter <jdieter@lesbg.com> - 0.2.1-1
- Rebase to upstream

* Thu Mar 22 2007 Jonathan Dieter <jdieter@lesbg.com> - 0.2-1
- Initial release
J'ai bien obtenu un yum-presto-0.7.1-2.fc16.noarch.rpm que j'ai installé et qui fonctionne.

Les deux phrases que j'ai traduites dans le fichier fr.po sont bien affichées en français quand j'ai fait une mise à jour.

Il me reste plus qu'a faire la traduction complète.
Génial ça !
Par contre, peux-tu ouvrir un ticket sur le bugzilla (avec tes patchs) pour qu'ils l'ajoutent à transifex ?
Je ne sais pas si c'est la même équipe qui développe, mais pour yum notre correspondant c'est james (login bugzilla).

Merci !
15 jours plus tard
Bonjour,
Je remonte ce sujet, car même si la version que j'ai faite avec un makefile fonctionne sans soucis, cela n'a pas l'air d'être apprécié par le mainteneur de yum-presto, qui préférerait rester avec un setup.py.

J'ai trouvé un tuto pour cela : http://wiki.maemo.org/How_to_Internationalize_python_apps , et après pas mal de tentative, je pensai être arrivé à mes fins.

Malheureusement, après avoir installé le rpm que j'ai construit, yum me jette avec cette erreur : « L'extension « presto » ne peut pas être importé » (mais yum fonctionne quand même, c'est juste yum-presto qui ne se charge pas).

J'ai mis le rpm source en ligne sur le site du bugzilla https://bugzilla.redhat.com/show_bug.cgi?id=799500 , c'est l'attachement « yum-presto-0.7.1-2.test.fc16.src.rpm ».

La je suis bloqué et je ne vois pas ce qui peut clocher.

Si une bonne âme veut bien regarder et me dire ce qui ne va pas, d'avance merci.