uacpid 0.0.2 → 0.0.3
raw patch · 3 files changed
+34/−26 lines, 3 filessetup-changed
Files
- Setup.hs +32/−24
- src/main.hs +1/−1
- uacpid.cabal +1/−1
Setup.hs view
@@ -4,6 +4,7 @@ -- License: BSD3 (see LICENSE) -- Author: Dino Morelli <dino@ui3.info> +import Control.Monad import Distribution.Simple import Distribution.Simple.LocalBuildInfo import System.Cmd@@ -12,33 +13,40 @@ import System.FilePath -main = defaultMainWithHooks (simpleUserHooks - { postInst = customPostInstall- } )- where- customPostInstall _ _ _ localBuildInfo = do- -- Construct src and dest dirs for copying the man page- let manFile = "uacpid.1"- let srcPath = "resources" </> "man" </> manFile+copyManPage _ _ _ localBuildInfo = do+ -- Construct src and dest dirs for copying the man page+ let manFile = "uacpid.1"+ let srcPath = "resources" </> "man" </> manFile - {- There's a "right way" to get the absolute mandir FilePath - from the Cabal API, but I can't figure it out yet.- Have to revisit someday.- -}- let prefixDir = fromPathTemplate $ prefix- $ installDirTemplates localBuildInfo- let destDir =- prefixDir </> "share" </> "man" </> "man1"+ {- There's a "right way" to get the absolute mandir FilePath + from the Cabal API, but I can't figure it out yet.+ Have to revisit someday.+ -}+ let prefixDir = fromPathTemplate $ prefix+ $ installDirTemplates localBuildInfo+ let destDir =+ prefixDir </> "share" </> "man" </> "man1" - createDirectoryIfMissing True destDir+ createDirectoryIfMissing True destDir - let destPath = destDir </> manFile+ putStrLn $ "Installing man page in " ++ destDir - -- Copy it to the appropriate man directory, based on the- -- prefix- copyFile srcPath destPath+ let destPath = destDir </> manFile - -- gzip the man page- gzipExitCode <- system $ "gzip -f " ++ destPath+ -- Copy it to the appropriate man directory, based on the+ -- prefix+ copyFile srcPath destPath - exitWith gzipExitCode+ -- gzip the man page+ gzipExitCode <- system $ "gzip -f " ++ destPath++ unless (gzipExitCode == ExitSuccess) $+ putStrLn "Copy of man page failed!"++ return ()+++main = defaultMainWithHooks (simpleUserHooks + { postCopy = copyManPage+ , postInst = copyManPage+ } )
src/main.hs view
@@ -167,7 +167,7 @@ , "" , "Please see man uacpid for detailed info" , ""- , "Version 0.0.2 2009-Jul-15 Dino Morelli <dino@ui3.info>"+ , "Version 0.0.3 2009-Jul-15 Dino Morelli <dino@ui3.info>" ] exitWith ExitSuccess
uacpid.cabal view
@@ -1,5 +1,5 @@ name: uacpid-version: 0.0.2+version: 0.0.3 cabal-version: >= 1.2 build-type: Simple license: BSD3