Begin migration to new News DOMFilter. Migrate oldest news entry.
[htmlpurifier-web.git] / releases / build.sh
blob1b6da2ffad865e8be37f888840085701cd7725d1
1 #!/bin/bash
3 VERSION="$1"
4 NAME="htmlpurifier-$VERSION"
6 shopt -s expand_aliases
8 copy_meta_files() {
9 cp "$NAME/LICENSE" "$SNAME"
10 cp "$NAME/NEWS" "$SNAME"
11 cp "$NAME/INSTALL" "$SNAME"
12 cp "$NAME/CREDITS" "$SNAME"
15 if [ "$VERSION" = "" ]
16 then
17 echo "Version must be specified in first param"
18 exit
21 # Dreamhost specific compatibility code
22 alias php="/usr/local/dh/cgi-system/php5.cgi"
23 cd "/home/ezyang/htmlpurifier.org/releases"
25 if [ "$VERSION" = "trunk" ]
26 then
27 LOC="trunk"
28 else
29 LOC="tags/$VERSION"
32 svn export --force \
33 "http://htmlpurifier.org/svnroot/htmlpurifier/$LOC" \
34 "$NAME"
36 #cp -R "$NAME" "$NAME.bak"
38 tar -cvf - "$NAME" | gzip -c > "$NAME.tar.gz"
40 SNAME="$NAME-lite"
41 mkdir "$SNAME"
42 cp -R "$NAME/library" "$SNAME"
43 copy_meta_files
44 tar -cvf - "$SNAME" | gzip -c > "$NAME-lite.tar.gz"
45 rm -R "$SNAME"
47 SNAME="$NAME-standalone"
48 mkdir "$SNAME"
49 export PHP_IS_CLI=1
50 php "$NAME/maintenance/merge-library.php"
51 mv "$NAME/library/HTMLPurifier.standalone.php" "$SNAME"
52 mv "$NAME/library/standalone" "$SNAME"
53 rm -Rf "$NAME/tests/blanks/*"
54 tar -cvf - "$SNAME" | gzip -c > "$NAME-standalone.tar.gz"
55 rm -R "$SNAME"
57 rm -R "$NAME"