diff options
author | defanor <defanor@uberspace.net> | 2017-11-13 18:48:39 +0300 |
---|---|---|
committer | defanor <defanor@uberspace.net> | 2017-11-13 18:48:39 +0300 |
commit | d9d4044525c7b76adc32218ee999fdfaa3b510da (patch) | |
tree | 76bbec9b50efc51b22b08b37a2286f7f4fb3794c /Setup.hs | |
parent | 36f86bfe407e261c102eabfc65397fdf23661ee8 (diff) |
Add a man page
A basic and static one for now, perhaps should be generated out of a
single source with README and the help message later.
Diffstat (limited to 'Setup.hs')
-rw-r--r-- | Setup.hs | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/Setup.hs b/Setup.hs new file mode 100644 index 0000000..1af2e43 --- /dev/null +++ b/Setup.hs @@ -0,0 +1,20 @@ +import Distribution.Simple +import Distribution.Simple.LocalBuildInfo +import Distribution.Simple.Utils +import Distribution.PackageDescription +import Distribution.Simple.Setup +import System.FilePath + +main = defaultMainWithHooks simpleUserHooks { postCopy = installManPage } + +installManPage :: Args + -> CopyFlags + -> PackageDescription + -> LocalBuildInfo + -> IO () +installManPage _ cf pd lbi = + let dirs = absoluteInstallDirs pd lbi (fromFlag $ copyDest cf) + man1 = mandir dirs </> "man1" + fname = "pancake.1" + target = man1 </> fname + in installOrdinaryFile (fromFlag $ copyVerbosity cf) fname target |