FAQ Search Today's Posts Mark Forums Read
» Video Reviews

» Linux Archive

Linux-archive is a website aiming to archive linux email lists and to make them easily accessible for linux users/developers.


» Sponsor

» Partners

» Sponsor

Go Back   Linux Archive > Debian > Debian User

 
 
LinkBack Thread Tools
 
Old 07-23-2008, 05:42 AM
T o n g
 
Default directory to deb

Hi,

Quick question,

Apart from using checkinstall, if I've prepared a directory of folders and
files, can I make the directory into a .deb file?

Thanks

--
Tong (remove underscore(s) to reply)
http://xpt.sourceforge.net/techdocs/
http://xpt.sourceforge.net/tools/


--
To UNSUBSCRIBE, email to debian-user-REQUEST@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org
 
Old 07-23-2008, 07:16 AM
"Eugene V. Lyubimkin"
 
Default directory to deb

T o n g wrote:
> Hi,
>
> Quick question,
>
> Apart from using checkinstall, if I've prepared a directory of folders and
> files, can I make the directory into a .deb file?
>
> Thanks
>
As I know, no. In your case checkinstall is better. To prepare valid .deb, you must
provide more than just directories and files, see 'Debian New Maintainers' Guide' for
detailed info and consider writing to 'debian-mentors[dog]lists.debian.org' about
preparing the .deb's.

--
Eugene V. Lyubimkin aka JackYF, Ukrainian C++ developer.
 
Old 07-23-2008, 10:36 AM
NN_il_Confusionario
 
Default directory to deb

On Wed, Jul 23, 2008 at 10:16:20AM +0300, Eugene V. Lyubimkin wrote:
> T o n g wrote:
> > Apart from using checkinstall, if I've prepared a directory of folders and
> > files, can I make the directory into a .deb file?
> As I know, no. In your case checkinstall is better.

customizing the script which follows produces a .deb of the same
(usually low) quality of checkinstall. Sorry for the fact that comments
inside the script are not in english.

#!/bin/bash

test `id -u` -eq 0 || { echo "AVVISO: l'uid non 0, bisognerebbe usare 'fakeroot ./.crea_deb.sh'!
" ; echo "Ora tento di rieseguire lo script dentro fakeroot:
" ; exec fakeroot "$0"; }

echo 'Script per fare un .deb con tutti i files in una dir (e sottodir)'
echo 'NOTARE! da eseguirsi con `pwd`=la dir coi files'
echo 'NOTARE! la parte coi simlink funziona bene solo nelle ipotesi:'
echo 'la dir coi files ha la forma $BBASE/NN/$NOME'
echo 'I link sono in ../../bin=$BBASE/bin (files universalmente eseguibili)'
echo 'in ../../sbin=$BBASE/sbin (files eseguibili solo dal possessore, root)'

BASENOME=`/bin/pwd`
BASE="`dirname "$BASENOME"`"
NOME="`basename "$BASENOME"`"
NOMEPKG="$NOME"
VERSIONE="1.0.1-0.back.1"

BBASE=`dirname "$BASE"`
echo "
*** In questo momento BBASE vale $BBASE ***
"
test -d "../../bin" || { echo "AVVISO: ../../bin non dir! Male per i links!
" ; }
test -d "../../sbin" || { echo "AVVISO: ../../sbin non dir! Male per i links!
" ; }
which lintian>/dev/null || { echo "AVVISO: servirebbe avere lintian installato!
" ; }
which fakeroot>/dev/null || { echo "AVVISO: servirebbe avere fakeroot installato!
" ; }
which dpkg-shlibdeps>/dev/null || { echo "AVVISO: servirebbe avere dpkg-dev installato per usare dpkg-shlibdeps (dipendenze di un binario)!
" ; }
which ar>/dev/null || { echo "AVVISO: *OCCORRE* avere binutils installato! senza ar NON creo pacchetto .deb
" ; }
umask 0022

Crea_deb () {
TMPDIR="/tmp/$NOME.`date +%Y-%m-%d--%H-%M-%S`"
{
mkdir -p "$TMPDIR"
test -d "$TMPDIR" || { echo "ERRORE: $TMPDIR non dir!" ; exit 1 ; }
# "$BASENOME/lista" = lista files fuori da "$BASENOME" ma nel pkg
##### ATTENZIONE: NON SONO AMMESSI NOMI SIFULI (spazi nel path, ...)
test -e "$BASENOME/lista" || touch "$BASENOME/lista"
INST_SIZE=`du -sc "$BASENOME" $(cat "$BASENOME/lista")|tail -n 1|sed "s/[[:blank:]].*//"`
# crea data.tar.gz
find "$BBASE"/bin -lname "$BASENOME/*">"$TMPDIR/lista_bin"
find "$BBASE"/bin -lname "../NN/$NOME/*">>"$TMPDIR/lista_bin"
find "$BBASE"/sbin -lname "$BASENOME/*">"$TMPDIR/lista_sbin"
find "$BBASE"/sbin -lname "../NN/$NOME/*">>"$TMPDIR/lista_sbin"
cat "$TMPDIR/lista_sbin" "$TMPDIR/lista_bin" "$BASENOME/lista">"$TMPDIR/lista"
tar --numeric-owner
--files-from="$TMPDIR/lista"
-cvziSf "$TMPDIR/data.tar.gz" "$BASENOME"
##tolto numeric-owner, _MA_ allora nomi utenti devono essere "universali" ...
##tar -cvziSf "$TMPDIR/data.tar.gz" "$BASENOME"
# crea debian-binary
echo "2.0">"$TMPDIR/debian-binary"
# crea control.tar.gz
cat<<EOF>"$TMPDIR/control"
Package: $NOMEPKG
Version: $VERSIONE
Section: localscripts
Priority: optional
Architecture: all
Depends: bash (>= 2)
Recommends: screen, mc, ssh, rsync, bzip2, less, deborphan
Suggests: file, pinfo, telnet-ssl, lynx, mutt, wget, pdmenu, super, dpkg-repack, ntpdate, sash, e3
Installed-Size: $INST_SIZE
Maintainer: NN <nn@nohay.net>
Description: Una raccolta di scripts
Dalla collezione di scripts di NN.
ATTENZIONE: il pacchetto NON rispetta completamente la policy debian
EOF
find "$BASENOME" -type f -print0|xargs -0 md5sum|sed "s+ /+ +">"$TMPDIR/md5sums"
for F in `cat "$BASENOME/lista"` ; do
md5sum $F|sed "s+ /+ +">>"$TMPDIR/md5sums" ; done
#E: bho: control-file-has-bad-permissions md5sums 0664 != 0644
#E: bho: control-file-has-bad-owner md5sums 1000/1000 != root/root
##chmod 0644 "$TMPDIR/control" "$TMPDIR/md5sums" "$TMPDIR/debian-binary"
chown root:root "$TMPDIR/control" "$TMPDIR/md5sums" "$TMPDIR/debian-binary"
cd "$TMPDIR"
tar --numeric-owner -cvziSf "$TMPDIR/control.tar.gz" control md5sums
# crea pacchetto .deb
ar rucv "${NOME}_${VERSIONE}_all.deb" debian-binary control.tar.gz data.tar.gz
lintian "${NOME}_${VERSIONE}_all.deb" 2>&1 >"${NOME}_${VERSIONE}_all.deb.lintian" 2>&1
grep ^E: "${NOME}_${VERSIONE}_all.deb.lintian"
echo "ATTENZIONE: cercare di soddisfare lintian prima di installare il .deb !"
cd -
} 2>&1 | tee -a "$TMPDIR/LOG" 2>&1
} # fine funzione Crea_deb

Crea_links () {
# files "nascosti" ".*" NON vengono linkati in bin o sbin
# files non nascosti e eseguibili vengono linkati
cd $BASENOME
cd ../../bin
find ../NN/$NOME -type f -perm -111 ! -name ".*" -print0|xargs -0
ln --target-directory=. -s
cd $BASENOME
cd ../../sbin
find ../NN/$NOME -type f -perm -100 ! -perm -1 ! -name ".*" -print0|xargs -0
ln --target-directory=. -s
cd $BASENOME
}

Togli_links () {
cd $BASENOME
find ../../bin -lname "$BASENOME/*" -print0|xargs -0 rm
find ../../bin -lname "../NN/$NOME/*" -print0|xargs -0 rm
find ../../sbin -lname "$BASENOME/*" -print0|xargs -0 rm
find ../../sbin -lname "../NN/$NOME/*" -print0|xargs -0 rm
}

Controlla_permessi () {
cd $BASENOME
echo "Files (o dir...) con almeno uno dei tre bit speciali attivato: premere invio"
read DUMMY
find . -perm +7000 -ls|less
echo "Files (o dir...) x per l'utente ma non gruppo o altri: premere invio"
read DUMMY
find . -perm +100 ! -perm -11 -ls|less
echo "Files (o dir...) con uid non 0: premere invio"
read DUMMY
find . ! -uid 0 -ls|less
echo "Files (o dir...) con gid non 0: premere invio"
read DUMMY
find . ! -gid 0 -ls|less
}

Chown_root () {
cd $BASENOME
chown -R root:root .
}

Chmod_aXr () {
cd $BASENOME
find . -perm +111 -print0|xargs -0 chmod a+xr
find . -print0|xargs -0 chmod go-w,a+X
}

CercoDipendenze () {
mkdir -p debian
touch debian/substvars
find . -type f -perm +111 -print0|xargs -0 dpkg-shlibdeps
}

PRE=" **** Comandi disponibili: ****
"
PS3="
Digitare il numero del comando voluto e premere enter; Ctrl-D per uscire: "
echo "$PRE"
select COMANDO in
Crea_links Togli_links Controlla_permessi Chown_root Chmod_aXr
CercoDipendenze Crea_deb ;
do $COMANDO ; echo "$PRE" ; done

--
Chi usa software non libero avvelena anche te. Digli di smettere.
Informatica=arsenico: minime dosi in rari casi patologici, altrimenti letale.
Informatica=bomba: intelligente solo per gli stupidi che ci credono.


--
To UNSUBSCRIBE, email to debian-user-REQUEST@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org
 
Old 07-24-2008, 03:26 AM
T o n g
 
Default directory to deb

On Wed, 23 Jul 2008 12:36:05 +0200, NN_il_Confusionario wrote:

>> > Apart from using checkinstall, if I've prepared a directory of folders and
>> > files, can I make the directory into a .deb file?
>> As I know, no. In your case checkinstall is better.
>
> customizing the script which follows produces a .deb of the same
> (usually low) quality of checkinstall.

Thanks a lot for the code snip, NN_il_Confusionario. It explains well why
there isn't such a tool to create .deb from a directory.

I have a second thought, since checkinstall accept any install command,
can I do

checkinstall rsync -vua . /

from the directory that I prepared to create a .deb file?

thanks

--
Tong (remove underscore(s) to reply)
http://xpt.sourceforge.net/techdocs/
http://xpt.sourceforge.net/tools/


--
To UNSUBSCRIBE, email to debian-user-REQUEST@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org
 
Old 07-24-2008, 09:29 AM
NN_il_Confusionario
 
Default directory to deb

On Thu, Jul 24, 2008 at 03:26:37AM +0000, T o n g wrote:
> I have a second thought, since checkinstall accept any install command,
> can I do
>
> checkinstall rsync -vua . /
>
> from the directory that I prepared to create a .deb file?

if the command

rsync -vua . /

is really what you want to do, then instead give a look to
dh_builddeb
and/or other dh_* commands

My script instead was for an _alredy installed_ package, for example
when you as user do a
./configure --prefix=/usr/local/NN/packagename-version/;make;make install
(where /usr/local/NN/packagename-version is a pre-existing directory owened
by the user). Sorry for having misunderstood your problem.

Also, give a look at ckeckinstall (really, installwatch) bugs; for
example be SURE that your installation does not modify /etc/passwd or
any other (inportant) file which exists before the installation.

--
Chi usa software non libero avvelena anche te. Digli di smettere.
Informatica=arsenico: minime dosi in rari casi patologici, altrimenti letale.
Informatica=bomba: intelligente solo per gli stupidi che ci credono.


--
To UNSUBSCRIBE, email to debian-user-REQUEST@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org
 

Thread Tools




All times are GMT. The time now is 06:59 AM.

VBulletin, Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2007, Crawlability, Inc.
Copyright 2007 - 2008, www.linux-archive.org