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.
10 shopt -s expand_aliases
11 alias php
='/usr/local/dh/cgi-system/php5.cgi'
16 NAME
="htmlpurifier-$VERSION"
19 cp "$NAME/LICENSE" "$SNAME"
20 cp "$NAME/NEWS" "$SNAME"
21 cp "$NAME/INSTALL" "$SNAME"
22 cp "$NAME/CREDITS" "$SNAME"
26 if [ "$FORMAT" = "zip" ]
30 tar -cvf - "$1" |
gzip -c > "$1.tar.gz"
36 echo "Format of tar or zip must be specified in first param"
40 if [ "$VERSION" = "" ]
42 echo "Version must be specified in second param"
48 REPO
="git://repo.or.cz/htmlpurifier.git"
51 if [ "$VERSION" = "trunk" ]
58 git clone
-n "$REPO" "$NAME"
61 CRLF
=`git config core.autocrlf`
62 if [ "$FORMAT" = "zip" ]
64 git config core.autocrlf true
66 git config core.autocrlf false
76 cp -R "$NAME/library" "$SNAME"
81 SNAME
="$NAME-standalone"
84 php
"$NAME/maintenance/merge-library.php"
85 mv "$NAME/library/HTMLPurifier.standalone.php" "$SNAME"
86 mv "$NAME/library/standalone" "$SNAME"
87 rm -Rf "$NAME/tests/blanks/*"
93 git config core.autocrlf
"$CRLF"