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.
13 NAME
="htmlpurifier-$VERSION"
16 cp "$NAME/LICENSE" "$SNAME"
17 cp "$NAME/NEWS" "$SNAME"
18 cp "$NAME/INSTALL" "$SNAME"
19 cp "$NAME/CREDITS" "$SNAME"
23 if [ "$FORMAT" = "zip" ]
27 tar -cvf - "$1" |
gzip -c > "$1.tar.gz"
33 echo "Format of tar or zip must be specified in first param"
37 if [ "$VERSION" = "" ]
39 echo "Version must be specified in second param"
45 REPO
="git://repo.or.cz/htmlpurifier.git"
48 if [ "$VERSION" = "trunk" ]
55 git clone
-n "$REPO" "$NAME"
58 CRLF
=`git config core.autocrlf`
59 if [ "$FORMAT" = "zip" ]
61 git config core.autocrlf true
63 git config core.autocrlf false
73 cp -R "$NAME/library" "$SNAME"
78 SNAME
="$NAME-standalone"
81 php
"$NAME/maintenance/merge-library.php"
82 mv "$NAME/library/HTMLPurifier.standalone.php" "$SNAME"
83 mv "$NAME/library/standalone" "$SNAME"
84 rm -Rf "$NAME/tests/blanks/*"
90 git config core.autocrlf
"$CRLF"