Posted: Tue 23 Oct 2007, 17:15 Post_subject:
packpet (under development,help requested) Sub_title: a tool that can automatically create tgzs (or pets) from source packages!
packpet is a little script I made that can automatically package tgzs out of source packages.
For example:
I download vim source package.
I put the script into the same directory as the vim source is.
Now I run packpet and in a while, the script finishes and volla,
my pets are in there!
Right now it is "workable". That means it will work, but there are bugs.
Volunteers appreciated for help on the script.
TO get my script, copy below to a text editor (like geany).
Code:
#!/bin/sh
#packpet script by jimhap
CDIR=`pwd`
CONFARG=""
for dirs in *
do
if [ -f "$dirs" ]
then
echo "$dirs is not a directory. Skipping the file $dirs...."
continue
fi
if [ ! -f "$dirs/configure" ]
then
echo "Configure file not found in $dirs. Skipping...."
continue
fi
dirlist="$dirlist
$dirs"
done
sleep 1s
clear
printf "List of programs to be compiled and packaged:
$dirlist
\033[1mPRESS CTRL-C NOW IF THE LIST IS INCORRECT"'!!!!!'"
if [ ! -f "$dirs/configure" ]
then
continue
fi
echo -e "
\033[1m---------------------------------------\033[0m
Compiling and packaging \033[1m""$dirs""\033[0m...
\033[1m---------------------------------------\033[0m"
cd $dirs
./configure --prefix=$CDIR/buildp/$dirs/usr/X11R6 $CONFARG && make && make install
cd ../buildp/$dirs
find -type d > $CDIR/$dirs.folders
find -type f > $CDIR/$dirs.files
for dirs2 in `find ./usr -type d `
do
if [ -f "$dirs2" ]
then
continue
fi
for dirs3 in `find $dirs2 -type f`
do
executelist="$executelist
cp -r $dirs3 $CDIR/packagedir/$dirs/$dirs2/"
done
done
echo "
$executelist"
cd $CDIR/packagedir
mkdir -p $dirs
cd $dirs
DIRM=`cat $CDIR/$dirs.folders`
echo "mkdir -p $CDIR/packagedir/$dirs/$DIRM"
mkdir -p $CDIR/packagedir/$dirs/$DIRM
cd $CDIR/$dirs
make uninstall && make distclean
./configure --prefix=/usr/X11R6 $CONFARG && make && make install
FILESTOCOPY=`cat $CDIR/$dirs.files`
cd /
if [ `pwd` = "/" ]; then
cat > copyfile <<EOF
#!/bin/sh
$executelist
EOF
chmod +x /copyfile
/copyfile
rm /copyfile
cd $CDIR
else
cd /
cat > copyfile <<EOF
#!/bin/sh
$executelist
EOF
chmod +x /copyfile
/copyfile
rm /copyfile
cd $CDIR
fi
mv $CDIR/packagedir/$dirs/ /$dirs
tar -czvf "$dirs".tgz /$dirs
done
Then save it to /root (or where ever the source is or will be stored).
The open a terminal. cd to the directory, and execute
Rules_post_cannot Rules_reply_cannot Rules_edit_cannot Rules_delete_cannot Rules_vote_cannot You cannot attach files in this forum You can download files in this forum