Skip to content

Instantly share code, notes, and snippets.

@rhtyd rhtyd/buildrepo.sh
Last active May 3, 2016

Embed
What would you like to do?
APT/YUM signed repo hosting
cd /path/to/repo
# rpm
for release in 4.2 4.3 4.4;
do
echo "Buildling repo for $release"
cd $release
rm -fr repodata
createrepo .
cd ..
done
cd /path/to/repo
# debian
for release in 4.2 4.3 4.4;
do
echo "Buildling repo for $release"
cd $release
apt-ftparchive packages . > Packages
gzip -c Packages > Packages.gz
apt-ftparchive release . > Release
gpg --passphrase $(cat ~/.gnupg/token) --clearsign -o InRelease Release
gpg --passphrase $(cat ~/.gnupg/token) -abs -o Release.gpg Release
cd ..
done
yum install maven genisoimage git vim mkisofs gcc python MySQL-python openssh-clients wget unzip jpackage-utils java-1.7.0-openjdk-devel glibc-devel MySQL-python bzip2 gzip nfs-utils mysql-connector-java tomcat python nfs-utils openssh-clients ws-commons-util sudo ipmitool mysql bridge-utils rpm-build ebtables iptables jsvc ipset jakarta-commons-daemon-jsvc rpm libvirt-python net-tools qemu-kvm qemu-img chkconfig jakarta-commons-daemon-jsvc jsvc make gcc
#!/usr/bin/expect -f
set timeout -1
spawn sh -c "rpm --resign *.rpm"
match_max 100000
expect -exact "Enter pass phrase: "
send -- "put-password-here\r"
expect eof
# rpm
rpms=$(find cloudstack | grep rpm$)
rpm --resign $rpms
# debian
files=$(find cloudstack | grep deb$)
filesToSign=""
for file in $files;
do
echo $file
if [[ $(dpkg-sig -l $file | grep builder | wc -l) -eq 0 ]]; then
filesToSign="$filesToSign $file"
fi
done
echo "Signing following debs: " $filesToSign
dpkg-sig -s builder -k <ID> -p $filesToSign
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.