2010-11-24 17:45:13 +00:00
|
|
|
#!/bin/sh
|
2010-11-06 04:51:11 +00:00
|
|
|
# This script creates a Debian repository in ${DIR} using the reprepro tool.
|
|
|
|
# The packages are signed with the key referenced in the newest changelog entry.
|
2010-11-09 22:19:32 +00:00
|
|
|
|
|
|
|
set -e
|
2010-11-06 04:51:11 +00:00
|
|
|
|
|
|
|
cd $(dirname $0)
|
|
|
|
DIR=./repo
|
|
|
|
CONFDIR=conf
|
|
|
|
CONFFILE=${CONFDIR}/distributions
|
|
|
|
|
2010-11-24 17:45:13 +00:00
|
|
|
SIGNER=`parsechangelog --file changelog | grep Maintainer | cut -d\< -f2 | cut -d\> -f1`
|
2010-11-06 04:51:11 +00:00
|
|
|
KEYID=`gpg --list-keys "${SIGNER}" | cut -d: -f2 | grep -w pub | cut -d/ -f2 | cut -d\ -f1`
|
|
|
|
echo Using signing key: ${SIGNER}
|
|
|
|
echo Key ID: ${KEYID}
|
|
|
|
|
|
|
|
# creating the reprepro config file dynamically allows us to specify the signer
|
|
|
|
mkdir -p ${CONFDIR}
|
|
|
|
echo "Origin: I2P" > ${CONFFILE}
|
|
|
|
echo "Label: I2P Debian Repository" >> ${CONFFILE}
|
|
|
|
echo "Suite: all" >> ${CONFFILE}
|
|
|
|
echo "Codename: all" >> ${CONFFILE}
|
|
|
|
echo "Architectures: i386 amd64 source" >> ${CONFFILE}
|
|
|
|
echo "Components: main" >> ${CONFFILE}
|
|
|
|
echo "SignWith: ${SIGNER}" >> ${CONFFILE}
|
|
|
|
|
|
|
|
# create the repository
|
|
|
|
echo Building the repository...
|
2010-11-18 20:56:42 +00:00
|
|
|
find packages/ -name *.deb -exec reprepro --ask-passphrase --outdir ${DIR} includedeb all {} \;
|
|
|
|
find packages/ -name *.changes -exec reprepro --ask-passphrase --outdir ${DIR} include all {} \;
|
|
|
|
find packages/ -name *.dsc -exec reprepro --ask-passphrase --outdir ${DIR} includedsc all {} \;
|
2010-11-06 04:51:11 +00:00
|
|
|
|
|
|
|
# export the public key
|
|
|
|
gpg --armor --export ${SIGNER} > ${DIR}/0x${KEYID}.asc
|
|
|
|
|
|
|
|
# remove the config file created above
|
|
|
|
echo Cleaning up...
|
|
|
|
rm -f ${CONFFILE}
|
|
|
|
rmdir ${CONFDIR}
|
2010-11-06 05:40:24 +00:00
|
|
|
|
|
|
|
echo Debian repository created in `pwd`/${DIR}.
|