diff --git a/Makefile b/Makefile index ca9ea2036b..d23f08a7d1 100644 --- a/Makefile +++ b/Makefile @@ -98,20 +98,12 @@ docs: $(mans) clean: rm -rf tmp $(bins) $(mans) test configure *.tix .hpc $(sources) \ - doc/.ikiwiki html dist $(clibs) git-annex.cabal + doc/.ikiwiki html dist $(clibs) -# Workaround for cabal sdist not running Setup hooks, so I cannot -# generate a file list there. +# Workaround for `cabal sdist` requiring all included files to be listed +# in .cabal. sdist: clean $(mans) - # Could make this a .PHONY, but it needs to be rerun each time, - # unless we want to list a *lot* of dependencies. - ./git-annex.cabal.template.sh > git-annex.cabal - # Complains about not running 'configure' first, but adding - # - # cabal configure - # - # does not help. - cabal sdist + ./make-sdist.sh # Upload to hackage. hackage: sdist diff --git a/git-annex.cabal b/git-annex.cabal old mode 100755 new mode 100644 index 5ff8155e90..ac039bc636 --- a/git-annex.cabal +++ b/git-annex.cabal @@ -1,11 +1,5 @@ -#!/bin/bash - -# Template for git-annex.cabal: the 'Other-Module:' fields are -# dynamically generated. - -cat <= 1.8 License: GPL Maintainer: Joey Hess @@ -30,9 +24,6 @@ Description: versioned files, which is convenient for maintaining documents, Makefiles, etc that are associated with annexed files but that benefit from full revision control. -Extra-Source-Files: - git-annex.1 git-annex-shell.1 - INSTALL README CHANGELOG NEWS GPL COPYRIGHT Flag S3 Description: Enable S3 support @@ -44,10 +35,8 @@ Executable git-annex pcre-light, extensible-exceptions, dataenc, SHA, process, json, HTTP, base == 4.5.*, monad-control, transformers-base, lifted-base, IfElse, text, QuickCheck >= 2.1, bloomfilter, edit-distance - Other-Modules: - Utility.Touch - -- Auto-generated list of all Haskell modules: -`./gen-other-modules.sh | xargs -n1 -i echo ' '{}` + -- Need to list this because it's generated from a .hsc file. + Other-Modules: Utility.Touch C-Sources: Utility/libdiskfree.c Extensions: CPP @@ -55,6 +44,7 @@ Executable git-annex Build-Depends: hS3 CPP-Options: -DWITH_S3 +-- XXX: Broken. Test-Suite test Type: exitcode-stdio-1.0 Main-Is: test.hs @@ -63,14 +53,10 @@ Test-Suite test pcre-light, extensible-exceptions, dataenc, SHA, process, json, HTTP, base == 4.5.*, monad-control, transformers-base, lifted-base, IfElse, text, QuickCheck >= 2.1, bloomfilter, edit-distance + Other-Modules: Utility.Touch C-Sources: Utility/libdiskfree.c - Other-Modules: - Utility.Touch - -- Auto-generated list of all Haskell modules: -`./gen-other-modules.sh | xargs -n1 -i echo ' '{}` Extensions: CPP source-repository head type: git location: git://git-annex.branchable.com/ -EOF diff --git a/make-sdist.sh b/make-sdist.sh new file mode 100755 index 0000000000..debc5195e4 --- /dev/null +++ b/make-sdist.sh @@ -0,0 +1,15 @@ +#!/bin/bash + +# Create target directory +cabal sdist +sdist_dir=$(basename dist/*.tar.gz .tar.gz) +rm -f dist/*.tar.gz +mkdir dist/$sdist_dir + +find . \( -name .git -or -name dist -or -name cabal-dev \) -prune \ + -or -not -name \\*.orig -not -type d -print \ +| perl -ne 'print unless length >= 100' \ +| xargs cp --parents --target-directory dist/$sdist_dir + +cd dist +tar -caf $sdist_dir.tar.gz $sdist_dir