3 # Build script for HTML Purifier distributions. Syntax:
5 # ./build.sh (tar|zip) 1.2.3 git://repo.or.cz/htmlpurifier.git
7 # Tar will actually produce tar.gz, and the repository third parameter can
8 # be replaced with any valid repository path that contains the necessary tags.
15 NAME
="htmlpurifier-$VERSION"
18 cp "$NAME/LICENSE" "$SNAME"
19 cp "$NAME/NEWS" "$SNAME"
20 cp "$NAME/INSTALL" "$SNAME"
21 cp "$NAME/CREDITS" "$SNAME"
25 if [ "$FORMAT" = "zip" ]
27 zip -q -r "$1.zip" "$1"
29 tar -cf - "$1" |
gzip -c > "$1.tar.gz"
35 echo "Format of tar or zip must be specified in first param"
39 if [ "$VERSION" = "" ]
41 echo "Version must be specified in second param"
47 REPO
="git://repo.or.cz/htmlpurifier.git"
50 if [ "$VERSION" = "trunk" ]
57 git clone
-n "$REPO" "$NAME"
60 CRLF
=`git config core.autocrlf`
61 if [ "$FORMAT" = "zip" ]
63 git config core.autocrlf true
65 git config core.autocrlf false
75 cp -R "$NAME/library" "$SNAME"
80 SNAME
="$NAME-standalone"
83 php
"$NAME/maintenance/generate-standalone.php"
84 mv "$NAME/library/HTMLPurifier.standalone.php" "$SNAME"
85 mv "$NAME/library/standalone" "$SNAME"
86 rm -Rf "$NAME/tests/blanks/*"
92 git config core.autocrlf
"$CRLF"