[Pkg-ocaml-maint-commits] [SCM] ocaml-doc packaging branch, master, updated. debian/3.11-1-8-g7e26310

Mehdi Dogguy mehdi at debian.org
Wed Jan 4 15:44:31 UTC 2012


The following commit has been merged in the master branch:
commit ab09b6baae98b86626adc39b5d0681c7c01994fc
Author: Mehdi Dogguy <mehdi at debian.org>
Date:   Wed Jan 4 15:03:29 2012 +0100

    Add a script to generate a new tarball

diff --git a/debian/generate_tarball b/debian/generate_tarball
new file mode 100755
index 0000000..76aef97
--- /dev/null
+++ b/debian/generate_tarball
@@ -0,0 +1,59 @@
+#!/bin/bash
+#
+# This script prepares a tarbaill for ocaml-doc package by downloading
+# OCaml's upstream documentation from caml.inria.fr
+#
+# It needs tar and curl.
+
+set -e
+
+ver="$1"
+dir=`mktemp -d "ocaml-doc-3.12-XXXXXXXXX"`
+finaldir="ocaml-doc-$ver"
+tmp=`mktemp -d "ocaml-doc-3.12-tmp-XXXXXXXXX"`
+url="http://caml.inria.fr/pub/distrib/ocaml-${ver}"
+dl="curl -#"
+
+function tarxf() {
+  top=`tar tzf $1/$3 | sed -e 's@/.*@@' | uniq`
+  tar xf $1/$3 -C $2
+  mv $2/$top $4
+}
+
+function msg() {
+  echo "I: $1"
+}
+
+function usage() {
+  echo "Usage: $0 MAJOR_VERSION.MINOR_VERSION"
+  exit 1
+}
+
+test -z $ver && usage
+
+# Downloading documentation
+msg "Downloading documentation in $dir ($tmp)"
+$dl "$url/ocaml-${ver}-refman.info.tar.gz" -o $dir/info.tar.gz
+$dl "$url/ocaml-${ver}-refman.html.tar.gz" -o $dir/html.tar.gz
+$dl "$url/ocaml-${ver}-refman.pdf" -P $dir -o $dir/refman.pdf
+$dl "$url/ocaml-${ver}-refman.txt" -P $dir -o $dir/refman.txt
+$dl "http://nicolaspouillard.fr/ocamlbuild/ocamlbuild-user-guide.pdf" -o $dir/ocamlbuild-user-guide.pdf
+
+# Extracting tarballs
+msg "Extracting downloaded traballs"
+mkdir -p $finaldir
+tarxf $dir $tmp info.tar.gz $finaldir/ocaml.info
+tarxf $dir $tmp html.tar.gz $finaldir/ocaml.html
+cp $dir/refman.pdf $finaldir/ocaml-${ver}-refman.pdf
+gzip --to-stdout $dir/refman.txt > $finaldir/ocaml-${ver}-refman.txt.gz
+cp $dir/ocamlbuild-user-guide.pdf $finaldir/
+
+# Building final tarball
+msg "Building final tarball in ../ocaml-doc-${ver}.tar.gz"
+tar czvf ../ocaml-doc-${ver}.tar.gz $finaldir
+
+# Cleaning
+msg "Cleaning..."
+rm -rf $dir
+rm -rf $tmp
+rm -rf $finaldir

-- 
ocaml-doc packaging



More information about the Pkg-ocaml-maint-commits mailing list