Puppy Linux Discussion Forum Forum Index Puppy Linux Discussion Forum
Puppy HOME page : puppylinux.com
"THE" alternative forum : puppylinux.info
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

The time now is Fri 25 Apr 2014, 05:06
All times are UTC - 4
 Forum index » Advanced Topics » Puppy Projects
packpet (under development,help requested)
Moderators: Flash, JohnMurga
Post new topic   Reply to topic View previous topic :: View next topic
Page 1 of 1 [1 Post]  
Author Message
jimhap

Joined: 03 Mar 2007
Posts: 63

PostPosted: Tue 23 Oct 2007, 17:15    Post subject:  packpet (under development,help requested)
Subject description: 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"'!!!!!'"

Number of seconds left: "
num=2
printf "$num "
sleep 1s
num=`expr $num - 1`
printf "$num "
sleep 1s
num=`expr $num - 1`
echo -e $num" \033[0m"

mkdir -p buildp
mkdir -p packagedir


for dirs in *
do

   if [ -f "$dirs" ]
   then
      continue
   fi
   
   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
Code:

chmod +x packpet

./packpet



And you get what you want. Wink
Back to top
View user's profile Send private message Visit poster's website 
Display posts from previous:   Sort by:   
Page 1 of 1 [1 Post]  
Post new topic   Reply to topic View previous topic :: View next topic
 Forum index » Advanced Topics » Puppy Projects
Jump to:  

You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Powered by phpBB © 2001, 2005 phpBB Group
[ Time: 0.0535s ][ Queries: 11 (0.0157s) ][ GZIP on ]