[Bluez]Creare pacchetti multipli

Coordinamento delle attività e informazioni sui progetti del gruppo: creazione, modifica e gestione dei pacchetti di Ubuntu e relative problematiche.

Moderatore: Gruppo Sviluppo

Avatar utente
P4blo
Scoppiettante Seguace
Scoppiettante Seguace
Messaggi: 947
Iscrizione: giovedì 7 febbraio 2008, 20:55
Contatti:

[Bluez]Creare pacchetti multipli

Messaggio da P4blo »

Come da oggetto ho pacchettizzato bluez, il problema ora sta nel fatto che nei repo bluez è suddiviso in più pacchetti
bluez
bluez-alsa
bluez-gstreamer
bluez-gnome
bluez-cups
...
ora siccome il sorgente è uno mi chiedo come posso creare anche io tanti piccoli pacchetti?
questo è il configure

Codice: Seleziona tutto

paolo@paolo-desktop:~/Scrivania/bluez-4.29$ ./configure
checking for a BSD-compatible install... /usr/bin/install -c
checking whether build environment is sane... yes           
checking for a thread-safe mkdir -p... /bin/mkdir -p        
checking for gawk... gawk                                   
checking whether make sets $(MAKE)... yes                   
checking whether to enable maintainer-specific portions of Makefiles... no
checking for gcc... gcc                                                   
checking for C compiler default output file name... a.out                 
checking whether the C compiler works... yes                              
checking whether we are cross compiling... no                             
checking for suffix of executables...                                     
checking for suffix of object files... o                                  
checking whether we are using the GNU C compiler... yes                   
checking whether gcc accepts -g... yes                                    
checking for gcc option to accept ISO C89... none needed                  
checking for style of include used by make... GNU                         
checking dependency style of gcc... gcc3                                  
checking whether gcc accepts -fPIE... yes                                 
checking for a BSD-compatible install... /usr/bin/install -c              
checking for bison... bison -y                                            
checking for flex... flex                                                 
checking lex output file root... lex.yy                                   
checking lex library... -lfl                                              
checking whether yytext is a pointer... yes                               
checking build system type... i686-pc-linux-gnu                           
checking host system type... i686-pc-linux-gnu                            
checking for a sed that does not truncate output... /bin/sed              
checking for grep that handles long lines and -e... /bin/grep             
checking for egrep... /bin/grep -E                                        
checking for ld used by gcc... /usr/bin/ld                                
checking if the linker (/usr/bin/ld) is GNU ld... yes                     
checking for /usr/bin/ld option to reload object files... -r              
checking for BSD-compatible nm... /usr/bin/nm -B                          
checking whether ln -s works... yes                                       
checking how to recognize dependent libraries... pass_all                 
checking how to run the C preprocessor... gcc -E                          
checking for ANSI C header files... yes                                   
checking for sys/types.h... yes                                           
checking for sys/stat.h... yes                                            
checking for stdlib.h... yes                                              
checking for string.h... yes                                              
checking for memory.h... yes                                              
checking for strings.h... yes                                             
checking for inttypes.h... yes                                            
checking for stdint.h... yes                                              
checking for unistd.h... yes                                              
checking dlfcn.h usability... yes                                         
checking dlfcn.h presence... yes                                          
checking for dlfcn.h... yes                                               
checking the maximum length of command line arguments... 1572864          
checking command to parse /usr/bin/nm -B output from gcc object... ok     
checking for objdir... .libs                                              
checking for ar... ar                                                     
checking for ranlib... ranlib                                             
checking for strip... strip                                               
checking if gcc supports -fno-rtti -fno-exceptions... no                  
checking for gcc option to produce PIC... -fPIC                           
checking if gcc PIC flag -fPIC works... yes                               
checking if gcc static flag -static works... yes                          
checking if gcc supports -c -o file.o... yes                              
checking whether the gcc linker (/usr/bin/ld) supports shared libraries... yes
checking whether -lc should be explicitly linked in... no                     
checking dynamic linker characteristics... GNU/Linux ld.so                    
checking how to hardcode library paths into programs... immediate             
checking whether stripping libraries is possible... yes                       
checking if libtool supports shared libraries... yes                          
checking whether to build shared libraries... yes                             
checking whether to build static libraries... no                              
configure: creating libtool                                                   
checking for pkg-config... /usr/bin/pkg-config                                
checking pkg-config is at least version 0.9.0... yes                          
checking whether to build gtk-doc documentation... no                         
checking for gtkdoc-check... no                                               
checking for ppoll... yes                                                     
checking for dlopen in -ldl... yes                                            
checking for DBUS... yes                                                      
checking for dbus_watch_get_unix_fd in -ldbus-1... yes                        
checking for GLIB... yes                                                      
checking for ALSA... yes                                                      
checking for clock_gettime in -lrt... yes                                     
checking for GSTREAMER... yes                                                 
checking for USB... yes                                                       
checking for usb_get_busses in -lusb... yes                                   
checking for usb_interrupt_read in -lusb... yes                               
checking for NETLINK... yes                                                   
checking for SNDFILE... yes                                                   
configure: creating ./config.status                                           
config.status: creating Makefile                                              
config.status: creating include/Makefile                                      
config.status: creating lib/Makefile                                          
config.status: creating gdbus/Makefile                                        
config.status: creating common/Makefile                                       
config.status: creating sbc/Makefile                                          
config.status: creating src/Makefile                                          
config.status: creating client/Makefile                                       
config.status: creating plugins/Makefile                                      
config.status: creating network/Makefile                                      
config.status: creating serial/Makefile                                       
config.status: creating input/Makefile                                        
config.status: creating audio/Makefile                                        
config.status: creating tools/Makefile                                        
config.status: creating rfcomm/Makefile                                       
config.status: creating compat/Makefile                                       
config.status: creating scripts/Makefile                                      
config.status: creating cups/Makefile                                         
config.status: creating test/Makefile                                         
config.status: creating doc/Makefile                                 
config.status: creating doc/version.xml                                       
config.status: creating bluez.pc                                              
config.status: creating config.h                                              
config.status: executing depfiles commands   
all'interno di ogni cartella poi vengono creati dei makefile, ora posso compilarli separatamente? e soprattutto che dipendenze mettere nel file control?

EDIT:ora se ad esempio entro nella cartella audio dopo averla rinominata bluez-alsa-4.29 la costruzione del pacchetto fallisce

Codice: Seleziona tutto

paolo@paolo-desktop:~/Scrivania/bluez-4.29/bluez-alsa-4.29$ debuild binary  
# Add here commands to compile the arch part of the package.                
#/usr/bin/make                                                              
touch build-arch-stamp                                                      
dh_testdir                                                                  
dh_testroot                                                                 
dh_clean -k -s                                                              
dh_installdirs -s                                                           
# Add here commands to install the arch part of the package into            
# debian/tmp.                                                               
/usr/bin/make DESTDIR=/home/paolo/Scrivania/bluez-4.29/bluez-alsa-4.29/debian/bluez-alsa install
make[1]: Entering directory `/home/paolo/Scrivania/bluez-4.29/bluez-alsa-4.29'                  
/usr/bin/make  install-am                                                                       
make[2]: Entering directory `/home/paolo/Scrivania/bluez-4.29/bluez-alsa-4.29'                  
/bin/bash ../libtool --tag=CC   --mode=link gcc -I/usr/include/alsa   -I../include -I../sbc -Wall -O2 -D_FORTIFY_SOURCE=2 -D_FORTIFY_SOURCE=2 -fPIC -module -avoid-version -export-symbols-regex [_]*snd_pcm_.* -pie -o libasound_module_pcm_bluetooth.la -rpath /usr/local/lib/alsa-lib libasound_module_pcm_bluetooth_la-pcm_bluetooth.lo libasound_module_pcm_bluetooth_la-ipc.lo ../sbc/libsbc.la ../lib/libbluetooth.la -lasound   -lrt
libtool: link: cannot find the library `../sbc/libsbc.la' or unhandled argument `../sbc/libsbc.la'
make[2]: *** [libasound_module_pcm_bluetooth.la] Error 1
make[2]: Leaving directory `/home/paolo/Scrivania/bluez-4.29/bluez-alsa-4.29'
make[1]: *** [install] Error 2
make[1]: Leaving directory `/home/paolo/Scrivania/bluez-4.29/bluez-alsa-4.29'
make: *** [install-arch] Error 2
debuild: fatal error at line 1311:
couldn't exec fakeroot debian/rules:
paolo@paolo-desktop:~/Scrivania/bluez-4.29/bluez-alsa-4.29$
a quanto pare non trova delle librerie...che stanno nella cartella ../sbc del sorgente
Ultima modifica di P4blo il giovedì 12 febbraio 2009, 16:01, modificato 1 volta in totale.
Avatar utente
P4blo
Scoppiettante Seguace
Scoppiettante Seguace
Messaggi: 947
Iscrizione: giovedì 7 febbraio 2008, 20:55
Contatti:

Re: [Bluez]Creare pacchetti multipli

Messaggio da P4blo »

giusto per uppare un pò anche se dò

Codice: Seleziona tutto

dh_make -m
gli unici pacchetti che vengono creati sono bluez e bluez-doc
Xiam
Entusiasta Emergente
Entusiasta Emergente
Messaggi: 2174
Iscrizione: venerdì 25 aprile 2008, 11:59

Re: [Bluez]Creare pacchetti multipli

Messaggio da Xiam »

Sul manuale di debian per la creazione pacchetti non ho trovato in effetti le spiegazioni per pacchetti multipli da sorgente quando ne ho avuto bisogno anch'io.
Ti consiglio però per prima cosa di scaricarti i sorgenti da: http://packages.ubuntu.com/, applicare il diff col comando

Codice: Seleziona tutto

dpkg-source -x nomefile.dsc
e poi entrare nella cartella Debian appena creata e controllare il file control e il file rules da cui puoi prendere spunto.
Ci sono i comandi e le descrizioni dei diversi pacchetti che vengon fuori dall'unico codice sorgente.
Avatar utente
P4blo
Scoppiettante Seguace
Scoppiettante Seguace
Messaggi: 947
Iscrizione: giovedì 7 febbraio 2008, 20:55
Contatti:

Re: [Bluez]Creare pacchetti multipli

Messaggio da P4blo »

ciao Xiam intanto grazie per la risposta, con
applicare il diff
non ho capito cosa intendi, comunque ho scaricato i sorgenti con

Codice: Seleziona tutto

apt-get source bluez
che scarica sia i sorgenti sia il file .dsc e un archivio con un file .diff, allora ho provato a compilarli ed in effetti mi vengono creati 8 pacchetti questo è il file rules

Codice: Seleziona tutto

#!/usr/bin/make -f
# build rules for bluez-utils

include /usr/share/cdbs/1/rules/buildcore.mk
include /usr/share/cdbs/1/rules/debhelper.mk
include /usr/share/cdbs/1/rules/simple-patchsys.mk
include /usr/share/cdbs/1/class/autotools.mk

DEB_UPDATE_RCD_PARAMS = "start 25 2 3 4 5 . stop 74 0 1 6 ."
DEB_DH_INSTALLINIT_ARGS = "--name=bluetooth"
DEB_CONFIGURE_EXTRA_FLAGS := --enable-gstreamer \
                             --enable-alsa \
                             --enable-usb \
                             --enable-hal \
                             --enable-netlink \
                             --enable-tools \
                             --enable-bccmd \
                             --enable-hid2hci \
                             --enable-dfutool \
                             --enable-cups \
                             --enable-manpages \
                             --enable-pcmciarules \
                             --enable-debug \
                             --enable-hidd \
                             --enable-pand \
                             --enable-dund


DEB_DESTDIR := $(CURDIR)/debian/tmp

install/bluez::
	install -D -m 0644 $(CURDIR)/input/input.conf $(CURDIR)/debian/bluez/etc/bluetooth/input.conf
	install -D -m 0644 $(CURDIR)/audio/audio.conf $(CURDIR)/debian/bluez/etc/bluetooth/audio.conf
	install -D -m 0644 $(CURDIR)/network/network.conf $(CURDIR)/debian/bluez/etc/bluetooth/network.conf
	install -D -m 0755 $(CURDIR)/scripts/hid2hci.pm-utils $(CURDIR)/debian/bluez/usr/lib/pm-utils/sleep.d/48hid2hci
	install -D -m 0644 $(CURDIR)/debian/hid2hci.rules $(CURDIR)/debian/bluez/etc/udev/rules.d/62-bluez-hid2hci.rules

install/bluez-alsa::
	install -D -m 0644 $(CURDIR)/audio/asound.conf $(CURDIR)/debian/bluez-alsa/usr/share/alsa/bluetooth.conf

binary-install/bluez-gstreamer::
	dh_gstscancodecs -pbluez-gstreamer

install/bluez-pcmcia-support::
	cp -f $(CURDIR)/scripts/bluetooth.rules $(CURDIR)/debian/bluez-pcmcia-support.udev

binary-install/bluez-pcmcia-support::
	chmod a+x $(CURDIR)/debian/bluez-pcmcia-support/lib/udev/bluetooth_serial

clean::
	-rm -f $(CURDIR)/debian/bluez-pcmcia-support.udev
l'unica cosa che ho capito è che passa delle opzioni al configure cosa che potrei tranquillamente passare io stesso al configure, questo invece è il file control

Codice: Seleziona tutto

Source: bluez
Section: admin
Priority: optional
Maintainer: Ubuntu Core Developers <ubuntu-devel-discuss@lists.ubuntu.com>
Build-Depends: debhelper (>= 7),
               autotools-dev,
               cdbs,
               flex,
               bison,
               gstreamer-tools,
               libasound2-dev,
               libdbus-1-dev,
               libdbus-glib-1-dev,
               libglib2.0-dev,
               libgstreamer0.10-dev,
               libgstreamer-plugins-base0.10-dev,
               libnl-dev,
               libsndfile1-dev,
               libusb-dev,
Vcs-Bzr: http://bazaar.launchpad.net/~ubuntu-dev/utils/ubuntu-bluez-4.x
Vcs-Browser: http://code.launchpad.net/~ubuntu-dev/utils/ubuntu-bluez-4.x
Homepage: http://www.bluez.org
Standards-Version: 3.8.0

Package: libbluetooth3
Section: libs
Conflicts: libsdp2 (<= 1.5-2)
Replaces: libsdp2 (<= 1.5-2)
Depends: ${shlibs:Depends}
Architecture: any
Description: Library to use the BlueZ Linux Bluetooth stack
 BlueZ is the official Linux Bluetooth protocol stack. It is an Open Source
 project distributed under GNU General Public License (GPL).

Package: libbluetooth-dev
Section: libdevel
Provides: libbluetooth3-dev
Conflicts: libbluetooth-dev, libsdp2-dev (<= 1.5.2), bluez-pan
Replaces: libsdp2-dev (<= 1.5.2)
Depends: libbluetooth3 (= ${binary:Version}), libc6-dev | libc-dev
Suggests: pkg-config
Priority: extra
Architecture: any
Description: Development files for using the BlueZ Linux Bluetooth library
 BlueZ is the official Linux Bluetooth protocol stack. It is an Open Source
 project distributed under GNU General Public License (GPL).

Package: bluetooth
Architecture: all
Depends: bluez
Recommends: bluez-alsa,
            bluez-cups,
            bluez-gstreamer,
Description: Bluetooth support
 This package provides all of the different plugins supported
 by the Bluez bluetooth stack.

Package: bluez
Architecture: any
Depends: ${shlibs:Depends}, module-init-tools, makedev | udev, lsb-base, dbus
Replaces: bluez-input, bluez-network, bluez-audio, bluez-serial, bluez-utils (<=4.9)
Description: Bluetooth tools and daemons
 This package contains tools and system daemons for using Bluetooth devices.
 .
 BlueZ is the official Linux Bluetooth protocol stack. It is an Open Source
 project distributed under GNU General Public License (GPL).

Package: bluez-alsa
Replaces: bluez-audio
Architecture: any
Depends: ${shlibs:Depends}
Description: Bluetooth audio support
 This package contains a driver operate with the ALSA stack.
 .
 BlueZ is the official Linux Bluetooth protocol stack. It is an Open Source
 project distributed under GNU General Public License (GPL).

Package: bluez-cups
Architecture: any
Depends: ${shlibs:Depends}, cups
Description: Bluetooth printer driver for CUPS
 This package contains a driver to let CUPS print to Bluetooth-connected
 printers.
 .
 BlueZ is the official Linux Bluetooth protocol stack. It is an Open Source
 project distributed under GNU General Public License (GPL).

Package: bluez-gstreamer
Architecture: any
Depends: ${shlibs:Depends}
Replaces: bluez-audio
Description: Bluetooth gstreamer support
 This package contains a plugin to operate with with gstreamer applications.
 .
 BlueZ is the official Linux Bluetooth protocol stack. It is an Open Source
 project distributed under GNU General Public License (GPL).

Package: bluez-pcmcia-support
Architecture: any
Priority: extra
Depends: pcmciautils
Recommends: setserial
Description: PCMCIA support files for BlueZ 2.0 Bluetooth tools
 This package contains files to enable PCMCIA card services to recognise
 and initialise PCMCIA Bluetooth devices.
 .
 BlueZ is the official Linux Bluetooth protocol stack. It is an Open Source
 project distributed under GNU General Public License (GPL).

Package: bluez-compat
Architecture: any
Depends: ${shlibs:Depends}
Description: BlueZ 3.x compatibility binaries
 This package provides the legacy binaries that were reminiscent of the
 BlueZ 3.x pairing methods.  These binaries are not supported, and will
 go away again in the future. The provided binaries are:
 .
 hidd
 dund
 pand

Package: bluez-utils
Depends: bluetooth
Architecture: all
Description: Transitional package
 This is a transitional package to assist with moving people to the
 BlueZ 4.x stack.
molto più complesso, dove vengono specificati tutti i pacchetti da creare, il file .dsc non ho capito bene ma mi sembra una specie di indice che dice ad apt che archivi scaricare?
Comunque grazie della dritta non ci avevo pensato ora provo a modificare il file control e vediamo come va
Avatar utente
P4blo
Scoppiettante Seguace
Scoppiettante Seguace
Messaggi: 947
Iscrizione: giovedì 7 febbraio 2008, 20:55
Contatti:

Re: [Bluez]Creare pacchetti multipli

Messaggio da P4blo »

grande Xiam, me li ha creati, ora però non ho capito in base a quale principio mi ha creato questi deb, visto che nel file control ho messo solo i nomi dei vari pacchetti, e come ha fatto dh_make a capire quali file mettere in quali pacchetti, chi ne sa qualcosa?
Xiam
Entusiasta Emergente
Entusiasta Emergente
Messaggi: 2174
Iscrizione: venerdì 25 aprile 2008, 11:59

Re: [Bluez]Creare pacchetti multipli

Messaggio da Xiam »

con applicare il diff intendevo dare il comando

Codice: Seleziona tutto

dpkg-source -x nomefile.dsc
che però, ho visto recentemente, è una cosa che fa in automatico anche il comando

Codice: Seleziona tutto

debuild
o probabilmente dh_make.

Per sapere come fa a creare i pacchetti diversi nonostante tu abbia solamente specificato i nomi dei pacchetti devi guardare dentro l'archivio diff.gz che hai scaricato insieme al sorgente vero e proprio e al file .dsc. Dentro c'è un file con estensione .diff che ti spiega tutto ;)
Scrivi risposta

Ritorna a “Gruppo Sviluppo”

Chi c’è in linea

Visualizzano questa sezione: 0 utenti iscritti e 1 ospite