From: Stefan Seefeld Date: Sun, 22 May 2016 21:38:08 +0000 (-0400) Subject: Add new toplevel Makefile and set up CI. X-Git-Tag: snapshot/2016-11-03-35~11 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=12e9d50dbe4d254ea6ae5fe598ae0b4bd234aefb;p=docbook-dsssl Add new toplevel Makefile and set up CI. --- diff --git a/.travis.yml b/.travis.yml new file mode 100644 index 000000000..094a050bf --- /dev/null +++ b/.travis.yml @@ -0,0 +1,60 @@ +language: java +branches: + only: + - master + - "/^release.*/" + +env: + global: + - CLASSPATH=/usr/share/java/xalan-j2.jar:/usr/share/java/xercesImpl.jar:/usr/share/java/xml-resolver.jar:$(pwd)/.travis + - secure: "CyGQbyoAoFmAst01IZtu3aGGVCTRN/oo8aMZJPwnDRi9F3q/ptueFKYoQEWWEzDYzPMPAtvbDVDx5lhfyZxlm6HwyvU8Frdt+3RTkn287EiDk0fnUhZGSasLaWwZ5SxGuRq/yonc/oLfktK1e6Z9ZUAD9q0GnWncI6ZiLeJussWpRIz5W88Jaz2VJKGdiiHZbQDmCE6b5Oe9Ucu8gYAnmHbz0QbxacPm58+D7rrWVwF9haH0oDlwlMCfM1lI0/GNJVMAREGYLFJBVsieSuDunYz9kZg3ewr0wKud4spy9qUMAGt5yEAn9I+vQYqTgzWpbLAP8cOgSxsVJWbBN8JXUuoQRh1Pu78J0phDII8YouYB98o1JdkQeytrUXJmzfdRtmw/iKKp4qAKHK7v6R0KkcpDhjeiVVWrptc4vXbkpm16EFgv3/d+Gs++M5s6fag60mlth9u6IwZ/tSJbafvUqvPn977YJbua40SSzwwF9/8GP0GGDTp7SoO7oKaIVN9Gv9qMANOYIqOGA/KCyzQ3oLuhD14P5Hy2Gdfa8S4o9UZI43QWURljWniN9ycyZb53px/4WZc2adAcxcB+V64M3UHkLGU+MH7mJWJtLE1v/32fBYaBGEkTch2Ghj/oKV89+rav40ssKyol6IYjKN7uVXh3R3t4kT8jJPbDmUBhFoo=" + +install: +- sudo apt-get update -q +- sudo apt-get install xsltproc +- sudo apt-get install libxml-xpath-perl +- sudo apt-get install libsaxon-java libxml-commons-resolver1.1-java libsaxon-java + libxerces2-java +- sudo apt-get install trang +- sudo apt-get install imagemagick +- sudo apt-get install dblatex +- cp .travis/xmlc ~/.xmlc + +script: +- make +- make check +- make dist + +before_deploy: +- git config --global user.email "builds@travis-ci.com" +- git config --global user.name "Travis CI" +- export GIT_TAG=snapshot/$(date -u "+%Y-%m-%d")-$TRAVIS_BUILD_NUMBER +- git tag $GIT_TAG -a -m "Generated tag from TravisCI build $TRAVIS_BUILD_NUMBER" +- git push https://$GITHUBTOKEN@github.com/docbook/xslt10-stylesheets $GIT_TAG > /dev/null 2>&1 + +deploy: + provider: releases + prerelease: true + api_key: + secure: "VJAj9hVynNFo4A5G5E6/PbND0dE/NpV1tzhuEgP86RyK1O6CIdIgUMvhjtH2Nv1fuc1C7PdEwMsggNFIelquVIJfdfTSq1xvwYbuQV9djXGhnoDRZB99a8cTI9q7xJ9E4d5fZyLd+s93Pzh3yTUZY+BCaVohnoZPhkA09YqKu/B/XVCDN/Qb3S5rdI+sacGCJqAoXXVrlNn4WUNUBCshJ/o/9KzvdGs5AcVDB8n219CIK5Lw+bM7rV0ifnwcQyLyc2k5fJdQkDoXQwuoeZ9YpNi2Cqoe5NWPtZxzGB5jod21yyU6/QYzOxA/64aC/ZRhEIUMiAnP0gGqTkK+DHJwC+ficoh8iTzNiVNlBuoYqKxo7ErKJPFgpppfCh07SFy8alJ6h1zFeYYLxohqBI1KdfDpDtO5h3YzTm17pQZ8xtuca1U4FgaMnXVMgsvThEwoPgqnhN1ee57MUuwZPc6tc811fZRZcVzfyTIkmpn084Cxl3jk6ZLTF91da/X7FQB/SsKghY1NCpdIwU0oW0PC72fXdSRK+mOegh1Z5aL1unrYp7jVCHEgjHobbe9P5SpycJ3ndiMbTFcnQil/gc6C+7Z7IedE/mlaEtvlrYHtK4w8GNsNWCXfIY4bxZS3XugS43eZc09MTyTTqRHsIgRfsveERmzQRWLtN02VDMYmul4=" + file: + - dist/docbook-xsl-snapshot.tar.bz2 + - dist/docbook-xsl-snapshot.tar.gz + - dist/docbook-xsl-snapshot.zip + - dist/docbook-xsl-ns-snapshot.tar.bz2 + - dist/docbook-xsl-ns-snapshot.tar.gz + - dist/docbook-xsl-ns-snapshot.zip + - dist/docbook-xsl-doc-snapshot.tar.bz2 + - dist/docbook-xsl-doc-snapshot.tar.gz + - dist/docbook-xsl-doc-snapshot.zip + on: + repo: docbook/xslt10-stylesheets + branch: master + +notifications: + email: + on_success: change + on_failure: change + irc: + channels: + - "chat.freenode.net#docbook" diff --git a/.travis/CatalogManager.properties b/.travis/CatalogManager.properties new file mode 100644 index 000000000..93922d01a --- /dev/null +++ b/.travis/CatalogManager.properties @@ -0,0 +1,76 @@ +# Licensed to the Apache Software Foundation (ASF) under one or more +# contributor license agreements. See the NOTICE file distributed with +# this work for additional information regarding copyright ownership. +# The ASF licenses this file to You under the Apache License, Version 2.0 +# (the "License"); you may not use this file except in compliance with +# the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +######################################################################## +# CatalogManager provides an interface to the catalog properties. +# Properties can come from two places: from system properties or +# from a CatalogManager.properties file. This class provides a +# transparent interface to both, with system properties preferred +# over property file values. + +####################################################################### +# Catalog Files: +# The semicolon-delimited list of catalog files. +# Example: catalogs=./xcatalog;/share/doctypes/catalog + +catalogs=/etc/xml/catalog + +####################################################################### +# Relative Catalogs: +# If false, relative catalog URIs are made absolute with respect to the +# base URI of the CatalogManager.properties file. This setting only +# applies to catalog URIs obtained from the catalogs property in the +# CatalogManager.properties file +# Example: relative-catalogs = [yes|no] + +relative-catalogs=yes + +####################################################################### +# Verbosity: +# If non-zero, the Catalog classes will print informative and debugging +# messages. The higher the number, the more messages. +# Example: verbosity = [0..99] + +#verbosity=99 + +####################################################################### +# Prefer: +# Which identifier is preferred, "public" or "system"? +# Example: xml.catalog.prefer = [public|system] + +prefer=system + +####################################################################### +# Static-catalog: +# Should a single catalog be constructed for all parsing, or should a +# different catalog be created for each parser? +# Example: static-catalog = [yes|no] + +static-catalog=yes + +####################################################################### +# Allow-oasis-xml-catalog-pi +# If the source document contains "oasis-xml-catalog" processing +# instructions, should they be used? +# Example: allow-oasis-xml-catalog-pi = [yes|no] + +allow-oasis-xml-catalog-pi=yes + +####################################################################### +# catalog-class-name +# If you're using the convenience classes +# org.apache.xml.resolver.tools.*, this setting allows you to specify +# an alternate class name to use for the underlying catalog. +# Example: catalog-class-name=org.apache.xml.resolver.Resolver diff --git a/.travis/xmlc b/.travis/xmlc new file mode 100644 index 000000000..338b469d1 --- /dev/null +++ b/.travis/xmlc @@ -0,0 +1,30 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/Makefile b/Makefile new file mode 100644 index 000000000..af9fd758d --- /dev/null +++ b/Makefile @@ -0,0 +1,17 @@ +export repo_dir ?= $(abspath .) + +all: + $(MAKE) -C xsl + +doc: + $(MAKE) -C xsl doc + +check: + $(MAKE) -C xsl check + +dist: + $(MAKE) -C xsl release + $(MAKE) -C xsl zip-ns TMP=$(repo_dir)/dist + +clean: + $(MAKE) -C xsl clean diff --git a/README.adoc b/README.md similarity index 51% rename from README.adoc rename to README.md index 9d4d62a52..288f9484b 100644 --- a/README.adoc +++ b/README.md @@ -1,4 +1,6 @@ -= DocBook XSLT 1.0 Stylesheets +## DocBook XSLT 1.0 Stylesheets + +[![Build Status](https://travis-ci.org/docbook/xslt10-stylesheets.svg)](https://travis-ci.org/docbook/xslt10-stylesheets) This repository contains the DocBook XSLT 1.0 Stylesheets, now migrated away from SourceForge. @@ -7,3 +9,5 @@ There are still some rough edges here as the build system and various other things are being ported. Nevertheless, this is now the intended repository of record. + +For build instructions please refer to the [DocBook XSL Release Build Process](building.md). \ No newline at end of file diff --git a/building.md b/building.md index dd94467e4..19de65879 100644 --- a/building.md +++ b/building.md @@ -1,115 +1,35 @@ DocBook XSL Release Build Process ================================= -The build process for a snapshot or actual release is created by running the docbook-build shell script like follows: -``` -/opt/buildtree/docbook/releasetools/docbook-build \ - -a ns \ - -b /opt/buildtree/docbook \ - -l /opt/scratch-release \ - -t /opt/scratch-release \ - -p /var/opt/release \ - -v 1.79.1 \ - -x zip-ns \ - -z US/Pacific \ - xsl \ - || rm -f /opt/scratch/docbook-xsl-snapshot.lock -``` - -Where - -* `-a ns` Specifies that the 'ns' suffix is to be added to the build name of the namespace version. Saved in the `$ADDEDSUFFIX` variable. -* `-b /opt/buildtree/docbook` Specifies the source for the build, the repo directory. Saved in the `$BASEDIR` variable. -* `-l /opt/scratch-release` Location of the generated log file. Saved in the `$LOGDIR` variable. -* `-t /opt/scratch-release` Location of any generated temp files. This is where the "built" version resides before being zipped up. Saved in the `$TMPDIR` variable. -* `-p /var/opt/release` Location of the final zip files. Saved in the `$SITEBASE` variable. -* `-v 1.79.1` The numerical version of this release. Saved in the `$RELEASEVERSION` variable. -* `-x zip-ns` Name of the Makefile target for generating the zip files. Saved in the `$ZIPARG` variable. -* `-z US/Pacific` Specifies the time zone for date stamps. Saved in the `$ZONE` variable. -* `xsl` The name of the distro to build. Saved in the `$DISTROS` variable. - -docbook-build script steps --------------------------- - -The `docbook-build` shell script performs the following steps: - -1. cd to the build directory `/opt/buildtree/docbook`. -2. Execute `svn cleanup`. -3. Execute `svn update` to make sure the latest files are in place. -4. Execute `svn info` and extract from the results the SVN version number to be placed in the `REVISION` variable, and copies it the the `REVISION` file. -5. Create a lock file to prevent two build processes from running at the same time. -6. Filter the `VERSION` file to insert the current build version taken from the `-v` option of the `docbook-build` script. -7. Checks to see if a lock file is in place from a previous build. If so, it loops with sleep 1 until a) the -LOCK_TIMEOUT count is reached and exits if so, or b) the lock has cleared and it prints "Done", creates a new -lock file, and continues. -8. Remove the previous log file that captures `STDERR` and `STDOUT`. -9. Removes the existing `VERSION` file in the source, and then does `svn update VERSION` to get the latest. -10. Runs a sed command on the `VERSION` file to replace the old content with the value of `$REVISION` created earlier. -11. Starts the logging of output to the log file. -12. Prints a date timestamp. -13. Build the XSL files using this command. This Makefile must also build the -ns version as well, because no other commands in the script do so. - - ``` - make distrib -C xsl XSLT="$repo_dir/buildtools/xslt -$ENGINE" \ - PDF_MAKER=$PDF_MAKER - ``` -14. echo some descriptive text to a file named header.txt. -15. Make a tar.bz2 file using this command: - - ``` - make zip-ns -C xsl ZIPVER=$RELEASEVERSION TMP=$TMP \ - XSLT="$repo_dir/buildtools/xslt -$ENGINE" PDF_MAKER=$PDF_MAKER - ``` - where `$RELEASEVERSION` is the value from the -v command line option. -16. Generate a list of changes to a LatestChanges file using this command: - - ``` - svn cleanup && svn update && svn log --verbose --limit 200 > LatestChanges - ``` -17. Copy the contents of `header.txt` and `LatestChanges` to a `README.txt` file. -18. Copy the tar.bz2 files to `$SITEBASE` and cd to that directory. -19. Remove the old existing xsl and xsl-ns directories and any log file. -20. For each tar.bz2 file, bunzip it and tar extract into the $TMP directory, creating the `docbook-xsl-1.79.1` -directory there. -21. Run `mkdir xsl` and `mkdir xsl-ns` to initialize these directories. -22. Copy contents of the directories: - - ``` - cp -pR docbook-xsl-1.79.1/* xsl - cp -pR docbook-xsl-ns-1.79.1/* xsl-ns - ``` -23. Copy the zip files, `README.txt`, and `LatestChanges` to `$SITEBASE` (`/var/opt/release`) - -Uploading a distro ------------------- - -This section describes setting up a distribution on SourceForge. It requires a SourceForge shell account. - -1. Log onto the SourceForge DocBook project and create the new release directories. Go to Files > docbook-xsl and select Add Folder, and name it 1.79.1 for the new release. Do the same for docbook-xsl-ns and docbook-xsl-doc. This creates the new directories for the new release in the location `/home/frs/project/docbook/docbook-xsl/1.79.1` for example. -2. On the build machine, cd to `$SITEBASE` (`/var/opt/release`) where the .zip and tar.bz2 files are located. -3. Use scp to copy the .zip and .tar.bz2 files to the SourceForge account, using a command like this: -`scp docbook-xsl-1.79.1.zip bobstayton,docbook@web.sourceforge.net`: -The files will land in `/home/project-web/docbook`. -4. Log into the shell account on the SourceForge machine with a command like this: -`ssh -t bobstayton,docbook@shell.sourceforge.net create` -5. `cd /home/project-web/docbook/htdocs/release/xsl` -6. rm current (this is a symlink, not an actual directory). -7. Unzip the stylesheet files and doc, creating the docbook-xsl-1.79.1 directory: - - ``` - unzip ../../../docbook-xsl-1.79.1.zip - unzip ../../../docbook-xsl-doc-1.79.1.zip - ``` -8. Run these commands to set up the numbered and current directories: - - ``` - mv docbook-xsl-1.79.1 1.79.1 - chmod -R g+w 1.79.1 - ln -s 1.79.1 current - ``` -9. Repeat steps 5 to 8 replacing xsl with xsl-ns for the namespaced version of the stylesheets. -10. To make the zip files available for download, use commands like this to copy the zip and tar.bz2 files to the directories created in step 1 of this section: - ```cp /home/project-web/docbook/docbook-xsl-1.79.1.zip /home/frs/project/docbook/docbook-xsl-1.79.1``` -Repeat for docbook-xsl-ns and docbook-xsl-doc -11. Edit the `RELEASE-NOTES.txt` file into a short `README` file and post that there using SourceForge upload. -That will cause the `README` to be displayed below the list of files. \ No newline at end of file +Prerequisites +------------- + +TBD + + +Building +-------- + +Run + + `make` + +Avalable flags: + +* XSLTENGINE=[saxon,xsltproc] + +Testing +------- + +Run + + `make check` + + +Packaging +--------- + +Run + + `make dist` +