[BROTHER MFC240C] Erreur création [RÉSOLU]

Mise à jour / Création /debug de paquetages
Avatar de l’utilisateur
aramisqc
yeomen
Messages : 257
Inscription : lun. 11 févr. 2008, 22:03
Localisation : Québec, Canada

[BROTHER MFC240C] Erreur création [RÉSOLU]

Message par aramisqc »

Bonjour !

Tout néophyte de Archlinux que je suis, je ne veux absolument pas en rester à ce niveau. Je me suis donc hasardé à créer un paquetage pour installer une imprimante tout-en-un Brother MFC240-C.

Je me suis basé sur les sources disponibles ici : Le PKGBUILD résultant pour l'imprimante visée se lit ainsi :

Code : Tout sélectionner

# Contributor: Guy Fontaine <guy.fontaine@videotron.qc.ca>
# based on the brother-MFC210C package by Neil Drummond
pkgname="brother-mfc240c"
pkgver="1.0.1.1"
pkgrel="1"
pkgdesc="Brother CUPS driver: MFC-240C"
url="http://www.brother.com/"
license=('custom:Brother Industries')
depends=('tcsh' 'a2ps')
makedepends=('rpmextract')
#install="brother-mfc240c.install"
arch=('i686')

source=(
  brother-mfc240c.patch \
  http://solutions.brother.com/Library/sol/printer/linux/rpmfiles/cups_wrapper/mfc240ccupswrapper-1.0.1-1.i386.rpm \
  http://solutions.brother.com/Library/sol/printer/linux/rpmfiles/lpr_others/mfc240Clpr-1.0.1-1.i386.rpm
)

build()
{
  cd "$startdir/src" || return 1
  for n in *.rpm; do
    rpmextract.sh "$n" || return 1
  done 

  cd "$startdir/src/usr/" || return 1
  patch -p1 < ../brother-mfc240c.patch
  
  cd "$startdir/src" || return 1
  "$startdir/src/usr/local/Brother/cupswrapper/mfc240ccupswrapper-1.0.1-1"

  mkdir -p "$startdir/pkg/usr/share"
  cp -R "$startdir/src/usr/bin" "$startdir/pkg/usr"
  cp -R "$startdir/src/usr/lib" "$startdir/pkg/usr"
  cp -R "$startdir/src/usr/local/Brother" "$startdir/pkg/usr/share/brother"

  rm "$startdir/pkg/usr/share/brother/cupswrapper/mfc240ccupswrapper-1.0.1-1"
  rm "$startdir/pkg/usr/share/brother/inf/setupPrintcapij"

  install -m 644 -D ppd_file "$startdir/pkg/usr/share/cups/model/brmfc240c_cups.ppd"
  install -m 755 -D wrapper "$startdir/pkg/usr/lib/cups/filter/brlpdwrappermfc240c"
  
  #return 1
}       

Quand je l'exécute avec makepkg (en fakeroot), j'obtiens ce message d'erreur :

Code : Tout sélectionner

==> ERREUR: Il n'y a aucun agent configuré pour les URLs brother-mfc240c.patch. Vérifiez /etc/makepkg.conf.
Voilà bien ma veine ! Je ne sais pas du tout comment configurer cela. Un coup de pouce est très apprécié.

Vous noterez que j'ai mis install en commentaire. Je n'ai pas encore créé le post-install. Ce que je veux vérifier en premier est la création des paquets. Vous remarquerez aussi que j'ai inscrit mon nom en tant que «contributor». C'est tout simplement pour respecter le source original. Loin de moi l'idée de me prétendre «contributor».

aramisqc
Dernière modification par aramisqc le lun. 25 févr. 2008, 02:54, modifié 1 fois.
Avatar de l’utilisateur
lenglemetz
Chu Ko Nu
Messages : 307
Inscription : dim. 27 mai 2007, 22:26
Localisation : Marmande
Contact :

Message par lenglemetz »

tu as installé patch ?
[Thème] Sujet (état) |<
🇨🇵🎮 @donf_me • 🔥 StreaminG • La TeaM à DonF
Avatar de l’utilisateur
wain
Maître du Kyudo
Messages : 1854
Inscription : ven. 11 août 2006, 19:15
Localisation : Nancy (54)

Message par wain »

je pense que c'est juste le fichier "brother-mfc240c.patch" qui n'est pas présent dans le répertoire.
Vérifies aussi que dans ton /etc/makepkg.conf, tu as bien

Code : Tout sélectionner

DLAGENTS=('ftp::/usr/bin/wget -c --passive-ftp -t 3 --waitretry=3'
          'http::/usr/bin/wget -c -t 3 --waitretry=3'
          'https::/usr/bin/wget -c -t 3 --waitretry=3 --no-check-certificate'
          'rsync::/usr/bin/rsync -z'
          'scp::/usr/bin/scp -C')
Avatar de l’utilisateur
aramisqc
yeomen
Messages : 257
Inscription : lun. 11 févr. 2008, 22:03
Localisation : Québec, Canada

Message par aramisqc »

Merci pour le tuyau.

J'ai copié le patch et l'install. Je vais appliquer les modifications de manière à remplacer mfc210 par mfc240.

Si j'arrive à faire fonctionner l'imprimante dans Archlinux, je pourrai dire adieu à Debian sur le P4.

aramisqc
Avatar de l’utilisateur
aramisqc
yeomen
Messages : 257
Inscription : lun. 11 févr. 2008, 22:03
Localisation : Québec, Canada

Message par aramisqc »

Salut !

Il y a du progrès. Le makepkg va plus loin. Il plante avec une erreur de compilation. Je sais que c'est une question de référence à un dossier, mais je ne sais trop comment corriger le tout. Cela doit avoir un rapport avec la syntaxe ../ de la ligne 27 du PKGBUILD. Les .. doivent indiquer à l'utilitaire de remonter de deux niveaux.

Le message d'erreur :
PKGBUILD: line 27: patch: command not found
PKGBUILD: line 30: /home/fonguy21/pkgbuild/brothermfc240c/src/usr/local/Brother/cupswrapper/mfc240ccupswrapper-1.0.1-1: Aucun fichier ou répertoire de ce type
cp: ne peut évaluer `/home/fonguy21/pkgbuild/brothermfc240c/src/usr/lib': Aucun fichier ou répertoire de ce type
rm: ne peut enlever `/home/fonguy21/pkgbuild/brothermfc240c/pkg/usr/share/brother/cupswrapper/mfc240ccupswrapper-1.0.1-1': Aucun fichier ou répertoire de ce type
rm: ne peut enlever `/home/fonguy21/pkgbuild/brothermfc240c/pkg/usr/share/brother/inf/setupPrintcapij': Aucun fichier ou répertoire de ce type
install: ne peut évaluer `ppd_file': Aucun fichier ou répertoire de ce type
install: ne peut évaluer `wrapper': Aucun fichier ou répertoire de ce type
==> ERREUR: La compilation a échoué.
Abandon...
En tous les cas, voici la structure hiérarchique :
  • Les fichiers PKGBUILD, install et patch sont dans le dossier brothermfc240c
  • Ce dossier est dans /home/fonguy21/pkgbuild
Voici les sources :

PKGBUILD

Code : Tout sélectionner

# based on the brother-MFC210C package by Neil Drummond
pkgname="brother-mfc240c"
pkgver="1.0.1.1"
pkgrel="1"
pkgdesc="Brother CUPS driver: MFC-240C"
url="http://www.brother.com/"
license=('custom:Brother Industries')
depends=('tcsh' 'a2ps')
makedepends=('rpmextract')
install="brother-mfc240c.install"
arch=('i686')

source=(
  brother-mfc240c.patch \
  http://solutions.brother.com/Library/sol/printer/linux/rpmfiles/cups_wrapper/mfc240ccupswrapper-1.0.1-1.i386.rpm \
  http://solutions.brother.com/Library/sol/printer/linux/rpmfiles/lpr_others/mfc240clpr-1.0.1-1.i386.rpm
)

build()
{
  cd "$startdir/src" || return 1
  for n in *.rpm; do
    rpmextract.sh "$n" || return 1
  done 

  cd "$startdir/src/usr/" || return 1
  patch -p1 < ../brother-mfc240c.patch
  
  cd "$startdir/src" || return 1
  "$startdir/src/usr/local/Brother/cupswrapper/mfc240ccupswrapper-1.0.1-1"

  mkdir -p "$startdir/pkg/usr/share"
  cp -R "$startdir/src/usr/bin" "$startdir/pkg/usr"
  cp -R "$startdir/src/usr/lib" "$startdir/pkg/usr"
  cp -R "$startdir/src/usr/local/Brother" "$startdir/pkg/usr/share/brother"

  rm "$startdir/pkg/usr/share/brother/cupswrapper/mfc240ccupswrapper-1.0.1-1"
  rm "$startdir/pkg/usr/share/brother/inf/setupPrintcapij"

  install -m 644 -D ppd_file "$startdir/pkg/usr/share/cups/model/brmfc240c_cups.ppd"
  install -m 755 -D wrapper "$startdir/pkg/usr/lib/cups/filter/brlpdwrappermfc240c"
  
  #return 1
}       

md5sums=('309dc2a43705c9404fae083629af0f2e'
         '207cf1eb6bbab8d2ecafd8a2b5bc8f4b'
         'e2564327cb7fc6501ca9657080855322')
brothermfc20c.install

Code : Tout sélectionner

post_install() {
  __port2=`lpinfo -v | grep -i 'usb://Brother/MFC-240C' | head -1`
  if [ "$__port2" = '' ];then
          __port2=`lpinfo -v | grep 'usb://' | head -1`
  fi
  __port=`echo $__port2| sed s/direct//g`
  if [ "$__port" = '' ];then
          __port="usb:/dev/usb/lp0"
  fi

  lpadmin -p MFC240C -E -v $__port -P /usr/share/cups/model/MFC240C.ppd
  echo "If CUPS is not running now, start it after installation"
  echo "and type command:" 
  echo "  lpadmin -p MFC210C -E -v URL -P /usr/share/cups/model/MFC240C.ppd"
  echo "where URL can be found using command:"
  echo "  lpinfo -v | grep -i 'Brother'"
  echo "You can also register new printer using web interface at:"
  echo "  http://localhost:631/"
}

post_upgrade() {
  /bin/true
}

pre_remove() {
  lpadmin -x MFC240C
}


op=$1
shift

$op "$@"
brothermfc240c.patch

Code : Tout sélectionner

diff -ur old_usr/local/Brother/cupswrapper/cupswrapperMFC210C-1.0.0 usr/local/Brother/cupswrapper/mfc240ccupswrapper-1.0.1-1
--- old_usr/local/Brother/cupswrapper/mfc240ccupswrapper-1.0.1-1	2007-12-27 14:26:22.000000000 +0100
+++ usr/local/Brother/cupswrapper/mfc240ccupswrapper-1.0.1-1	2007-12-27 16:09:28.000000000 +0100
@@ -1,4 +1,4 @@
-#! /bin/csh
+#! /usr/bin/csh
 #
 # Brother Print filter
 # Copyright (C) 2004 Brother. Industries, Ltd.
@@ -18,19 +18,20 @@
 # Place, Suite 330, Boston, MA  02111-1307  USA
 #
 
-if("$1" == '-e')then
+if(false == true) then
+if("$1" == '-e') then
   lpadmin -x MFC240C
   rm -f /usr/share/cups/model/brmfc240c_cups.ppd
   rm -f /usr/lib/cups/filter/brlpdwrappermfc240C
   /etc/init.d/cups restart
   exit(0)
 endif
-if("$1" == "-r")then
+if("$1" == "-r") then
   lpadmin -x MFC240C
   /etc/init.d/cups restart
   exit(0)
 endif
-if($1 == "help" || $1 == "-h")then
+if($1 == "help" || $1 == "-h") then
   echo   'option -h : help'
   echo   '       -i : install'
   echo   '       -e : uninstall'
@@ -40,11 +41,12 @@
 mkdir -p /usr/local/Brother/filter
 mkdir -p /usr/lib/cups/filter
 
-if(!(-e "/usr/local/Brother/lpd/filterMFC240C"))then
+if(!(-e "/usr/local/Brother/lpd/filterMFC240C")) then
   echo "ERROR : Brother LPD filter is not installed."
 endif
 rm -f /usr/share/cups/model/brmfc240c_cups.ppd
-set  ppd_file_name=/usr/share/cups/model/brmfc240c_cups.ppd
+endif
+set  ppd_file_name=ppd_file
 
 echo '*PPD-Adobe: "4.3"'                                                                >>$ppd_file_name
 echo ''                                                                                 >>$ppd_file_name
@@ -609,10 +611,12 @@
 echo '*Font Germany: Standard "(001.005)" Standard ROM'                                 >>$ppd_file_name
 echo '*Font SanDiego: Standard "(001.005)" Standard ROM'                                >>$ppd_file_name
 echo '*Font US-Roman: Standard "(001.005)" Standard ROM'                                >>$ppd_file_name
-set  brotherlpdwrapper=/usr/lib/cups/filter/brlpdwrappermfc240C
+set  brotherlpdwrapper=wrapper
+if(false == true) then
 rm -f  $brotherlpdwrapper
 echo 'rm -f /usr/lib/cups/filter/brlpdwrappermfc240C'
-echo  '#! /bin/csh'  >>  $brotherlpdwrapper
+endif
+echo  '#! /usr/bin/csh'  >>  $brotherlpdwrapper
 echo  '#'  >>  $brotherlpdwrapper
 echo  '# Brother Print filter  '  >>  $brotherlpdwrapper
 echo  '# Copyright (C) 2004 Brother. Industries, Ltd.'  >>  $brotherlpdwrapper
@@ -1035,8 +1039,8 @@
 echo  '    echo "PPD  = $PPD"                                   >>$LOGFILE'  >>  $brotherlpdwrapper
 echo  'endif'  >>  $brotherlpdwrapper
 echo  ''  >>  $brotherlpdwrapper
-echo  'if(!(-e /usr/local/Brother/lpd/filterMFC240C)) then'  >>  $brotherlpdwrapper
-echo  '    echo "ERROR: /usr/local/Brother/lpd/filterMFC240C does not exist"                      >>$LOGFILE'  >>  $brotherlpdwrapper
+echo  'if(!(-e /usr/share/brother/lpd/filterMFC240C)) then'  >>  $brotherlpdwrapper
+echo  '    echo "ERROR: /usr/share/brother/lpd/filterMFC240C does not exist"                      >>$LOGFILE'  >>  $brotherlpdwrapper
 echo  '    set errorcode=30'  >>  $brotherlpdwrapper
 echo  '    exit $errorcode'  >>  $brotherlpdwrapper
 echo  'endif'  >>  $brotherlpdwrapper
@@ -1177,7 +1181,7 @@
 echo  ''  >>  $brotherlpdwrapper
 echo  ''  >>  $brotherlpdwrapper
 echo  'if($DEBUG < 10) then'  >>  $brotherlpdwrapper
-echo  '    cat    $INPUT_TEMP_PS | /usr/local/Brother/lpd/filterMFC240C'  >>  $brotherlpdwrapper
+echo  '    cat    $INPUT_TEMP_PS | /usr/share/brother/lpd/filterMFC240C'  >>  $brotherlpdwrapper
 echo  ''  >>  $brotherlpdwrapper
 echo  '    if($LOGLEVEL > 2) then'  >>  $brotherlpdwrapper
 echo  '	if($LOGFILE != "/dev/null") then'  >>  $brotherlpdwrapper
@@ -1194,6 +1198,7 @@
 echo  ''  >>  $brotherlpdwrapper
 echo  ''  >>  $brotherlpdwrapper
 echo  ''  >>  $brotherlpdwrapper
+if(false == true) then
 chmod a+x $brotherlpdwrapper
 chmod a+w /usr/local/Brother/inf/brMFC240Crc
 chmod a+w /usr/local/Brother/inf
@@ -1206,4 +1211,5 @@
 /etc/init.d/cups restart
 sleep 2s
 lpadmin -p MFC240C -E -v usb:/dev/usb/lp0 -m brmfc240c_cups.ppd
+endif
   exit(0)
Only in usr/local/Brother/lpd: .filterMFC240C.swp
diff -ur old_usr/local/Brother/lpd/filterMFC240C usr/local/Brother/lpd/filterMFC240C
--- old_usr/local/Brother/lpd/filterMFC240C	2007-12-27 14:26:22.000000000 +0100
+++ usr/local/Brother/lpd/filterMFC240C	2007-12-27 16:30:31.000000000 +0100
@@ -21,7 +21,7 @@
 PRINTER="MFC240C"
 PRINTER_TMP=$(echo $PRINTER | sed -e 's/ //g' -e 's/-//g')
 
-BR_PRT_PATH=/usr/local/Brother/
+BR_PRT_PATH=/usr/share/brother
 RCFILE=`eval echo $BR_PRT_PATH/inf/brPRINTERrc | eval sed 's/PRINTER/"$PRINTER_TMP"/'`
 PAPER_INF=$BR_PRT_PATH/inf/paperinfij2
 PSCONV=$BR_PRT_PATH/lpd/psconvertij2
Avatar de l’utilisateur
lenglemetz
Chu Ko Nu
Messages : 307
Inscription : dim. 27 mai 2007, 22:26
Localisation : Marmande
Contact :

Message par lenglemetz »

cf mon premier post :p
[Thème] Sujet (état) |<
🇨🇵🎮 @donf_me • 🔥 StreaminG • La TeaM à DonF
Avatar de l’utilisateur
aramisqc
yeomen
Messages : 257
Inscription : lun. 11 févr. 2008, 22:03
Localisation : Québec, Canada

Message par aramisqc »

lenglemetz a écrit :cf mon premier post :p
Oups ! J'avais mal interprété. Je croyais que tu référais au .patch. J'ai installé patch. Maintenant ça donne une erreur de validation sur brother-mfc240c.patch.

Il doit y avoir une erreur dans mes md5sums. Je vais fouiller plus en profondeur.

Encore merci pour l'aide.

aramisqc
Avatar de l’utilisateur
aramisqc
yeomen
Messages : 257
Inscription : lun. 11 févr. 2008, 22:03
Localisation : Québec, Canada

Message par aramisqc »

Salut !

J'ai résolu le problème de l'imprimante. J'ai abandonné la création des paquets à la faveur d'un truc beaucoup plus simple.

Voir le post :

http://forums.archlinux.fr/post13416.html#13416

J'ai utilisé la procédure décrite dans ce tutoriel :

http://wiki.archlinux.org/index.php/Brother_MFC-440CN

L'imprimante MFC-440CN est dans la même catégorie que la MFC-240C. Évidemment j'ai utilisé les rpm de la MFC-240C.

L'imprimante fonctionne très bien. Reste à savoir si le même exercice avec le pilote BRSCAN2 donnera les mêmes résultats positifs pour la fonction scanner. Ça c'est une autre histoire et je reviendrai là-dessus plus tard.

Merci à mélodie pour le lien vers leu tutoriel.

aramisqc
Avatar de l’utilisateur
mélodie
Maître du Kyudo
Messages : 2784
Inscription : lun. 30 oct. 2006, 02:06
Localisation : Pyrénées

Message par mélodie »

aramisqc a écrit : Merci à mélodie pour le lien vers leu tutoriel.

aramisqc
De rien, je vais régulièrement voir leur wiki quand je ne trouve pas dans le nôtre, ils écrivent des tutos très détaillés et faciles à suivre à mon goût.
Répondre