summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--Setup.hs6
-rw-r--r--pancake.cabal1
2 files changed, 5 insertions, 2 deletions
diff --git a/Setup.hs b/Setup.hs
index 1af2e43..e07df74 100644
--- a/Setup.hs
+++ b/Setup.hs
@@ -4,6 +4,7 @@ import Distribution.Simple.Utils
import Distribution.PackageDescription
import Distribution.Simple.Setup
import System.FilePath
+import System.Directory
main = defaultMainWithHooks simpleUserHooks { postCopy = installManPage }
@@ -12,9 +13,10 @@ installManPage :: Args
-> PackageDescription
-> LocalBuildInfo
-> IO ()
-installManPage _ cf pd lbi =
+installManPage _ cf pd lbi = do
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
+ createDirectoryIfMissing True man1
+ installOrdinaryFile (fromFlag $ copyVerbosity cf) fname target
diff --git a/pancake.cabal b/pancake.cabal
index 9aa343c..bf9831a 100644
--- a/pancake.cabal
+++ b/pancake.cabal
@@ -27,6 +27,7 @@ custom-setup
setup-depends: Cabal >= 1.24
, base >= 4.9 && < 5
, filepath >= 1.4.1.0 && < 2
+ , directory >= 1.2.6.2 && < 2
executable pancake
main-is: Pancake.hs