Diff: [root] @ 7b476afb62d | faq | css

howto/setup-hackage-mirror

File: howto/index [Diff]

-- a/howto/index++ b/howto/index
@@ -4,4 +4,5 @@
read-song-lyrics - How to read song lyrics online the most comfortable way
vangers-linux - How to play beta version of Vangers on linux
celebrate - How to celebrate properly (Russian)
setup-hackage-mirror - How to set up Hackage mirror

File created: howto/setup-hackage-mirror [Diff]

-- /dev/null++ b/howto/setup-hackage-mirror
@@ -1 +1,20 @@
h1. How to set up a "hackage":http://hackage.haskell.org/packages/hackage.html mirror

1. @cd@ to a clean directory where you want your hackage mirror to be

2. Download a tarball with latest hackage contents from [http://hackage.haskell.org/cgi-bin/hackage-scripts/archive.tar]

bc. wget http://hackage.haskell.org/cgi-bin/hackage-scripts/archive.tar -O /tmp

3. This archive contains packages in tar.gz's placed in folders (@HAppS-Server/0.9.3.1/HAppS-Server-0.9.3.1.tar.gz@), which should be placed in @package@ subdirectory on server. However, if your mirror hostname is not @hackage.haskell.org@ (*UGLY UGLY HACK GODDAMN WHOEVER DONE IT*), cabal will request not @package/HAppS-Server/0.9.3.1/HAppS-Server-0.9.3.1.tar.gz@, but just @package/HAppS-Server-0.9.3.1.tar.gz@. So, we need to transform file paths:

bc. tar xf /tmp/archive.tar --transform 's|^.*/|package/|'

4. Download package index:

bc. wget http://hackage.haskell.org/packages/archive/00-index.tar.gz

That is all! You can serve this directory as hackage mirror

Here's a shell script that does it for you: [http://gist.github.com/562813]

By Voker57 on 2010-09-02 19:35:33 +0000