Last active
May 3, 2016 03:35
-
-
Save rohityadavcloud/e19463222663a2201aed to your computer and use it in GitHub Desktop.
APT/YUM signed repo hosting
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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