summaryrefslogtreecommitdiff
path: root/configure.hs
diff options
context:
space:
mode:
authorGravatar Joey Hess <joey@kitenet.net>2011-06-30 14:55:03 -0400
committerGravatar Joey Hess <joey@kitenet.net>2011-06-30 14:55:03 -0400
commit56aeeb4565dd419c315d370f6e648abfe009a7d3 (patch)
tree224bbf233bc99bd1ac8584dd0ec1b3838de8e920 /configure.hs
parentb3aaf980e460c2287fc1ef2b262685b1879e6ed0 (diff)
cabal can now be used to build git-annex.
This is substantially slower than using make, does not build or install documentation, does not run the test suite, and is not particularly recommended, but could be useful to some.
Diffstat (limited to 'configure.hs')
-rw-r--r--configure.hs14
1 files changed, 13 insertions, 1 deletions
diff --git a/configure.hs b/configure.hs
index c81aa17e6..2e39feb16 100644
--- a/configure.hs
+++ b/configure.hs
@@ -56,12 +56,24 @@ unicodeFilePath = do
{- Pulls package version out of the changelog. -}
getVersion :: Test
getVersion = do
- changelog <- readFile "debian/changelog"
+ changelog <- readFile "CHANGELOG"
let verline = head $ lines changelog
let version = middle (words verline !! 1)
+
+ -- Replace Version field in cabal file, so I don't have to maintain
+ -- the version there too.
+ cabal <- readFile cabalfile
+ writeFile tmpcabalfile $ unlines $ map (setversion version) $ lines cabal
+ renameFile tmpcabalfile cabalfile
+
return $ Config "packageversion" (StringConfig version)
where
middle s = drop 1 $ take (length s - 1) s
+ cabalfile = "git-annex.cabal"
+ tmpcabalfile = cabalfile++".tmp"
+ setversion version s
+ | "Version:" `isPrefixOf` s = "Version: " ++ version
+ | otherwise = s
setup :: IO ()
setup = do