12 |
13 |
13 -h This help |
14 -h This help |
14 -v version Specify version of package (default: hg-$DATE) |
15 -v version Specify version of package (default: hg-$DATE) |
15 -r revision Mercurial revision to pull (default: tip) |
16 -r revision Mercurial revision to pull (default: tip) |
16 -R repopath Path to Mercurial repository (default: ./enano-hg) |
17 -R repopath Path to Mercurial repository (default: ./enano-hg) |
|
18 -m If set, installer doesn't pack a copy of Enano. Instead, |
|
19 it downloads and runs mkenanodev.sh. |
17 |
20 |
18 EOF |
21 EOF |
19 exit 1 |
22 exit 1 |
20 } |
23 } |
21 |
24 |
48 |
54 |
49 if [ -z "$VERSION" -o -z "$REVISION" -o -z "$REPO" ]; then |
55 if [ -z "$VERSION" -o -z "$REVISION" -o -z "$REPO" ]; then |
50 usage |
56 usage |
51 fi |
57 fi |
52 |
58 |
53 if [ ! -d "$REPO/.hg" ]; then |
59 if [ ! -d "$REPO/.hg" -a -z "$MINIMAL" ]; then |
54 echo "ERROR: Could not find the Enano Mercurial repository at $REPO." |
60 echo "ERROR: Could not find the Enano Mercurial repository at $REPO." |
55 echo "Perhaps you need to obtain a copy?" |
61 echo "Perhaps you need to obtain a copy?" |
56 echo " $ hg clone http://hg.enanocms.org/repos/enano-1.1 ./enano-hg" |
62 echo " $ hg clone http://hg.enanocms.org/repos/enano-1.1 ./enano-hg" |
57 echo "If you have a copy somewhere else, make a symlink:" |
63 echo "If you have a copy somewhere else, make a symlink:" |
58 echo " $ ln -s /path/to/enano/hg ./enano-hg" |
64 echo " $ ln -s /path/to/enano/hg ./enano-hg" |
60 fi |
66 fi |
61 |
67 |
62 printf "Compacting self-extraction script..." |
68 printf "Compacting self-extraction script..." |
63 sed -f compact-shellscript.sed self-extract-src.sh > self-extract.sh || fail "Failed to generate compacted self-extract script" |
69 sed -f compact-shellscript.sed self-extract-src.sh > self-extract.sh || fail "Failed to generate compacted self-extract script" |
64 |
70 |
65 printf "\nPulling latest code..." |
71 if [ -z "$MINIMAL" ]; then |
66 hg -R $REPO archive -r $REVISION -t tgz enano-$VERSION.tar.gz || fail "Could not pull revision $REVISION from Mercurial repo" |
72 printf "\nPulling latest code..." |
67 printf "\nExtracting..." |
73 hg -R $REPO archive -r $REVISION -t tgz enano-$VERSION.tar.gz || fail "Could not pull revision $REVISION from Mercurial repo" |
68 tar xzCf `dirname $0`/stage enano-$VERSION.tar.gz || fail "Could not extract tarball" |
74 printf "\nExtracting..." |
69 rm -f enano-$VERSION.tar.gz |
75 tar xzCf `dirname $0`/stage enano-$VERSION.tar.gz || fail "Could not extract tarball" |
|
76 rm -f enano-$VERSION.tar.gz |
|
77 fi |
70 printf "\nCreating payload..." |
78 printf "\nCreating payload..." |
71 cd stage |
79 cd stage |
72 tar cjf ../enano-$VERSION-selfextract.tar.bz2 * || fail "Could not create staging tarball" |
80 tar cjf ../enano-$VERSION-selfextract.tar.bz2 * || fail "Could not create staging tarball" |
73 rm -rf enano-$VERSION |
81 if [ -z "$MINIMAL" ]; then |
|
82 rm -rf enano-$VERSION |
|
83 fi |
74 cd .. |
84 cd .. |
75 printf "\nWriting output..." |
85 printf "\nWriting output..." |
76 cat self-extract.sh enano-$VERSION-selfextract.tar.bz2 > enano-$VERSION-bitnami-module.sh || fail "Could not write output" |
86 cat self-extract.sh enano-$VERSION-selfextract.tar.bz2 > enano-$VERSION-bitnami-module.sh || fail "Could not write output" |
77 chmod +x enano-$VERSION-bitnami-module.sh |
87 chmod +x enano-$VERSION-bitnami-module.sh |
78 rm -f enano-$VERSION-selfextract.tar.bz2 |
88 rm -f enano-$VERSION-selfextract.tar.bz2 |