aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorYurii Rashkovskii <[email protected]>2011-08-30 02:50:57 -0700
committerYurii Rashkovskii <[email protected]>2011-08-30 02:50:57 -0700
commit5a69a5a707e119d20473a3642be997862618691a (patch)
treea9526595f9717c3bf358885f71a9a7a86d567c97
parent3d835cf703ee4feef47c5b3175662e81ba703c9d (diff)
parent56b67f5a1a9812c0a0007f9eb5acd692ac3c1a40 (diff)
downloadkerl-5a69a5a707e119d20473a3642be997862618691a.tar.gz
kerl-5a69a5a707e119d20473a3642be997862618691a.tar.bz2
kerl-5a69a5a707e119d20473a3642be997862618691a.zip
Merge pull request #8 from nox/install-manpages
Add automatic manpages installation
-rw-r--r--README.md5
-rwxr-xr-xkerl43
2 files changed, 33 insertions, 15 deletions
diff --git a/README.md b/README.md
index eb69397..d8688f5 100644
--- a/README.md
+++ b/README.md
@@ -180,6 +180,7 @@ You can set the following variables:
- KERL_AGNER_AUTOINSTALL a list of packages to pre-install
- KERL_SASL_STARTUP use SASL system startup instead of minimal
- KERL_USE_AUTOCONF use autoconf in the builds process
+- KERL_INSTALL_MANPAGES if non-empty will install manpages
Glossary
========
@@ -256,6 +257,10 @@ You can auto-install agner packages listing them in the KERL_AGNER_AUTOINSTALL v
You can have SASL started automatically setting KERL_SASL_STARTUP=yes in your $HOME/.kerlrc file or prepending it to the command line
+#### Manpages installation
+
+You can have manpages installed automatically setting KERL_INSTALL_MANPAGES=yes in your $HOME/.kerlrc file or prepending it to the command line
+
update
------
diff --git a/kerl b/kerl
index fbc19db..56138da 100755
--- a/kerl
+++ b/kerl
@@ -39,6 +39,7 @@ fi
KERL_CONFIGURE_OPTIONS=
KERL_DISABLE_AGNER=
KERL_SASL_STARTUP=
+KERL_INSTALL_MANPAGES=
# ensure the base dir exsists
mkdir -p "$KERL_BASE_DIR"
@@ -285,21 +286,7 @@ do_build()
assert_build_name_unused $2
FILENAME=otp_src_$1.tar.gz
- if [ ! -f "$KERL_DOWNLOAD_DIR/$FILENAME" ]; then
- echo "Downloading $FILENAME to $KERL_DOWNLOAD_DIR"
- mkdir -p "$KERL_DOWNLOAD_DIR"
- curl $ERLANG_DOWNLOAD_URL/$FILENAME > "$KERL_DOWNLOAD_DIR/$FILENAME"
- update_checksum_file
- fi
- ensure_checksum_file
- echo "Verifying archive checksum..."
- SUM=`$MD5SUM "$KERL_DOWNLOAD_DIR/$FILENAME" | cut -d " " -f $MD5SUM_FIELD`
- ORIG_SUM=`grep $FILENAME "$KERL_DOWNLOAD_DIR/MD5" | cut -d " " -f 2`
- if [ "$SUM" != "$ORIG_SUM" ]; then
- echo "Checksum error, check the files in $KERL_DOWNLOAD_DIR"
- exit 1
- fi
- echo "Checksum verified ($SUM)"
+ download "$FILENAME"
mkdir -p "$KERL_BUILD_DIR/$2"
if [ ! -d "$KERL_BUILD_DIR/$2/otp_src_$1" ]; then
echo "Extracting source code"
@@ -428,6 +415,13 @@ ACTIVATE
done
fi
fi
+ if [ "$rel" != "git" -a -n "$KERL_INSTALL_MANPAGES" ]; then
+ echo "Fetching and installing manpages..."
+ FILENAME=otp_doc_man_$rel.tar.gz
+ download "$FILENAME"
+ echo "Extracting manpages"
+ cd "$absdir" && tar xfz "$KERL_DOWNLOAD_DIR/$FILENAME"
+ fi
echo "You can activate this installation running the following command:"
echo ". $absdir/activate"
echo "Later on, you can leave the installation typing:"
@@ -505,6 +499,25 @@ do_active()
fi
}
+download()
+{
+ if [ ! -f "$KERL_DOWNLOAD_DIR/$1" ]; then
+ echo "Downloading $1 to $KERL_DOWNLOAD_DIR"
+ mkdir -p "$KERL_DOWNLOAD_DIR"
+ curl "$ERLANG_DOWNLOAD_URL/$1" > "$KERL_DOWNLOAD_DIR/$1"
+ update_checksum_file
+ fi
+ ensure_checksum_file
+ echo "Verifying archive checksum..."
+ SUM=`$MD5SUM "$KERL_DOWNLOAD_DIR/$1" | cut -d " " -f $MD5SUM_FIELD`
+ ORIG_SUM=`grep -F "$1" "$KERL_DOWNLOAD_DIR/MD5" | cut -d " " -f 2`
+ if [ "$SUM" != "$ORIG_SUM" ]; then
+ echo "Checksum error, check the files in $KERL_DOWNLOAD_DIR"
+ exit 1
+ fi
+ echo "Checksum verified ($SUM)"
+}
+
case "$1" in
build)
if [ "$2" = "git" ]; then