[Gambas-user] Making debian repositories?

Hamish Robertson robertsonhamish at ...626...
Sat May 31 17:11:52 CEST 2008


Nearly finished a BASH script that makes it possible to double-click install
software on ubuntu sans the internet. I'm almost there but I'm having
trouble creating a local apt repository (I want to create an apt repository
in a folder on my hard disk. Anyone got a clue how to do this? Any help
would be greatly appreciated. p.s sorry this isn't GAMBAS...will add a
proper gambas UI once I get this script worked out...


l#/bin/bash
# MAKE AN INSTALL SCRIPT SCRIPT
# Hamish's convert's deb files to self extracting gz files.
# bundles the desired deb and all it's dependancies together.

gksu -k /bin/echo "login der"

sudo mkdir /tmp/setupfiles

sudo rm -f /var/cache/apt/archives/*.deb

#sudo yes | sudo apt-get update

sdebname=$(zenity --text "Please enter a one-word name for your superdeb."
--entry)

zenity --info \
--text="Please choose the packages to include in your setup file. When you
have finished downloading your packages, please exit Synaptic to continue."

sudo synaptic
#Synaptic has now finished
#Make a directory for the metapackage

sudo mkdir -p /tmp/setupfiles/$sdebname/DEBIAN
# Now we need to clear the control file if there is a pre-existing control
file
sudo rm -f /tmp/setupfiles/$sdebname/DEBIAN/control
cd /tmp/setupfiles/$sdebname/DEBIAN
#Make a new (and empty) control file
sudo touch control
sudo chmod 666 control
#start filling in the fields

#Insert package name into control file
sudo echo "Package: "$sdebname >> control
#insert version no... in this case it's always 1.0
sudo echo "Version: 1.0" >> control
#insert section
sudo echo "Section: unknown" >> control
#insert Priority
sudo echo "Priority: optional" >> control
#insert Maintainer
sudo echo "Maintainer: Superdeb! <superdeb at ...1917...>" >> control
#insert Architechture
sudo echo "Architecture: i386" >> control
#insert list of dependancies
cd /var/cache/apt/archives/
## Rob's perl listing script. (Thanks Rob!!)
DEPLIST=$(perl -e 'print join(", ", map { s/.deb$//; $_ }
split("\n", `ls *.deb`)), "\n";')
cd /tmp/setupfiles/$sdebname/DEBIAN
sudo echo "Depends: "$DEPLIST >> control
#Metapackage Description
sudo echo "Description: This is the metapackage used to install "$sdebname
>> control

##Control file is made! Yay! Now just have to make it into a .deb file
cd /tmp/setupfiles/
sudo dpkg-deb -b --nocheck $sdebname

#in theory I should now have a metapackage! <CONFIRMED>

#Now to make a repository HELP!!!! I'm in the ballpark here...just not
hitting a home run yet..

 cd /var/cache/apt/archives
sudo cp *.deb /tmp/setupfiles
sudo -i
cd /tmp/setupfiles/


    sudo ls -1 *.deb > override

    # create a package file
    dpkg-scanpackages ./ override | gzip > Packages.gz

mkdir /tmp/setupfiles/packages
sudo cp *.deb /tmp/setupfiles/packages



More information about the User mailing list