diff options
author | Patrick Barnes <nman64@n-man.com> | 2006-01-04 21:45:48 +0000 |
---|---|---|
committer | Patrick Barnes <nman64@n-man.com> | 2006-01-04 21:45:48 +0000 |
commit | 048d4600e6a8f222f3f3812dd34521ade9fc23c6 (patch) | |
tree | 354495bb585a3a34ba170295dc7e156562a16f08 | |
parent | 8d4f5f2a8125573927c742b2099da116563878e7 (diff) | |
download | fedora-doc-utils-048d4600e6a8f222f3f3812dd34521ade9fc23c6.tar.gz fedora-doc-utils-048d4600e6a8f222f3f3812dd34521ade9fc23c6.tar.xz fedora-doc-utils-048d4600e6a8f222f3f3812dd34521ade9fc23c6.zip |
Replacing bulkbuild script with build-docs package
-rw-r--r-- | bin/build-docs/Makefile | 69 | ||||
-rw-r--r-- | bin/build-docs/README | 95 | ||||
-rw-r--r-- | bin/build-docs/build-docs (renamed from bin/bulkbuild) | 11 | ||||
-rw-r--r-- | bin/build-docs/build-docs.conf | 26 | ||||
-rw-r--r-- | bin/build-docs/build-docs.cron | 10 | ||||
-rw-r--r-- | bin/build-docs/build-docs.spec | 65 |
6 files changed, 269 insertions, 7 deletions
diff --git a/bin/build-docs/Makefile b/bin/build-docs/Makefile new file mode 100644 index 0000000..10ee145 --- /dev/null +++ b/bin/build-docs/Makefile @@ -0,0 +1,69 @@ +VERSION=$(shell awk '/Version:/ { print $$2 }' build-docs.spec) +RELEASE=$(shell awk '/Release:/ { print $$2 }' build-docs.spec) +CVSTAG=r$(subst .,-,$(VERSION)) + +PREFIX=/usr +BINDIR=$(PREFIX)/bin +DATADIR=$(PREFIX)/share +LOCALSTATEPREFIX=/var +LOCALSTATEDIR=$(LOCALSTATEPREFIX)/lib +DOCDIR=$(DATADIR)/doc +PKGNAME=build-docs +PKGLOCALSTATEDIR=$(LOCALSTATEDIR)/$(PKGNAME) +PKGDOCDIR=$(DOCDIR)/$(PKGNAME)-$(VERSION) + +SOURCEDIR := $(shell pwd) + +default: +.PHONY: default + +.PHONY: tarball +tarball: clean + rm -rf /tmp/$(PKGNAME)-$(VERSION) + mkdir -p /tmp/$(PKGNAME)-$(VERSION) + cp -a * /tmp/$(PKGNAME)-$(VERSION) + tar -C /tmp --exclude CVS --bzip2 -cSpf $(PKGNAME)-$(VERSION).tar.bz2 $(PKGNAME)-$(VERSION) + rm -rf /tmp/$(PKGNAME)-$(VERSION) + +srpm: tarball + rpmbuild --define "_srcrpmdir $(SOURCEDIR)" -ts $(PKGNAME)-$(VERSION).tar.bz2 + +install: + @[ "x$(INSTROOT)" != "x" ] || echo -e "\nWARNING\nWARNING: Installation using make is discouraged, try RPMs instead!\nWARNING\n" + mkdir -p $(INSTROOT) + mkdir -p $(INSTROOT)$(BINDIR) + mkdir -p $(INSTROOT)$(PKGLOCALSTATEDIR) + @if [ "$(DISABLECRON)" != "1" ]; then \ + mkdir -p $(INSTROOT)/etc/cron.hourly ; \ + install -b $(PKGNAME).conf $(INSTROOT)/etc/$(PKGNAME).conf ; \ + install $(PKGNAME).cron $(INSTROOT)/etc/cron.hourly/$(PKGNAME).cron ; \ + fi + install -m755 $(PKGNAME) $(INSTROOT)$(BINDIR)/$(PKGNAME) + +install-docs: + @[ "x$(INSTROOT)" != "x" ] || echo -e "\nWARNING\nWARNING: Installation using make is discouraged, try RPMs instead!\nWARNING\n" + mkdir -p $(INSTROOT)$(DOCDIR) + install README $(INSTROO)$(DOCDIR)/README + +uninstall: + @rm -fv $(INSTROOT)/etc/cron.hourly/$(PKGNAME).cron + @rm -fv $(INSTROOT)$(BINDIR)/$(PKGNAME) + @-rmdir -v --ignore-fail-on-non-empty $(INSTROOT)/etc/cron.hourly + @-rmdir -v --ignore-fail-on-non-empty $(INSTROOT)/etc + @-rmdir -v --ignore-fail-on-non-empty $(INSTROOT)$(PKGLOCALSTATEDIR) + @-rmdir -v --ignore-fail-on-non-empty $(INSTROOT)$(LOCALSTATEDIR) + @-rmdir -v --ignore-fail-on-non-empty $(INSTROOT)$(LOCALSTATEPREFIX) + @-rmdir -v --ignore-fail-on-non-empty $(INSTROOT)$(DATADIR) + @-rmdir -v --ignore-fail-on-non-empty $(INSTROOT)$(BINDIR) + @-rmdir -v --ignore-fail-on-non-empty $(INSTROOT)$(PREFIX) + +uninstall-docs: + @rm -fv $(INSTROOT)$(DOCDIR)/README + @-rmdir -v --ignore-fail-on-non-empty $(INSTROOT)$(DOCDIR) + @-rmdir -v --ignore-fail-on-non-empty $(INSTROOT)$(DATADIR) + @-rmdir -v --ignore-fail-on-non-empty $(INSTROOT)$(PREFIX) + +.PHONY: clean +clean: + @rm -fv $(PKGNAME)-$(VERSION)-$(RELEASE).src.rpm + @rm -fv $(PKGNAME)-$(VERSION).tar.bz2 diff --git a/bin/build-docs/README b/bin/build-docs/README new file mode 100644 index 0000000..f0c9e24 --- /dev/null +++ b/bin/build-docs/README @@ -0,0 +1,95 @@ +build-docs - Fedora Documentation builder script +Main script written by Paul W. Frields <stickster@gmail.com> +Packaged by Patrick Barnes <nman64@n-man.com> + +== About == + +The build-docs script is used by the Fedora Documentation Project to +build the latest documents in CVS for viewing by others without a testing +sandbox. It is intended to build HTML (and potentially other) documents for +presentation on a local web server. + +This package also includes a cron job that can run the build process once each +hour. This requires the crontabs package to be installed. The cron job is +normally installed but disabled by default. You can disable it's installation +when building the RPM -- see below. To enable the cron job after installation, +see the file /etc/build-docs.conf for instructions. + +== Installation == + +The recommended method for installing this package is using RPM. + +Note that this document demonstrates using 'sudo' to gain root privileges. You +may need or want to use another method, such as 'su'. + +=== Using RPM & yum === + +If you already have an RPM package, you can use yum to install it. + + sudo yum localinstall build-docs-<version>.noarch.rpm + +==== Building Your Own RPM ==== + +If you are working from a source directory or tarball, you can make an RPM +to install easily. You will need rpmbuild (found in the rpm-build package) +installed on the system. Note that it is considered poor practice to build +packages as root. Dag Wieers has an excellent HOWTO for creating a non-root +RPM-building environment: http://dag.wieers.com/howto/bits/rpm-build-user.php + +First build an SRPM: + + make srpm + +Next, build the RPM from the SRPM: + + rpmbuild --rebuild build-docs-<version>.src.rpm + + Where <version> is replaced by the version of the package you are building. + * If you do not want to use the cron job, you can disable its installation + and the dependency on crontabs: + + rpmbuild --rebuild --define "_without_cron 1" build-docs-... + +Finally, install the package: + + cd /path/to/your/rpm + sudo yum localinstall build-docs-<version>.noarch.rpm + + If you don't know where the RPM was built, look at the output from rpmbuild. + +=== Using make === + +Installing the package using make is not recommended. See the +'Using RPM & yum' section above. To install the package using make: + + make install + + * If you do not want to use the cron job, you can disable its installation: + + make DISABLECRON=1 install + +Uninstallation is also available: + + make uninstall + +== Usage == + + build-docs [options...] + +Where options can be one or more of: + + -h : print usage + -m WORKDIR : set home directory, default '~' + -f FDPDIR : set d/l dir for CVS, default '~/fdpdocs-cvs<datetag>' + -D TARGETDIR : set target dir for built files, + default '/var/www/webtest/docs' + -a ANONCVS : set CVS repo location (cvs -d), default + ':pserver:anonymous@cvs.fedora.redhat.com:/cvs/docs' + -r REV : checkout REV from CVS (global), default 'HEAD' + -Q : make CVS checkout less quiet + -c : build chunked HTML + -n : build HTML nochunks + -p : build PDF (not working currently) + -t : build tarball + -k : continue building in face of errors + diff --git a/bin/bulkbuild b/bin/build-docs/build-docs index ca485dc..c460c98 100644 --- a/bin/bulkbuild +++ b/bin/build-docs/build-docs @@ -2,21 +2,20 @@ # # Written by stickster :) # Mangled by megacoder ;-P +# Further editing and packaging by nman64 +# +# Dedicated to the lazy Fedora Docs heroes. ;-) # # Pull all active FDP docs from CVS, build and install HTML in # TARGETDIR folder. # -# This script is not designed to be run inside a local CVS repository; -# it is only stored here for convenience and upkeep. It may be used -# in DocsRawhide as part of a build system of some sort. On the other -# hand, it may be vaporized. -# MYSELF="$(basename "$0")" NOW="$(date +%Y%m%d%H%M%S)" print_usage() { echo "$MYSELF: Usage: $MYSELF [options...]" + echo " -h : print usage (this message)" echo " -m WORKDIR : set home directory, default $HOME" echo " -f FDPDIR : set d/l dir for CVS, default $FDPDIR" echo " -D TARGETDIR : set target dir for built files, default $TARGETDIR" @@ -27,7 +26,6 @@ print_usage() { echo " -n : build HTML nochunks" echo " -p : build PDF (not working currently)" echo " -t : build tarball" - echo " -h : print usage (this message)" echo " -k : continue building in face of errors" } @@ -173,4 +171,3 @@ popd >/dev/null [ "$FDPDIR" != "/" ] && [ "$FDPDIR" != "$HOME" ] && rm -rf "${FDPDIR}" exit 0 - diff --git a/bin/build-docs/build-docs.conf b/bin/build-docs/build-docs.conf new file mode 100644 index 0000000..f2fce89 --- /dev/null +++ b/bin/build-docs/build-docs.conf @@ -0,0 +1,26 @@ +## Configuration for build-docs cron job + +# +# ENABLE_HOURLY_BUILD, if set to 'yes', will enable the hourly cron +# job that runs the build-docs script. +# +#ENABLE_HOURLY_BUILD=yes + +# +# BDR, if set, should point to the absolute path where the main +# build-docs script is located. +# +#BDR="build-docs" + +# +# BDRFLAGS, if set, should contain the desired flags to be passed +# to the build-docs script. +# +#BDRFLAGS="-c -m /var/lib/build-docs" + +# +# LOGFILE, if set, should point to the location where you want the +# build-docs script output to be written. +# +#LOGFILE="/var/log/build-docs.log" + diff --git a/bin/build-docs/build-docs.cron b/bin/build-docs/build-docs.cron new file mode 100644 index 0000000..6c45ce1 --- /dev/null +++ b/bin/build-docs/build-docs.cron @@ -0,0 +1,10 @@ +#!/bin/sh +. /etc/build-docs.conf +[ "${ENABLE_HOURLY_BUILD}" == "yes" ] || exit 0 +[ "x" == "x${BDR}" ] && BDR="build-docs" +[ "x" == "x${BDRFLAGS}" ] && BDRFLAGS="-c -m /var/lib/build-docs" +[ "x" == "x${LOGFILE}" ] && LOGFILE="/var/log/build-docs.log" +echo "Starting build-docs at `date -uR`..." >> $LOGFILE +$BDR $BDRFLAGS &> $LOGFILE 2>&1 +echo "Finished build-docs at `date -uR`..." >> $LOGFILE +exit 0 diff --git a/bin/build-docs/build-docs.spec b/bin/build-docs/build-docs.spec new file mode 100644 index 0000000..008b64a --- /dev/null +++ b/bin/build-docs/build-docs.spec @@ -0,0 +1,65 @@ +Summary: A simple script and cron job to build Fedora Documentation +Name: build-docs +Version: 0.0.3 +Release: 1 +URL: http://fedoraproject.org/wiki/DocsProject +License: GPL +ExclusiveOS: Linux +Group: Applications/Publishing +BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root +BuildArch: noarch +Source0: %{name}-%{version}.tar.bz2 +Requires: xmlto docbook-utils docbook-utils-pdf cvs +%{!?_without_cron:Requires: crontabs} + +%description +build-docs is a script that builds Fedora Documentation. +rpmbuild options: + --define "_without_cron 1" Disables installation of hourly cron job + (default: cron job is installed but disabled) + +%prep +%setup -q + +%build +make + +%install +make INSTROOT=$RPM_BUILD_ROOT %{?_without_cron:DISABLECRON=1} install + +%clean +rm -rf $RPM_BUILD_ROOT + +%post + +%preun + +%postun + +%files +%defattr(-,root,root) +%doc README +%dir /var/lib/%{name} +%attr(0744,root,root) /usr/bin/%{name} +%if 0%{!?_without_cron:1} +%attr(0744,root,root) /etc/cron.hourly/%{name}.cron +%attr(0644,root,root) %config /etc/%{name}.conf +%endif + +%changelog +* Sat Dec 17 2005 Patrick Barnes <nman64@n-man.com> +- Renamed package to build-docs +- Updated script now allows -k flag +- Incremented version to 0.0.3 + +* Fri Dec 02 2005 Patrick Barnes <nman64@n-man.com> +- Added last Requires +- Allowed disabling of cron job +- Incremented version to 0.0.2 + +* Fri Dec 2 2005 Paul W. Frields <stickster@gmail.com> +- Added Requires and changed to valid Group + +* Thu Dec 01 2005 Patrick Barnes <nman64@n-man.com> +- Initial packaging + |