#!/usr/local/bin/perl # # OpenBSD Package to Web Page Converter # ------------------------------------- # # This script generates web pages by extracting the long and short # definitions from OpenBSD package files (.tgz files). # Info: Ryan Walker (walkerr@ssimicro.com) # Mangled by Bob Beck (beck@openbsd.org) # This file is in the public domain # # commited as working on ftp.openbsd.org (so /usr/local/bin/perl isn't a typo) # remember this has to work on non openbsd platforms. # # Define these variables to fit your config # $pkg_root -- root directory of packages to build, should contain arch # $web_root -- main web directory, index.html created in this directory # $tmp -- temporary directory, obviously must be writable # $version -- version number we are building for, ie "2.7" (only used for # ftp1 & 2 -- self explanatory, used for building FTP links $pkg_root="/afs/ualberta.ca/sunsite/ftp/pub/OpenBSD/2.8/packages"; $web_root="/usr/sunsite02/home/beck/www"; $tmp="/usr/sunsite02/home/beck/tmp"; $version="2.8"; $ftp1="ftp://ftp.openbsd.org/pub/OpenBSD/$version"; $ftp2="ftp://ftp1.usa.openbsd.org/pub/OpenBSD/$version"; # OK, let's get started. # verifyvars just checks to make sure all the variables specified # make sense. (In that the directories exist, are writable, etc.) &verifyvars; &getdata; system "rm -rf $web_root/*"; system "mv $tmp/build/* $web_root"; system "rm -rf $tmp/*"; sub getdata { opendir ROOT, "$pkg_root" or die "Could not open $pkg_root directory!"; @array=(readdir(ROOT)); open(INDEXFILE,">$tmp/build/index.html"); print INDEXFILE "