Add buildouts
Browse files- buildouts/components/jxml.cfg +36 -0
- buildouts/components/virtualenv-1.9.1.cfg +5 -0
- buildouts/components/virtualenv-jython.cfg +22 -0
- buildouts/components/xalan-j-2.7.1.cfg +18 -0
- buildouts/components/xalan-j-2.7.2.cfg +19 -0
- buildouts/developer.cfg +337 -0
- buildouts/maintainer.cfg +35 -0
- buildouts/tester.cfg +115 -0
- buildouts/translator.cfg +125 -0
- buildouts/user.cfg +7 -0
buildouts/components/jxml.cfg
ADDED
|
@@ -0,0 +1,36 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
[buildout]
|
| 2 |
+
extends= virtualenv-jython.cfg
|
| 3 |
+
|
| 4 |
+
[jxml]
|
| 5 |
+
recipe = collective.recipe.cmd
|
| 6 |
+
cmds = ${jxml-install:output} "${:location}"
|
| 7 |
+
on_install = true
|
| 8 |
+
on_update = true
|
| 9 |
+
|
| 10 |
+
location = ${buildout:parts-directory}/jxml
|
| 11 |
+
|
| 12 |
+
[jxml-install]
|
| 13 |
+
recipe = collective.recipe.template
|
| 14 |
+
output = ${buildout:parts-directory}/jxml-install.sh
|
| 15 |
+
mode=755
|
| 16 |
+
input =inline:
|
| 17 |
+
#!/bin/sh
|
| 18 |
+
set -e
|
| 19 |
+
|
| 20 |
+
usage() {
|
| 21 |
+
echo "usage: $0 <location>"
|
| 22 |
+
exit
|
| 23 |
+
}
|
| 24 |
+
|
| 25 |
+
location="$1"
|
| 26 |
+
[ -n "$location" ] || usage;
|
| 27 |
+
|
| 28 |
+
${virtualenv-jython:output} "$location"
|
| 29 |
+
jython="$location/bin/jython"
|
| 30 |
+
installed="$location/installed"
|
| 31 |
+
"$location/bin/pip" list > "$installed"
|
| 32 |
+
grep pyhwp "$installed" || "$jython" "${buildout:directory}/setup.py" develop
|
| 33 |
+
grep xsltest "$installed" || "$jython" "${buildout:directory}/tools/xsltest/setup.py" develop
|
| 34 |
+
grep jxml "$installed" || "$jython" "${buildout:directory}/tools/jxml/setup.py" develop
|
| 35 |
+
grep jxml.lxml "$installed" || "$jython" "${buildout:directory}/tools/jxml/lxml/setup.py" develop
|
| 36 |
+
grep jxml.coverage "$installed" || "$jython" "${buildout:directory}/tools/jxml/jxml.coverage/setup.py" develop
|
buildouts/components/virtualenv-1.9.1.cfg
ADDED
|
@@ -0,0 +1,5 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
[virtualenv-1.9.1]
|
| 2 |
+
recipe = hexagonit.recipe.download
|
| 3 |
+
url = https://pypi.python.org/packages/source/v/virtualenv/virtualenv-1.9.1.tar.gz
|
| 4 |
+
destination = ${buildout:parts-directory}/virtualenv-1.9.1
|
| 5 |
+
strip-top-level-dir = true
|
buildouts/components/virtualenv-jython.cfg
ADDED
|
@@ -0,0 +1,22 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
[buildout]
|
| 2 |
+
extends= virtualenv-1.9.1.cfg
|
| 3 |
+
|
| 4 |
+
[virtualenv-jython]
|
| 5 |
+
recipe = collective.recipe.template
|
| 6 |
+
output = ${buildout:bin-directory}/virtualenv-jython
|
| 7 |
+
mode=755
|
| 8 |
+
input =inline:
|
| 9 |
+
#!/bin/sh
|
| 10 |
+
set -e
|
| 11 |
+
|
| 12 |
+
usage() {
|
| 13 |
+
echo "usage: $0 <location>"
|
| 14 |
+
exit 1
|
| 15 |
+
}
|
| 16 |
+
|
| 17 |
+
location="$1"
|
| 18 |
+
[ -n "$location" ] || usage
|
| 19 |
+
|
| 20 |
+
activate="$location/bin/activate"
|
| 21 |
+
[ -e "$activate" ] || jython ${virtualenv-1.9.1:destination}/virtualenv.py $location
|
| 22 |
+
|
buildouts/components/xalan-j-2.7.1.cfg
ADDED
|
@@ -0,0 +1,18 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
[xalan-j-2.7.1]
|
| 2 |
+
recipe = hexagonit.recipe.download
|
| 3 |
+
url = ${xalan-j-2.7.1.tar.gz:downloaded}
|
| 4 |
+
destination = ${buildout:parts-directory}/xalan-j-2.7.1
|
| 5 |
+
strip-top-level-dir = true
|
| 6 |
+
|
| 7 |
+
jars = ${:destination}/xalan.jar:${:destination}/xercesImpl.jar:${:destination}/serializer.jar:${:destination}/xml-apis.jar
|
| 8 |
+
|
| 9 |
+
[xalan-j-2.7.1.tar.gz]
|
| 10 |
+
recipe = hexagonit.recipe.download
|
| 11 |
+
url = http://mirror.apache-kr.org/xalan/xalan-j/binaries/xalan-j_2_7_1-bin-2jars.tar.gz
|
| 12 |
+
md5sum = 3ccda39bcd08b780436dfd2f22fb23d5
|
| 13 |
+
destination = ${buildout:parts-directory}
|
| 14 |
+
filename = xalan-j-2.7.1.tar.gz
|
| 15 |
+
download-only = true
|
| 16 |
+
|
| 17 |
+
downloaded = ${:destination}/${:filename}
|
| 18 |
+
|
buildouts/components/xalan-j-2.7.2.cfg
ADDED
|
@@ -0,0 +1,19 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
[xalan-j-2.7.2]
|
| 2 |
+
recipe = hexagonit.recipe.download
|
| 3 |
+
url = ${xalan-j-2.7.2.tar.gz:downloaded}
|
| 4 |
+
destination = ${buildout:parts-directory}/xalan-j-2.7.2
|
| 5 |
+
strip-top-level-dir = true
|
| 6 |
+
|
| 7 |
+
jars = ${:destination}/xalan.jar:${:destination}/xercesImpl.jar:${:destination}/serializer.jar:${:destination}/xml-apis.jar
|
| 8 |
+
|
| 9 |
+
[xalan-j-2.7.2.tar.gz]
|
| 10 |
+
recipe = hexagonit.recipe.download
|
| 11 |
+
url = http://apache.tt.co.kr/xalan/xalan-j/binaries/xalan-j_2_7_2-bin-2jars.tar.gz
|
| 12 |
+
# md5sum = 3ccda39bcd08b780436dfd2f22fb23d5
|
| 13 |
+
destination = ${buildout:parts-directory}
|
| 14 |
+
filename = xalan-j-2.7.2.tar.gz
|
| 15 |
+
download-only = true
|
| 16 |
+
|
| 17 |
+
downloaded = ${:destination}/${:filename}
|
| 18 |
+
|
| 19 |
+
|
buildouts/developer.cfg
ADDED
|
@@ -0,0 +1,337 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
[buildout]
|
| 2 |
+
extends = translator.cfg
|
| 3 |
+
components/jxml.cfg
|
| 4 |
+
components/xalan-j-2.7.2.cfg
|
| 5 |
+
develop+= pyhwp-tests
|
| 6 |
+
tools/xsltest
|
| 7 |
+
tools/gpl
|
| 8 |
+
parts+= test-core
|
| 9 |
+
test-coverage
|
| 10 |
+
test-cli
|
| 11 |
+
test-xsl
|
| 12 |
+
test-xsl-cov
|
| 13 |
+
test-sdist
|
| 14 |
+
test-tools
|
| 15 |
+
test-for-bisect
|
| 16 |
+
xsltest
|
| 17 |
+
code-analysis
|
| 18 |
+
collect-samples
|
| 19 |
+
masstest-failed
|
| 20 |
+
massfind-unknowntag
|
| 21 |
+
massfind-incomplete
|
| 22 |
+
expected-output-update
|
| 23 |
+
|
| 24 |
+
[pyhwp]
|
| 25 |
+
eggs+= nose
|
| 26 |
+
coverage
|
| 27 |
+
gpl
|
| 28 |
+
pyroma
|
| 29 |
+
|
| 30 |
+
[test-core]
|
| 31 |
+
recipe = collective.xmltestreport
|
| 32 |
+
eggs = pyhwp-tests
|
| 33 |
+
defaults = ['--auto-color', '--auto-progress', '--xml', '--tests-pattern=hwp5_tests']
|
| 34 |
+
|
| 35 |
+
[test-xsl]
|
| 36 |
+
recipe = collective.recipe.template
|
| 37 |
+
input = ${buildout:directory}/misc/test-xsl.in
|
| 38 |
+
output = ${buildout:directory}/bin/test-xsl
|
| 39 |
+
mode = 755
|
| 40 |
+
|
| 41 |
+
[test-xsl-cov]
|
| 42 |
+
recipe = collective.recipe.template
|
| 43 |
+
mode=755
|
| 44 |
+
output=${buildout:bin-directory}/test-xsl-cov
|
| 45 |
+
input =inline:
|
| 46 |
+
#!/bin/sh
|
| 47 |
+
CLASSPATH=${xalan-j-2.7.2:jars} ${jxml:location}/bin/jxml-cov-test $*
|
| 48 |
+
|
| 49 |
+
[test-coverage]
|
| 50 |
+
recipe = collective.recipe.template
|
| 51 |
+
input = ${buildout:directory}/misc/test-coverage
|
| 52 |
+
output = ${buildout:directory}/bin/test-coverage
|
| 53 |
+
mode = 755
|
| 54 |
+
|
| 55 |
+
[test-cli]
|
| 56 |
+
recipe = collective.recipe.template
|
| 57 |
+
input = ${buildout:directory}/misc/test-cli.in
|
| 58 |
+
output = ${buildout:directory}/bin/test-cli
|
| 59 |
+
mode = 755
|
| 60 |
+
|
| 61 |
+
[test-sdist]
|
| 62 |
+
recipe = collective.recipe.template
|
| 63 |
+
input = ${buildout:directory}/misc/test-sdist.in
|
| 64 |
+
output = ${buildout:directory}/bin/test-sdist
|
| 65 |
+
mode = 755
|
| 66 |
+
|
| 67 |
+
[test-tools]
|
| 68 |
+
recipe = collective.xmltestreport
|
| 69 |
+
eggs = gpl
|
| 70 |
+
defaults = ['--auto-color', '--auto-progress', '--xml']
|
| 71 |
+
|
| 72 |
+
[test-for-bisect]
|
| 73 |
+
recipe = collective.recipe.template
|
| 74 |
+
input = ${buildout:directory}/misc/test-for-bisect
|
| 75 |
+
output = ${buildout:directory}/bin/test-for-bisect
|
| 76 |
+
mode = 755
|
| 77 |
+
|
| 78 |
+
[xsltest]
|
| 79 |
+
recipe = zc.recipe.egg
|
| 80 |
+
eggs = xsltest
|
| 81 |
+
|
| 82 |
+
[code-analysis]
|
| 83 |
+
recipe = plone.recipe.codeanalysis
|
| 84 |
+
directory = ${buildout:directory}/pyhwp
|
| 85 |
+
|
| 86 |
+
# Default is 10
|
| 87 |
+
flake8-max-complexity = 30
|
| 88 |
+
|
| 89 |
+
utf8-header = True
|
| 90 |
+
|
| 91 |
+
[collect-samples]
|
| 92 |
+
recipe = collective.recipe.template
|
| 93 |
+
mode = 755
|
| 94 |
+
output = ${buildout:bin-directory}/${:_buildout_section_name_}
|
| 95 |
+
input =
|
| 96 |
+
inline:
|
| 97 |
+
#!/bin/sh
|
| 98 |
+
|
| 99 |
+
set -e
|
| 100 |
+
|
| 101 |
+
dir="$1"
|
| 102 |
+
find "$dir" -iname '*.hwp' -print0 | parallel --gnu -0 "${save-sample:output}"
|
| 103 |
+
|
| 104 |
+
[save-sample]
|
| 105 |
+
recipe = collective.recipe.template
|
| 106 |
+
mode = 755
|
| 107 |
+
output = ${buildout:bin-directory}/${:_buildout_section_name_}
|
| 108 |
+
input =
|
| 109 |
+
inline:
|
| 110 |
+
#!/bin/sh
|
| 111 |
+
|
| 112 |
+
set -e
|
| 113 |
+
|
| 114 |
+
src="$1"
|
| 115 |
+
|
| 116 |
+
[ -e "$src" ] || (echo "$src not found"; exit 1)
|
| 117 |
+
|
| 118 |
+
${:abspath}
|
| 119 |
+
|
| 120 |
+
version=$(${buildout:bin-directory}/hwp5proc version "$src")
|
| 121 |
+
srcpath=$(abspath "$src")
|
| 122 |
+
sha1sum=$(sha1sum -b "$srcpath" | awk '{ print $1 }')
|
| 123 |
+
|
| 124 |
+
echo "$version/$sha1sum $srcpath"
|
| 125 |
+
|
| 126 |
+
repo="${buildout:directory}/samples.local"
|
| 127 |
+
|
| 128 |
+
blob_dir="${buildout:directory}/samples.local/blob"
|
| 129 |
+
[ -d "$blob_dir" ] || mkdir -p "$blob_dir"
|
| 130 |
+
|
| 131 |
+
blob_path="$blob_dir/$sha1sum"
|
| 132 |
+
[ -e "$blob_path" ] || cp "$srcpath" "$blob_path"
|
| 133 |
+
|
| 134 |
+
dst_path="$repo/$version/$sha1sum.hwp"
|
| 135 |
+
dst_dir=$(dirname "$dst_path")
|
| 136 |
+
[ -d "$dst_dir" ] || mkdir -p "$dst_dir"
|
| 137 |
+
[ -e $dst_path ] || ln -s "$blob_path" "$dst_path"
|
| 138 |
+
|
| 139 |
+
abspath=
|
| 140 |
+
abspath() {
|
| 141 |
+
if [ $(echo "$1" | head -c 1) = "/" ]; then
|
| 142 |
+
echo "$1"
|
| 143 |
+
else
|
| 144 |
+
echo "$PWD/$1"
|
| 145 |
+
fi
|
| 146 |
+
}
|
| 147 |
+
|
| 148 |
+
[masstest-failed]
|
| 149 |
+
recipe = collective.recipe.template
|
| 150 |
+
mode = 755
|
| 151 |
+
output = ${buildout:bin-directory}/${:_buildout_section_name_}
|
| 152 |
+
input =
|
| 153 |
+
inline:
|
| 154 |
+
#!/bin/sh
|
| 155 |
+
|
| 156 |
+
set -e
|
| 157 |
+
|
| 158 |
+
${masstest:output} "${masstest-worker:failed-dir}"
|
| 159 |
+
|
| 160 |
+
[masstest]
|
| 161 |
+
recipe = collective.recipe.template
|
| 162 |
+
mode = 755
|
| 163 |
+
output = ${buildout:bin-directory}/${:_buildout_section_name_}
|
| 164 |
+
input =
|
| 165 |
+
inline:
|
| 166 |
+
#!/bin/sh
|
| 167 |
+
|
| 168 |
+
set -e
|
| 169 |
+
|
| 170 |
+
${:def-masstest}
|
| 171 |
+
|
| 172 |
+
sample_dir="${buildout:directory}/samples.local/"
|
| 173 |
+
[ -z "$1" ] || sample_dir="$1"
|
| 174 |
+
|
| 175 |
+
masstest "$sample_dir" | tee ${buildout:parts-directory}/masstest.log
|
| 176 |
+
|
| 177 |
+
def-masstest=
|
| 178 |
+
masstest() {
|
| 179 |
+
find "$1" -iname '*.hwp' -print0 | parallel --gnu -0 ${masstest-worker:output}
|
| 180 |
+
}
|
| 181 |
+
|
| 182 |
+
[masstest-worker]
|
| 183 |
+
recipe = collective.recipe.template
|
| 184 |
+
mode = 755
|
| 185 |
+
output = ${buildout:bin-directory}/${:_buildout_section_name_}
|
| 186 |
+
input =
|
| 187 |
+
inline:
|
| 188 |
+
#!/bin/sh
|
| 189 |
+
|
| 190 |
+
set -e
|
| 191 |
+
|
| 192 |
+
[ -e "$1" ] || (echo "$1: not found"; exit 1)
|
| 193 |
+
testee="$1"
|
| 194 |
+
|
| 195 |
+
failed_dir="${:failed-dir}"
|
| 196 |
+
[ -d "$failed_dir" ] || mkdir -p "$failed_dir"
|
| 197 |
+
|
| 198 |
+
errors_dir="${:errors-dir}"
|
| 199 |
+
[ -d "$errors_dir" ] || mkdir -p "$errors_dir"
|
| 200 |
+
|
| 201 |
+
testee_filename=$(basename "$testee")
|
| 202 |
+
testee_error_hwp5proc="$errors_dir/$testee_filename.hwp5proc.err"
|
| 203 |
+
testee_error_xmllint="$errors_dir/$testee_filename.xmllint.err"
|
| 204 |
+
|
| 205 |
+
test_xml() {
|
| 206 |
+
${buildout:bin-directory}/hwp5proc xml "$testee" 2> "$testee_error_hwp5proc" | xmllint --format - > /dev/null 2> "$testee_error_xmllint"
|
| 207 |
+
}
|
| 208 |
+
|
| 209 |
+
handle_success() {
|
| 210 |
+
echo ""
|
| 211 |
+
filename=$(basename "$testee")
|
| 212 |
+
failed_path="$failed_dir/$filename"
|
| 213 |
+
[ ! -e "$failed_path" ] || rm -f "$failed_path"
|
| 214 |
+
rm -f "$testee_error_hwp5proc"
|
| 215 |
+
rm -f "$testee_error_xmllint"
|
| 216 |
+
}
|
| 217 |
+
|
| 218 |
+
handle_failed() {
|
| 219 |
+
echo " FAILED"
|
| 220 |
+
[ -e "$failed_path" ] || ln -s "$testee" "$failed_dir"
|
| 221 |
+
}
|
| 222 |
+
|
| 223 |
+
echo -n "$testee"
|
| 224 |
+
test_xml && handle_success || handle_failed
|
| 225 |
+
|
| 226 |
+
failed-dir=${buildout:parts-directory}/masstest/failed
|
| 227 |
+
errors-dir=${buildout:parts-directory}/masstest/errors
|
| 228 |
+
|
| 229 |
+
|
| 230 |
+
[massfind-unknowntag]
|
| 231 |
+
recipe = collective.recipe.template
|
| 232 |
+
output = ${buildout:bin-directory}/${:_buildout_section_name_}
|
| 233 |
+
mode = 755
|
| 234 |
+
input =
|
| 235 |
+
inline:
|
| 236 |
+
#!/bin/sh
|
| 237 |
+
|
| 238 |
+
set -e
|
| 239 |
+
|
| 240 |
+
samples='${buildout:directory}/samples.local'
|
| 241 |
+
find "$samples/" -iname '*.hwp' | parallel --gnu ${buildout:bin-directory}/hwp5proc find --model=UnknownTagModel | tee ${buildout:parts-directory}/massfind-unknowntag
|
| 242 |
+
|
| 243 |
+
|
| 244 |
+
[massfind-incomplete]
|
| 245 |
+
recipe = collective.recipe.template
|
| 246 |
+
output = ${buildout:bin-directory}/${:_buildout_section_name_}
|
| 247 |
+
mode = 755
|
| 248 |
+
input =
|
| 249 |
+
inline:
|
| 250 |
+
#!/bin/sh
|
| 251 |
+
|
| 252 |
+
set -e
|
| 253 |
+
|
| 254 |
+
samples='${buildout:directory}/samples.local'
|
| 255 |
+
find "$samples/" -iname '*.hwp' | parallel --gnu ${buildout:bin-directory}/hwp5proc find --incomplete | tee ${buildout:parts-directory}/massfind-incomplete
|
| 256 |
+
|
| 257 |
+
|
| 258 |
+
[expected-output-update]
|
| 259 |
+
recipe = collective.recipe.template
|
| 260 |
+
output = ${buildout:bin-directory}/${:_buildout_section_name_}
|
| 261 |
+
mode = 755
|
| 262 |
+
input =
|
| 263 |
+
inline:
|
| 264 |
+
#!/bin/sh
|
| 265 |
+
|
| 266 |
+
set -e
|
| 267 |
+
|
| 268 |
+
samples='${buildout:directory}/samples'
|
| 269 |
+
find "$samples/" -iname '*.hwp' | parallel --gnu ${expected-output-update-worker:output}
|
| 270 |
+
|
| 271 |
+
[expected-output-update-worker]
|
| 272 |
+
recipe = collective.recipe.template
|
| 273 |
+
output = ${buildout:bin-directory}/${:_buildout_section_name_}
|
| 274 |
+
mode = 755
|
| 275 |
+
input =
|
| 276 |
+
inline:
|
| 277 |
+
#!/bin/sh
|
| 278 |
+
|
| 279 |
+
set -e
|
| 280 |
+
|
| 281 |
+
filename=$1
|
| 282 |
+
docinfo="$filename.docinfo.json"
|
| 283 |
+
section0="$filename.bodytext.section0.json"
|
| 284 |
+
xmlformat="$filename.formatted.xml"
|
| 285 |
+
odt_output="$filename.odt"
|
| 286 |
+
odt_filename=`basename "$odt_output"`
|
| 287 |
+
|
| 288 |
+
hwp5proc_xml() {
|
| 289 |
+
${buildout:bin-directory}/hwp5proc xml "$1" 2> "$xmlformat.err"
|
| 290 |
+
}
|
| 291 |
+
|
| 292 |
+
hwp5odt() {
|
| 293 |
+
local orgdir="$PWD"
|
| 294 |
+
local filename=`basename "$1"`
|
| 295 |
+
local odt_file=`echo $filename | sed -e "s/.hwp$/.odt/g"`
|
| 296 |
+
cd `dirname "$1"`
|
| 297 |
+
${buildout:bin-directory}/hwp5odt "$filename"
|
| 298 |
+
rm -rf "$odt_file.d"
|
| 299 |
+
mkdir "$odt_file.d"
|
| 300 |
+
unzip "$odt_file" -d "$odt_file.d"
|
| 301 |
+
rm -f "$odt_file"
|
| 302 |
+
cd "$orgdir"
|
| 303 |
+
}
|
| 304 |
+
|
| 305 |
+
hwp5html() {
|
| 306 |
+
local html_dir=`echo $1 | sed -e "s/.hwp$/.html.d/g"`
|
| 307 |
+
rm -rf "$html_dir"
|
| 308 |
+
${buildout:bin-directory}/hwp5html "$1" --output "$html_dir"
|
| 309 |
+
xmllint --c14n --nonet --encode utf-8 "$html_dir/index.xhtml" | xmllint --format --encode utf-8 - > "$html_dir/index.formatted.xhtml"
|
| 310 |
+
}
|
| 311 |
+
|
| 312 |
+
xml_c14n() {
|
| 313 |
+
xmllint --c14n --encode utf-8 - 2> "$xmlformat.c14n.err"
|
| 314 |
+
}
|
| 315 |
+
xml_format() {
|
| 316 |
+
xmllint --format --encode utf-8 - 2> "$xmlformat.format.err"
|
| 317 |
+
}
|
| 318 |
+
|
| 319 |
+
if ${buildout:bin-directory}/hwp5proc header "$filename" | grep password | grep 0 > /dev/null; then
|
| 320 |
+
dummy=''
|
| 321 |
+
else
|
| 322 |
+
echo "$filename: SKIPPING"
|
| 323 |
+
rm -f "$docinfo.err"
|
| 324 |
+
rm -f "$section0.err"
|
| 325 |
+
rm -f "$xmlformat.err"
|
| 326 |
+
rm -f "$xmlformat.c14n.err"
|
| 327 |
+
rm -f "$xmlformat.format.err"
|
| 328 |
+
exit 0
|
| 329 |
+
fi
|
| 330 |
+
|
| 331 |
+
${buildout:bin-directory}/hwp5proc models "$filename" docinfo > "$docinfo" 2> "$docinfo.err" && echo "$filename: docinfo" && rm -f "$docinfo.err"
|
| 332 |
+
|
| 333 |
+
${buildout:bin-directory}/hwp5proc models "$filename" bodytext/0 > "$section0" 2> "$section0.err" && echo "$filename: bodytext/0" && rm -f "$section0.err"
|
| 334 |
+
|
| 335 |
+
hwp5proc_xml "$filename" | xml_c14n | xml_format > "$xmlformat" && echo "$filename: xml" && rm -f "$xmlformat.err" "$xmlformat.c14n.err" "$xmlformat.format.err"
|
| 336 |
+
hwp5odt "$filename"
|
| 337 |
+
hwp5html "$filename"
|
buildouts/maintainer.cfg
ADDED
|
@@ -0,0 +1,35 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
[buildout]
|
| 2 |
+
extends = tester.cfg
|
| 3 |
+
develop+= tools/pyhwp.zestreleaser.cmds
|
| 4 |
+
parts+= test-upload
|
| 5 |
+
docs-upload
|
| 6 |
+
upload
|
| 7 |
+
test-pypi
|
| 8 |
+
|
| 9 |
+
[pyhwp]
|
| 10 |
+
eggs+= zest.releaser
|
| 11 |
+
pyhwp.zestreleaser.cmds
|
| 12 |
+
|
| 13 |
+
[docs-upload]
|
| 14 |
+
recipe = collective.recipe.template
|
| 15 |
+
input = ${buildout:directory}/misc/docs-upload
|
| 16 |
+
output = ${buildout:directory}/bin/docs-upload
|
| 17 |
+
mode = 755
|
| 18 |
+
|
| 19 |
+
[test-upload]
|
| 20 |
+
recipe = collective.recipe.template
|
| 21 |
+
input = ${buildout:directory}/misc/test-upload.in
|
| 22 |
+
output = ${buildout:directory}/bin/test-upload
|
| 23 |
+
mode = 755
|
| 24 |
+
|
| 25 |
+
[upload]
|
| 26 |
+
recipe = collective.recipe.template
|
| 27 |
+
input = ${buildout:directory}/misc/upload
|
| 28 |
+
output = ${buildout:directory}/bin/upload
|
| 29 |
+
mode = 755
|
| 30 |
+
|
| 31 |
+
[test-pypi]
|
| 32 |
+
recipe = collective.recipe.template
|
| 33 |
+
input = ${buildout:directory}/misc/test-pypi.in
|
| 34 |
+
output = ${buildout:directory}/bin/test-pypi
|
| 35 |
+
mode = 755
|
buildouts/tester.cfg
ADDED
|
@@ -0,0 +1,115 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
[buildout]
|
| 2 |
+
extends = developer.cfg
|
| 3 |
+
https://raw.github.com/mete0r/mkvenv/master/lib/buildout.extends/mkvenv.cfg
|
| 4 |
+
develop+= tools/constants
|
| 5 |
+
tools/jingodf
|
| 6 |
+
parts+= tox-ini
|
| 7 |
+
tox-py25
|
| 8 |
+
tox-jy25
|
| 9 |
+
wheelhouse
|
| 10 |
+
|
| 11 |
+
[versions]
|
| 12 |
+
collective.xmltestreport = 1.2.6
|
| 13 |
+
|
| 14 |
+
[constants]
|
| 15 |
+
recipe = pyhwp.dev.constants
|
| 16 |
+
|
| 17 |
+
[wheelhouse]
|
| 18 |
+
recipe = z3c.recipe.mkdir
|
| 19 |
+
paths=wheelhouse
|
| 20 |
+
|
| 21 |
+
[tox]
|
| 22 |
+
recipe = zc.recipe.egg
|
| 23 |
+
eggs = tox
|
| 24 |
+
|
| 25 |
+
[tox-ini]
|
| 26 |
+
recipe = collective.recipe.template
|
| 27 |
+
input = ${buildout:directory}/tox.ini.in
|
| 28 |
+
output = ${buildout:directory}/tox.ini
|
| 29 |
+
mode = 755
|
| 30 |
+
|
| 31 |
+
[tox-shim]
|
| 32 |
+
recipe = collective.recipe.template
|
| 33 |
+
mode = 755
|
| 34 |
+
output = ${buildout:bin-directory}/${:name}
|
| 35 |
+
input = inline:
|
| 36 |
+
#!/bin/sh
|
| 37 |
+
set -e
|
| 38 |
+
|
| 39 |
+
# build virtualenv
|
| 40 |
+
${:mkvenv} ${:envdir}
|
| 41 |
+
. ${:envbindir}/activate
|
| 42 |
+
|
| 43 |
+
# sdist & install
|
| 44 |
+
${:envpython} setup.py install
|
| 45 |
+
|
| 46 |
+
${:environment-variables}
|
| 47 |
+
|
| 48 |
+
# ---- commands ----
|
| 49 |
+
${:envpython} ${:toxinidir}/misc/cleanup-pyc.py ${:toxinidir}/pyhwp ${:toxinidir}/pyhwp_uno ${:toxinidir}/unokit
|
| 50 |
+
${:envpython} ${:toxinidir}/misc/mkdir.py ${:envtmpdir}
|
| 51 |
+
|
| 52 |
+
${:envbindir}/pip install nose coverage
|
| 53 |
+
${:install-crypto}
|
| 54 |
+
${:install-lxml}
|
| 55 |
+
|
| 56 |
+
${:envbindir}/coverage run -p ${:coverage-options} ${:envbindir}/nosetests${constants:script_py_suffix} -v -w ${:envtmpdir} ${:toxinidir}/pyhwp-tests --logging-config=${:toxinidir}/etc/testlog.conf --with-xunit --xunit-file=${:envtmpdir}/nosetests.xml
|
| 57 |
+
${:envpython} ${:toxinidir}/misc/test-cli.py
|
| 58 |
+
${:envpython} ${:toxinidir}/misc/prepare-hwp5-xsl-fixtures.py --fixtures-dir=${:toxinidir}/pyhwp-tests/hwp5_tests/fixtures --out-dir=${:envtmpdir}/hwp5_xsl_fixtures
|
| 59 |
+
${:toxinidir}/bin/xsltest --styles-dir=${:toxinidir}/pyhwp/hwp5/xsl --import-dir=${:envtmpdir}/hwp5_xsl_fixtures --gen-dir=${:envtmpdir}/hwp5_xsl_tests ${:toxinidir}/pyhwp-tests/hwp5_xsl_tests
|
| 60 |
+
|
| 61 |
+
echo '${:name} successful.'
|
| 62 |
+
|
| 63 |
+
name=${:_buildout_section_name_}
|
| 64 |
+
mkvenv=
|
| 65 |
+
envdir=${buildout:parts-directory}/${:name}
|
| 66 |
+
envbindir=${:envdir}/bin
|
| 67 |
+
envtmpdir=${:envdir}/tmp
|
| 68 |
+
envpython=${:envdir}/bin/python
|
| 69 |
+
toxinidir=${buildout:directory}
|
| 70 |
+
|
| 71 |
+
environment-variables=
|
| 72 |
+
install-lxml=
|
| 73 |
+
install-crypto=
|
| 74 |
+
coverage-options=--source=hwp5,hwp5_tests
|
| 75 |
+
|
| 76 |
+
|
| 77 |
+
[tox-py25]
|
| 78 |
+
<=tox-shim
|
| 79 |
+
mkvenv=${mkvenv-CPython-2.5:output}
|
| 80 |
+
|
| 81 |
+
install-lxml=[ -e ${:lxml-built} ] && tar -C ${:site-packages} -xzf ${:lxml-built} || ${:envbindir}/pip install lxml && tar -C ${:site-packages} -czf ${:lxml-built} lxml
|
| 82 |
+
site-packages=${:envdir}/lib/python2.5/site-packages
|
| 83 |
+
lxml-built=${buildout:parts-directory}/tox-py25-lxml-built.tar.gz
|
| 84 |
+
|
| 85 |
+
install-crypto=[ -e ${:pycrypto-built} ] && tar -C ${:site-packages} -xzf ${:pycrypto-built} || ${:envbindir}/pip install pycrypo && tar -C ${:site-packages} -czf ${:pycrypto-built} Crypto
|
| 86 |
+
pycrypto-built=${buildout:parts-directory}/tox-py25-pycrypto-built.tar.gz
|
| 87 |
+
|
| 88 |
+
[tox-jy25]
|
| 89 |
+
<=tox-shim
|
| 90 |
+
mkvenv=${mkvenv-Jython-2.5:output}
|
| 91 |
+
|
| 92 |
+
environment-variables = export JYTHONPATH=${poi-3.9:destination}/poi-3.9-20121203.jar
|
| 93 |
+
export PIP_INSECURE=1
|
| 94 |
+
|
| 95 |
+
# WORKAROUND: 현재 jython 2.5.3, coverage 3.5.3에서 coverage run 실행 시
|
| 96 |
+
# --source=hwp5,hwp5_tests 옵션을 주면 이상하게도 hwp5_tests의 결과만 저장된다.
|
| 97 |
+
# 따라서 --source 대신 -L을 주어 모든 파일에 대해 coverage 결과를 얻은 후,
|
| 98 |
+
# coverage xml에서 필터링한다.
|
| 99 |
+
coverage-options=--source=hwp5,hwp5_tests
|
| 100 |
+
|
| 101 |
+
[poi-3.9]
|
| 102 |
+
recipe = hexagonit.recipe.download
|
| 103 |
+
url = ${poi-bin-3.9-20121203.tar.gz:downloaded}
|
| 104 |
+
destination=${buildout:parts-directory}/poi-3.9
|
| 105 |
+
strip-top-level-dir=true
|
| 106 |
+
|
| 107 |
+
[poi-bin-3.9-20121203.tar.gz]
|
| 108 |
+
recipe = hexagonit.recipe.download
|
| 109 |
+
url = http://archive.apache.org/dist/poi/release/bin/${:filename}
|
| 110 |
+
md5sum = 09c4dfd63317bb9eb37fe12d6febea74
|
| 111 |
+
download-only = true
|
| 112 |
+
destination=${buildout:parts-directory}
|
| 113 |
+
filename=poi-bin-3.9-20121203.tar.gz
|
| 114 |
+
|
| 115 |
+
downloaded=${:destination}/${:filename}
|
buildouts/translator.cfg
ADDED
|
@@ -0,0 +1,125 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
[buildout]
|
| 2 |
+
extends = user.cfg
|
| 3 |
+
parts+= docs-update-po
|
| 4 |
+
docs-build
|
| 5 |
+
docs-build-latex
|
| 6 |
+
|
| 7 |
+
[pyhwp]
|
| 8 |
+
eggs+= sphinx
|
| 9 |
+
interpreter = console
|
| 10 |
+
|
| 11 |
+
[docs-update-po]
|
| 12 |
+
recipe = collective.recipe.template
|
| 13 |
+
output = ${buildout:directory}/bin/docs-update-po
|
| 14 |
+
mode = 755
|
| 15 |
+
input=inline:
|
| 16 |
+
#!/bin/sh
|
| 17 |
+
|
| 18 |
+
# exit if any statement returns non-true return value
|
| 19 |
+
set -e
|
| 20 |
+
|
| 21 |
+
# exit on uninitialized variable
|
| 22 |
+
set -u
|
| 23 |
+
|
| 24 |
+
SRC_DIR=${buildout:directory}/docs
|
| 25 |
+
POT_DIR=${buildout:directory}/docs/.build/gettext
|
| 26 |
+
PO_BASE=${buildout:directory}/docs/translated
|
| 27 |
+
|
| 28 |
+
${buildout:directory}/bin/sphinx-build -b gettext $SRC_DIR $POT_DIR
|
| 29 |
+
|
| 30 |
+
for LANG in ko en; do
|
| 31 |
+
for FILE in index intro hwp5proc converters; do
|
| 32 |
+
PO_FILE=$PO_BASE/$LANG/LC_MESSAGES/$FILE.po
|
| 33 |
+
POT_FILE=$POT_DIR/$FILE.pot
|
| 34 |
+
echo $PO_FILE
|
| 35 |
+
[ -e $PO_FILE ] && msgmerge --update $PO_FILE $POT_FILE
|
| 36 |
+
[ -e $PO_FILE ] || cp $POT_FILE $PO_FILE
|
| 37 |
+
|
| 38 |
+
done
|
| 39 |
+
done
|
| 40 |
+
|
| 41 |
+
[docs-build]
|
| 42 |
+
recipe = collective.recipe.template
|
| 43 |
+
input = ${buildout:directory}/misc/docs-build
|
| 44 |
+
output = ${buildout:directory}/bin/docs-build
|
| 45 |
+
mode = 755
|
| 46 |
+
input=inline:
|
| 47 |
+
#!/bin/sh
|
| 48 |
+
|
| 49 |
+
# exit if any statement returns non-true return value
|
| 50 |
+
set -e
|
| 51 |
+
|
| 52 |
+
# exit on uninitialized variable
|
| 53 |
+
set -u
|
| 54 |
+
|
| 55 |
+
SRC_DIR=${buildout:directory}/docs
|
| 56 |
+
PO_BASE=${buildout:directory}/docs/translated
|
| 57 |
+
HTML_BASE=${buildout:directory}/docs/.build/html
|
| 58 |
+
BUILD_DIR=${buildout:directory}/build
|
| 59 |
+
|
| 60 |
+
cd ${buildout:directory}
|
| 61 |
+
|
| 62 |
+
for LANG in ko en; do
|
| 63 |
+
for FILE in index intro hwp5proc converters; do
|
| 64 |
+
PO_FILE=$PO_BASE/$LANG/LC_MESSAGES/$FILE.po
|
| 65 |
+
MO_FILE=$PO_BASE/$LANG/LC_MESSAGES/$FILE.mo
|
| 66 |
+
echo $MO_FILE
|
| 67 |
+
msgfmt $PO_FILE -o $MO_FILE
|
| 68 |
+
done
|
| 69 |
+
OUT_DIR=$HTML_BASE/$LANG
|
| 70 |
+
echo $OUT_DIR
|
| 71 |
+
# sphinx does not detect changes in .mo files
|
| 72 |
+
# see https://bitbucket.org/birkenfeld/sphinx/issue/830
|
| 73 |
+
rm -rf $OUT_DIR
|
| 74 |
+
${buildout:directory}/bin/sphinx-build -b html -Dlanguage=$LANG $SRC_DIR $OUT_DIR
|
| 75 |
+
done
|
| 76 |
+
|
| 77 |
+
EN_DIR=$HTML_BASE/en
|
| 78 |
+
KO_DIR=$HTML_BASE/ko
|
| 79 |
+
|
| 80 |
+
mkdir -p $BUILD_DIR
|
| 81 |
+
rm -rf $BUILD_DIR/docs
|
| 82 |
+
|
| 83 |
+
cp -r $EN_DIR $BUILD_DIR/docs # en becomes docs/
|
| 84 |
+
cp -r $KO_DIR $BUILD_DIR/docs/ # ko becomes docs/ko
|
| 85 |
+
|
| 86 |
+
[docs-build-latex]
|
| 87 |
+
recipe = collective.recipe.template
|
| 88 |
+
output = ${buildout:bin-directory}/${:_buildout_section_name_}
|
| 89 |
+
mode = 755
|
| 90 |
+
input =
|
| 91 |
+
inline:
|
| 92 |
+
#!/bin/sh
|
| 93 |
+
|
| 94 |
+
# exit if any statement returns non-true return value
|
| 95 |
+
set -e
|
| 96 |
+
|
| 97 |
+
# exit on uninitialized variable
|
| 98 |
+
set -u
|
| 99 |
+
|
| 100 |
+
SRC_DIR=${buildout:directory}/docs
|
| 101 |
+
PO_BASE=${buildout:directory}/docs/translated
|
| 102 |
+
LATEX_BASE=${buildout:directory}/docs/.build/latex
|
| 103 |
+
DIST_DIR=${buildout:directory}/dist
|
| 104 |
+
|
| 105 |
+
cd ${buildout:directory}
|
| 106 |
+
|
| 107 |
+
for LANG in ko en; do
|
| 108 |
+
for FILE in index intro hwp5proc converters; do
|
| 109 |
+
PO_FILE=$PO_BASE/$LANG/LC_MESSAGES/$FILE.po
|
| 110 |
+
MO_FILE=$PO_BASE/$LANG/LC_MESSAGES/$FILE.mo
|
| 111 |
+
echo $MO_FILE
|
| 112 |
+
msgfmt $PO_FILE -o $MO_FILE
|
| 113 |
+
done
|
| 114 |
+
OUT_DIR=$LATEX_BASE/$LANG
|
| 115 |
+
echo $OUT_DIR
|
| 116 |
+
# sphinx does not detect changes in .mo files
|
| 117 |
+
# see https://bitbucket.org/birkenfeld/sphinx/issue/830
|
| 118 |
+
rm -rf $OUT_DIR
|
| 119 |
+
${buildout:directory}/bin/sphinx-build -b latex -Dlanguage=$LANG $SRC_DIR $OUT_DIR
|
| 120 |
+
make -C $OUT_DIR
|
| 121 |
+
done
|
| 122 |
+
|
| 123 |
+
|
| 124 |
+
cp $LATEX_BASE/en/pyhwp.pdf $DIST_DIR/pyhwp.en.pdf
|
| 125 |
+
cp $LATEX_BASE/ko/pyhwp.pdf $DIST_DIR/pyhwp.ko.pdf
|
buildouts/user.cfg
ADDED
|
@@ -0,0 +1,7 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
[buildout]
|
| 2 |
+
develop+= .
|
| 3 |
+
parts+= pyhwp
|
| 4 |
+
|
| 5 |
+
[pyhwp]
|
| 6 |
+
recipe = zc.recipe.egg
|
| 7 |
+
eggs = pyhwp
|