From: Michael S. <xm...@us...> - 2005-04-14 10:20:17
|
Update of /cvsroot/docbook/releasetools In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv2659/releasetools Added Files: Targets.mk Variables.mk deb2sourceforge docbook-build docbook-dtd-test Log Message: Moved some release-related tools to releasetools dir --- NEW FILE --- # this file is a -*- makefile -*- snippet # targets in the file are used only for release builds # $Id: Targets.mk,v 1.1 2005/04/14 10:20:07 xmldoc Exp $ RELEASE-NOTES.html: RELEASE-NOTES.xml $(XJPARSE) $< $(XSLT) $< $(DOC-LINK-STYLE) $@ RELEASE-NOTES.txt: RELEASE-NOTES.html $(BROWSER) $(BROWSER_OPTS) $< > $@ distrib: all $(DISTRIB_DEPENDS) $(CVS2LOG) -w ifeq ($(DIFFVER),) $(MERGELOGS) > $(NEWSFILE) else $(MERGELOGS) -v $(DIFFVER) > $(NEWSFILE) endif newversion: ifeq ($(CVSCHECK),) ifeq ($(DIFFVER),) @echo "DIFFVER must be specified." exit 1 else ifeq ($(NEXTVER),$(RELVER)) cvs tag $(TAGVER) $(MAKE) DIFFVER=$(DIFFVER) distrib else @echo "VERSION $(RELVER) doesn't match specified version $(NEXTVER)." exit 1 endif endif else @echo "CVS is not up-to-date! ($(CVSCHECK))" exit 1 endif freshmeat: ifeq ($(SFRELID),) @echo "You must specify the sourceforge release identifier in SFRELID" exit 1 else $(XSLT) VERSION VERSION $(TMP)/fm-docbook-$(DISTRO) sf-relid=$(SFRELID) grep -v "<?xml" $(TMP)/fm-docbook-$(DISTRO) | freshmeat-submit $(FMGO) endif zip: ifeq ($(ZIPVER),) @echo You must specify ZIPVER for the zip target exit 1 else # normalize perms/filemodes for all files and dirs find . -type f | xargs chmod 0644 find . -type d | xargs chmod 0755 # set executable bit on anything that should be executable ifneq ($(EXECUTABLES),) chmod 0755 $(EXECUTABLES) endif # ----------------------------------------------------------------- # Prepare *zip files for main (NON-doc) part of distro # ----------------------------------------------------------------- rm -rf $(TMP)/docbook-$(DISTRO)-$(ZIPVER) rm -f $(TMP)/tar.exclude rm -f $(TMP)/docbook-$(DISTRO)-$(ZIPVER).tar.gz rm -f $(TMP)/docbook-$(DISTRO)-$(ZIPVER).tar.bz2 rm -f $(TMP)/docbook-$(DISTRO)-$(ZIPVER).zip umask 022; mkdir -p $(TMP)/docbook-$(DISTRO)-$(ZIPVER) touch $(TMP)/tar.exclude # distro-specific excludes for file in $(DISTRIB_EXCLUDES); do \ find . -print | grep $$file | cut -c3- >> $(TMP)/tar.exclude; \ done # specific excludes for distros with docs if [ -d doc ]; then \ find . -print | grep /doc/ | cut -c3- >> $(TMP)/tar.exclude; \ fi if [ -d docsrc ]; then \ find . -print | grep /docsrc/ | cut -c3- >> $(TMP)/tar.exclude; \ fi # global excludes for file in $(ZIP_EXCLUDES); do \ find . -print | grep $$file | cut -c3- >> $(TMP)/tar.exclude; \ done # tar up distro, then gzip/bzip/zip it tar cf - * --exclude-from $(TMP)/tar.exclude | (cd $(TMP)/docbook-$(DISTRO)-$(ZIPVER); tar xf -) umask 022; cd $(TMP) && tar cf - docbook-$(DISTRO)-$(ZIPVER) | gzip > docbook-$(DISTRO)-$(ZIPVER).tar.gz umask 022; cd $(TMP) && tar cf - docbook-$(DISTRO)-$(ZIPVER) | bzip2 > docbook-$(DISTRO)-$(ZIPVER).tar.bz2 umask 022; cd $(TMP) && zip -q -rpD docbook-$(DISTRO)-$(ZIPVER).zip docbook-$(DISTRO)-$(ZIPVER) rm -f $(TMP)/tar.exclude # ----------------------------------------------------------------- # Prepare *zip files for DOC part of distro (if any) # ----------------------------------------------------------------- ifeq ($(shell test -d doc; echo $$?),0) rm -rf $(TMP)/docbook-$(DISTRO)-$(ZIPVER) rm -f $(TMP)/tar.exclude rm -f $(TMP)/docbook-$(DISTRO)-doc-$(ZIPVER).tar.gz rm -f $(TMP)/docbook-$(DISTRO)-doc-$(ZIPVER).tar.bz2 rm -f $(TMP)/docbook-$(DISTRO)-doc-$(ZIPVER).zip umask 022; mkdir -p $(TMP)/docbook-$(DISTRO)-$(ZIPVER) touch $(TMP)/tar.exclude # distro-specific excludes for file in $(DISTRIB_EXCLUDES); do \ find . -print | grep $$file | cut -c3- >> $(TMP)/tar.exclude; \ done # global excludes for file in $(ZIP_EXCLUDES); do \ find . -print | grep $$file | cut -c3- >> $(TMP)/tar.exclude; \ done # tar up just the doc and docsrc dirs & if an "images" dir exists, # mv it into the doc dir tar cf - doc docsrc images --exclude-from $(TMP)/tar.exclude | (cd $(TMP)/docbook-$(DISTRO)-$(ZIPVER); tar xf -) umask 022; cd $(TMP) && \ if [ -d docbook-$(DISTRO)-$(ZIPVER)/images ]; \ then mv docbook-$(DISTRO)-$(ZIPVER)/images docbook-$(DISTRO)-$(ZIPVER)/doc/; \ fi umask 022; cd $(TMP) && tar cf - docbook-$(DISTRO)-$(ZIPVER) | gzip > docbook-$(DISTRO)-doc-$(ZIPVER).tar.gz umask 022; cd $(TMP) && tar cf - docbook-$(DISTRO)-$(ZIPVER) | bzip2 > docbook-$(DISTRO)-doc-$(ZIPVER).tar.bz2 umask 022; cd $(TMP) && zip -q -rpD docbook-$(DISTRO)-doc-$(ZIPVER).zip docbook-$(DISTRO)-$(ZIPVER) rm -f $(TMP)/tar.exclude endif endif install: zip -$(FTP) $(FTP_OPTS) "mput -O $(SF_UPLOAD_DIR) $(TMP)/docbook-$(DISTRO)-$(ZIPVER).*; quit" $(SF_UPLOAD_HOST) $(SCP) $(SCP_OPTS) $(TMP)/docbook-$(DISTRO)-$(ZIPVER).tar.bz2 $(PROJECT_USER)@$(PROJECT_HOST):$(PROJECT_BASE)/$(DISTRO)/ $(SSH) $(SSH_OPTS)-l $(PROJECT_USER) $(PROJECT_HOST) \ "(\ umask 002; \ cd $(PROJECT_BASE)/$(DISTRO); \ rm -rf $(ZIPVER); \ tar xfj docbook-$(DISTRO)-$(ZIPVER).tar.bz2; \ mv docbook-$(DISTRO)-$(ZIPVER) $(ZIPVER); \ rm -rf docbook-$(DISTRO)-$(ZIPVER).tar.bz2; \ chmod -R g+w $(ZIPVER); \ rm -f current; \ ln -s $(ZIPVER) current; \ if [ -d $(ZIPVER)/doc ] || [ -d $(ZIPVER)/images ]; then \ cd $(ZIPVER)/doc; \ ln -s ../images; \ fi \ )" --- NEW FILE --- #----------------------------------------------------------------- # -*- makefile -*- snippet with VARIABLES FOR RELEASE BUILDS #----------------------------------------------------------------- # If you are doing normal (non-release) sandbox builds just for # your own use, you can ignore all the variables below. They are # used only when doing release builds. #----------------------------------------------------------------- # $Id: Variables.mk,v 1.1 2005/04/14 10:20:07 xmldoc Exp $ # stylesheet for generating release notes DOC-LINK-STYLE=$(DOCBOOK_CVS)/xsl/docsrc/doc-link-docbook.xsl # browser to use for making text version of release notes BROWSER=w3m BROWSER_OPTS=-dump # file containing "What's New" info generated from CVS log NEWSFILE=NEWS # determine RELVER automatically by: # # - figuring out if VERSION file exists # - checking to see if VERSION is an XSL stylesheet or not # - grabbing the version number from VERSION file based on # whether or not it is a stylesheet # RELVER := $(shell \ if [ -f VERSION ]; then \ if grep "<xsl:stylesheet" VERSION >/dev/null; then \ grep "Version>.\+<" VERSION \ | sed 's/^[^<]*<fm:Version>\(.\+\)<\/fm:Version>$$/\1/' \ | tr -d "\n"; \ else cat VERSION; \ fi \ fi \ ) ZIPVER=$(RELVER) # the following are used to determine what version to compare to # in order to create the WhatsNew file NEXTVER= DIFFVER= # CVSCHECK is used to make sure your working directory is up to # date with CVS. Note that we use a makefile conditional here # because we want/need to check whether we're up to date only when # the "newversion" target is called. Without the conditional, the # right side of this variable assignment will get call every time # make is run, regardless of the target. Which kind of tends to # slow down things a bit... ifeq ($@,newversion) CVSCHECK = $(shell cvs -n update 2>&1 | grep -v ^cvs | cut -c3-) endif # remove dots from version number to create CVS tag TAGVER := $(shell echo "V$(RELVER)" | sed "s/\.//g") # if TMP is already defined in the environment, build uses that as # location for temporary storage for files generated by "make # zip"; otherwise it defaults to /tmp. To use a temp directory # other than /tmp, run "make zip TMP=/foo" ifeq ($(TMP),) TMP=/tmp endif # value of ZIP_EXCLUDES is a space-separated list of any file or # directory names (regular expressions OK) that should be excluded # from the *zip files for the release ZIP_EXCLUDES = \ /CVS$$ \ /CVS/ \ /debian/ \ \.classes \ ~$$ \ \..*\.pyc \ \\\#.* \ \.\\\#.* \ prj\.el \ \.cvsignore \ MANIFEST.build \ Makefile$$ \ Makefile[.] \ README\.CVS # specifies options to feed to "freshmeat-submit" FMGO=-N # SFRELID specifies Sourceforge release ID for current release. # Before running "make freshmeat", you need to manually create the # new release at Sourceforge (via the SF web interface), then copy # down the release ID in the URI for the release SFRELID= # specifies which FTP app to use for upload to SF incoming FTP=lftp FTP_OPTS=-e SCP=scp SCP_OPTS= SSH=ssh SSH_OPTS= SF_UPLOAD_HOST=upload.sf.net SF_UPLOAD_DIR=incoming PROJECT_HOST=docbook.sf.net RELEASE_DIR=/home/groups/d/do/docbook/htdocs/release PROJECT_USER:=`sed 's/^:.\+:\([^@]\+\)@.\+$$/\1/' CVS/Root` --- NEW FILE --- #!/bin/sh # $Id: deb2sourceforge,v 1.1 2005/04/14 10:20:07 xmldoc Exp $ # deb2sourceforge - Upload .deb to a Sourceforge project website # # Usage: deb2sourceforge # # There are no switches (yet). # # Use deb2sourceforge to automate upload of debs and deb sources # to a Sourceforge project website and to generate the files # needed for making the deb apt-gettable from that site. # # deb2sourceforge needs to be run from within the root of the # source tree (working directory) for the Debian package. # # This is free software. See the copyright notice at the end of # the script. # You must specify an Sourceforge project name and username #SF_PROJECT_NAME=docbook #SF_USER_NAME=xmldoc if [ ! -n "$SF_PROJECT_NAME" ] || [ ! -n "$SF_USER_NAME" ]; then echo echo "`basename $0`: Error (upload failed)" echo "Set values for both SF_PROJECT_NAME and SF_USER_NAME," echo "either as environment variables or within the `basename $0` script;" echo "then run `basename $0` again." exit 1 fi SCP=scp SCP_OPTS= SSH=ssh SSH_OPTS= SF_PROJECTHOST=$SF_PROJECT_NAME.sourceforge.net SF_PROJECT_HTDOCS=/home/groups/\ `echo $SF_PROJECT_NAME | cut -c-1`/\ `echo $SF_PROJECT_NAME | cut -c-2`/\ $SF_PROJECT_NAME/htdocs DEBIAN_BASEDIR=debian DEBIAN_SUBDIR=unstable # SF_DPKG_BIN directory needs to contain the following: # # dpkg, dpkg-deb, dpkg-scanpackages, dpkg-scansources # # Feel free to copy them to your own project space. # SF_DPKG_BIN=/home/groups/d/do/docbook/htdocs/bin # check to make sure we're actually in a built package source tree if [ ! -f debian/files ]; then echo echo "`basename $0`: Error (could not find or read debian/files)" exit 1 fi PACKAGENAME=`cut -d" " -f 1 debian/files | sed 's/\(.\+\)_[^.]\+.deb/\1/'` ORIGINALNAME=`echo $PACKAGENAME | sed 's/\(.\+\)-.\+/\1/'` echo "Checking remote directories and removing old package (if any)..." $SSH $SSH_OPTS -l $SF_USER_NAME $SF_PROJECTHOST \ "(\ mkdir -p $SF_PROJECT_HTDOCS/$DEBIAN_BASEDIR/$DEBIAN_SUBDIR; \ cd $SF_PROJECT_HTDOCS/$DEBIAN_BASEDIR/$DEBIAN_SUBDIR; \ rm -rf $PACKAGENAME*; \ )" echo "Uploading new package to $SF_PROJECT_HTDOCS/$DEBIAN_BASEDIR/$DEBIAN_SUBDIR..." cd .. $SCP $SCPOPTS \ $PACKAGENAME*.deb \ $PACKAGENAME*.diff.gz \ $PACKAGENAME*.dsc \ $PACKAGENAME*.changes \ $ORIGINALNAME.orig.tar.gz \ $SF_USER_NAME@$SF_PROJECTHOST:$SF_PROJECT_HTDOCS/$DEBIAN_BASEDIR/$DEBIAN_SUBDIR/ echo "Re-generating Packages.gz & Sources.gz files..." $SSH $SSH_OPTS -l $SF_USER_NAME $SF_PROJECTHOST \ "(\ umask 002; \ export PATH=$SF_PROJECT_HTDOCS/bin:$PATH; \ cd $SF_PROJECT_HTDOCS/$DEBIAN_BASEDIR; \ dpkg-scanpackages $DEBIAN_SUBDIR /dev/null | gzip -9c > $DEBIAN_SUBDIR/Packages.gz; \ dpkg-scansources $DEBIAN_SUBDIR /dev/null | gzip -9c > $DEBIAN_SUBDIR/Sources.gz \ )" echo echo "To apt-get the package you uploaded, users need to add the" echo "the following to their /etc/apt/sources.list" echo echo " deb http://$SF_PROJECT_NAME.sourceforge.net/$DEBIAN_BASEDIR $DEBIAN_SUBDIR/" echo " deb-src http://$SF_PROJECT_NAME.sourceforge.net/$DEBIAN_BASEDIR $DEBIAN_SUBDIR/" # Copyright # --------- # Copyright 2005 Michael Smith <xm...@us...> # # Permission is hereby granted, free of charge, to any person # obtaining a copy of this software and associated documentation # files (the "Software"), to deal in the Software without # restriction, including without limitation the rights to use, copy, # modify, merge, publish, distribute, sublicense, and/or sell copies # of the Software, and to permit persons to whom the Software is # furnished to do so, subject to the following conditions: # # The above copyright notice and this permission notice shall be # included in all copies or substantial portions of the Software. # # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, # EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF # MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND # NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT # HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, # WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER # DEALINGS IN THE SOFTWARE. --- NEW FILE --- #!/bin/sh # vim: number # docbook-build - Build script for generating DocBook project snapshots # $Id: docbook-build,v 1.1 2005/04/14 10:20:07 xmldoc Exp $ # fail if no CLASSPATH set if [ -z "$CLASSPATH" ]; then cat <<- EOF `basename $0`: error: CLASSPATH not set. Stopping. Before invoking `basename $0`, you must set the Java CLASSPATH environment variable in the environment from which the script runs, and it must contain absolute pathnames for the following: - Saxon or Xalan2 jar file or classes - Xerces jar file(s) or classes - Apache XML Commons Resolver jar file or classes - directory containing CatalogManager.properties file EOF exit 1 fi # fail if no DOCBOOK_CVS set if [ -z "$DOCBOOK_CVS" ]; then cat <<- EOF `basename $0`: error: DOCBOOK_CVS not set. Stopping. Before invoking `basename $0`, you must set the DOCBOOK_CVS environment variable in the environment from which the script runs. The value of DOCBOOK_CVS should be the absolute path to the base of a DocBook Project CVS working directory that contains the various DocBook Project modules; that is, such that the modules can be found in \$DOCBOOK_CVS/xsl, \$DOCBOOK_CVS/website, etc. EOF exit 1 fi umask 002 # set up some defaults SITEUSER=`whoami` SITEBASE=/home/groups/d/do/docbook/htdocs/snapshots SITEHOST=docbook.sourceforge.net RELEASEVERSION=snapshot if [ -z "$TMP" ]; then TMP=/tmp fi # default timeout waiting for lock file to clear is 1200 seconds (20 mins) LOCK_TIMEOUT=1200 usage="Usage: `basename $0` [-b BASEDIR] [-d DOMAIN] [-l LOGDIR] [-p PATH] [-r] [-s] [-t TMPDIR] [-u USER] [-v VERSION] [-z ZONE] DISTRO... " opts_admon="Type '`basename $0` -h' for details about options. " help=" Options: -b BASEDIR Specifies the location of the base directory containing the CVS working directories for modules from the DocBook project (directory containing 'xsl', 'dsssl', 'slides', etc. subdirs) Default: value of the DOCBOOK_CVS environment variable, if set; otherwise, the directory from which the script is run. -d DOMAIN Specifies the remote host (domain) to which the snaphost is uploaded Default: 'docbook.sourceforge.net' -l LOGDIR Specifies the directory to which the script redirects its standard output and standard error. Default: none -- if not set, stdout and stderr are not redirected to a log file. -p PATH Specifies the upload path on the remote host Default: '/home/groups/d/do/docbook/htdocs/snapshots' -r If specified, read commit message from standard input. -s If specified, scp the distro to upload site (after tar/zipping). -t TMPDIR Specifies the directory to which the script writes temporary files. Default: /tmp -u USER Specifies the (Sourceforge) username with which to upload the snapshot to the target (Sourceforge) website Default: Username found in CVS/Root in working directory, if found; otherwise, local username. -v VERSION Specifies the version name to put on the build. Default: 'snapshot' -z ZONE Specifies timezone to use for date/time stamps Default: none -- if not set, 'date' uses timezone configured on local machine. DISTRO... Space-separated list of distros to build (e.g. 'xsl dsssl') " while getopts ":b:d:hl:p:rst:u:v:z:" opt; do case $opt in r ) # parse commit message while read -r LINE do if echo $LINE | grep "^Message-Id: " >/dev/null; then MESSAGE_ID=`echo $LINE | sed 's/^Message-Id: <\([^@]\+\)@[^\>]\+>$/\1/'` elif echo $LINE | grep "^Subject: " >/dev/null; then CHANGE_DIR=`echo $LINE | sed 's/^.*CVS: \([^ ]\+\) .\+$/\1/'` CHANGE_FILES=`echo $LINE | sed 's/^.*CVS: [^ ]\+ \(.\+\)$/\1/' | sed 's/ /:/g'` break fi done ;; b ) BUILDDIR=$OPTARG ;; l ) LOGDIR=$OPTARG ;; t ) TMP=$OPTARG ;; v ) RELEASEVERSION=$OPTARG ;; u ) SITEUSER=$OPTARG OVERRIDE_CVSUSER=1 ;; d ) SITEHOST=$OPTARG ;; p ) SITEBASE=$OPTARG ;; s ) UPLOAD="yes" ;; z ) TZ=$OPTARG alias date="TZ=$TZ date" alias cvs2cl="TZ=$TZ cvs2cl" ;; h ) printf "$usage" printf "$help" exit 0 ;; \? ) printf "$usage" printf "$opts_admon" exit 1 ;; esac done shift $(($OPTIND - 1)) if [ -z "$BUILDDIR" ]; then BUILDDIR=`pwd` fi cd $BUILDDIR DISTROS="$@" if [ -z "$DISTROS" ]; then echo echo "`basename $0`: error: No DISTROS specified. Stopping." echo printf "$usage" printf "$opts_admon" exit 1; else for DISTRO in $DISTROS; do lock_timer=0 # wait for lock file (if any) to clear printf "Waiting for $TMP/docbook-$DISTRO-$RELEASEVERSION.lock file to clear..." 1>&2 while [ -f $TMP/docbook-$DISTRO-$RELEASEVERSION.lock ]; do if [ $lock_timer = $LOCK_TIMEOUT ]; then # time out after reaching $LOCK_TIMEOUT seconds # default is 1200 seconds (20 minutes) echo printf "Timed out after $LOCK_TIMEOUT seconds waiting for" printf "$TMP/docbook-$DISTRO-$RELEASEVERSION.lock file to clear.\n" echo "You probably have a stale $TMP/docbook-$DISTRO-$RELEASEVERSION.lock file that you need to delete." exit 1 fi printf "." 1>&2 sleep 1 let lock_timer=$lock_timer+1 done printf "Done.\n" 1>&2 printf "Doing some initialization..." 1>&2 # create new lock file touch $TMP/docbook-$DISTRO-$RELEASEVERSION.lock # remove old log file, if any rm -f $LOGDIR/docbook-$DISTRO-$RELEASEVERSION.log.tmp DATE=`date +%Y-%m-%d` TIME=`date '+%H:%M'` ZONE=`date '+%Z'` UPPER_DISTRO=`echo $DISTRO | tr "[:lower:]" "[:upper:]"` if [ -f $DISTRO/CVS/Root ]; then CVSROOT=`cat $DISTRO/CVS/Root` export CVSROOT CVSUSER=`sed 's/^:.\+:\([^@]\+\)@.\+$/\1/' $DISTRO/CVS/Root` if [ "$CVSUSER" != "anonymous" ]; then CVS_RSH=ssh export CVS_RSH fi if [ -z "$OVERRIDE_CVSUSER" ]; then # if no value for USER has been specified via -u option, set # SITEUSER for ssh uploads to same value as CVSUSER SITEUSER=$CVSUSER fi fi rm -f $DISTRO/VERSION cvs update -C $DISTRO/VERSION 1>/dev/null 2>&1 printf "." 1>&2 if grep "<xsl:stylesheet" $DISTRO/VERSION >/dev/null; then DIFFVER=`grep "Version>.\+<" $DISTRO/VERSION \ | sed "s/^[^<]*<fm:Version>\(.\+\)<\/fm:Version>$/\1/" | tr -d "\n"` else DIFFVER=`cat $DISTRO/VERSION` fi DIFFTAG=`cvs status -v $DISTRO/VERSION | grep -C1 "Existing Tags:" \ | grep revision | sed 's/^[ \t]\+\([^ \t]\+\)[ \t]\+.\+$/\1/'` if [ $MESSAGE_ID ]; then BUILD_ID=$MESSAGE_ID else BUILD_ID=$DATE\_$TIME\_$$ fi # done setting up environment printf "Done.\n" 1>&2 # start re-directing stout and stderr to log file (if logging enabled) if [ $LOGDIR ]; then echo "Logging all further output to $LOGDIR/docbook-$DISTRO-$RELEASEVERSION.log.tmp" exec 1> $LOGDIR/docbook-$DISTRO-$RELEASEVERSION.log.tmp exec 2>&1 fi date echo # echo selected variables set | grep "BUILD_ID\|^CHANGE\|DIFFTAG\|DIFFVER\|^DISTRO=\|RELEASEVERSION" echo echo "Running cvs update in gentext and $DISTRO working directories..." cvs update -d -P gentext || exit 1 cvs update -d -P $DISTRO || exit 1 echo # if this module has a "common" dir, it means it's probably # relying on the "gentext" stuff, so make "gentext" first if [ -d $DISTRO/common ]; then echo "Making gentext..." echo make -C gentext $DISTRO-files fi echo date echo "Building $DISTRO distribution..." echo make distrib -C $DISTRO DIFFVER=$DIFFVER cat <<- EOF > HEADER.txt The snapshot for a particular distribution is re-built automatically each time a change is checked into the CVS source tree for the distribution. The most recent build was of the "$DISTRO" distribution, on $DATE at $TIME $ZONE. These snapshots are intended for testing purposes only and otherwise come with no guarantees. Any of them may in fact be broken at any given time. EOF cat <<- EOF > $DISTRO/$DATE\_$RELEASEVERSION This directory contains a pre-release snapshot of the DocBook "$DISTRO" distribution, auto-built from the latest development sources in the DocBook project CVS repository on $DATE at $TIME $ZONE. The unique ID for this snapshot is $BUILD_ID. It is intended for testing purposes only and otherwise comes with no guarantees. It may in fact be broken. EOF cvs2cl -S --delta $DIFFTAG:HEAD --stdout $DISTRO \ | expand -t2 > $DISTRO/LatestChanges if grep "<xsl:stylesheet" $DISTRO/VERSION >/dev/null; then cp -p $DISTRO/VERSION $DISTRO/VERSION.tmp sed "s/Version>.\+</Version>$DATE\_$TIME\_$RELEASEVERSION</" $DISTRO/VERSION.tmp > $DISTRO/VERSION rm $DISTRO/VERSION.tmp else echo "$DATE_$TIME_$RELEASEVERSION" > $DISTRO/VERSION fi if [ "$UPLOAD" = "yes" ]; then make zip -C $DISTRO ZIPVER=$RELEASEVERSION TMP=$TMP || exit 1 cat <<- EOF > $TMP/line.tmp -------------------------------------------------------------------------------- Latest Changes: -------------------------------------------------------------------------------- EOF cvs2cl -S -l -d ">3 months ago" --stdout \ | expand -t2 > LatestChanges cat HEADER.txt $TMP/line.tmp LatestChanges > README.txt rm $TMP/line.tmp scp \ $TMP/docbook-$DISTRO*$RELEASEVERSION.zip \ $TMP/docbook-$DISTRO*$RELEASEVERSION.tar.gz \ $TMP/docbook-$DISTRO*$RELEASEVERSION.tar.bz2 \ README.txt \ LatestChanges \ $SITEUSER@$SITEHOST:$SITEBASE ssh -l $SITEUSER $SITEHOST \ "( \ umask 002; \ cd $SITEBASE; \ rm -f docbook-$DISTRO-$RELEASEVERSION.log; \ rm -rf $DISTRO; \ for tarball in docbook-$DISTRO*$RELEASEVERSION.tar.gz; do \ cat \$tarball | gunzip | \ (cd /tmp; tar xf -); \ done; \ mkdir $DISTRO; \ cp -pR /tmp/docbook-$DISTRO-$RELEASEVERSION/* $DISTRO; \ rm -rf /tmp/docbook-$DISTRO-$RELEASEVERSION; \ rm -rf $DISTRO/tools; \ rm -rf $DISTRO/RELEASE-NOTES.* ; \ )" rm -rf $TMP/docbook-$DISTRO*$RELEASEVERSION.tar.bz2 rm -rf $TMP/docbook-$DISTRO*$RELEASEVERSION.tar.gz rm -rf $TMP/docbook-$DISTRO*$RELEASEVERSION.zip rm -rf $TMP/docbook-$DISTRO-$RELEASEVERSION rm -f $DISTRO/$DATE\_$RELEASEVERSION $DISTRO/LatestChanges HEADER.txt README.txt LatestChanges date if [ -f $LOGDIR/docbook-$DISTRO-$RELEASEVERSION.log.tmp ]; then # filter raw log and copy to site cat $LOGDIR/docbook-$DISTRO-$RELEASEVERSION.log.tmp \ | grep -v '^cvs log: \|cvs update\|^tar: \|^tar \|^ adding: \|^find \|^cd \|rm \|^mkdir \|^touch \|cvs2log\|mergechangelogs' \ > $LOGDIR/docbook-$DISTRO-$RELEASEVERSION.log scp $LOGDIR/docbook-$DISTRO-$RELEASEVERSION.log $SITEUSER@$SITEHOST:$SITEBASE fi ssh -l $SITEUSER $SITEHOST "(cd $SITEBASE; chmod 664 *.tar.gz *.zip *.log)" fi rm -f $LOGDIR/docbook-$DISTRO-$RELEASEVERSION.log rm -f $TMP/docbook-$DISTRO-$RELEASEVERSION.lock cd - done fi --- NEW FILE --- #!/bin/sh # $Id: docbook-dtd-test,v 1.1 2005/04/14 10:20:07 xmldoc Exp $ TEMPDIR=/tmp CVS=cvs CVS_OPTS='-Q' WGET=wget WGET_OPTS='-q' UNZIP=unzip UNZIP_OPTS='-q' SED=sed SED_OPTS= XMLLINT=xmllint XMLLINT_OPTS='--noout --nonet --postvalid --nowarning --xinclude' usage="Usage: `basename $0` [-t TEMPDIR] [-v] URI " opts_admon="Type '`basename $0` -h' for details about options. " help="Options: -t TEMPDIR Specifies temporary directory (default: /tmp) -v Specifies verbose output for validation phase URI Location of zip file containing DocBook DTD to validate against Example: `basename $0` -v -t /scratch http://www.docbook.org/xml/4.4CR2/docbook-xml-4.4CR2.zip " while getopts "ht:v" opt; do case $opt in h ) printf "$usage" printf "$help" exit 0 ;; t ) TEMPDIR=$OPTARG ;; v ) VERBOSE=Yes ;; \? ) printf "$usage" printf "$opts_admon" exit 1 ;; esac done shift $(($OPTIND - 1)) if [ "$1" = "" ]; then echo "`basename $0`: Error - no URI specified" printf "$usage" printf "$opts_admon" exit 1 fi cd $TEMPDIR $CVS $CVS_OPTS -z3 -d:pserver:ano...@cv...:/cvsroot/docbook co testdocs zipfile=`basename $1` unzip_dir=`basename $1 .zip` url_base=`dirname $1` version=`basename $url_base` rm -rf $unzip_dir mkdir $unzip_dir cd $unzip_dir $WGET $WGET_OPTS $1 $UNZIP $UNZIP_OPTS `basename $1` XML_CATALOG_FILES=$TEMPDIR/$unzip_dir/catalog.xml export XML_CATALOG_FILES cd $TEMPDIR/testdocs/tests for file in `find . -name "*.xml" -maxdepth 1 | cut -c3-`; do if [ "$VERBOSE" = "Yes" ]; then $SED $SED_OPTS "s#/[^/]\+/docbookx.dtd#/$version/docbookx.dtd#" $file \ | $XMLLINT $XMLLINT_OPTS - else $SED $SED_OPTS "s#/[^/]\+/docbookx.dtd#/$version/docbookx.dtd#" $file \ | $XMLLINT $XMLLINT_OPTS - 1>/dev/null 2>&1 fi echo $file if [ $? != "0" ] ; then echo "Not valid: $file" if [ "$VERBOSE" = "Yes" ]; then echo fi fi done cd $TEMPDIR #rm -rf testdocs rm -rf $unzip_dir |