[Risolto]Obexftp: errore di compilazione e utilizzo Obextool

Postate qui se avete consigli per migliorare i pacchetti disponibili in questo sito o se avete problemi con installazione, funzionamento o altro.

Moderatore: Staff

Regole del forum
1) Citare in modo preciso il nome del pacchetto.
2) Specificare se discussione/suggerimento o richiesta d'aiuto.
3) Leggere attentamente le risposte ricevute
4) Scrivere i messaggi con il colore di default, evitare altri colori.
5) Scrivere in Italiano o in Inglese, se possibile grammaticalmente corretto, evitate stili di scrittura poco chiari, quindi nessuna abbreviazione tipo telegramma o scrittura stile SMS o CHAT.
6) Appena registrati è consigliato presentarsi nel forum dedicato.

La non osservanza delle regole porta a provvedimenti di vari tipo da parte dello staff, in particolare la non osservanza della regola 5 porta alla cancellazione del post e alla segnalazione dell'utente. In caso di recidività l'utente rischia il ban temporaneo.
Rispondi
Bart
Staff
Staff
Messaggi: 4249
Iscritto il: lun 9 ago 2004, 0:00
Località: Rimini

[Risolto]Obexftp: errore di compilazione e utilizzo Obextool

Messaggio da Bart »

Ciao,
stavo cercando di creare i pacchetti obexftp e obextool per slackware current.

Obextool è un front-end per obexftp e per compilare necessita di queste dipendenze (cito il file INSTALL):
1 TCL/Tk version 8.x

2 The BWidget Toolkit
The BWidget library was originally developed by UNIFIX Online, and
released under both the GNU Public License and the Tcl license.
You may download it from http://sourceforge.net/projects/tcllib
or install it from your favourite freeware server or Linux distribution.

3 TableList, a multi-column listbox package written by
Csaba Nemethi <csaba.nemethi@t-online.de>
It is also part of the tklib package from
http://sourceforge.net/projects/tcllib.
ALternatively you may download it from http://www.nemethi.de
I've used Tablelist 4.2, but older and newer version should work also.

4 The ObexFTP program
You may download it from http://triq.net/obexftp, from OpenOBEX too
http://openobex.sourceforge.net/projects/openobex/
or install it from your favourite freeware server or Linux distribution.
Tested with ObexFTP 0.19.
Be sure to configure your wrapper script etc/obexwrap.sh or use the
correct commandline syntax for the --obexcmd command line option or
set the environent variable OBEXCMD to the corresponding value.


Il problema avviene in fase di compilazione di obexftp:

Codice: Seleziona tutto

creating Makefile
make -fMakefile.ruby
make[4]: Entering directory `/tmp/pkg/obexftp-0.22/swig/ruby'
gcc -I. -I/usr/include/ruby-1.9.1/i486-linux -I/usr/include/ruby-1.9.1/ruby/backward -I/usr/include/ruby-1.9.1 -I. -I../..  -D_FILE_OFFSET_BITS=64  -fPIC -O2 -march=i486 -mtune=i686 -O2 -g -Wall -Wno-parentheses  -fPIC  -o ruby_wrap.o -c ruby_wrap.c
ruby_wrap.c: In function '_wrap_Client_callback':
ruby_wrap.c:2109: warning: assignment makes pointer from integer without a cast
ruby_wrap.c: In function '_wrap_Client_get':
ruby_wrap.c:2413: warning: pointer targets in passing argument 1 of 'rb_str_new' differ in signedness
ruby_wrap.c: In function '_wrap_Client_list':
ruby_wrap.c:2448: warning: pointer targets in passing argument 1 of 'rb_str_new' differ in signedness
ruby_wrap.c: In function '_wrap_Client_get_capability':
ruby_wrap.c:2483: warning: pointer targets in passing argument 1 of 'rb_str_new' differ in signedness
ruby_wrap.c: In function '_wrap_Client_put_data':
ruby_wrap.c:2583: error: 'struct RString' has no member named 'len'
make[4]: *** [ruby_wrap.o] Error 1
make[4]: Leaving directory `/tmp/pkg/obexftp-0.22/swig/ruby'
make[3]: *** [obexftp.so] Error 2
make[3]: Leaving directory `/tmp/pkg/obexftp-0.22/swig/ruby'
make[2]: *** [all-recursive] Error 1
make[2]: Leaving directory `/tmp/pkg/obexftp-0.22/swig'
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory `/tmp/pkg/obexftp-0.22'
make: *** [all] Error 2
Le versioni testate sono la 0.22 e la 0.23 (l'ultima). Non ho trovato versioni più datate. Nel file INSTALL dicono di aver provato con la 0.19 ma non l'ho trovata. Non riesco a capire se è un baco o se è un errore di dipendenze.
Le dipendenze BWidget Toolkit e TableList sono contenute in un pacchetto chiamato tcllib che non ho capito se è già incluso nel pacchetto tcl installato su slackware 13.0. Qui viene riportato come un baco: http://bugs.gentoo.org/261736

Per completezza metto anche lo slackbuild:

Codice: Seleziona tutto

#!/bin/sh                                            
#                                                    
# SlackBuild for ObexFTP                             
# Heavily based on the Slackware 13.0 SlackBuild     

# Get current and temporary directories
CWD=`pwd`                              
if [ "$TMP" = "" ]; then               
 TMP=/tmp/pkg                          
fi                                     

# Set up working directories
if [ ! -d $TMP ]; then      
 mkdir -p $TMP              
fi                          

# Some useful variables about the package
NAME=obexftp                             
PKG=$TMP/package-$NAME                   
VERSION=0.22                             
ARCH=i686                                
BUILD=1lf                                
SOURCEARCH=$NAME-$VERSION                

# Print a welcome screen
echo "+----------------+"
echo "| $NAME-$VERSION |"
echo "+----------------+"

if [ -d $PKG ]; then
 # Clean up a previous build
 #rm -rf $PKG               
 #mkdir -p $PKG             
 echo "Previous package build directory found, please remove it and"
 echo "restart the SlackBuild script for: $PKG"                     
 exit 1                                                             
else                                                                
 mkdir -p $PKG                                                      
fi                                                                  

for i in
do      
        echo "--- Creating directory $PKG/$i"
        mkdir -p $PKG/$i                     
done                                         

# Decompress
echo "------------------------- Uncompressing source -------------------------"
cd $TMP                                                                        
tar xjvf $CWD/$SOURCEARCH.tar.bz2                                              
#mv $SOURCEARCH $NAME-$VERSION                                                 
cd $NAME-$VERSION                                                              

# Build
echo "------------------------------ Configuring -----------------------------"
CFLAGS="-O2 -march=i486 -mcpu=i686" \                                          
CXXFLAGS="-O2 -march=i486 -mcpu=i686" \                                        
        ./configure --prefix=/usr \                                            
        --sysconfdir=/etc \                                                    
        --localstatedir=/var                                                   

#echo "------------------------------- Patching -------------------------------"

echo "------------------------------ Compiling -------------------------------"
make                                                                           
res=$?                                                                         
if [ $res -ne 0 ]                                                              
then                                                                           
        # make failed, we cannot continue                                      
        exit $res                                                              
fi                                                                             

echo "------------------------------ Installing ------------------------------"
make install DESTDIR=$PKG                                                      
res=$?                                                                         
if [ $res -ne 0 ]                                                              
then                                                                           
        # make install failed, we cannot continue                              
        exit 1                                                                 
fi                                                                             

# Doc
echo "----------------- Copying documentation and other files ----------------"
mkdir -p $PKG/usr/doc/$NAME-$VERSION                                           
for i in AUTHORS ChangeLog COPYING INSTALL NEWS README* THANKS TODO            
do                                                                             
#        cat $i | gzip > $PKG/usr/doc/$NAME-$VERSION/$i.gz                     
        cp -a $i $PKG/usr/doc/$NAME-$VERSION/                                  
done                                                                           

# Fix broken doc installed
#mv $PKG/*.html $PKG/usr/doc/$NAME-$VERSION


# Gzip man pages
find $PKG/usr/man -name "*.[123456789]" -exec gzip -9 {} \;

# SlackBuild stuff
mkdir -p $PKG/usr/doc/$NAME-$VERSION/slackbuild
cp $CWD/$0 $CWD/slack-desc $PKG/usr/doc/$NAME-$VERSION/slackbuild


# Strip binaries
echo "--------------------------- Stripping binaries -------------------------"
find $PKG -type f | xargs file | grep ELF | cut -f 1 -d : | xargs strip --strip-unneeded

# Set permissions
echo "--------------------------- Setting permissions ------------------------"
chown -R root.bin $PKG/usr/bin # $PKG/usr/sbin                                 

chown -R root.root $PKG/usr/doc
chmod -R 755 $PKG/usr/doc/*    
find $PKG/usr/doc -type f -exec chmod 644 {} \;

if [ -d $PKG/usr/share ]
then
        chown -R root.root $PKG/usr/share
        chmod -R 755 $PKG/usr/share/*
        find $PKG/usr/share -type f -exec chmod 644 {} \;
fi

# Copy Slackware package files
echo "--------------------- Copying Slackware package files ------------------"
mkdir -p $PKG/install
cat $CWD/slack-desc > $PKG/install/slack-desc
#cat $CWD/slack-required > $PKG/install/slack-required

# Create package
echo "---------------------------- Creating package --------------------------"
echo "Creating package"
cd $PKG
makepkg -l y -c n $CWD/$NAME-$VERSION-$ARCH-$BUILD.txz

# Clean up
if [ "$1" = "--cleanup" ]; then
        echo "---------------------- Cleaning up working directory -------------------"
        rm -rf $TMP/$NAME-$VERSION
        rm -rf $PKG
fi

# Package created
echo "Package creation finished!"

Bart
Staff
Staff
Messaggi: 4249
Iscritto il: lun 9 ago 2004, 0:00
Località: Rimini

Re: Obexftp: errore di compilazione

Messaggio da Bart »

Allora, per far andare obexftp ho dovuto aggiungere al configure l'opzione --disable-ruby: ora non ottengo più l'errore e il pacchetto lo crea. Ho installato anche il pacchetto tcllib, versione 1.12 (l'ultima). Se provo però a lanciare obextool da eseguibile ottengo questo errore:

Codice: Seleziona tutto

Error in startup script: can't find package BWidget
    while executing
"package require BWidget"
    (file "./obextool.tk" line 31)
Da quello che ho letto nel file INSTALL citato sopra, il pacchetto BWidget dovrebbe essere incluso nel pacchetto tcllib (il link porta a quel pacchetto almeno). O sbaglio? :roll:

Bart
Staff
Staff
Messaggi: 4249
Iscritto il: lun 9 ago 2004, 0:00
Località: Rimini

Re: Obexftp: errore di compilazione

Messaggio da Bart »

Rettifico, BWidget è una dipendenza a parte, sistemato il tutto è partito subito obextool.
Non so perché obextool non mi vede il cellulare che viene invece regolarmente riconosciuto dal pc, tanto che se lo uso come memoria di massa riesco a scaricare foto e file.
Leggendo questa guida: http://www.slacky.eu/wikislack/index.ph ... 6_Obextool
ho visto che patcha obexftp (versione 0.18). Io ho testato la 0.23 e la 0.22. Qualcuno di voi lo usa o ha problemi simili?
Bisogna configurare qualcosa in obextool?

Bart
Staff
Staff
Messaggi: 4249
Iscritto il: lun 9 ago 2004, 0:00
Località: Rimini

Re: Obexftp: errore di compilazione

Messaggio da Bart »

Credo che il changelog di oggi fixi il problema: adesso provo.
http://www.slacky.eu/rss-current/change ... d3de3b7a56

Bart
Staff
Staff
Messaggi: 4249
Iscritto il: lun 9 ago 2004, 0:00
Località: Rimini

Re: Obexftp: errore di compilazione

Messaggio da Bart »

Niente da fare, non va! Occorre abilitare "--disable-ruby". Slackbuild:

Codice: Seleziona tutto

#!/bin/sh                                          
#                                                  
# SlackBuild for ObexFTP                           
# http://openobex.sourceforge.net                  

# Get the current and temporary directories
CWD=`pwd`                                  
if [ "$TMP" = "" ]; then                   
 TMP=/tmp/pkg                              
fi                                         

# Set up working directories
if [ ! -d $TMP ]            
then                        
        mkdir -p $TMP       
fi                          

# Some useful variables about the package
NAME=obexftp                             
PKG=$TMP/package-$NAME                   
VERSION=0.23                             
ARCH=i486                                
BUILD=1lf                                
SOURCEARCH=$NAME-$VERSION                

# Print a welcome screen
echo "+----------------+"
echo "| $NAME-$VERSION |"
echo "+----------------+"


if [ -d $PKG ]
then          
        # Clean up a previous build
        #rm -rf $PKG               
        #mkdir -p $PKG             
        echo "Previous package build directory found, please remove it and"
        echo "restart the SlackBuild script: $PKG"                         
        exit 1                                                             
else                                                                       
        mkdir -p $PKG                                                      
fi                                                                         

for i in
do      
        echo "--- Creating directory $PKG/$i"
        mkdir -p $PKG/$i                     
done                                         

# Decompress
echo "------------------------- Uncompressing source -------------------------"
cd $TMP                                                                        
tar xjvf $CWD/$SOURCEARCH.tar.bz2                                              
#mv $SOURCEARCH $NAME-$VERSION                                                 
cd $NAME-$VERSION                                                              

# Build
echo "------------------------------ Configuring -----------------------------"
CFLAGS="-O2 -march=i486 -mcpu=i686" \                                          
CXXFLAGS="-O2 -march=i486 -mcpu=i686" \                                        
        ./configure --prefix=/usr \                                            
        --disable-ruby \                                                       
#       --enable-swig \                                                        
        --sysconfdir=/etc \                                                    
        --localstatedir=/var                                                   

#echo "------------------------------- Patching -------------------------------"

echo "------------------------------ Compiling -------------------------------"
make                                                                           
res=$?                                                                         
if [ $res -ne 0 ]                                                              
then                                                                           
        # make failed, we cannot continue                                      
        exit $res                                                              
fi                                                                             

echo "------------------------------ Installing ------------------------------"
make install DESTDIR=$PKG                                                      
res=$?                                                                         
if [ $res -ne 0 ]                                                              
then                                                                           
        # make install failed, we cannot continue                              
        exit 1                                                                 
fi                                                                             

# Doc
echo "----------------- Copying documentation and other files ----------------"
mkdir -p $PKG/usr/doc/$NAME-$VERSION                                           
for i in AUTHORS ChangeLog COPYING INSTALL NEWS README* THANKS TODO            
do                                                                             
#        cat $i | gzip > $PKG/usr/doc/$NAME-$VERSION/$i.gz                     
        cp -a $i $PKG/usr/doc/$NAME-$VERSION/                                  
done                                                                           

# Fix broken doc installed
#mv $PKG/*.html $PKG/usr/doc/$NAME-$VERSION


# Gzip man pages
find $PKG/usr/man -name "*.[123456789]" -exec gzip -9 {} \;

# SlackBuild stuff
mkdir -p $PKG/usr/doc/$NAME-$VERSION/slackbuild
cp $CWD/$0 $CWD/slack-desc $PKG/usr/doc/$NAME-$VERSION/slackbuild


# Strip binaries
echo "--------------------------- Stripping binaries -------------------------"
find $PKG -type f | xargs file | grep ELF | cut -f 1 -d : | xargs strip --strip-unneeded

# Set permissions
echo "--------------------------- Setting permissions ------------------------"
chown -R root.bin $PKG/usr/bin # $PKG/usr/sbin                                 

chown -R root.root $PKG/usr/doc
chmod -R 755 $PKG/usr/doc/*    
find $PKG/usr/doc -type f -exec chmod 644 {} \;

if [ -d $PKG/usr/share ]
then                    
        chown -R root.root $PKG/usr/share
        chmod -R 755 $PKG/usr/share/*    
        find $PKG/usr/share -type f -exec chmod 644 {} \;
fi

# Copy Slackware package files
echo "--------------------- Copying Slackware package files ------------------"
mkdir -p $PKG/install
cat $CWD/slack-desc > $PKG/install/slack-desc
#cat $CWD/slack-required > $PKG/install/slack-required

# Create package
echo "---------------------------- Creating package --------------------------"
echo "Creating package"
cd $PKG
makepkg -l y -c n $CWD/$NAME-$VERSION-$ARCH-$BUILD.tgz

# Clean up
if [ "$1" = "--cleanup" ]; then
        echo "---------------------- Cleaning up working directory -------------------"
        rm -rf $TMP/$NAME-$VERSION
        rm -rf $PKG
fi

# Package created
echo "Package creation finished!"
C'è qualche problema di integrazione tra ruby e le tcl/tk e il changelog di oggi lo conferma. Comunque se non volete sbattervi per capire cosa non va installate direttamente obexftp dal repository di slackware. Per usare Obextool avete bisogno delle librerie BWidget e Tablelist. La guida http://www.slacky.eu/wikislack/index.ph ... 6_Obextool spiega come installarle.
Per le librerie Bwidget io ho usato questo slackbuild:

Codice: Seleziona tutto

#!/bin/sh
#                                                  
# SlackBuild for BWidget library
       
VERSION=1.9.0
ARCH=${ARCH:-noarch}
BUILD=${BUILD:-1lf}

set -e
PKG=/tmp/package-bwidget
rm -rf "$PKG"

CWD=`pwd`

cd /tmp
rm -rf bwidget-$VERSION
tar xfvz $CWD/BWidget-$VERSION.tar.gz
cd BWidget-$VERSION
rm -f aclocal.m4 configure.in Makefile.in
rm -rf tests
mkdir -p $PKG/usr/doc/bwidget-$VERSION $PKG/usr/lib/bwidget$VERSION
mv ChangeLog CHANGES.txt LICENSE.txt README.txt $PKG/usr/doc/bwidget-$VERSION
mv BWman $PKG/usr/doc/bwidget-$VERSION/html
mv demo $PKG/usr/doc/bwidget-$VERSION/examples
mv * $PKG/usr/lib/bwidget$VERSION
cd ..
rmdir BWidget-$VERSION

mkdir -p $PKG/install
cat $CWD/slack-desc > $PKG/install/slack-desc

cd "$PKG"
makepkg -l y -c n ../bwidget-$VERSION-$ARCH-$BUILD.txz
Dopo aver installato obexftp, BWidget, Tablelist e aver configurato udev (come da precedente guida) basta lanciare i seguenti comandi:

Codice: Seleziona tutto

#obexftp -u
per vedere su che interfaccia è stato rilevato il telefonino (guardate sempre la voce pcsuite per i nokia) e ammettendo che l'interfaccia sia la numero 1 lanciate obextool con il seguente comando:

Codice: Seleziona tutto

#./obextool.tk --obexcmd "obexftp -u 1"
.

Rispondi