Home > Dai forum, Debian, Debianizzazione, Gnome, Guide, Linux, LQH, Pacchetti, Ubuntu > Debianizzare un programma Python #17

Debianizzare un programma Python #17

23 giugno 2010

Questa guida a puntate riporterà i passaggi necessari dalla pacchettizzazione fino all’inclusione ufficiale di un software scritto in Python (Gespeaker) su Debian e più avanti su Ubuntu. Ogni giorno per circa un mese sarà descritto un passaggio da seguire per poter debianizzare così un proprio software.

#17 Compilazione iniziale del pacchetto

Completati tutti i passaggi di configurazione del pacchetto è finalmente possibile compilare il pacchetto con:

dpkg-buildpackage -us -uc

Il parametro -us indica di non firmare il file sorgente mentre il parametro -uc indica di non firmare il file dei cambiamenti (.changes). Essendo la prima compilazione inizialmente non è necessario firmare questi files, potranno esserci errori o avvisi e quindi può essere necessario compilarlo più volte.

Quello che segue è il risultato di una compilazione andata a buon fine senza nessun errore.

dpkg-buildpackage: set CFLAGS to default value: -g -O2
dpkg-buildpackage: set CPPFLAGS to default value:
dpkg-buildpackage: set LDFLAGS to default value:
dpkg-buildpackage: set FFLAGS to default value: -g -O2
dpkg-buildpackage: set CXXFLAGS to default value: -g -O2
dpkg-buildpackage: source package gespeaker
dpkg-buildpackage: source version 0.7-1
dpkg-buildpackage: source changed by Fabio Castelli <muflone@XXXXXX.net>
dpkg-buildpackage: host architecture i386
 fakeroot debian/rules clean
pyversions: missing XS-Python-Version in control file, fall back to debian/pyversions
test -x debian/rules
dh_testroot
dh_clean
cd . && python setup.py clean -a
running clean
'build/lib' does not exist -- can't clean it
'build/bdist.linux-i686' does not exist -- can't clean it
'build/scripts-2.5' does not exist -- can't clean it
rm -f python-build-stamp-*
find . -name '*.pyc' -exec rm '{}' ';'
rm -rf build/
 dpkg-source -b gespeaker-0.7
dpkg-source: info: using source format `1.0'
dpkg-source: info: building gespeaker using existing gespeaker_0.7.orig.tar.gz
dpkg-source: info: building gespeaker in gespeaker_0.7-1.diff.gz
dpkg-source: info: building gespeaker in gespeaker_0.7-1.dsc
 debian/rules build
pyversions: missing XS-Python-Version in control file, fall back to debian/pyversions
test -x debian/rules
mkdir -p "."
cd . && python setup.py build --build-base="/home/muflone/gespeaker-0.7/./build"
running build
running build_scripts
creating /home/muflone/gespeaker-0.7/build
creating /home/muflone/gespeaker-0.7/build/scripts-2.5
copying gespeaker -> /home/muflone/gespeaker-0.7/./build/scripts-2.5
changing mode of /home/muflone/gespeaker-0.7/./build/scripts-2.5/gespeaker from 744 to 755
touch python-build-stamp-2.5
 fakeroot debian/rules binary
pyversions: missing XS-Python-Version in control file, fall back to debian/pyversions
test -x debian/rules
dh_testroot
dh_clean -k
dh_installdirs -A
mkdir -p "."

Fino a questo punto è stato soltanto preparato il pacchetto.

Quello che segue è il log delle attività di setup.py visto in precedenza, che si occuperà di copiare i files al posto giusto e compilare i files della lingua.

cd . && python setup.py install --root=/home/muflone/gespeaker-0.7/debian/gespeaker/ --no-compile -O0 --install-lib=/usr/share/gespeaker
running install
running build
running build_scripts
running install_scripts
creating /home/muflone/gespeaker-0.7/debian/gespeaker/usr
creating /home/muflone/gespeaker-0.7/debian/gespeaker/usr/bin
copying build/scripts-2.5/gespeaker -> /home/muflone/gespeaker-0.7/debian/gespeaker/usr/bin
changing mode of /home/muflone/gespeaker-0.7/debian/gespeaker/usr/bin/gespeaker to 755
running install_data
creating build/mo/en_US
compiling po/en_US.po -> build/mo/en_US/gespeaker.mo
creating build/mo/fr
compiling po/fr.po -> build/mo/fr/gespeaker.mo
creating build/mo/it
compiling po/it.po -> build/mo/it/gespeaker.mo
creating build/mo/es
compiling po/es.po -> build/mo/es/gespeaker.mo
creating /home/muflone/gespeaker-0.7/debian/gespeaker/usr/share
creating /home/muflone/gespeaker-0.7/debian/gespeaker/usr/share/applications
copying data/gespeaker.desktop -> /home/muflone/gespeaker-0.7/debian/gespeaker/usr/share/applications
creating /home/muflone/gespeaker-0.7/debian/gespeaker/usr/share/man
creating /home/muflone/gespeaker-0.7/debian/gespeaker/usr/share/man/man1
copying man/gespeaker.1 -> /home/muflone/gespeaker-0.7/debian/gespeaker/usr/share/man/man1
creating /home/muflone/gespeaker-0.7/debian/gespeaker/usr/share/doc
creating /home/muflone/gespeaker-0.7/debian/gespeaker/usr/share/doc/gespeaker
copying doc/README -> /home/muflone/gespeaker-0.7/debian/gespeaker/usr/share/doc/gespeaker
copying doc/changelog -> /home/muflone/gespeaker-0.7/debian/gespeaker/usr/share/doc/gespeaker
creating /home/muflone/gespeaker-0.7/debian/gespeaker/usr/share/gespeaker
creating /home/muflone/gespeaker-0.7/debian/gespeaker/usr/share/gespeaker/data
copying data/testing.wav -> /home/muflone/gespeaker-0.7/debian/gespeaker/usr/share/gespeaker/data
creating /home/muflone/gespeaker-0.7/debian/gespeaker/usr/share/gespeaker/data/icons
copying data/icons/palogo.png -> /home/muflone/gespeaker-0.7/debian/gespeaker/usr/share/gespeaker/data/icons
copying data/icons/alsalogo.png -> /home/muflone/gespeaker-0.7/debian/gespeaker/usr/share/gespeaker/data/icons
copying data/icons/gespeaker.svg -> /home/muflone/gespeaker-0.7/debian/gespeaker/usr/share/gespeaker/data/icons
creating /home/muflone/gespeaker-0.7/debian/gespeaker/usr/share/gespeaker/data/ui
copying data/ui/preferences.glade -> /home/muflone/gespeaker-0.7/debian/gespeaker/usr/share/gespeaker/data/ui
copying data/ui/gespeaker.glade -> /home/muflone/gespeaker-0.7/debian/gespeaker/usr/share/gespeaker/data/ui
creating /home/muflone/gespeaker-0.7/debian/gespeaker/usr/share/gespeaker/src
copying src/DialogAbout.py -> /home/muflone/gespeaker-0.7/debian/gespeaker/usr/share/gespeaker/src
copying src/SubprocessWrapper.py -> /home/muflone/gespeaker-0.7/debian/gespeaker/usr/share/gespeaker/src
copying src/PreferencesWindow.py -> /home/muflone/gespeaker-0.7/debian/gespeaker/usr/share/gespeaker/src
copying src/gespeaker.py -> /home/muflone/gespeaker-0.7/debian/gespeaker/usr/share/gespeaker/src
copying src/DialogYesNo.py -> /home/muflone/gespeaker-0.7/debian/gespeaker/usr/share/gespeaker/src
copying src/gespeakerUI.py -> /home/muflone/gespeaker-0.7/debian/gespeaker/usr/share/gespeaker/src
copying src/pygtkutils.py -> /home/muflone/gespeaker-0.7/debian/gespeaker/usr/share/gespeaker/src
copying src/TempfileWrapper.py -> /home/muflone/gespeaker-0.7/debian/gespeaker/usr/share/gespeaker/src
copying src/DialogSimpleMessages.py -> /home/muflone/gespeaker-0.7/debian/gespeaker/usr/share/gespeaker/src
copying src/Settings.py -> /home/muflone/gespeaker-0.7/debian/gespeaker/usr/share/gespeaker/src
copying src/gespeaker_dbus_service.py -> /home/muflone/gespeaker-0.7/debian/gespeaker/usr/share/gespeaker/src
copying src/EspeakFrontend.py -> /home/muflone/gespeaker-0.7/debian/gespeaker/usr/share/gespeaker/src
copying src/handlepaths.py -> /home/muflone/gespeaker-0.7/debian/gespeaker/usr/share/gespeaker/src
copying src/DialogFileOpenSave.py -> /home/muflone/gespeaker-0.7/debian/gespeaker/usr/share/gespeaker/src
creating /home/muflone/gespeaker-0.7/debian/gespeaker/usr/share/locale
creating /home/muflone/gespeaker-0.7/debian/gespeaker/usr/share/locale/en_US
creating /home/muflone/gespeaker-0.7/debian/gespeaker/usr/share/locale/en_US/LC_MESSAGES
copying build/mo/en_US/gespeaker.mo -> /home/muflone/gespeaker-0.7/debian/gespeaker/usr/share/locale/en_US/LC_MESSAGES
creating /home/muflone/gespeaker-0.7/debian/gespeaker/usr/share/locale/fr
creating /home/muflone/gespeaker-0.7/debian/gespeaker/usr/share/locale/fr/LC_MESSAGES
copying build/mo/fr/gespeaker.mo -> /home/muflone/gespeaker-0.7/debian/gespeaker/usr/share/locale/fr/LC_MESSAGES
creating /home/muflone/gespeaker-0.7/debian/gespeaker/usr/share/locale/it
creating /home/muflone/gespeaker-0.7/debian/gespeaker/usr/share/locale/it/LC_MESSAGES
copying build/mo/it/gespeaker.mo -> /home/muflone/gespeaker-0.7/debian/gespeaker/usr/share/locale/it/LC_MESSAGES
creating /home/muflone/gespeaker-0.7/debian/gespeaker/usr/share/locale/es
creating /home/muflone/gespeaker-0.7/debian/gespeaker/usr/share/locale/es/LC_MESSAGES
copying build/mo/es/gespeaker.mo -> /home/muflone/gespeaker-0.7/debian/gespeaker/usr/share/locale/es/LC_MESSAGES
running install_egg_info
Writing /home/muflone/gespeaker-0.7/debian/gespeaker/usr/share/gespeaker/Gespeaker-0.8.egg-info

Quindi continua la normale compilazione del pacchetto con i nuovi files generati dentro debian/gespeaker:

dh_installdirs -pgespeaker
dh_installdocs -pgespeaker   
dh_installexamples -pgespeaker
dh_installman -pgespeaker  
dh_installinfo -pgespeaker  
dh_installmenu -pgespeaker
dh_installcron -pgespeaker
dh_installinit -pgespeaker   
dh_installdebconf -pgespeaker
dh_installemacsen -pgespeaker   
dh_installcatalogs -pgespeaker
dh_installpam -pgespeaker
dh_installlogrotate -pgespeaker
dh_installlogcheck -pgespeaker
dh_installchangelogs -pgespeaker   
dh_installudev -pgespeaker
dh_lintian -pgespeaker
dh_install -pgespeaker  
dh_link -pgespeaker  
dh_installmime -pgespeaker
dh_pysupport -pgespeaker
dh_python -pgespeaker   
dh_python: Doing nothing since dh_pycompat exists; dh_pysupport or dh_pycentral should do the work. You can remove dh_python from your rules file.
dh_strip -pgespeaker  
dh_compress -pgespeaker  
dh_fixperms -pgespeaker  
dh_makeshlibs -pgespeaker  
dh_installdeb -pgespeaker
dh_perl -pgespeaker
dh_shlibdeps -pgespeaker    
dh_gencontrol -pgespeaker  
dh_md5sums -pgespeaker
dh_builddeb -pgespeaker
dpkg-deb: costruisco il pacchetto `gespeaker' in `../gespeaker_0.7-1_all.deb'.
dpkg-genchanges  >../gespeaker_0.7-1_i386.changes
dpkg-genchanges: including full source code in upload
dpkg-buildpackage: full upload (original source is included)

Le ultime righe del log sono fondamentali:

dpkg-deb: costruisco il pacchetto `gespeaker' in `../gespeaker_0.7-1_all.deb'.
dpkg-genchanges  >../gespeaker_0.7-1_i386.changes
dpkg-genchanges: including full source code in upload
dpkg-buildpackage: full upload (original source is included)

La prima indica l’avvenuta compilazione del pacchetto e la creazione del file deb. La seconda e terza riga mostrano la creazione del file changes mentre infine l’ultima indica l’avvenuta costruzione di un pacchetto completo di sorgente originale, cambiamenti, differenze.

%d blogger cliccano Mi Piace per questo: