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 24 Oct 2014, 22:47
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 Posts_count_1  
Author Message
jimhap

Joined: 03 Mar 2007
Posts: 63

PostPosted: 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"'!!!!!'"

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_website 
Display_posts:   Sort by:   
Page 1 of 1 Posts_count_1  
Post_new_topic   Reply_to_topic View_previous_topic :: View_next_topic
 Forum index » Advanced Topics » Puppy Projects
Jump to:  

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


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