Merge remote branch 'nico/master'

This commit is contained in:
Steven Armstrong 2011-03-25 23:08:18 +01:00
commit b30c6ee9b0
5 changed files with 144 additions and 138 deletions

134
Makefile
View file

@ -1,134 +0,0 @@
# General
PREFIX=/usr
BINDIR=$(PREFIX)/bin
MANDIR=$(PREFIX)/share/man
# Manpage and HTML
A2XM=a2x -f manpage --no-xmllint
# A2XH=a2x -f xhtml --no-xmllint
A2XH=asciidoc -b xhtml11
# Developer only
WEBDIR=$$HOME/niconetz
WEBBASE=software/cdist
WEBPAGE=$(WEBBASE).mdwn
# Documentation
MANDIR=doc/man
HTMLDIR=$(MANDIR)/html
MAN1SRC= \
$(MANDIR)/cdist-code-run.text \
$(MANDIR)/cdist-code-run-all.text \
$(MANDIR)/cdist-config.text \
$(MANDIR)/cdist-dir.text \
$(MANDIR)/cdist-env.text \
$(MANDIR)/cdist-explorer-run-global.text \
$(MANDIR)/cdist-deploy-to.text \
$(MANDIR)/cdist-explorer.text \
$(MANDIR)/cdist-manifest.text \
$(MANDIR)/cdist-manifest-run.text \
$(MANDIR)/cdist-manifest-run-init.text \
$(MANDIR)/cdist-manifest-run-all.text \
$(MANDIR)/cdist-object-explorer-all.text \
$(MANDIR)/cdist-object-gencode.text \
$(MANDIR)/cdist-object-gencode-all.text \
$(MANDIR)/cdist-remote-explorer-run.text \
$(MANDIR)/cdist-run-remote.text \
$(MANDIR)/cdist-type-build-emulation.text \
$(MANDIR)/cdist-type-emulator.text \
$(MANDIR)/cdist-type-template.text \
MAN7SRC=$(MANDIR)/cdist.text \
$(MANDIR)/cdist-best-practise.text \
$(MANDIR)/cdist-hacker.text \
$(MANDIR)/cdist-quickstart.text \
$(MANDIR)/cdist-reference.text \
$(MANDIR)/cdist-stages.text \
$(MANDIR)/cdist-type.text \
$(shell ls conf/type/*/man.text)
MAN1DST=$(MAN1SRC:.text=.1)
MAN7DST=$(MAN7SRC:.text=.7)
MANHTML=$(MAN1SRC:.text=.html) $(MAN7SRC:.text=.html)
################################################################################
# User targets
#
all:
@echo ''
@echo 'Welcome to cdist!'
@echo ''
@echo 'Here are the possible targets:'
@echo ''
@echo ' man: Build manpages (requires Asciidoc)'
@echo ' clean: Remove build stuff'
@echo ''
@echo ''
%.1 %.7: %.text
$(A2XM) $*.text
%.html: %.text
$(A2XH) $*.text
man: $(MAN1DST) $(MAN7DST)
html: $(MANHTML)
# man: doc/man/.marker
# Move into manpath directories
manmove: $(MAN1DST) $(MAN7DST) $(MANHTML)
for manpage in $(MANDIR)/*.[1-9] conf/type/*/*.7; do \
cat=$${manpage##*.}; \
mandir=$(MANDIR)/man$$cat; \
mkdir -p $$mandir; \
mv $$manpage $$mandir; \
done
# HTML
mkdir -p $(HTMLDIR)
mv doc/man/*.html $(HTMLDIR)
for mantype in conf/type/*/man.html; do \
mannew=$$(echo $$mantype | sed -e 's;conf/;cdist-;' -e 's;/;;' -e 's;/man;;');\
mv $$mantype doc/html/$$mannew; \
done
# Reference depends on conf/type/*/man.text - HOWTO with posix make?
$(MANDIR)/cdist-reference.text: $(MANDIR)/cdist-reference.text.sh
$(MANDIR)/cdist-reference.text.sh
$(A2XM) $(MANDIR)/cdist-reference.text
$(A2XH) $(MANDIR)/cdist-reference.text
clean:
rm -rf doc/man/html/* doc/man/*.[1-9] doc/man/man[1-9]
rm -f conf/type/*/man.html $(MANDIR)/cdist-reference.text
rm -rf $(HTMLDIR)
################################################################################
# Developer targets
#
test:
# ubuntu
.rsync lyni@tablett:cdist
# redhat
.rsync nicosc@free.ethz.ch:cdist
# gentoo
.rsync nicosc@ru3.inf.ethz.ch:cdist
web: manmove
cp README $(WEBDIR)/$(WEBPAGE)
rm -rf $(WEBDIR)/$(WEBBASE)/man && mkdir $(WEBDIR)/$(WEBBASE)/man
cp -r $(HTMLDIR)/* $(WEBDIR)/$(WEBBASE)/man
cd $(WEBDIR) && git add $(WEBBASE)/man
cd $(WEBDIR) && git commit -m "cdist update" $(WEBBASE) $(WEBPAGE)
cd $(WEBDIR) && make pub
pub:
git push --mirror
git push --mirror github

View file

@ -19,7 +19,7 @@
# #
# #
__cdist_version="1.4.0" __cdist_version="1.4.1"
# Fail if something bogus is going on # Fail if something bogus is going on
set -u set -u

131
build.sh Executable file
View file

@ -0,0 +1,131 @@
#!/bin/sh
#
# 2011 Nico Schottelius (nico-cdist at schottelius.org)
#
# This file is part of cdist.
#
# cdist is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# cdist is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with cdist. If not, see <http://www.gnu.org/licenses/>.
#
#
# Push a directory to a target, both sides have the same name (i.e. explorers)
# or
# Pull a directory from a target, both sides have the same name (i.e. explorers)
#
# Manpage and HTML
A2XM="a2x -f manpage --no-xmllint"
A2XH="a2x -f xhtml --no-xmllint"
# Developer webbase
WEBDIR=$HOME/niconetz
WEBBASE=software/cdist
WEBPAGE=${WEBBASE}.mdwn
# Documentation
MANDIR=doc/man
MAN1DSTDIR=${MANDIR}/man1
MAN7DSTDIR=${MANDIR}/man7
case "$1" in
man)
set -e
"$0" mandirs
"$0" mantype
"$0" man1
"$0" man7
"$0" manbuild
;;
manbuild)
for src in ${MAN1DSTDIR}/*.text ${MAN7DSTDIR}/*.text; do
echo "Compiling manpage and html for $src"
$A2XM "$src"
$A2XH "$src"
done
;;
mandirs)
# Create destination directories
mkdir -p "${MAN1DSTDIR}" "${MAN7DSTDIR}"
;;
mantype)
for mansrc in ${MAN7TYPESRC}; do
dst="$(echo $mansrc | sed -e 's;conf/;cdist-;' -e 's;/;;' -e 's;/man;;' -e 's;^;doc/man/man7/;')"
ln -sf "../../../$mansrc" "$dst"
done
;;
man1)
for man in cdist-code-run.text cdist-code-run-all.text cdist-config.text \
cdist-dir.text cdist-env.text cdist-explorer-run-global.text \
cdist-deploy-to.text cdist-explorer.text cdist-manifest.text \
cdist-manifest-run.text cdist-manifest-run-init.text \
cdist-manifest-run-all.text cdist-object-explorer-all.text \
cdist-object-gencode.text cdist-object-gencode-all.text \
cdist-remote-explorer-run.text cdist-run-remote.text \
cdist-type-build-emulation.text cdist-type-emulator.text \
cdist-type-template.text
do
ln -sf ../$man ${MAN1DSTDIR}
done
;;
man7)
for man in cdist.text cdist-best-practise.text cdist-hacker.text \
cdist-quickstart.text cdist-reference.text cdist-stages.text \
cdist-type.text
do
ln -sf ../$man ${MAN7DSTDIR}
done
;;
mangen)
${MANDIR}/cdist-reference.text.sh
;;
web)
cp README ${WEBDIR}/${WEBPAGE}
rm -rf ${WEBDIR}/${WEBBASE}/man && mkdir ${WEBDIR}/${WEBBASE}/man
cp ${MAN1DSTDIR}/*.html ${MAN7DSTDIR}/*.html ${WEBDIR}/${WEBBASE}/man
cd ${WEBDIR} && git add ${WEBBASE}/man
cd ${WEBDIR} && git commit -m "cdist update" ${WEBBASE} ${WEBPAGE}
cd ${WEBDIR} && make pub
;;
pub)
git push --mirror
git push --mirror github
;;
clean)
rm -rf "$MAN1DSTDIR" "$MAN7DSTDIR"
rm -f ${MANDIR}/cdist-reference.text
;;
*)
echo ''
echo 'Welcome to cdist!'
echo ''
echo 'Here are the possible targets:'
echo ''
echo ' man: Build manpages (requires Asciidoc)'
echo ' manhtml: Build html-manpages (requires Asciidoc)'
echo ' clean: Remove build stuff'
echo ''
echo ''
echo "Unknown target, \"$1\"" >&2
exit 1
;;
esac

View file

@ -1,6 +1,8 @@
1.4.1: 1.4.1: 2011-03-25
* Manpage generation cleanup
* New type __key_value (Steven Armstrong) * New type __key_value (Steven Armstrong)
* New type __apt_ppa (Steven Armstrong)
* Documentation: Manpage generation cleanup
* Documentation: Manpage fix for __apt_ppa
1.4.0: 2011-03-24 1.4.0: 2011-03-24
* Add --recursive to __directory * Add --recursive to __directory

View file

@ -1,7 +1,14 @@
UNASSIGNED TODOS
----------------
The following list of todos has not been assigned to any developer. The following list of todos has not been assigned to any developer.
Feel free to pick one!
Feel free to pick one: CORE
----
Only build manpages if necessary for types as well as for the core!
TYPES
------
Types to be written/extended: Types to be written/extended:
- __ssh-keys (host/user) - __ssh-keys (host/user)
- Think about __service - necessary? - Think about __service - necessary?