Skip to content

Commit

Permalink
Merge pull request #56 from jimsch/master
Browse files Browse the repository at this point in the history
General re-arrangement
Start Travis
  • Loading branch information
jimsch committed Aug 10, 2015
2 parents 00393dc + 23aa466 commit 256b6ef
Show file tree
Hide file tree
Showing 8 changed files with 867 additions and 1 deletion.
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
# Ignore emacs files
*~
*#

29 changes: 29 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
language: python
rvm:
- 2.2.0
before_install:
- sudo apt-get update -qq
- sudo apt-get install -y python-lxml python-pip
install:
- deactivate
- rvm install 2.2.0
- rvm use 2.2.0
- sudo pip install xml2rfc
script:
- make ghpages
env:
global:
- secure: <insert encrypted GH_TOKEN=blah here>
before_deploy: make submit
deploy:
provider: releases
api-key:
secure: <insert encrypted API key here>
file:
- $TRAVIS_TAG.txt
- $TRAVIS_TAG.html
- $TRAVIS_TAG.xml
skip_cleanup: true
on:
branch: master
tags: true
187 changes: 187 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,187 @@
# Original makefile from https://github.com/martinthomson/i-d-template

# The following tools are used by this file.
# All are assumed to be on the path, but you can override these
# in the environment, or command line.

# Mandatory:
# https://pypi.python.org/pypi/xml2rfc
xml2rfc ?= xml2rfc

# If you are using markdown files:
# https://github.com/cabo/kramdown-rfc2629
kramdown-rfc2629 ?= kramdown-rfc2629

# If you are using outline files:
# https://github.com/Juniper/libslax/tree/master/doc/oxtradoc
oxtradoc ?= oxtradoc.in

# For sanity checkout your draft:
# https://tools.ietf.org/tools/idnits/
idnits ?= idnits

# For diff:
# https://tools.ietf.org/tools/rfcdiff/
rfcdiff ?= rfcdiff --browse

# For generating PDF:
# https://www.gnu.org/software/enscript/
enscript ?= enscript
# http://www.ghostscript.com/
ps2pdf ?= ps2pdf


## Work out what to build

draft := $(basename $(lastword $(sort $(wildcard draft-*.xml)) $(sort $(wildcard draft-*.org))))

ifeq (,$(draft))
$(warning No file named draft-*.md or draft-*.xml or draft-*.org)
$(error Read README.md for setup instructions)
endif

draft_type := $(suffix $(firstword $(wildcard $(draft).md $(draft).org $(draft).xml)))

current_ver := $(shell git tag | grep '$(draft)-[0-9][0-9]' | tail -1 | sed -e"s/.*-//")
ifeq (,$(current_ver))
next_ver ?= 00
else
next_ver ?= $(shell printf "%.2d" $$((1$(current_ver)-99)))
endif
next := $(draft)-$(next_ver)
diff_ver := $(draft)-$(current_ver)


## Targets

.PHONY: latest txt html pdf submit diff clean update ghpages

latest: txt html
txt: $(draft).txt
html: $(draft).html
pdf: $(draft).pdf

submit: $(next).txt

idnits: $(next).txt
$(idnits) $<

## If you'd like the main github page to show the draft text.
readme: $(next).txt
@echo '```' > README.md
@cat $(next).txt >> README.md
@echo '```' >> README.md

clean:
-rm -f $(draft).{txt,html,pdf} index.html
-rm -f $(draft)-[0-9][0-9].{xml,md,org,txt,html,pdf}
-rm -f *.diff.html
ifneq (.xml,$(draft_type))
-rm -f $(draft).xml
endif

## diff

$(next).xml: $(draft).xml
sed -e"s/$(basename $<)-latest/$(basename $@)/" $< > $@

ifneq (,$(current_ver))
.INTERMEDIATE: $(addprefix $(draft)-$(current_ver),.txt $(draft_type))
diff: $(draft).txt $(draft)-$(current_ver).txt
-$(rfcdiff) $^

$(draft)-$(current_ver)$(draft_type):
git show $(draft)-$(current_ver):$(draft)$(draft_type) > $@
endif

## Recipes

.INTERMEDIATE: $(draft).xml
%.xml: %.md
$(kramdown-rfc2629) $< > $@

%.xml: %.org
$(oxtradoc) -m outline-to-xml -n "$@" $< > $@

%.txt: %.xml
$(xml2rfc) $< -o $@ --text

%.htmltmp: %.xml
$(xml2rfc) $< -o $@ --html
%.html: %.htmltmp
sed -f lib/addstyle.sed $< > $@

%.pdf: %.txt
$(enscript) --margins 76::76: -B -q -p - $^ | $(ps2pdf) - $@

## Update this Makefile

# The prerequisites here are what is updated
.INTERMEDIATE: .i-d-template.diff
update: Makefile lib .gitignore SUBMITTING.md
git diff --quiet -- $^ || \
(echo "You have uncommitted changes to:" $^ 1>&2; exit 1)
-if [ -f .i-d-template ]; then \
git diff --exit-code $$(cat .i-d-template) -- $^ > .i-d-template.diff && \
rm -f .i-d-template.diff; \
fi
git remote | grep i-d-template > /dev/null || \
git remote add i-d-template https://github.com/martinthomson/i-d-template.git
git fetch i-d-template
[ -f .i-d-template ] && [ $$(git rev-parse i-d-template/master) = $$(cat .i-d-template) ] || \
git checkout i-d-template/master $^
git diff --quiet -- $^ && rm -f .i-d-template.diff || \
git commit -m "Update of $^ from i-d-template/$$(git rev-parse i-d-template/master)" $^
if [ -f .i-d-template.diff ]; then \
git apply .i-d-template.diff && \
git commit -m "Restoring local changes to $$(git diff --name-only $^ | paste -s -d ' ' -)" $^; \
fi
git rev-parse i-d-template/master > .i-d-template

## Update the gh-pages branch with useful files

GHPAGES_TMP := /tmp/ghpages$(shell echo $$$$)
.INTERMEDIATE: $(GHPAGES_TMP)
ifeq (,$(TRAVIS_COMMIT))
GIT_ORIG := $(shell git branch | grep '*' | cut -c 3-)
else
GIT_ORIG := $(TRAVIS_COMMIT)
endif

# Only run upload if we are local or on the master branch
IS_LOCAL := $(if $(TRAVIS),,true)
ifeq (master,$(TRAVIS_BRANCH))
IS_MASTER := $(findstring false,$(TRAVIS_PULL_REQUEST))
else
IS_MASTER :=
endif

index.html: $(draft).html
cp $< $@

ghpages: index.html $(draft).txt
ifneq (,$(or $(IS_LOCAL),$(IS_MASTER)))
mkdir $(GHPAGES_TMP)
cp -f $^ $(GHPAGES_TMP)
git clean -qfdX
ifeq (true,$(TRAVIS))
git config user.email "ci-bot@example.com"
git config user.name "Travis CI Bot"
git checkout -q --orphan gh-pages
git rm -qr --cached .
git clean -qfd
git pull -qf origin gh-pages --depth=5
else
git checkout gh-pages
git pull
endif
mv -f $(GHPAGES_TMP)/* $(CURDIR)
git add $^
if test `git status -s | wc -l` -gt 0; then git commit -m "Script updating gh-pages."; fi
ifneq (,$(GH_TOKEN))
@echo git push https://github.com/$(TRAVIS_REPO_SLUG).git gh-pages
@git push https://$(GH_TOKEN)@github.com/$(TRAVIS_REPO_SLUG).git gh-pages
endif
-git checkout -qf "$(GIT_ORIG)"
-rm -rf $(GHPAGES_TMP)
endif
94 changes: 94 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,94 @@
# SACM Requirements

This is the working area for the IETF SACM Requirements draft.

* [Working Group Draft] (https://tools.ietf.org/html/draft-ietf-sacm-requirements)

## Document Status

This document is currently being actively developed by the working group.

## Contributing

Before submitting feedback, please familiarize yourself with our current issues
list and review the [SACM Working Group](https://datatracker.ietf.org/wg/sacm/charter/). If you're
new to this, you may also want to read the [Tao of the
IETF](https://www.ietf.org/tao.html).

Be aware that all contributions to the specification fall under the "NOTE WELL"
terms outlined below.

1. The best way to provide feedback (editorial or design) and ask questions is
sending an e-mail to sacm@ietf.org (https://www.ietf.org/mailman/listinfo/SACM). This will ensure that
the entire Working Group sees your input in a timely fashion.

2. If you have **editorial** suggestions (i.e., those that do not change the
meaning of the specification), you can either:

a) Fork this repository and submit a pull request; this is the lowest
friction way to get editorial changes in.

b) Submit a new issue to Github, and mention that you believe it is editorial
in the issue body. It is not necessary to notify the mailing list for
editorial issues. (This is currently the recommended way as the authors are not
github literate.)

c) Make comments on individual commits in Github. Note that this feedback is
processed only with best effort by the editors, so it should only be used for
quick editorial suggestions or questions.

3. For non-editorial (i.e., **design**) issues, you can also create an issue on
Github. However, you **must notify the mailing list** when creating such issues,
providing a link to the issue in the message body.

Note that **github issues are not for substantial discussions**; the only
appropriate place to discuss design issues is on the mailing list itself.


## Building the Draft

In order to build a copy of the draft, you will need to install xml2rfc. This
requires Python 2.7 and can be installed using `pip`:

```sh
$ pip install xml2rfc
```

Other tools can be used to produce PDF files, or to provide a comparison. These
tools - and where to find them - are described in the `Makefile`.


## NOTE WELL

Any submission to the [IETF](https://www.ietf.org/) intended by the Contributor
for publication as all or part of an IETF Internet-Draft or RFC and any
statement made within the context of an IETF activity is considered an "IETF
Contribution". Such statements include oral statements in IETF sessions, as
well as written and electronic communications made at any time or place, which
are addressed to:

* The IETF plenary session
* The IESG, or any member thereof on behalf of the IESG
* Any IETF mailing list, including the IETF list itself, any working group
or design team list, or any other list functioning under IETF auspices
* Any IETF working group or portion thereof
* Any Birds of a Feather (BOF) session
* The IAB or any member thereof on behalf of the IAB
* The RFC Editor or the Internet-Drafts function
* All IETF Contributions are subject to the rules of
[RFC 5378](https://tools.ietf.org/html/rfc5378) and
[RFC 3979](https://tools.ietf.org/html/rfc3979)
(updated by [RFC 4879](https://tools.ietf.org/html/rfc4879)).

Statements made outside of an IETF session, mailing list or other function,
that are clearly not intended to be input to an IETF activity, group or
function, are not IETF Contributions in the context of this notice.

Please consult [RFC 5378](https://tools.ietf.org/html/rfc5378) and [RFC
3979](https://tools.ietf.org/html/rfc3979) for details.

A participant in any IETF activity is deemed to accept all IETF rules of
process, as documented in Best Current Practices RFCs and IESG Statements.

A participant in any IETF activity acknowledges that written, audio and video
records of meetings may be made and may be available to the public.
Loading

0 comments on commit 256b6ef

Please sign in to comment.