diff options
author | dennis@bratac.ausil.us <dennis@bratac.ausil.us> | 2007-12-03 12:58:35 -0600 |
---|---|---|
committer | dennis@bratac.ausil.us <dennis@bratac.ausil.us> | 2007-12-03 12:58:35 -0600 |
commit | 9bf3c49ae9b4557ae4948172a16dff195aa2e801 (patch) | |
tree | 2c7512703b86c26d74170919a28c47f9f99ea9f8 /src | |
parent | 31c66cf58f809d861ff8737c034e09d6214736f1 (diff) | |
download | fedora-packager-9bf3c49ae9b4557ae4948172a16dff195aa2e801.tar.gz fedora-packager-9bf3c49ae9b4557ae4948172a16dff195aa2e801.tar.xz fedora-packager-9bf3c49ae9b4557ae4948172a16dff195aa2e801.zip |
attempt to autotoolise
Diffstat (limited to 'src')
-rwxr-xr-x | src/fedora-cvs.py | 49 | ||||
-rw-r--r-- | src/fedora-packager-setup.sh | 129 |
2 files changed, 178 insertions, 0 deletions
diff --git a/src/fedora-cvs.py b/src/fedora-cvs.py new file mode 100755 index 0000000..eb0a7b4 --- /dev/null +++ b/src/fedora-cvs.py @@ -0,0 +1,49 @@ +#!/usr/bin/python + +import os +import string +import sys +import commands + +def readUser(): + ''' samle line "Subject: C=US, ST=North Carolina, O=Fedora Project, OU=Dennis Gilmore, CN=ausil/emailAddress=dennis@ausil.us" ''' + userCert = "" + if os.access(os.path.join(os.path.expanduser('~'),".fedora.cert"), os.R_OK): + userCert = open(os.path.join(os.path.expanduser('~'),".fedora.cert"), "r").read() + else: + print "!!! cannot read your ~/.fedora.cert file !!!" + print "!!! Ensure the file is readable and try again !!!" + os.exit(1) + for certLine in userCert.split("\n"): + if not len(certLine): + continue + stripCertLine = certLine.strip() + if stripCertLine.startswith("Subject: "): + subjectLine = certLine.split("CN=") + name = subjectLine[1].split("/") + return name[0] + + +def cvsco(user, module): + '''CVSROOT=:ext:ausil@cvs.fedoraproject.org:/cvs/extras/''' + (s, o) = commands.getstatusoutput("CVSROOT=:ext:%s@cvs.fedoraproject.org:/cvs/extras/ CVS_RSH=ssh cvs co %s" % (user, module)) + if s != 0: + print "Error: %s" % o + else: + print o + + +def main(pkg): + userName = readUser() + cvsco(userName, pkg) + +if __name__ == '__main__': + if len(sys.argv) < 2: + print "you need to specify the module to checkout of cvs" + sys.exit(1) + + #the package we want to pull from cvs + pkg = sys.argv[1] + + main(pkg) + diff --git a/src/fedora-packager-setup.sh b/src/fedora-packager-setup.sh new file mode 100644 index 0000000..92faf28 --- /dev/null +++ b/src/fedora-packager-setup.sh @@ -0,0 +1,129 @@ +#!/bin/bash + +set -e + +function check_wget() { + if [ ! -f /usr/bin/wget ]; then + echo "You must have wget installed to download the required CA certificates" + echo "Please run \"yum install wget\" as root, and re-run this script" + exit 1 + fi +} + +echo "Setting up Koji client..." + +if [ ! -f ~/.fedora.cert ]; then + echo "You need a client certificate from the Fedora Account System" + echo "Please download one from https://admin.fedoraproject.org/accounts/gen-cert.cgi" + echo "Save it to ~/.fedora.cert and re-run this script" + exit 1 +fi + +if [ ! -f ~/.fedora-upload-ca.cert ]; then + check_wget + /usr/bin/wget -q "https://admin.fedoraproject.org/accounts/fedora-upload-ca.cert" -O ~/.fedora-upload-ca.cert +fi + +if [ ! -f ~/.fedora-server-ca.cert ]; then + check_wget + /usr/bin/wget -q "https://admin.fedoraproject.org/accounts/fedora-server-ca.cert" -O ~/.fedora-server-ca.cert +fi + +if [ ! -d ~/.koji ]; then + mkdir ~/.koji +fi + +# remove existing contents of ~/.koji to avoid confusion +rm -f ~/.koji/* + +cat > ~/.koji/config <<EOF +[koji] + +;configuration for koji cli tool + +;url of XMLRPC server +server = http://koji.fedoraproject.org/kojihub + +;url of web interface +weburl = http://koji.fedoraproject.org/koji + +;url of package download site +pkgurl = http://koji.fedoraproject.org/packages + +;path to the koji top directory +;topdir = /mnt/koji + +;configuration for SSL athentication + +;client certificate +cert = ~/.fedora.cert + +;certificate of the CA that issued the client certificate +ca = ~/.fedora-upload-ca.cert + +;certificate of the CA that issued the HTTP server certificate +serverca = ~/.fedora-server-ca.cert + +EOF + +for arch in arm alpha ia64 sparc s390 ;do +cat > ~/.koji/$arch-config <<EOF +[koji] + +;configuration for koji cli tool + +;url of XMLRPC server +server = http://$arch.koji.fedoraproject.org/kojihub + +;url of web interface +weburl = http://$arch.koji.fedoraproject.org/koji + +;url of package download site +pkgurl = http://$arch.koji.fedoraproject.org/packages + +;path to the koji top directory +;topdir = /mnt/koji + +;configuration for SSL athentication + +;client certificate +cert = ~/.fedora.cert + +;certificate of the CA that issued the client certificate +ca = ~/.fedora-upload-ca.cert + +;certificate of the CA that issued the HTTP server certificate +serverca = ~/.fedora-server-ca.cert + +EOF +done + +cat <<EOF +Creating an SSL certificate to import into your browser, to enable +user authentication at http://koji.fedoraproject.org/koji/ +Choose your own passphrase, you will be prompted for this when importing the certificate. + +EOF + +if [ -f ~/fedora-browser-cert.p12 ]; then + rm ~/fedora-browser-cert.p12 +fi + +/usr/bin/openssl pkcs12 -export -in ~/.fedora.cert -CAfile ~/.fedora-upload-ca.cert -out ~/fedora-browser-cert.p12 + +cat <<EOF + +Browser certificate exported to ~/fedora-browser-cert.p12 +To import the certificate into Firefox: + +Edit -> Preferences -> Advanced +Click "View Certificates" +On "Your Certificates" tab, click "Import" +Select ~/fedora-browser-cert.p12 +Type the export passphrase you chose earlier + +Once imported, you should see a certificate named "Fedora Project". +Your username should appear underneath this. + +You should now be able to click the "login" link at http://koji.fedoraproject.org/koji/ successfully. +EOF |