aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorGravatar ridiculousfish <corydoras@ridiculousfish.com>2012-07-09 19:41:51 -0700
committerGravatar ridiculousfish <corydoras@ridiculousfish.com>2012-07-09 19:41:51 -0700
commit69ace201f8532d1062f90edf97c6e8fb4620095e (patch)
treeeb832482182b1a0b227c2ab739fa81b6f31eccf9
parenta04f31c5c04cc6768b31bc2867dcb753ba393bc8 (diff)
Release tarballs with the user docs already build, removing the doxygen dependency
-rw-r--r--Makefile.in8
-rwxr-xr-xbuild_tools/make_tarball.sh53
2 files changed, 51 insertions, 10 deletions
diff --git a/Makefile.in b/Makefile.in
index d76ad119..1c323cf2 100644
--- a/Makefile.in
+++ b/Makefile.in
@@ -862,6 +862,10 @@ distclean: clean
# are created by the configure script.
#
+# Don't delete the docs unless we have Doxygen installed
+# We provide pre-built docs in the tarball, and if they get
+# deleted we won't be able to regenerate them
+
clean:
rm -f *.o doc.h doc.tmp doc_src/*.doxygen doc_src/*.cpp doc_src/*.o doc_src/commands.hdr
rm -f $(GENERATED_INTERN_SCRIPT_FILES)
@@ -872,7 +876,9 @@ clean:
rm -f fish-@PACKAGE_VERSION@.tar
rm -f fish-@PACKAGE_VERSION@.tar.gz
rm -f fish-@PACKAGE_VERSION@.tar.bz2
- rm -rf doc user_doc share/man;
+ if command -v doxygen; then \
+ rm -rf doc user_doc share/man; \
+ fi
rm -rf fish-@PACKAGE_VERSION@
rm -f $(TRANSLATIONS)
test ! -d "$(XSEL)" || make -C $(XSEL) clean
diff --git a/build_tools/make_tarball.sh b/build_tools/make_tarball.sh
index c7400292..ec5322af 100755
--- a/build_tools/make_tarball.sh
+++ b/build_tools/make_tarball.sh
@@ -1,11 +1,46 @@
#!/bin/sh
-path=~/fish_built/fishfish-2.0.tar.gz
-rm -f "$path"
-if git archive --format=tar --prefix=fishfish/ master | gzip - > "$path"
-then
- echo "Tarball written to $path"
- openssl sha1 "$path"
-else
- echo "Tarball could not be written"
-fi
+# Script to generate a tarball
+# We use git to output a tree. But we also want to build the user documentation
+# and put that in the tarball, so that nobody needs to have doxygen installed
+# to build it.
+
+# Exit on error
+set -e
+
+# We wil generate a tarball with a prefix "fish"
+# git can do that automatically for us via git-archive
+# but to get the documentation in, we need to make a symlink called "fish"
+# and tar from that, so that the documentation gets the right prefix
+
+# Get the current directory, which we'll use for symlinks
+wd="$PWD"
+
+# The name of the prefix, which is the directory that you get when you untar
+prefix="fish"
+
+# The path where we will output the tar file
+path=~/fish_built/fish-2.0.tar
+
+# Clean up stuff we've written before
+rm -f "$path" "$path".gz
+
+# git starts the archive
+git archive --format=tar --prefix="$prefix"/ master > "$path"
+
+# tarball out the documentation
+make user_doc
+make share/man
+cd /tmp
+rm -f "$prefix"
+ln -s "$wd" "$prefix"
+tar --append --file="$path" "$prefix"/user_doc/html
+tar --append --file="$path" "$prefix"/share/man
+rm -f "$prefix"
+
+# gzip it
+gzip "$path"
+
+# Output what we did, and the sha1 hash
+echo "Tarball written to $path".gz
+openssl sha1 "$path".gz