|
|
Riga 1: |
Riga 1: |
| =Introduzione= | | <div align="right" style="position: absolute;"> |
| Il pacchetto bootsplash per Debian, presente nei repository:
| | {| {{prettytable}} |
| <pre>
| | | colspan="2" align="center" | A partire da |
| deb http://debian.bootsplash.de unstable main
| | |- |
| deb-src http://debian.bootsplash.de unstable main
| | | Debian |
| </pre>
| | | bgcolor="white" | {{{1}}} |
| � molto comodo per la gestione dei temi, ma ha un ''difetto'': utilizza debconf per la gestione dei temi. Questo porta ad un effetto collaterale: i temi installati manualmente non saranno riconosciuti e per poterli usare si dovranno eseguire operazioni scomode (rispetto ad un semplice ''dpkg-reconfigure bootsplash'' :-) ).
| | |- |
| | | | Kernel |
| Vedremo, ora, come creare un pacchetto Debian contenente un tema, e come gestire il template di debconf per aggiornare la lista dei temi.
| | | bgcolor="white" | {{{2}}} |
| | | |- |
| {{Box|Nota Bene:|gli script qui descritti non sono opera mia, ma di [mailto:oliver_at_dediziert_dot_org Oliver Sorge], che mantiene i temi presenti nel repository sopra riportato}} | | | Modulo |
| | | | bgcolor="white" | {{{3}}} |
| =Requisiti=
| | |} |
| Per poter creare un pacchetto Debian dobbiamo installare i seguenti pacchetti:
| | </div> |
| * build-essential
| |
| * dpkg-dev
| |
| * dh-make
| |
| * debhelper
| |
| | |
| =Creazione del pacchetto=
| |
| Estraiamo il pacchetto contenente il tema, e rinominiamo la directory contenente il tema in un formato del tipo ''bootsplash-theme-<nometema>-<versione>''.
| |
| | |
| La directory deve contenere le directory images, ...
| |
| | |
| Una volta completato, lanciamo il comando
| |
| <pre>
| |
| $ dh_make --copyright GPL
| |
| </pre>
| |
| ovviamente dopo aver verificato la licenza del tema...
| |
| | |
| Alla domanda
| |
| <pre>
| |
| Type of package: single binary, multiple binary, library, or kernel module?
| |
| [s/m/l/k]</pre> rispondiamo con una ''s''.
| |
| | |
| Controlliamo i dati riportati (per il nome e l'email possiamo usare le variabili d'ambiente $DEBEMAIL e $DEBFULLNAME); se tutto � corretto � possibile andare avanti.
| |
| | |
| Verr� cos� creata la directory debian/, contenente tutto il necessario per il nostro pacchetto.
| |
| | |
| ==La directory debian/*==
| |
| ===Rimozione dei file non necessari===
| |
| La directory debian/ contiene molti file non necessari, che possiamo tranquillamente rimuovere:
| |
| <pre>
| |
| $ cd debian
| |
| $ rm conffiles.ex cron.d.ex emacsen* init.d.ex manpage* matrix* menu.ex watch*
| |
| </pre>
| |
| | |
| ===.templates===
| |
| Dobbiamo creare il template utilizzato da debconf. Creiamo, quindi, un file del tipo ''bootsplash-theme-<nometema>.template'' con il seguente contenuto:
| |
| <pre>
| |
| Template: shared/bootsplash-theme
| |
| Type: select
| |
| Choices: ${choices}
| |
| Description: Please select theme bootsplash should use.
| |
| Please select the theme bootsplash should use. If you wish to
| |
| change it at a later date, just run dpkg-reconfigure bootsplash.
| |
| | |
| Template: bootsplash-theme-<nometema>/resolutions
| |
| Type: multiselect
| |
| Choices: 1024x768
| |
| Default: 1024x768
| |
| Description: Select the resoultion you would like to enable bootsplash for.
| |
| You need to select which resolutions bootsplash should be enabled for, also
| |
| remember to include the proper (vga=???) line in your lilo.conf.
| |
| </pre>
| |
| Ricordandoci di sostituire a ''<nometema>'' il nome del nostro tema ed eventualmente sistemare i valori delle risoluzioni.
| |
| | |
| ===rules===
| |
| Il file ''debian/rules'' necessit� di molte modifiche... Conviene, quindi, sostituire il contenuto con questo:
| |
| <pre>
| |
| #!/usr/bin/make -f
| |
| # -*- makefile -*-
| |
| # Sample debian/rules that uses debhelper.
| |
| # GNU copyright 1997 to 1999 by Joey Hess.
| |
| | |
| # Uncomment this to turn on verbose mode.
| |
| # export DH_VERBOSE=1
| |
| | |
| # Edit these lines!!!
| |
| THEME_DIRS = images config animations bootloader
| |
| THEME_SUFFIX = <nometema>
| |
| | |
| configure: configure-stamp
| |
| configure-stamp:
| |
| dh_testdir
| |
| touch configure-stamp
| |
| | |
| build: build-stamp
| |
| | |
| build-stamp: configure-stamp
| |
| dh_testdir
| |
| touch build-stamp
| |
| | |
| clean:
| |
| dh_testdir
| |
| dh_testroot
| |
| rm -f build-stamp configure-stamp
| |
| dh_clean
| |
| | |
| install: build
| |
| dh_testdir
| |
| dh_testroot
| |
| dh_clean -k
| |
| dh_installdirs
| |
| -cp -a $(THEME_DIRS) \
| |
| "$(CURDIR)/debian/bootsplash-theme-$(THEME_SUFFIX)/etc/bootsplash/themes/$(THEME_SUFFIX)/" | |
| | |
| binary-indep: build install
| |
| # We have nothing to do by default.
| |
| | |
| # Build architecture-dependent files here.
| |
| binary-arch: build install
| |
| dh_testdir
| |
| dh_testroot
| |
| dh_installchangelogs
| |
| dh_installdocs
| |
| dh_installdebconf
| |
| dh_link
| |
| dh_strip
| |
| dh_compress
| |
| dh_fixperms
| |
| dh_installdeb
| |
| dh_shlibdeps
| |
| dh_gencontrol
| |
| dh_md5sums
| |
| dh_builddeb
| |
| | |
| binary: binary-indep binary-arch
| |
| .PHONY: build clean binary-indep binary-arch binary install configure
| |
| </pre>
| |
| | |
| ricordando le seguente cose:
| |
| * fare attenzione ad usare la tabulazioni (tasto <tab>) al posto degli spazi per le indentazioni (obbligatorie)!
| |
| * modificare la variabile THEME_DIRS riportando solo le directory presenti all'interno della directory ''<nometema>-<versione>'' ad eccezione di ''debian''.
| |
| * modificare la variabile THEME_SUFFIX con il nome del tema.
| |
| | |
| ===control===
| |
| Il file ''debian/control'' necessita di alcune modifiche:
| |
| * ''Section'' dovrebbe essere modificata in ''graphics''
| |
| * ''Architecture'' pu� essere modificato in ''all'', visto che il pacchetto non sar� dipendente dall'architettura
| |
| * ''Depends'' pu� essere modificato in ''bootsplash (>= 3.0.0), debconf (>= 0.5) | debconf-2.0''
| |
| * deve essere aggiunta la riga ''Provides: bootsplash-theme''
| |
| * la descrizione deve essere modificata nel seguente modo (in linea coi pacchetti di http://www.bootsplash.de ):
| |
| <pre>Description: The bootsplash theme <nometema>
| |
| This is another bootsplash theme packaged for the Debian GNU/Linux
| |
| Operating System.
| |
| .
| |
| Resolutions: 1280x1024</pre>
| |
| | |
| ===dirs===
| |
| Dovr� contenere
| |
| <pre>
| |
| etc/bootsplash/themes/<nometema>
| |
| </pre>
| |
| | |
| ===docs===
| |
| Dovr� contenere
| |
| <pre>
| |
| docs/*
| |
| </pre>
| |
| se la directory � presente nei sorgenti del tema (altrimenti si pu� omettere questo file).
| |
| | |
| ===postinst===
| |
| Usiamo direttamente quelli creati per i pacchetti dei temi presenti su http://www.bootsplash.org :
| |
| <pre>
| |
| #! /bin/sh
| |
| # postinst script for test
| |
| #
| |
| # see: dh_installdeb(1)
| |
| | |
| set -e
| |
| . /usr/share/debconf/confmodule
| |
| | |
| THEME_SUFFIX=<nometema>
| |
| | |
| # summary of how this script can be called:
| |
| # * <postinst> `configure' <most-recently-configured-version>
| |
| # * <old-postinst> `abort-upgrade' <new version>
| |
| # * <conflictor's-postinst> `abort-remove' `in-favour' <package>
| |
| # <new-version>
| |
| # * <deconfigured's-postinst> `abort-deconfigure' `in-favour'
| |
| # <failed-install-package> <version> `removing'
| |
| # <conflicting-package> <version>
| |
| # for details, see http://www.debian.org/doc/debian-policy/ or
| |
| # the debian-policy package
| |
| #
| |
| | |
| case "$1" in
| |
| configure)
| |
| db_register shared/bootsplash-theme bootsplash-theme-$THEME_SUFFIX
| |
| ;;
| |
| | |
| abort-upgrade|abort-remove|abort-deconfigure)
| |
| ;;
| |
| | |
| *)
| |
| gettext -s "postinst called with unknown argument \`$1'" >&2
| |
| exit 1
| |
| ;;
| |
| esac
| |
| | |
| # dh_installdeb will replace this with shell code automatically
| |
| # generated by other debhelper scripts.
| |
| | |
| #DEBHELPER#
| |
| | |
| exit 0
| |
| </pre>
| |
| ===postrm===
| |
| <pre>
| |
| #! /bin/sh
| |
| # postrm script for bootsplash-theme-newtux
| |
| #
| |
| # see: dh_installdeb(1)
| |
| | |
| set -e
| |
| | |
| # summary of how this script can be called:
| |
| # * <postrm> `remove'
| |
| # * <postrm> `purge'
| |
| # * <old-postrm> `upgrade' <new-version>
| |
| # * <new-postrm> `failed-upgrade' <old-version>
| |
| # * <new-postrm> `abort-install'
| |
| # * <new-postrm> `abort-install' <old-version>
| |
| # * <new-postrm> `abort-upgrade' <old-version>
| |
| # * <disappearer's-postrm> `disappear' <r>overwrit>r> <new-version>
| |
| # for details, see http://www.debian.org/doc/debian-policy/ or
| |
| # the debian-policy package
| |
| | |
| # Theme variables
| |
| THEME_SUFFIX=<nometema>
| |
| | |
| | |
| case "$1" in
| |
| remove)
| |
| | |
| # This only applies to the remove process.
| |
| # By default the directory of the theme under
| |
| # /etc/bootsplash/themes will not be removed.
| |
| # However, this postrm script will do this if
| |
| # a directory exists.
| |
| if [ -d /etc/bootsplash/themes/$THEME_SUFFIX ]
| |
| then
| |
| gettext -s "Deleting orphaned files under /etc/bootsplash/themes/$THEME_SUFFIX ... "
| |
| rm -rf /etc/bootsplash/themes/$THEME_SUFFIX || gettext -s "ERROR: Couldn't delete directory /etc/bootsplash/themes/$THEME_SUFFIX."
| |
| fi
| |
| ;;
| |
| | |
| purge|upgrade|failed-upgrade|abort-install|abort-upgrade|disappear)
| |
| | |
| | |
| ;;
| |
| | |
| *)
| |
| gettext -s "postrm called with unknown argument \`$1'" >&2
| |
| exit 1
| |
| | |
| esac
| |
| # dh_installdeb will replace this with shell code automatically
| |
| # generated by other debhelper scripts.
| |
| | |
| # Automatically added by dh_installdebconf
| |
| if [ "$1" = purge ] && [ -e /usr/share/debconf/confmodule ]; then
| |
| . /usr/share/debconf/confmodule
| |
| db_purge
| |
| fi
| |
| # End automatically added section
| |
| | |
| | |
| exit 0
| |
| </pre>
| |
| | |
| ===prerm===
| |
| <pre>
| |
| #! /bin/sh
| |
| # prerm script for bootsplash-theme-debblue
| |
| #
| |
| # see: dh_installdeb(1)
| |
| | |
| set -e
| |
| . /usr/share/debconf/confmodule
| |
| | |
| # summary of how this script can be called:
| |
| # * <prerm> `remove'
| |
| # * <old-prerm> `upgrade' <new-version>
| |
| # * <new-prerm> `failed-upgrade' <old-version>
| |
| # * <conflictor's-prerm> `remove' `in-favour' <package> <new-version>
| |
| # * <deconfigured's-prerm> `deconfigure' `in-favour'
| |
| # <package-being-installed> <version> `removing'
| |
| # <conflicting-package> <version>
| |
| # for details, see http://www.debian.org/doc/debian-policy/ or
| |
| # the debian-policy package
| |
| | |
| case "$1" in
| |
| remove|upgrade|deconfigure)
| |
| # I no longer claim this question.
| |
| db_unregister shared/bootsplash-theme
| |
| # See if the shared question still exists.
| |
| if db_get shared/bootsplash-theme; then
| |
| db_metaget shared/bootsplash-theme owners
| |
| db_subst shared/bootsplash-theme choices $RET
| |
| db_metaget shared/bootsplash-theme value
| |
| if [ "<package>" = "$RET" ] ; then
| |
| db_fset shared/bootsplash-theme seen false
| |
| db_input high shared/bootsplash-theme || true
| |
| db_go || true
| |
| fi
| |
| fi
| |
| ;;
| |
| | |
| failed-upgrade)
| |
| ;;
| |
| *)
| |
| gettext -s "prerm called with unknown argument \`$1'" >&2
| |
| exit 1
| |
| ;;
| |
| esac
| |
| | |
| exit 0
| |
| </pre>
| |
| | |
| =Compilazione=
| |
| La compilazione di un pacchetto � semplicissima: nella directory contenente i sorgenti diamo il seguente comando:
| |
| <pre>
| |
| $ dpkg-buildpackage
| |
| </pre> | |
| se tutto va a buon fine, verr� creato un pacchetto debian nella directory superiore.
| |
| | |
| =Test del pacchetto=
| |
| L'unico modo per testare il pacchetto � installarlo (dpkg -i pacchetto.deb) e riconfigurare il pacchetto bootsplash (dpkg-reconfigure bootsplash)... se tutto � stato fatto correttamente, nella lista apparir� il nuovo tema...
| |
| | |
| =Conclusioni=
| |
| La guida qui riportata � frutto dell'analisi dei pacchetti ''bootsplash-theme-*'' presenti nel repository di http://www.bootsplash.de ;)
| |
| | |
| [[Categoria:Apt]]
| |
| [[Categoria:Apt-Dev]]
| |