# ========================================================================= # Copyright 2004 Josh Glover # # LICENCE: # # This work is licensed under the Creative Commons Attribution-ShareAlike # License. To view a copy of this license, visit: # # http://creativecommons.org/licenses/by-sa/2.0/ # # or send a letter to: # # Creative Commons # 559 Nathan Abbott Way # Stanford, California 94305, USA. # # gentoo-dev_add-new-package.txt # # DESCRIPTION: # # Captain's Log for adding a completely new package to Portage. # # USAGE: # # Read the Captain's Log, pasting bits into your terminal once you # have verified that all paths, settings and so on are right for your # environment, *OR*, copy the Captain's Log somewhere on your box, # edit it to fit your environment, and run it (possibly as root): # # bash gentoo-dev_add-new-package.txt # # MODIFICATIONS: # # Josh Glover (2004/06/05): Initial revision # ========================================================================= # 1. Setup variables PORTAGE_CVS_PATH="$HOME/coding/gentoo-x86" NAME="Josh Glover" EMAIL="jmglov@gentoo.org" SUB_NAME="Josh Glover" SUB_BUG="36808" CATEGORY="net-misc" PN="ssh-installkeys" PV="1.3" LONGDESCRIPTION="This script tries to export ssh public keys to a specified "\ "site. It will walk you through generating key pairs if it doesn't find any "\ "to export. It handles all the fiddly details like making sure local and "\ "remote permissions are correct, and tells you what it's doing if it has to "\ "change anything." # 2. Update category tree, then add new package's directory to CVS cd ${PORTAGE_CVS_PATH}/${CATEGORY} cvs update -d mkdir ${PN} cvs add ${PN} # 3. Create metadata.xml cd ${PORTAGE_CVS_PATH}/${CATEGORY}/${PN} echo '' >metadata.xml echo '' \ >>metadata.xml echo '' >>metadata.xml echo ' ' >>metadata.xml echo ' '"${EMAIL}"'' >>metadata.xml echo ' '"${NAME}"'' >>metadata.xml echo ' ' >>metadata.xml echo ' '"${LONGDESCRIPTION}"'' \ >>metadata.xml echo '' >>metadata.xml # 4. Save ebuild into directory, or create it here if you do not have a user- # submitted ebuild cp /usr/portage/skel.ebuild "${PN}-${PV}.ebuild" xemacs "${PN}-${PV}.ebuild" & # 5. Add ebuild and metadata to CVS cvs add ${PN}-${PV}.ebuild metadata.xml # 5a. If the new ebuild requires a non-standard licence: LICENCE_FILE="somelicence.txt" cp "${LICENCE_FILE}" "${PORTAGE_CVS_PATH}/${PN}" cvs add "${PORTAGE_CVS_PATH}/${PN}" # 6. Create digest cd ${PORTAGE_CVS_PATH}/${CATEGORY}/${PN} PORTDIR_OVERLAY="${PORTAGE_CVS_PATH}" FEATURES="cvs autoaddcvs fixpackages" \ ebuild ${PN}-${PV}.ebuild digest # 7. Add files directory, digest, and any patches cd ${PORTAGE_CVS_PATH}/${CATEGORY}/${PN} cvs add ${PN}-${PV}.ebuild metadata.xml cvs add files find files/ -type f | grep -v CVS | xargs cvs add # 8. Create ChangeLog and add it to CVS ECHANGELOG_USER="${NAME} <${EMAIL}>" \ echangelog "This package was submitted by ${SUB_NAME} in bug #${SUB_BUG}" # 9. Use repoman to perform perfunctory QA PORTDIR_OVERLAY="${PORTAGE_CVS_PATH}" FEATURES="cvs autoaddcvs fixpackages" \ repoman fix # 10. Commit package to CVS if test -n "${LICENCE_FILE}"; then cvs commit "${PORTAGE_CVS_PATH}/${PN}"; fi PORTDIR_OVERLAY="${PORTAGE_CVS_PATH}" FEATURES="cvs autoaddcvs fixpackages" \ repoman commit \ -m "This package was submitted by ${SUB_NAME} in bug #${SUB_BUG}"