summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGravatar Nathan Collins <nathan.collins@gmail.com>2012-06-12 02:36:05 -0700
committerGravatar Nathan Collins <nathan.collins@gmail.com>2012-06-12 02:36:05 -0700
commit79a71d9ba68818a62cbf96f3cf46d01ac662f836 (patch)
tree41b1f51333a8232aeb0f0ef231d8b422106c8da2
parent72b0054931cd0d41477fa7270154cb53d8e94e4d (diff)
Simplify git-annex.cabal and generate sdist with make-sdist.sh.
The `cabal install` is happy as long as the files it needs are present, but `cabal sdist` will only package up files you tell it to. So, generate the source tarball ourselves. The source tarball is generated by make-sdist.sh, which uses cabal sdist to calculate the package name. Could also generate the name from the 'Version:' field in git-annex.cabal.
-rw-r--r--Makefile16
-rw-r--r--[-rwxr-xr-x]git-annex.cabal24
-rwxr-xr-xmake-sdist.sh15
3 files changed, 24 insertions, 31 deletions
diff --git a/Makefile b/Makefile
index ca9ea2036..d23f08a7d 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
index 5ff8155e9..ac039bc63 100755..100644
--- 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 <<EOF
Name: git-annex
-Version: 3.20120605
+Version: 3.20120606
Cabal-Version: >= 1.8
License: GPL
Maintainer: Joey Hess <joey@kitenet.net>
@@ -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 000000000..debc5195e
--- /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