etc/mirrors.d/50-rfc: Build bibliographic database from the RFC index.
[mirror-admin] / etc / mirrors.d / 50-rfc
index e44e1d4..d7b4388 100755 (executable)
@@ -17,3 +17,15 @@ standard_rsync "$@" \
 standard_rsync "$@" \
   rsync.mirrorservice.org::ftp.isi.edu/internet-drafts/ \
   internet-drafts/
+
+## Build a usable BibTeX database of RFCs.  XSLT runes are by Roland
+## Bless, taken from http://www.tm.uka.de/~bless/bibrfcindex.html
+mkdir -p rfc-bib
+if [ rfc/rfc-index.xml -nt rfc-bib/rfc.bib ]; then
+  xsltproc $HOME/lib/rfcxmlindex2bibtex.xslt rfc/rfc-index.xml |
+  sed '
+    s/\([_&%#$]\)/\\\1/g
+    /author=/s/\([^ ]*\) \(3rd\|Jr\.\)/\{\1 \2\}/g
+  ' >rfc-bib/rfc-bib.new
+  mv rfc-bib/rfc-bib.new rfc-bib/rfc.bib
+fi