Pagina 1 di 1

Tool per la pacchettizzazione

Inviato: sab 18 ott 2008, 10:39
da huvber
esiste un tool o uno script che genera pacchetti in automatico partendo dai sorgenti?

Re: tool per la packetizzazione

Inviato: sab 18 ott 2008, 10:48
da 414N
Gli script di SlackBuild.
Ne trovi parecchi su http://www.slackbuilds.org, ma anche qui su slacky.

Re: tool per la packetizzazione

Inviato: sab 18 ott 2008, 11:02
da conraid
huvber ha scritto:esiste un tool o uno script che genera pacchetti in automatico partendo dai sorgenti?
Se vuoi un "tool automatico", ma sarei anche io per gli slackbuild, guarda slacktrack
lo trovi in /extra nel cd/dvd/ftp/mirror di Slackware, qui la sua home: http://www.slackware.com/~mozes/

Re: tool per la packetizzazione

Inviato: sab 18 ott 2008, 12:36
da tigerwalk
Scusate se approfitto della discussione, sto dando un'occhiata a diversi slackbuild. Il mio target è di compilare i programmi per ARCH=i686. Il problema è che sono completamente a digiuno...!
Ad esempio, volendo ricompilare ddrescue per la mia ARCH, basta segnalarlo nella $ARCH oppure va inserita qualche altra opzione nello slackbuild originale?
Grazie.

Re: tool per la packetizzazione

Inviato: sab 18 ott 2008, 12:42
da conraid
tigerwalk ha scritto:Scusate se approfitto della discussione, sto dando un'occhiata a diversi slackbuild. Il mio target è di compilare i programmi per ARCH=i686. Il problema è che sono completamente a digiuno...!
Ad esempio, volendo ricompilare ddrescue per la mia ARCH, basta segnalarlo nella $ARCH oppure va inserita qualche altra opzione nello slackbuild originale?
Grazie.
Basta segnalarlo in ARCH, ma attento.
1) se compili tramite .configure usa sempre build=i486-slackware-linux, se non c'è on .configure non preoccuparti
2) se vuoi ottimizzare un poco, metti "-O2 -march=i686 -pipe -fomit-frame-pointer"

Re: tool per la packetizzazione

Inviato: sab 18 ott 2008, 12:56
da tigerwalk
Grazie conraid, se hai la pazienza ed il tempo di leggerlo, ti posto lo slackbuild che ho modificato per il pacchetto ddrescue.
Approfitto per porti un altro quesito, lo slack-required in base a che cosa bisogna impostarlo? In pratica, come si ricavano le dipendenze?
Grazie.

Codice: Seleziona tutto

#!/bin/sh
# Heavily based on the Slackware 10.0 SlackBuild

#
CWD=`pwd`
TMP=${TMP:-/tmp/tgz}
PKG=$TMP/package
NAME=ddrescue
VERSION=1.8
ARCH=${ARCH:-i686}
BUILD=1tw
#
if [ "$ARCH" = "i386" ]; then
  SLKCFLAGS="-O2 -march=i386 -mcpu=i686"
elif [ "$ARCH" = "i486" ]; then
  SLKCFLAGS="-O2 -march=i486 -mtune=i686"
elif [ "$ARCH" = "i686" ]; then
  SLKCFLAGS="-O2"
elif [ "$ARCH" = "s390" ]; then
  SLKCFLAGS="-O2"
elif [ "$ARCH" = "x86_64" ]; then
  SLKCFLAGS="-O2"
fi
#
if [ ! -d $TMP ]; then
mkdir -p $TMP 
fi
if [ ! -d $PKG ]; then
mkdir -p $PKG 
fi
#
#echo "| Start SlackBuild $NAME-$VERSION |"
#
mkdir -p $PKG
cd $TMP
#tar xzvf $CWD/$NAME-$VERSION.tar.gz
tar xjvf $CWD/$NAME-$VERSION.tar.bz2
#
cd $NAME-$VERSION
#zcat $CWD/$NAME.diff.gz | patch -p1 -E --backup --verbose
find . -perm 777 -exec chmod 755 {} \;
find . -perm 775 -exec chmod 755 {} \;
find . -perm 555 -exec chmod 755 {} \;
find . -perm 664 -exec chmod 644 {} \;
find . -perm 666 -exec chmod 644 {} \;
find . -perm 444 -exec chmod 644 {} \;
chown -R root.root .
#
CFLAGS="$SLKCFLAGS" \
CXXFLAGS="$SLKCFLAGS" \
./configure --prefix=/usr \
--disable-static \
--mandir=/usr/man \
--program-prefix= \
--program-suffix= \
--disable-debug \
--enable-color \
--enable-multibuffer \
--enable-nanorc \
--build=$CHOST-slackware-linux
#sed -i "s|-O2|-O2 -march=i486 -mtune=i686|g" Makefile
#sed -i "s|/usr/local|/usr|g" Makefile
#
make -j3 || exit 1
make install DESTDIR=$PKG
mkdir -p $PKG/usr/doc/$NAME-$VERSION
cp -a \
  AUTHORS COPYING ChangeLog INSTALL NEWS README TODO \
 $PKG/usr/doc/$NAME-$VERSION
#
cd $PKG 
  find . | xargs file | grep "executable" | grep ELF | cut -f 1 -d : | xargs strip --strip-unneeded 2> /dev/null 
  find . | xargs file | grep "shared object" | grep ELF | cut -f 1 -d : | xargs strip --strip-unneeded 2> /dev/null 
#
#gzip -9 $PKG/usr/man/*/*
find $PKG/usr/man -type f -exec gzip -9 {} \;
#gzip -9 $PKG/usr/info/*
#
#chown -R root.bin $PKG/usr/bin
#
mkdir -p $PKG/install
cat $CWD/slack-desc > $PKG/install/slack-desc
cat $CWD/doinst.sh > $PKG/install/doinst.sh
cat $CWD/slack-desc > $PKG/usr/doc/$NAME-$VERSION/slack-desc
cat $CWD/$NAME.SlackBuild > $PKG/usr/doc/$NAME-$VERSION/$NAME.SlackBuild
#
cd $PKG
requiredbuilder -v -y -s $CWD $PKG
makepkg -l y -c n ../$NAME-$VERSION-$ARCH-$BUILD.tgz
mv $TMP/$NAME-$VERSION-$ARCH-$BUILD.tgz $CWD

#
if [ "$1" = "--cleanup" ]; then
rm -rf $TMP/$NAME-$VERSION
rm -rf $PKG
fi



Re: tool per la packetizzazione

Inviato: sab 18 ott 2008, 13:10
da conraid
Dove l'hai trovato?

Usa questo
http://repository.slacky.eu/slackware-1 ... SlackBuild

Anche se io lo cambierei leggermente

Codice: Seleziona tutto

#!/bin/sh
# Slackware 12.1 SlackBuild
# http://ftp.gnu.org/gnu/ddrescue/

set -e # così ti esce se c'è un errore, so che molti non amano questo comando, ma in uno slackbuild lo ritengo essenziale

CWD=`pwd`
TMP=${TMP:-/tmp/tgz}
PKG=$TMP/package-ddrescue
NAME=ddrescue
VERSION=1.8
ARCH=i686
BUILD=2mtx

SOURCE=http://ftp.gnu.org/gnu/ddrescue/$NAME-$VERSION.tar.bz2

if [ ! -e $NAME-$VERSION.tar.bz2 ]; then
wget -c $SOURCE
fi

if [ ! -d $TMP ]; then
 mkdir -p $TMP
fi
if [ ! -d $PKG ]; then
 mkdir -p $PKG
fi


if [ "$ARCH" = "i486" ]; then
  SLKCFLAGS="-O2 -march=i486   -mtune=i686"
elif [ "$ARCH" = "i686" ]; then
  SLKCFLAGS="-O2 -march=i686 -pipe -fomit-frame-pointer"
elif [ "$ARCH" = "athlon64" ]; then
  SLKCFLAGS="-O2 -march=athlon64 -pipe"
elif [ "$ARCH" = "athlonxp" ]; then
  SLKCFLAGS="-O3 -march=athlon-xp -pipe -fomit-frame-pointer"
elif [ "$ARCH" = "x86_64" ]; then
  SLKCFLAGS="-O2"
elif [ "$ARCH" = "s390" ]; then
  SLKCFLAGS="-O2"
fi

cd $TMP
tar xvjf $CWD/$NAME-$VERSION.tar.bz2

cd $NAME-$VERSION

chown -R root:root .
chmod -R u+w,go+r-w,a-s .

CFLAGS="${SLKCFLAGS}" \
CXXFLAGS="${SLKCFLAGS}" \
./configure \
  --prefix=/usr \
  --sysconfdir=/etc \
  --localstatedir=/var \
  --infodir=/usr/info

make -j2
make install-strip DESTDIR=$PKG

( cd $PKG
  find . | xargs file | grep "executable" | grep ELF | cut -f 1 -d : | xargs strip --strip-unneeded 2> /dev/null
  find . | xargs file | grep "shared object" | grep ELF | cut -f 1 -d : | xargs strip --strip-unneeded 2> /dev/null
  find . | xargs file | grep "current ar archive" | cut -f 1 -d : | xargs strip -g 2> /dev/null
)

if [ ! -d $PKG/usr/doc/$NAME-$VERSION ]; then
  mkdir -p $PKG/usr/doc/$NAME-$VERSION
fi

mkdir -p $PKG/install
cat $CWD/slack-desc > $PKG/install/slack-desc
cat $CWD/slack-desc > $PKG/usr/doc/$NAME-$VERSION/slack-desc
cat $CWD/$NAME.SlackBuild > $PKG/usr/doc/$NAME-$VERSION/$NAME.SlackBuild
cp -a AUTHORS COPYING ChangeLog INSTALL NEWS README $PKG/usr/doc/$NAME-$VERSION

rm $PKG/usr/info/dir

if [ -d $PKG/usr/info ]; then
  find $PKG/usr/info -type f -name "*.info" -exec gzip -9f {} \;
fi

cd $PKG
requiredbuilder -v -y -s $CWD $PKG
makepkg -l y -c n $CWD/$NAME-$VERSION-$ARCH-$BUILD.tgz

if [ "$1" = "--cleanup" ]; then
 rm -rf $TMP
fi

Altrimenti guarda questo
http://slackbuilds.org/slackbuilds/12.1 ... SlackBuild


requiredbuiler produce un file che sia chiama slack-required, ma da solo ci fai poco, se non leggere cosa serve.
Serve più che altro agli script che creano il file PACKAGES.TXT ad aggiungere le sezioni apposite

Re: Tool per la pacchettizzazione

Inviato: sab 18 ott 2008, 13:23
da tigerwalk
non l'ho trovato, ho letto diversi slackbuild e mi sono ricavato quello che ti ho postato. Ho provato a compilare il pacchetto e va a buon fine. Lo adatterò secondo i tuoi suggerimenti (ndt: sempre preziosi). :)