Skip to content

Commit

Permalink
Debian repository management part 2/2
Browse files Browse the repository at this point in the history
Issue #31:
- use reprepro to build the repository
- include source package
- update to release engineering documentation
  • Loading branch information
jean1 committed May 16, 2012
1 parent c96b9b6 commit ee68172
Show file tree
Hide file tree
Showing 2 changed files with 49 additions and 24 deletions.
22 changes: 20 additions & 2 deletions RELENG
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,24 @@ XXXXXXXXXXXXXXXXXXXXXXXXXXX
cd $NETMAGIS
make debian-packages

3.c. Copy packages to the web server
3.c. Create repository if needed

mkdir -p /local/repo/conf
# add the following lines in /local/repo/conf/distributions
Origin: netmagis
Label: netmagis
Codename: stable
Architectures: amd64 i386
Components: main
Description: Apt repository for netmagis

3.d. Update local repository

make debian-repo

3.e. Copy local repository to the web server

tar cf - -C /local repo | \
ssh netmagis.org tar xf - -C /www/docs/files


scp netmagis-*-debian-*.tar.gz netmagis.org:/www/docs/files/
51 changes: 29 additions & 22 deletions pkg/debian/update-repo
Original file line number Diff line number Diff line change
@@ -1,5 +1,17 @@
#!/bin/sh

#
# Create or update Debian repository
#
# Usage Example:
#
# update-repo 2.1 $HOME/netmagis/pkg/debian /local/repo
#
# The package reprepro is required to run this script
#
# History:
# 2012/05/16 : pda/jean : design

if [ $# -ne 3 ]
then
echo "Usage: $0 version pkgdir repodir" >&2
Expand All @@ -10,16 +22,14 @@ VERSION="$1"
PKGDIR="$2"
REPODIR="$3"

BINSFX="dists/stable/main"
BINDIR="$REPODIR/$BINSFX"

# Check repository consistency
if [ \! -d $BINDIR ]
# Check repository existence
if [ ! -d "$REPODIR" ]
then
echo "Directory $BINDIR does not exist" >&2
echo "Directory $REPODIR does not exist" >&2
exit 1
fi


# Check for packages
for i in common database metro servers topo utils www
do
Expand All @@ -31,19 +41,16 @@ do
fi
done

# Guess architectures
arch=`ls $PKGDIR|sed -n "/netmagis-.*_$VERSION-.*_\(.*\)\.deb/s//\1/p"|sort -u`

# Copy packages
for a in $arch
do
mkdir -p $BINDIR/binary-$a
cp $PKGDIR/netmagis-*_$VERSION-*_$a.deb $BINDIR/binary-$a

# Generate Packages.gz relative to the debian directory
(
cd $REPODIR
/usr/bin/dpkg-scanpackages $BINSFX/binary-$a | \
gzip -9 > $BINSFX/binary-$a/Packages.gz
)
done
# Create configuration file for reprepro
cat > $REPODIR/conf/distributions <<EOF
Origin: netmagis
Label: netmagis
Codename: stable
Architectures: amd64 i386
Components: main
Description: Apt repository for netmagis
#SignWith: <key-id>
EOF

# Create or update repository
reprepro -b $REPODIR includedeb stable $PKGDIR/netmagis-*_$VERSION-*.deb

0 comments on commit ee68172

Please sign in to comment.