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"
57 if [ "$FORMAT" = "zip" ]
59 git config core.autocrlf true
61 git config core.autocrlf false
71 cp -R "$NAME/library" "$SNAME"
76 SNAME
="$NAME-standalone"
79 php
"$NAME/maintenance/merge-library.php"
80 mv "$NAME/library/HTMLPurifier.standalone.php" "$SNAME"
81 mv "$NAME/library/standalone" "$SNAME"
82 rm -Rf "$NAME/tests/blanks/*"