From e2936f8773bf7d84d493020bfe2fab1d8d7f3819 Mon Sep 17 00:00:00 2001 From: defanor Date: Mon, 20 Nov 2017 01:55:15 +0300 Subject: Create man directory if it doesn't exist It may be missing when destdir is altered to prepare a binary release. --- Setup.hs | 6 ++++-- pancake.cabal | 1 + 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 -- cgit v1.2.3