#!/bin/sh -x # # Usage: ./package-script [NEW-DEP-FILE] # Example: ./package-script /home/boudewijn/tribler_5.2.0-1ubuntu10_all.deb # function check_dir { DIR=$1 if [ ! -d "$DIR" ]; then echo "Creating missing directory: $DIR" mkdir $DIR fi } # 0: package # 1: distro {hardy, intrepid, jaunty, etc} # 2: architecture {amd64, i386} # 3: optional dep file {/home/boudewijn/tribler_5.2.0-1ubuntu10_all.deb} function package { # Ensure that the directory exists check_dir "dists" check_dir "dists/$1" check_dir "dists/$1/main" check_dir "dists/$1/main/binary-$2" DIR="dists/$1/main/binary-$2" # Optionally copy the new dep file if [ -f "$3" ]; then cp -v "$3" "$DIR" fi # Build Packages file dpkg-scanpackages "$DIR" /dev/null | gzip > "$DIR/Packages.gz" # Ensure that everything is readable chmod -R a+r "$DIR" } package maverick amd64 "$1" package maverick i386 "$1" package lucid amd64 "$1" package lucid i386 "$1" #package jaunty amd64 "$1" #package jaunty i386 "$1" #package karmic amd64 "$1" #package karmic i386 "$1" #package intrepid amd64 "$1" #package intrepid i386 "$1" #package hardy amd64 "$1" #package hardy i386 "$1"