[AUR] python2-xlrd(résolu)

Mise à jour / Création /debug de paquetages
0|*3|\||)00
Hankyu
Messages : 10
Inscription : dim. 03 juin 2012, 22:44

[AUR] python2-xlrd(résolu)

Message par 0|*3|\||)00 »

Bonjour,

je voudrai installer python2-xlrd, ce pkg est disponible sur AUR, mais est marqué out-of-date

voici le PKGBUILD:

Code : Tout sélectionner

# Maintainer:  tocer <tocer.deng@gmail.com>
# Contributor: Piotr Beling <qwak@stud.ics.p.lodz.pl>
# Contributor: Douglas Soares de Andrade <dsandrade@gmail.com>

pkgname=python2-xlrd
pkgver=0.7.1
pkgrel=1
pkgdesc="A library for developers to use to extract data from Microsoft Excel (tm) spreadsheet files."
url="http://www.lexicon.net/sjmachin/xlrd.htm"
depends=('python2')
conflicts=("python-xlrd")
source=(http://pypi.python.org/packages/source/x/xlrd/xlrd-$pkgver.tar.gz)
arch=('any')
license=('BSD')
md5sums=('d0439a7ad1ae583a6ba3942efd0189c8')

build() {
  cd $startdir/src/xlrd-$pkgver
  python2 setup.py install --root=$pkgdir
  sed -i '1i\#!/usr/bin/env python2' $pkgdir/usr/bin/runxlrd.py
  chmod 755 $pkgdir/usr/bin/runxlrd.py
}
dans le dernier commentaire en date il est dit:
It does not have to conflict with python-xlrd you just have to rename runxlrd.py to runxlrd2.py or runxlrd.py2 or runxlrd-python2 or whatever the only thing that matters is that it happens to exist for both versions^^
ma question est comment faire pour renommer runxlrd.py en runxlrd2.py ?

un simple mv avant le chmod ?
j'ai tenté de le renommer dans la ligne du sed et du chmod mais la compilation me retourne une erreur dans le build :

Code : Tout sélectionner

running install_scripts
creating /tmp/yaourt-tmp-steeve/aur-python2-xlrd/pkg/usr/bin
copying build/scripts-2.7/runxlrd.py -> /tmp/yaourt-tmp-steeve/aur-python2-xlrd/pkg/usr/bin
changing mode of /tmp/yaourt-tmp-steeve/aur-python2-xlrd/pkg/usr/bin/runxlrd.py to 755
running install_egg_info
Writing /tmp/yaourt-tmp-steeve/aur-python2-xlrd/pkg/usr/lib/python2.7/site-packages/xlrd-0.7.1-py2.7.egg-info
sed: impossible de lire /tmp/yaourt-tmp-steeve/aur-python2-xlrd/pkg/usr/bin/runxlrd2.py: Aucun fichier ou dossier de ce type
==> ERREUR : Une erreur s'est produite dans build().
    Abandon...
merci :chinois:
Dernière modification par 0|*3|\||)00 le lun. 04 juin 2012, 11:39, modifié 1 fois.
Avatar de l’utilisateur
FoolEcho
Maître du Kyudo
Messages : 10711
Inscription : dim. 15 août 2010, 11:48
Localisation : Basse-Normandie

Re: [AUR]python2-xlrd(en cours)

Message par FoolEcho »

0|*3|\||)00 a écrit :ma question est comment faire pour renommer runxlrd.py en runxlrd2.py ?

un simple mv avant le chmod ?
Un simple mv après le chmod.

Code : Tout sélectionner

mv $pkgdir/usr/bin/runxlrd.py  $pkgdir/usr/bin/runxlrd2.py
(pour info et pour pinailler, d'autant que ce n'est pas ton PKGBUILD, mais tout ce qui est dans build() devrait se trouver dans package(), $startdir ne s'utilise plus... :| )
«The following statement is not true. The previous statement is true.» :nage:
0|*3|\||)00
Hankyu
Messages : 10
Inscription : dim. 03 juin 2012, 22:44

Re: [AUR]python2-xlrd(en cours)

Message par 0|*3|\||)00 »

Merci FoolEcho,

j'ai fait le mv, mais du coup j'ai quand même le conflit avec python-xlrd :

Code : Tout sélectionner

recherche des conflits entre paquets...
:: python2-xlrd et python-xlrd sont en conflit. Supprimer python-xlrd ? [o/N]
du coup pour voir le "changing mode" (chmod) je l'ai mis avant, du coup le script d'install me renvoie à ma grande surprise:

Code : Tout sélectionner

running install_scripts
creating /home/steeve/xlrd/pkg/usr/bin
copying build/scripts-2.7/runxlrd.py -> /home/steeve/xlrd/pkg/usr/bin
changing mode of /home/steeve/xlrd/pkg/usr/bin/runxlrd.py to 755
running install_egg_info
Writing /home/steeve/xlrd/pkg/usr/lib/python2.7/site-packages/xlrd-0.7.1-py2.7.egg-info
==> Nettoyage de l'installation...
  -> Suppression des fichiers indésirables…
  -> Compression des pages de man/info...
  -> Nettoyage des symboles inutiles dans les fichiers binaires et les bibliothèques...
==> Création du paquet... 
  -> Génération du fichier .PKGINFO…
  -> Compression du paquet... 
==> Quitte l'environnement fakeroot.
==> Création finie : python2-xlrd 0.7.1-1 (lun. juin  4 11:11:16 CEST 2012)
je parle surtout de la ligne:

Code : Tout sélectionner

changing mode of /home/steeve/xlrd/pkg/usr/bin/runxlrd.py to 755
alors que le PKGBUILD est le suivant:

Code : Tout sélectionner

# Maintainer:  tocer <tocer.deng@gmail.com>
# Contributor: Piotr Beling <qwak@stud.ics.p.lodz.pl>
# Contributor: Douglas Soares de Andrade <dsandrade@gmail.com>

pkgname=python2-xlrd
pkgver=0.7.1
pkgrel=1
pkgdesc="A library for developers to use to extract data from Microsoft Excel (tm) spreadsheet files."
url="http://www.lexicon.net/sjmachin/xlrd.htm"
depends=('python2')
conflicts=("python-xlrd")
source=(http://pypi.python.org/packages/source/x/xlrd/xlrd-$pkgver.tar.gz)
arch=('any')
license=('BSD')
md5sums=('d0439a7ad1ae583a6ba3942efd0189c8')

package() {
  cd $startdir/src/xlrd-$pkgver
  python2 setup.py install --root=$pkgdir
  sed -i '1i\#!/usr/bin/env python2' $pkgdir/usr/bin/runxlrd.py
  mv $pkgdir/usr/bin/runxlrd.py $pkgdir/usr/bin/runxlrd2.py
  chmod 755 $pkgdir/usr/bin/runxlrd2.py
}
en mettant le mv après le chmod, j'ai la même erreur
Avatar de l’utilisateur
FoolEcho
Maître du Kyudo
Messages : 10711
Inscription : dim. 15 août 2010, 11:48
Localisation : Basse-Normandie

Re: [AUR]python2-xlrd(en cours)

Message par FoolEcho »

Il faut également que tu modifies python2-xlrd en commentant la ligne (puisque maintenant les deux paquets sont censés ne plus être en conflit):
0|*3|\||)00 a écrit :

Code : Tout sélectionner

conflicts=("python-xlrd")
... question bête et qui n'a rien à voir avec ton souci: l'un tourne avec python3 et l'autre avec le 2, ou c'est juste que l'un est à jour et pas l'autre ? :|

EDIT: je me réponds: en fait le python-xlrd utilise aussi python2 (le paquet est construit avec python3 mais il y a des erreurs de syntaxe, "forcément" :? )... Du coup y a doublon ou ça n'est pas net en tous cas, l'auteur aurait mieux de supprimer ce paquet à mon avis (le "légal" pour des questions de nommage étant python2-xlrd)... et donc faire le mv ne donne pas grand-chose.
«The following statement is not true. The previous statement is true.» :nage:
0|*3|\||)00
Hankyu
Messages : 10
Inscription : dim. 03 juin 2012, 22:44

Re: [AUR]python2-xlrd(résolu)

Message par 0|*3|\||)00 »

Il n'y as pas de question bête, c'est le fait de ne pas posé de question qui est bête :wink:

donc oui, le deuxième tourne avec python3, et celui que je veux installer tourne avec python2

Excelent sinon, sa fonctionne comme un charme :D

encore merci :chinois:

(c'est vrais que j'aurai pus être plus attentif à la ligne directive conflict :roll: )
Avatar de l’utilisateur
FoolEcho
Maître du Kyudo
Messages : 10711
Inscription : dim. 15 août 2010, 11:48
Localisation : Basse-Normandie

Re: [AUR] python2-xlrd(résolu)

Message par FoolEcho »

0|*3|\||)00 a écrit :donc oui, le deuxième tourne avec python3, et celui que je veux installer tourne avec python2
... il y a des erreurs quand même à l'installation pour le python3, ça ne m'inspirerait pas trop... mais bon, peu importe, tu as ce que tu voulais. :chinois:
«The following statement is not true. The previous statement is true.» :nage:
Répondre