cabal-debian 4.19.1 → 4.20.1
raw patch · 26 files changed
+1397/−223 lines, 26 filessetup-changedPVP ok
version bump matches the API change (PVP)
API changes (from Hackage documentation)
- Debian.Debianize: debianization :: (MonadIO m, Functor m) => DebT m () -> DebT m () -> DebT m ()
- Debian.Debianize: inputMaintainer :: MonadIO m => DebT m ()
- Debian.Debianize.Finalize: debianization :: (MonadIO m, Functor m) => DebT m () -> DebT m () -> DebT m ()
- Debian.Debianize.Finalize: finalizeDebianization' :: (MonadIO m, Functor m) => DebT m ()
- Debian.Debianize.Goodies: makeRulesHead :: (Monad m, Functor m) => DebT m Text
- Debian.Debianize.Input: inputMaintainer :: MonadIO m => DebT m ()
- Debian.Debianize.Types: maintainer :: Lens Atoms (Maybe NameAddr)
- Debian.Debianize.Types.Atoms: maintainerOld_ :: Atoms -> Maybe NameAddr
- Debian.Policy: getDebianMaintainer :: IO (Maybe NameAddr)
+ Debian.Debianize: debianize :: (MonadIO m, Functor m) => DebT m () -> DebT m ()
+ Debian.Debianize: finalizeDebianization :: (MonadIO m, Functor m) => DebT m ()
+ Debian.Debianize.Finalize: debianize :: (MonadIO m, Functor m) => DebT m () -> DebT m ()
+ Debian.Debianize.Finalize: finalizeDebianization :: (MonadIO m, Functor m) => DebT m ()
+ Debian.Debianize.Types: debianMaintainer :: Lens Atoms (Maybe NameAddr)
+ Debian.Debianize.Types: debianUploaders :: Lens Atoms [NameAddr]
+ Debian.Debianize.Types: maintainerOption :: Lens Atoms (Maybe NameAddr)
+ Debian.Debianize.Types: rulesIncludes :: Lens Atoms [Text]
+ Debian.Debianize.Types: rulesSettings :: Lens Atoms [Text]
+ Debian.Debianize.Types: uploadersOption :: Lens Atoms [NameAddr]
+ Debian.Debianize.Types.Atoms: instance Canonical Atoms
+ Debian.Debianize.Types.Atoms: maintainerOption :: Lens Atoms (Maybe NameAddr)
+ Debian.Debianize.Types.Atoms: maintainerOption_ :: Atoms -> Maybe NameAddr
+ Debian.Debianize.Types.Atoms: rulesIncludes :: Lens Atoms [Text]
+ Debian.Debianize.Types.Atoms: rulesIncludes_ :: Atoms -> [Text]
+ Debian.Debianize.Types.Atoms: rulesSettings :: Lens Atoms [Text]
+ Debian.Debianize.Types.Atoms: rulesSettings_ :: Atoms -> [Text]
+ Debian.Debianize.Types.Atoms: uploadersOption :: Lens Atoms [NameAddr]
+ Debian.Debianize.Types.Atoms: uploadersOption_ :: Atoms -> [NameAddr]
+ Debian.Debianize.Types.BinaryDebDescription: canonical :: Canonical a => a -> a
+ Debian.Debianize.Types.BinaryDebDescription: class Canonical a
+ Debian.Debianize.Types.BinaryDebDescription: instance Canonical BinaryDebDescription
+ Debian.Debianize.Types.BinaryDebDescription: instance Canonical PackageRelations
+ Debian.Debianize.Types.BinaryDebDescription: instance Canonical Relations
+ Debian.Debianize.Types.BinaryDebDescription: instance Canonical [BinaryDebDescription]
+ Debian.Debianize.Types.SourceDebDescription: instance Canonical SourceDebDescription
+ Debian.Policy: getCurrentDebianUser :: IO (Maybe NameAddr)
- Debian.Debianize.Types.Atoms: Atoms :: Bool -> Bool -> Bool -> Bool -> Set FilePath -> EnvSet -> Flags -> Map PackageName VersionSplits -> SourceDebDescription -> Maybe SrcPkgName -> Maybe DebBase -> Maybe String -> Maybe DebianVersion -> Maybe NameAddr -> Set (FlagName, Bool) -> Maybe SourceFormat -> Maybe Text -> Set (FilePath, Text) -> Maybe Text -> Set Text -> Set Text -> Maybe String -> Maybe Text -> Maybe ChangeLog -> Maybe [[Text]] -> Set BinPkgName -> Map String Relations -> Map String Relations -> Map PackageName Int -> Map PackageName PackageInfo -> Maybe Int -> CopyrightDescription -> Map BinPkgName (String, FilePath, Text) -> Map BinPkgName (Set Text) -> Map BinPkgName Text -> Map BinPkgName Text -> Map BinPkgName Text -> Map BinPkgName Text -> Maybe PackageArchitectures -> Map BinPkgName PackageArchitectures -> Maybe PackagePriority -> Map BinPkgName PackagePriority -> Maybe Section -> Map BinPkgName Section -> Set Atom -> Map BinPkgName Text -> Map BinPkgName InstallFile -> Map BinPkgName Server -> Map BinPkgName Site -> Map BinPkgName String -> Relations -> Maybe PackageDescription -> Set CompilerFlavor -> Bool -> Atoms
+ Debian.Debianize.Types.Atoms: Atoms :: Bool -> Bool -> Bool -> Bool -> Set FilePath -> EnvSet -> Flags -> Map PackageName VersionSplits -> SourceDebDescription -> Maybe SrcPkgName -> Maybe DebBase -> Maybe String -> Maybe DebianVersion -> Maybe NameAddr -> [NameAddr] -> Set (FlagName, Bool) -> Maybe SourceFormat -> Maybe Text -> Set (FilePath, Text) -> Maybe Text -> [Text] -> [Text] -> Set Text -> Set Text -> Maybe String -> Maybe Text -> Maybe ChangeLog -> Maybe [[Text]] -> Set BinPkgName -> Map String Relations -> Map String Relations -> Map PackageName Int -> Map PackageName PackageInfo -> Maybe Int -> CopyrightDescription -> Map BinPkgName (String, FilePath, Text) -> Map BinPkgName (Set Text) -> Map BinPkgName Text -> Map BinPkgName Text -> Map BinPkgName Text -> Map BinPkgName Text -> Maybe PackageArchitectures -> Map BinPkgName PackageArchitectures -> Maybe PackagePriority -> Map BinPkgName PackagePriority -> Maybe Section -> Map BinPkgName Section -> Set Atom -> Map BinPkgName Text -> Map BinPkgName InstallFile -> Map BinPkgName Server -> Map BinPkgName Site -> Map BinPkgName String -> Relations -> Maybe PackageDescription -> Set CompilerFlavor -> Bool -> Atoms
Files
- CabalDebian.hs +4/−6
- Setup.hs +14/−7
- Tests.hs +24/−30
- cabal-debian.cabal +3/−1
- changelog +45/−0
- debian/Debianize.hs +6/−3
- debian/changelog +1041/−0
- src/Debian/Debianize.hs +2/−14
- src/Debian/Debianize/Files.hs +7/−6
- src/Debian/Debianize/Finalize.hs +113/−33
- src/Debian/Debianize/Goodies.hs +2/−27
- src/Debian/Debianize/Input.hs +8/−39
- src/Debian/Debianize/Options.hs +13/−4
- src/Debian/Debianize/Output.hs +3/−3
- src/Debian/Debianize/Types.hs +11/−6
- src/Debian/Debianize/Types/Atoms.hs +27/−3
- src/Debian/Debianize/Types/BinaryDebDescription.hs +28/−2
- src/Debian/Debianize/Types/SourceDebDescription.hs +10/−2
- src/Debian/Policy.hs +3/−3
- test-data/alex/output/debian/control +3/−3
- test-data/archive/output/debian/control +3/−3
- test-data/artvaluereport-data/output/debian/control +9/−9
- test-data/artvaluereport2/input/debian/Debianize.hs +2/−2
- test-data/artvaluereport2/output/debian/control +9/−9
- test-data/clckwrks-dot-com/output/debian/control +6/−6
- test-data/clckwrks-dot-com/output/debian/rules +1/−2
CabalDebian.hs view
@@ -10,9 +10,9 @@ import Data.Lens.Lazy (access) import Data.List as List (unlines) import Debian.Debianize.Details (debianDefaultAtoms)-import Debian.Debianize.Finalize (debianization)+import Debian.Debianize.Finalize (debianize) import Debian.Debianize.Monad (DebT, evalDebT)-import Debian.Debianize.Options (compileCommandlineArgs, compileEnvironmentArgs, options)+import Debian.Debianize.Options (options) import Debian.Debianize.Output (doDebianizeAction) import Debian.Debianize.SubstVars (substvars) import Debian.Debianize.Types.Atoms (DebAction(Debianize, SubstVar, Usage), EnvSet(EnvSet), debAction, newAtoms)@@ -29,16 +29,14 @@ -- This picks up the options required to decide what action we are -- taking. Much of this will be repeated in the call to debianize. do atoms <- newAtoms- evalDebT (do init- compileEnvironmentArgs- compileCommandlineArgs+ evalDebT (do debianize init action <- access debAction finish action) atoms where envset = EnvSet "/" "/" "/" finish :: forall m. (MonadIO m, Functor m) => DebAction -> DebT m () finish (SubstVar debType) = substvars debType- finish Debianize = debianization (return ()) (return ()) >> doDebianizeAction envset+ finish Debianize = doDebianizeAction envset finish Usage = do progName <- liftIO getProgName let info = unlines [ "Typical usage is to cd to the top directory of the package's unpacked source and run: "
Setup.hs view
@@ -22,22 +22,29 @@ -- Do all we can to create or update a symbolic link - remove any -- existing file or directory and verify the link contents.+ensureSymbolicLink :: FilePath -> FilePath -> IO () ensureSymbolicLink destination location = do result <- try (readSymbolicLink location) case result of Right destination' | destination' == destination -> return ()- Right _ -> remove location >> ensureSymbolicLink destination location+ Right _ -> removeAndRepeat Left e -> case ioe_type e of- InvalidArgument -> remove location >> ensureSymbolicLink destination location+ InvalidArgument -> removeAndRepeat NoSuchThing -> createSymbolicLink destination location _ -> error $ "ensureSymbolicLink " ++ show destination ++ " " ++ show location ++ " -> " ++ show e where- remove path =- do fileExists <- doesFileExist path+ removeAndRepeat :: IO ()+ removeAndRepeat =+ do result <- try remove+ case (result :: Either IOError ()) of+ Left e -> error $ "Unable to remove " ++ show location ++ ": " ++ show e+ Right () -> ensureSymbolicLink destination location+ remove =+ do fileExists <- doesFileExist location case fileExists of- True -> removeFile path+ True -> removeFile location False -> do- dirExists <- doesDirectoryExist path+ dirExists <- doesDirectoryExist location case dirExists of- True -> removeDirectoryRecursive path+ True -> removeDirectoryRecursive location False -> return ()
Tests.hs view
@@ -6,6 +6,7 @@ ) where import Control.Applicative ((<$>))+import Control.Category ((.)) import Data.Algorithm.Diff.Context (contextDiff) import Data.Algorithm.Diff.Pretty (prettyDiff) import Data.Function (on)@@ -13,16 +14,15 @@ import Data.List (sortBy) import Data.Map as Map (differenceWithKey, intersectionWithKey) import qualified Data.Map as Map (elems, Map, toList)-import Data.Maybe (fromMaybe) import Data.Monoid ((<>), mconcat, mempty) import Data.Set as Set (fromList, singleton, union)-import Data.Text as Text (intercalate, lines, split, Text, unlines, pack, unpack)-import Data.Version (Version(Version, versionBranch))+import Data.Text as Text (intercalate, split, Text, unlines, unpack)+import Data.Version (Version(Version)) import Debian.Changes (ChangeLog(..), ChangeLogEntry(..), parseEntry) import Debian.Debianize.DebianName (mapCabal, splitCabal) import Debian.Debianize.Files (debianizationFileMap)-import Debian.Debianize.Finalize (debianization, finalizeDebianization')-import Debian.Debianize.Goodies (doBackups, doExecutable, doServer, doWebsite, makeRulesHead, tightDependencyFixup)+import Debian.Debianize.Finalize (debianize, finalizeDebianization)+import Debian.Debianize.Goodies (doBackups, doExecutable, doServer, doWebsite, tightDependencyFixup) import Debian.Debianize.Input (inputChangeLog, inputDebianization, inputCabalization) import Debian.Debianize.Monad (DebT, evalDebT, execDebM, execDebT) import Debian.Debianize.Prelude ((%=), (++=), (+=), (~=), withCurrentDirectory)@@ -38,9 +38,8 @@ import Debian.Release (ReleaseName(ReleaseName, relName)) import Debian.Version (parseDebianVersion, buildDebianVersion) import Distribution.Compiler (CompilerFlavor(GHC))-import Distribution.License (License(..)) import Distribution.Package (PackageName(PackageName))-import Prelude hiding (log)+import Prelude hiding (log, (.)) import System.Exit (ExitCode(ExitSuccess)) import System.FilePath ((</>)) import System.Process (readProcessWithExitCode)@@ -75,7 +74,7 @@ do T.changelog ~= Just log T.compat ~= level T.source ~= Just (SrcPkgName (logPackage entry))- T.maintainer ~= either error Just (parseMaintainer (logWho entry))+ (S.maintainer . T.control) ~= either error Just (parseMaintainer (logWho entry)) T.standardsVersion ~= standards newDebianization _ _ _ = error "Invalid changelog" @@ -125,7 +124,7 @@ newDebianization (ChangeLog [testEntry]) level standards copyright %= (\ c -> c { _summaryLicense = Just BSD_3_Clause }) -- inputCabalization top- finalizeDebianization')+ finalizeDebianization) atoms diff <- diffDebianizations (testDeb1 atoms) deb assertEqual label [] diff)@@ -143,7 +142,7 @@ compat ~= Just 9 -- This will change as new version of debhelper are released copyright %= (\ c -> c { _summaryLicense = Just BSD_3_Clause }) T.source ~= Just (SrcPkgName {unSrcPkgName = "haskell-cabal-debian"})- T.maintainer ~= Just (NameAddr (Just "David Fox") "dsf@seereason.com")+ (S.maintainer . T.control) ~= Just (NameAddr (Just "David Fox") "dsf@seereason.com") T.standardsVersion ~= Just (StandardsVersion 3 9 3 (Just 1)) -- This will change as new versions of debian-policy are released T.buildDepends %= (++ [[Rel (BinPkgName "debhelper") (Just (GRE (parseDebianVersion ("7.0" :: String)))) Nothing], [Rel (BinPkgName "haskell-devscripts") (Just (GRE (parseDebianVersion ("0.8" :: String)))) Nothing],@@ -172,7 +171,7 @@ newDebianization (ChangeLog [testEntry]) level standards copyright %= (\ c -> c { _summaryLicense = Just BSD_3_Clause }) -- inputCabalization top- finalizeDebianization')+ finalizeDebianization) atoms diff <- diffDebianizations (expect atoms) deb assertEqual label [] diff)@@ -189,7 +188,7 @@ compat ~= Just 9 copyright %= (\ c -> c { _summaryLicense = Just BSD_3_Clause }) T.source ~= Just (SrcPkgName {unSrcPkgName = "haskell-cabal-debian"})- T.maintainer ~= Just (NameAddr {nameAddr_name = Just "David Fox", nameAddr_addr = "dsf@seereason.com"})+ (S.maintainer . T.control) ~= Just (NameAddr {nameAddr_name = Just "David Fox", nameAddr_addr = "dsf@seereason.com"}) T.standardsVersion ~= Just (StandardsVersion 3 9 3 (Just 1)) T.buildDepends %= (++ [[Rel (BinPkgName "debhelper") (Just (GRE (parseDebianVersion ("7.0" :: String)))) Nothing], [Rel (BinPkgName "haskell-devscripts") (Just (GRE (parseDebianVersion ("0.8" :: String)))) Nothing],@@ -281,8 +280,8 @@ T.compat ~= Just 7 T.copyright %= \ c -> c { _summaryComment = Just "This package was debianized by John Goerzen <jgoerzen@complete.org> on\nWed, 6 Oct 2004 09:46:14 -0500.\n\nCopyright information removed from this test data.\n" } T.source ~= Just (SrcPkgName {unSrcPkgName = "haskell-devscripts"})- T.maintainer ~= Just (NameAddr {nameAddr_name = Just "Debian Haskell Group", nameAddr_addr = "pkg-haskell-maintainers@lists.alioth.debian.org"})- T.uploaders ~= [NameAddr {nameAddr_name = Just "Marco Silva", nameAddr_addr = "marcot@debian.org"},NameAddr {nameAddr_name = Just "Joachim Breitner", nameAddr_addr = "nomeata@debian.org"}]+ (S.maintainer . T.control) ~= Just (NameAddr {nameAddr_name = Just "Debian Haskell Group", nameAddr_addr = "pkg-haskell-maintainers@lists.alioth.debian.org"})+ (S.uploaders . T.control) ~= [NameAddr {nameAddr_name = Just "Marco Silva", nameAddr_addr = "marcot@debian.org"},NameAddr {nameAddr_name = Just "Joachim Breitner", nameAddr_addr = "nomeata@debian.org"}] T.sourcePriority ~= Just Extra T.sourceSection ~= Just (MainSection "haskell") T.buildDepends %= (++ [[Rel (BinPkgName {unBinPkgName = "debhelper"}) (Just (GRE (Debian.Version.parseDebianVersion ("7" :: String)))) Nothing]])@@ -388,7 +387,7 @@ atoms <- testAtoms old <- withCurrentDirectory outTop (execDebT (inputDebianization envset) atoms) let log = getL T.changelog old- new <- withCurrentDirectory inTop (execDebT (debianization defaultAtoms (customize log)) atoms)+ new <- withCurrentDirectory inTop (execDebT (debianize (defaultAtoms >> customize log)) atoms) diff <- diffDebianizations old ({-copyFirstLogEntry old-} new) assertEqual label [] diff) where@@ -424,12 +423,7 @@ serverNames = map BinPkgName ["clckwrks-dot-com-production"] -- , "clckwrks-dot-com-staging", "clckwrks-dot-com-development"] -- Insert a line just above the debhelper.mk include fixRules =- makeRulesHead >>= \ rh -> T.rulesHead %= (\ mt -> (Just . f) (fromMaybe rh mt))- where- f t = Text.unlines $ concat $- map (\ line -> if line == "include /usr/share/cdbs/1/rules/debhelper.mk"- then ["DEB_SETUP_GHC_CONFIGURE_ARGS = -fbackups", "", line] :: [Text]- else [line] :: [Text]) (Text.lines t)+ rulesSettings %= (++ ["DEB_SETUP_GHC_CONFIGURE_ARGS = -fbackups"]) {- mapAtoms f deb where@@ -501,7 +495,7 @@ old <- withCurrentDirectory outTop (execDebT (inputDebianization envset) atoms) let standards = getL T.standardsVersion old level = getL T.compat old- new <- withCurrentDirectory inTop (execDebT (debianization defaultAtoms (customize old level standards)) atoms)+ new <- withCurrentDirectory inTop (execDebT (debianize (defaultAtoms >> customize old level standards)) atoms) diff <- diffDebianizations old new assertEqual label [] diff) where@@ -598,7 +592,7 @@ atoms <- testAtoms old <- withCurrentDirectory outTop (execDebT (inputDebianization envset) atoms) log <- withCurrentDirectory inTop (evalDebT (inputChangeLog >> access T.changelog) atoms)- new <- withCurrentDirectory inTop (execDebT (debianization defaultAtoms (customize log)) atoms)+ new <- withCurrentDirectory inTop (execDebT (debianize (defaultAtoms >> customize log)) atoms) diff <- diffDebianizations old new assertEqual label [] diff )@@ -618,9 +612,9 @@ outTop = "test-data/alex/output" envset = EnvSet "/" "/" "/" atoms <- testAtoms- old <- withCurrentDirectory outTop (execDebT (inputDebianization envset) atoms)- let Just (ChangeLog (entry : _)) = getL T.changelog old- new <- withCurrentDirectory inTop (execDebT (debianization defaultAtoms customize >> copyChangelogDate (logDate entry)) atoms)+ new <- withCurrentDirectory inTop (execDebT (debianize (defaultAtoms >> customize)) atoms)+ let Just (ChangeLog (entry : _)) = getL T.changelog new+ old <- withCurrentDirectory outTop (execDebT (inputDebianization envset >> copyChangelogDate (logDate entry)) atoms) diff <- diffDebianizations old new assertEqual label [] diff) where@@ -656,9 +650,9 @@ outTop = "test-data/archive/output" envset = EnvSet "/" "/" "/" atoms <- testAtoms- old <- withCurrentDirectory outTop (execDebT (inputDebianization envset) atoms)- let Just (ChangeLog (entry : _)) = getL T.changelog old- new <- withCurrentDirectory inTop (execDebT (debianization defaultAtoms customize >> copyChangelogDate (logDate entry)) atoms)+ new <- withCurrentDirectory inTop (execDebT (debianize (defaultAtoms >> customize)) atoms)+ let Just (ChangeLog (entry : _)) = getL T.changelog new+ old <- withCurrentDirectory outTop (execDebT (inputDebianization envset >> copyChangelogDate (logDate entry)) atoms) diff <- diffDebianizations old new assertEqual label [] diff) where@@ -667,7 +661,7 @@ do T.sourcePackageName ~= Just (SrcPkgName "seereason-darcs-backups") T.compat ~= Just 5 T.standardsVersion ~= Just (StandardsVersion 3 8 1 Nothing)- T.maintainer ~= either (const Nothing) Just (parseMaintainer "David Fox <dsf@seereason.com>")+ (S.maintainer . T.control) ~= either (const Nothing) Just (parseMaintainer "David Fox <dsf@seereason.com>") T.depends (BinPkgName "seereason-darcs-backups") %= (++ [[Rel (BinPkgName "anacron") Nothing Nothing]]) T.sourceSection ~= Just (MainSection "haskell") T.utilsPackageNameBase ~= Just "seereason-darcs-backups"
cabal-debian.cabal view
@@ -1,5 +1,6 @@ Name: cabal-debian-Version: 4.19.1+Version: 4.20.1+Copyright: Copyright (c) 2007-2014, David Fox, Jeremy Shaw License: BSD3 License-File: debian/copyright Author: David Fox <dsf@seereason.com>@@ -18,6 +19,7 @@ Cabal-Version: >= 1.8 Extra-Source-Files: changelog+ debian/changelog debian/Debianize.hs test-data/creativeprompts/input/debian/changelog test-data/creativeprompts/input/debian/copyright
changelog view
@@ -1,3 +1,48 @@+haskell-cabal-debian (4.20.1) unstable; urgency=low++ * Fix a bug in the computation of the debian maintainer field+ * Improve rules file generation++ -- David Fox <dsf@seereason.com> Wed, 14 Jan 2015 14:38:56 -0800++haskell-cabal-debian (4.20) unstable; urgency=low++ * Add a --source-section option+ * Fix handling of debian maintainer and debian uploaders+ * Improve formatting of debian/rules file+ * Rename function debianization -> debianize+ * Rename function finalizeDebianization' -> finalizeDebianization+ * Rename function getDebianMaintainer -> getCurrentDebianUser++ -- David Fox <dsf@seereason.com> Fri, 09 Jan 2015 11:49:04 -0800++haskell-cabal-debian (4.19.3) unstable; urgency=low++ * Fix issue #23, so that if you run 'cabal-debian' and then+ 'cabal-debian --compare' it says there are no differences.+ * Fix issue #16 - set revision if format is Quilt3.++ -- David Fox <dsf@seereason.com> Thu, 08 Jan 2015 05:20:32 -0800++haskell-cabal-debian (4.19.2) unstable; urgency=low++ * Use canonical to put the debianization in a standard form before+ trying to compare existing and generated.+ * Fix bug where cabal-debian program processed the command line options+ twice.+ * Avoid using paths that point to ../ in the cabal file (even if+ disabled by a flag), it causes the package to be rejected by hackage.++ -- David Fox <dsf@seereason.com> Wed, 07 Jan 2015 13:26:33 -0800++haskell-cabal-debian (4.19.1) unstable; urgency=low++ * Support Cabal-1.22+ * Test whether apt-file is installed (from creichert)+ * Conditional compilation for new symbols MPL and BSD2 (from creichert)++ -- David Fox <dsf@seereason.com> Wed, 07 Jan 2015 12:56:00 -0800+ haskell-cabal-debian (4.19) unstable; urgency=low * Add remapCabal function here from a private package
debian/Debianize.hs view
@@ -17,7 +17,7 @@ import Debian.Changes (ChangeLog(ChangeLog)) import Debian.Debianize (inputChangeLog, inputDebianization) import Debian.Debianize.Details (debianDefaultAtoms)-import Debian.Debianize.Finalize (debianization)+import Debian.Debianize.Finalize (debianize) import Debian.Debianize.Types as T (changelog, compat, conflicts, control, depends, debianDescription, homepage, installCabalExec, sourceFormat, standardsVersion, utilsPackageNameBase, copyright, xDescription)@@ -44,7 +44,10 @@ -- checked into version control. log <- newAtoms >>= evalDebT (inputChangeLog >> access changelog) old <- newAtoms >>= execDebT (inputDebianization (T.EnvSet "/" "/" "/"))- new <- newAtoms >>= execDebT (debianization debianDefaultAtoms (changelog ~?= log >> customize >> copyFirstLogEntry old))+ new <- newAtoms >>= execDebT (debianize (do debianDefaultAtoms+ changelog ~?= log+ customize+ copyFirstLogEntry old)) diff <- compareDebianization old new case diff of "" -> return ()@@ -67,7 +70,7 @@ installCabalExec (BinPkgName "cabal-debian") "cabal-debian" "/usr/bin" utilsPackageNameBase ~= Just "cabal-debian" -- extraDevDeps (BinPkgName "debian-policy")- homepage ~= Just (pack "http://src.seereason.com/cabal-debian")+ homepage ~= Just (pack "https://github.com/ddssff/cabal-debian") rels :: String -> Relations rels = either (throw . userError . show) id . parseRelations
+ debian/changelog view
@@ -0,0 +1,1041 @@+haskell-cabal-debian (4.20.1) unstable; urgency=low++ * Fix a bug in the computation of the debian maintainer field+ * Improve rules file generation++ -- David Fox <dsf@seereason.com> Wed, 14 Jan 2015 14:38:56 -0800++haskell-cabal-debian (4.20) unstable; urgency=low++ * Add a --source-section option+ * Fix handling of debian maintainer and debian uploaders+ * Improve formatting of debian/rules file+ * Rename function debianization -> debianize+ * Rename function finalizeDebianization' -> finalizeDebianization+ * Rename function getDebianMaintainer -> getCurrentDebianUser++ -- David Fox <dsf@seereason.com> Fri, 09 Jan 2015 11:49:04 -0800++haskell-cabal-debian (4.19.3) unstable; urgency=low++ * Fix issue #23, so that if you run 'cabal-debian' and then+ 'cabal-debian --compare' it says there are no differences.+ * Fix issue #16 - set revision if format is Quilt3.++ -- David Fox <dsf@seereason.com> Thu, 08 Jan 2015 05:20:32 -0800++haskell-cabal-debian (4.19.2) unstable; urgency=low++ * Use canonical to put the debianization in a standard form before+ trying to compare existing and generated.+ * Fix bug where cabal-debian program processed the command line options+ twice.+ * Avoid using paths that point to ../ in the cabal file (even if+ disabled by a flag), it causes the package to be rejected by hackage.++ -- David Fox <dsf@seereason.com> Wed, 07 Jan 2015 13:26:33 -0800++haskell-cabal-debian (4.19.1) unstable; urgency=low++ * Support Cabal-1.22+ * Test whether apt-file is installed (from creichert)+ * Conditional compilation for new symbols MPL and BSD2 (from creichert)++ -- David Fox <dsf@seereason.com> Wed, 07 Jan 2015 12:56:00 -0800++haskell-cabal-debian (4.19) unstable; urgency=low++ * Add remapCabal function here from a private package+ * Remove debianVersionSplits, which has long been replaced by+ debianDefaultAtoms.++ -- David Fox <dsf@seereason.com> Mon, 08 Dec 2014 10:07:06 -0800++haskell-cabal-debian (4.18) unstable; urgency=low++ * Add types to support machine readable copyright files.+ * Add --debian-base-name option and overrideDebianBaseName lens.+ * Add --omit-prof-version-deps option flag, have --official imply it++ -- David Fox <dsf@seereason.com> Thu, 27 Nov 2014 07:11:35 -0800++haskell-cabal-debian (4.17.5) unstable; urgency=low++ * Use the prettyclass package and the PP wrappers in the latest+ debian package to do pretty printing.+ * Change default priority to extra+ * Use the new watch file suggested by nomeata+ * Use the control file template suggested in issue #3++ -- David Fox <dsf@seereason.com> Mon, 15 Sep 2014 13:28:36 -0700++haskell-cabal-debian (4.17.4) unstable; urgency=low++ * Add missing ifdefs to hide the GHCJS constructor when ghcjs-support+ flag is False.+ * Require Cabal < 1.21 when ghcjs-support flag is False.++ -- David Fox <dsf@seereason.com> Tue, 02 Sep 2014 09:06:20 -0700++haskell-cabal-debian (4.17.3) unstable; urgency=low++ * Moved source repository to github.com.++ -- David Fox <dsf@seereason.com> Fri, 29 Aug 2014 13:55:26 -0700++haskell-cabal-debian (4.17.2) unstable; urgency=low++ * Fix formatting of the generated debian/*.install files.++ -- David Fox <dsf@seereason.com> Tue, 19 Aug 2014 16:04:27 -0700++haskell-cabal-debian (4.17.1) unstable; urgency=low++ * Fix install of ghcjs executables - there was an extra subdir.+ * Don't append -ghcjs to default package name.++ -- David Fox <dsf@seereason.com> Tue, 19 Aug 2014 10:15:46 -0700++haskell-cabal-debian (4.17) unstable; urgency=low++ * Fix bug in architecture dependent build dependency generation - it+ was getting the indep dependencies as well.+ * Support GHCJS executable packages, which are directories with the+ extension .jsexe.++ -- David Fox <dsf@seereason.com> Mon, 18 Aug 2014 17:31:35 -0700++haskell-cabal-debian (4.16.1) unstable; urgency=low++ * Support for packaging libraries produced by the GHCJS compiler.+ * Generate debianizations that include libraries for multiple compiler+ flavors (not yet suppored in haskell-devscripts and/or Cabal.)+ * Put a DEB_DEFAULT_COMPILER assignment in debian/rules if we can+ infer it from the command line options.++ -- David Fox <dsf@seereason.com> Sat, 16 Aug 2014 07:56:50 -0700++haskell-cabal-debian (4.15.2) unstable; urgency=low++ * Lowercase the strings in the extraLibs argument of allBuildDepends+ before wrapping them in BinPkgName. Those types, which come from the+ debian package, should be opaque and do this whenever a BinPkgName (or+ SrcPkgName) is created, because upper case is never ok in Debian+ source or binary package names. In the meantime I will make this+ requested change. Thanks to Sven Bartscher for pointing this out.++ -- David Fox <dsf@seereason.com> Tue, 12 Aug 2014 07:47:17 -0700++haskell-cabal-debian (4.15.1) unstable; urgency=low++ * Add Data and Typeable instances.++ -- David Fox <dsf@seereason.com> Thu, 17 Jul 2014 11:22:17 -0700++haskell-cabal-debian (4.15) unstable; urgency=low++ * Don't hardcode the compiler name in makefile targets.++ -- David Fox <dsf@seereason.com> Sat, 12 Jul 2014 12:15:10 -0700++haskell-cabal-debian (4.14) unstable; urgency=low++ * Move the code to map the cabal package named "Cabal" to the debian+ package named "libghc-cabal-*" from the seereason defaults to the+ debian defaults.++ -- David Fox <dsf@seereason.com> Mon, 07 Jul 2014 08:35:39 -0700++haskell-cabal-debian (4.13) unstable; urgency=low++ * Add a flag for ghcjs support.++ -- David Fox <dsf@seereason.com> Thu, 03 Jul 2014 12:05:21 -0700++haskell-cabal-debian (4.12) unstable; urgency=low++ * Remove the Top type and argument - use getWorkingDirectory instead.++ -- David Fox <dsf@seereason.com> Sun, 29 Jun 2014 08:11:01 -0700++haskell-cabal-debian (4.11) unstable; urgency=low++ * Use MonadIO instead of IO for all signatures. This is so+ we can more easily use cabal debian from a Shelly script.++ -- David Fox <dsf@seereason.com> Sun, 29 Jun 2014 07:16:45 -0700++haskell-cabal-debian (4.10.1) unstable; urgency=low++ * Fix a tail exception in builtIn.++ -- David Fox <dsf@seereason.com> Tue, 17 Jun 2014 07:21:22 -0700++haskell-cabal-debian (4.10) unstable; urgency=low++ * Rename knownVersionSplits -> debianVersionSplits and move to+ Debian.Debianize.Details. (Should that be renamed+ Debian.Debianize.Debian?)+ * Add HC=ghc or HC=ghcjs to header of debian/rules depending on+ the value of the compilerFlavor atom.++ -- David Fox <dsf@seereason.com> Sat, 14 Jun 2014 10:20:01 -0700++haskell-cabal-debian (4.9) unstable; urgency=low++ * Generate the library package prefix, previously hard coded as libghc-,+ using the CompilerFlavor value, so we get libghcjs-foo-dev when using+ ghcjs.++ -- David Fox <dsf@seereason.com> Fri, 13 Jun 2014 09:58:13 -0700++haskell-cabal-debian (4.8) unstable; urgency=low++ * Add a --no-hoogle flag to omit the hoogle documentation link. This+ link doesn't contain the package's version number, so it will conflict+ with other versions of the library (such as those built into ghc.)++ -- David Fox <dsf@seereason.com> Tue, 10 Jun 2014 10:42:38 -0700++haskell-cabal-debian (4.7.1) unstable; urgency=low++ * Fix the code added in 4.7.+ * Add --recommends and --suggests options, similar to --depends et. al.++ -- David Fox <dsf@seereason.com> Tue, 03 Jun 2014 07:14:52 -0700++haskell-cabal-debian (4.7) unstable; urgency=low++ * Improve the treatment of dependencies which are built into ghc. This+ will allow the use of newer libraries than the ones built into ghc,+ provided they are given deb names that are different than the one ghc+ specifically conflicts with. For example, a newer version of Cabal+ could be used if it was in the deb package libghc-cabal-ghcjs-dev. To+ change the debian names of libraries we need to use the mapCabal and+ splitCabal functions, as is done in the autobuilder-seereason module+ Debian.AutoBuilder.Details.Atoms.++ -- David Fox <dsf@seereason.com> Mon, 02 Jun 2014 14:28:59 -0700++haskell-cabal-debian (4.6.2) unstable; urgency=low++ * Move a seereason specific function from here to the+ autobuilder-seereason package.++ -- David Fox <dsf@seereason.com> Mon, 02 Jun 2014 11:03:13 -0700++haskell-cabal-debian (4.6.1) unstable; urgency=low++ * Don't compute the current ghc version so often.++ -- David Fox <dsf@seereason.com> Fri, 30 May 2014 13:40:12 -0700++haskell-cabal-debian (4.6) unstable; urgency=low++ * Add a --default-package option to change haskell-packagename-utils to+ some other name.+ * Fix treatment of cabalfile Data-Dir field - it describes where the+ data files are in the source tree, but shouldn't affect where they will+ be installed.++ -- David Fox <dsf@seereason.com> Thu, 29 May 2014 08:27:54 -0700++haskell-cabal-debian (4.5) unstable; urgency=low++ * Remove the ghcVersion field and lens.++ -- David Fox <dsf@seereason.com> Mon, 05 May 2014 11:55:53 -0700++haskell-cabal-debian (4.4) unstable; urgency=low++ * Add the copytruncate directive to logrotate files we generate.+ As things were, hslogger would continue writing to the deleted+ log file after it was rotated.++ -- David Fox <dsf@seereason.com> Sun, 30 Mar 2014 13:05:48 -0700++haskell-cabal-debian (4.3.2) unstable; urgency=low++ * Speed up debianization by computing the ghc version once when+ we enter the DebT monad rather than repeatedly. It is slow+ because it needs to chroot.++ -- David Fox <dsf@seereason.com> Fri, 28 Mar 2014 13:03:57 -0700++haskell-cabal-debian (4.3.1) unstable; urgency=low++ * Safer default value for buildEnv - "/" instead of "". This is+ where we look for the GHC version number.++ -- David Fox <dsf@seereason.com> Thu, 27 Mar 2014 06:12:28 -0700++haskell-cabal-debian (4.3) unstable; urgency=low++ * Make the default value for buildEnv "/", this makes it normally look+ at the version number of the ghc compiler installed in the root+ environment.++ -- David Fox <dsf@seereason.com> Mon, 24 Mar 2014 06:01:49 -0700++haskell-cabal-debian (4.2) unstable; urgency=low++ * Get the GHC compiler version from the build environment, which+ now needs to be explicitly set.++ -- David Fox <dsf@seereason.com> Fri, 07 Mar 2014 10:58:37 -0800++haskell-cabal-debian (4.1.1) unstable; urgency=low++ * Remove build dependency on ansi-wl-pprint.+ * Split module Debian.Debianize.BuildDependencies out of+ Debian.Debianize.Finalize++ -- David Fox <dsf@seereason.com> Sun, 02 Feb 2014 07:37:03 -0800++haskell-cabal-debian (4.0.6) unstable; urgency=low++ * Ifdef out duplicate instances for Cabal-1.18.0 - thanks to Tom Nielsen.++ -- David Fox <dsf@seereason.com> Tue, 28 Jan 2014 17:10:48 -0800++haskell-cabal-debian (4.0.5) unstable; urgency=low++ * Changes for debian-3.81 - use the pretty printer in Debian.Pretty+ instead of ansi-wl-pprint.++ -- David Fox <dsf@seereason.com> Tue, 14 Jan 2014 05:02:59 -0800++haskell-cabal-debian (4.0.4) unstable; urgency=low++ * Restore the test data, the problem I had with long filenames+ is solved by using cabal sdist to create the tarball rather+ than runhaskell Setup sdist.++ -- David Fox <dsf@seereason.com> Wed, 18 Dec 2013 09:37:34 -0800++haskell-cabal-debian (4.0.3) unstable; urgency=low++ * Include the build dependencies of the executables in the debian+ source deb build dependencies.++ -- David Fox <dsf@seereason.com> Tue, 10 Dec 2013 14:37:20 -0800++haskell-cabal-debian (4.0.2) unstable; urgency=low++ * Export some lens state operators from Prelude.++ -- David Fox <dsf@seereason.com> Tue, 10 Dec 2013 05:38:00 -0800++haskell-cabal-debian (4.0.1) unstable; urgency=low++ * Make sure the utilities package gets created even if no name+ has been specified for it - use the name generated in DebianNames.hs.++ -- David Fox <dsf@seereason.com> Tue, 10 Dec 2013 05:10:11 -0800++haskell-cabal-debian (4.0.0) unstable; urgency=low++ * Massive lens overhaul++ -- David Fox <dsf@seereason.com> Thu, 05 Dec 2013 12:26:31 -0800++haskell-cabal-debian (3.10.3) unstable; urgency=low++ * Go back to using lens interface directly+ * Collect debianization fact code in Facts/++ -- David Fox <dsf@seereason.com> Sun, 24 Nov 2013 10:40:02 -0800++haskell-cabal-debian (3.10.2) unstable; urgency=low++ * Make some signatures in Monad.hs clearer++ -- David Fox <dsf@seereason.com> Wed, 20 Nov 2013 14:26:28 -0800++haskell-cabal-debian (3.10.1) unstable; urgency=low++ * More API changes - want need to get all the clients in sync before+ proceeding.++ -- David Fox <dsf@seereason.com> Tue, 19 Nov 2013 11:31:16 -0800++haskell-cabal-debian (3.10) unstable; urgency=low++ * Add a monadic interface++ -- David Fox <dsf@seereason.com> Sat, 16 Nov 2013 10:42:02 -0800++haskell-cabal-debian (3.9) unstable; urgency=low++ * Clean up documentation+ * Allow more than one utility package name, each of which will+ get copies of the data-files and leftover executables.+ * Make the --debianize option a no-op, the behavior is now the+ default.+ * Update the unit tests and build an executable to run them.+ * Copy debian/changelog to top directory at beginning of build+ so hackage will see it.++ -- David Fox <dsf@seereason.com> Tue, 05 Nov 2013 11:34:48 -0800++haskell-cabal-debian (3.8.3) unstable; urgency=low++ * Add an ifdef for compatibility with GHC-7.4.1.++ -- David Fox <dsf@seereason.com> Sun, 20 Oct 2013 15:50:47 -0700++haskell-cabal-debian (3.8.2) unstable; urgency=low++ * Actually, copy changelog from debian/changelog before+ building sdist tarball.++ -- David Fox <dsf@seereason.com> Tue, 15 Oct 2013 06:42:39 -0700++haskell-cabal-debian (3.8.1) unstable; urgency=low++ * Move changelog top top directory so hackage will see it.++ -- David Fox <dsf@seereason.com> Tue, 15 Oct 2013 06:24:25 -0700++haskell-cabal-debian (3.8) unstable; urgency=low++ * Downcase the package name to build the datadir name in /usr/share,+ this matches the paths in dist/autogen/Paths_packagename.++ -- David Fox <dsf@seereason.com> Mon, 14 Oct 2013 20:48:39 -0700++haskell-cabal-debian (3.7) unstable; urgency=low++ * Change path to hackage tarball in watch file for hackage2.++ -- David Fox <dsf@seereason.com> Fri, 04 Oct 2013 09:22:51 -0700++haskell-cabal-debian (3.6) unstable; urgency=low++ * Require haskell-devscripts >= 0.8.19. This version changes the+ value of datasubdir from /usr/share/packagename-packageversion to+ simply /usr/share/packagename. This could break some packaging.++ -- David Fox <dsf@seereason.com> Fri, 06 Sep 2013 16:48:18 -0700++haskell-cabal-debian (3.5) unstable; urgency=low++ * Allow full lists of debian relations to be passed to the --build-dep+ argument, not just a single package name.++ -- David Fox <dsf@seereason.com> Sun, 01 Sep 2013 07:08:37 -0700++haskell-cabal-debian (3.4.3) unstable; urgency=low++ * Fix the repository location in the cabal file.++ -- David Fox <dsf@seereason.com> Sat, 31 Aug 2013 07:57:15 -0700++haskell-cabal-debian (3.4.2) unstable; urgency=low++ * Notify user when debhelper isn't installed.+ * Avoid use of partial function read++ -- David Fox <dsf@seereason.com> Mon, 24 Jun 2013 13:51:51 -0700++haskell-cabal-debian (3.4.1) unstable; urgency=low++ * Remove call to test script in Setup.hs+ * Remove unused dependencies++ -- David Fox <dsf@seereason.com> Mon, 10 Jun 2013 09:12:38 -0700++haskell-cabal-debian (3.4) unstable; urgency=low++ * Add support for modifying the Provides and Replaces fields.++ -- David Fox <dsf@seereason.com> Sun, 09 Jun 2013 14:18:39 -0700++haskell-cabal-debian (3.3.2) unstable; urgency=low++ * Changes for debian-3.71++ -- David Fox <dsf@seereason.com> Sun, 14 Apr 2013 13:32:04 -0700++haskell-cabal-debian (3.3.1) unstable; urgency=low++ * Don't fail during dry run if the existing debianization has no+ copyright file.++ -- David Fox <dsf@seereason.com> Wed, 13 Mar 2013 10:00:25 -0700++haskell-cabal-debian (3.3) unstable; urgency=low++ * Add Debian.Debianize.Details, with default Atoms values for Debian and+ SeeReason.++ -- David Fox <dsf@seereason.com> Mon, 11 Mar 2013 11:44:10 -0700++haskell-cabal-debian (3.2.5) unstable; urgency=low++ * Add move the VersionSplits type into a module, and fix the code that+ splits the mapping of cabal to debian names over a version range.++ -- David Fox <dsf@seereason.com> Tue, 05 Mar 2013 05:17:03 -0800++haskell-cabal-debian (3.2.4) unstable; urgency=low++ * Fix long standing bug in Debian.Debianize.Interspersed.foldTriples.++ -- David Fox <dsf@seereason.com> Sun, 03 Mar 2013 09:45:14 -0800++haskell-cabal-debian (3.2.3) unstable; urgency=low++ * Clean up mapping from cabal names to debian names.++ -- David Fox <dsf@seereason.com> Sat, 02 Mar 2013 07:36:16 -0800++haskell-cabal-debian (3.2.2) unstable; urgency=low++ * Remove unused Debian.Debianize.Generic and Triplets modules.++ -- David Fox <dsf@seereason.com> Fri, 01 Mar 2013 11:14:33 -0800++haskell-cabal-debian (3.2.1) unstable; urgency=low++ * Do not add the options +RTS -IO -RTS to the server options, this+ is a security risk. Instead, server executables should built with+ -with-rtsopts=-IO.++ -- David Fox <dsf@seereason.com> Thu, 28 Feb 2013 09:02:39 -0800++haskell-cabal-debian (3.2) unstable; urgency=low++ * Strip executables when installing (well, at least some. There+ may be more work to do here.)+ * Change the build dependency type from BinPkgName to Relation, so we+ can specify version dependencies (though as yet not or relations.)++ -- David Fox <dsf@seereason.com> Tue, 26 Feb 2013 07:17:30 -0800++haskell-cabal-debian (3.1.1) unstable; urgency=low++ * Fix the code in the init file that checks for and sources a+ file in /etc/default.++ -- David Fox <dsf@seereason.com> Mon, 25 Feb 2013 14:46:02 -0800++haskell-cabal-debian (3.1) unstable; urgency=low++ * Create a Top type to represent the top directory of a debianization+ * Change the signature of Debian.Debianize.debianization so it notices+ command line arguments and environment arguments.++ -- David Fox <dsf@seereason.com> Fri, 22 Feb 2013 13:28:30 -0800++haskell-cabal-debian (3.0.7) unstable; urgency=low++ * Fix to copyright/license code+ * have the init script load /etc/default/packagename if available+ * Add an alternative function to showCommandForUser (called showCommand)+ that uses double quotes instead of single quotes so you can reference+ shell variables.++ -- David Fox <dsf@seereason.com> Wed, 20 Feb 2013 09:29:11 -0800++haskell-cabal-debian (3.0.6) unstable; urgency=low++ * When packaging a web site or server, don't add code to the postinst+ to start a server, it gets generated by debhelper.+ * Add the changelog and the Debianize.hs file to extra-source-files.+ * Add HTTP=1 to the list of known epoch mappings.++ -- David Fox <dsf@seereason.com> Thu, 14 Feb 2013 14:41:17 -0800++haskell-cabal-debian (3.0.5) unstable; urgency=low++ * Compatibility with ghc-7.4++ -- David Fox <dsf@seereason.com> Wed, 13 Feb 2013 10:48:19 -0800++haskell-cabal-debian (3.0.4) unstable; urgency=low++ * Add dependency on debian-policy, so we can compute the latest+ standards-version.+ * Documentation improvements+ * Test case improvements+ * Error message improvements++ -- David Fox <dsf@seereason.com> Sun, 10 Feb 2013 11:03:55 -0800++haskell-cabal-debian (3.0.3) unstable; urgency=low++ * Due to a typo, the noDocumentationLibrary lens was turning off+ profiling rather than documentation.++ -- David Fox <dsf@seereason.com> Fri, 08 Feb 2013 17:14:09 -0800++haskell-cabal-debian (3.0.2) unstable; urgency=low++ * Fix argument and exception handling in cabal-debian+ * Make Standards-Version field non-mandatory+ * Make sure every binary deb paragraph has a non-empty description++ -- David Fox <dsf@seereason.com> Thu, 07 Feb 2013 10:03:25 -0800++haskell-cabal-debian (3.0.1) unstable; urgency=low++ * Don't build Debian version numbers with revision (Just "").+ * Output the descriptions of the binary packages.++ -- David Fox <dsf@seereason.com> Tue, 05 Feb 2013 14:48:33 -0800++haskell-cabal-debian (3.0) unstable; urgency=low++ * Moved the Distribution.Debian modules to Debian.Cabal and+ Debian.Debianize.+ * Refactored the debianize function for easier testing+ * Added test cases.+ * Add a Debianization type that intends to fully describe a debian+ package, with functions to read, build, modify, and write a+ Debianization.++ -- David Fox <dsf@seereason.com> Wed, 26 Dec 2012 05:45:35 -0800++haskell-cabal-debian (2.6.3) unstable; urgency=low++ * Fix pretty printing of Relations (i.e. dependency lists.) There+ is an instance for printing lists in ansi-wl-pprint which prevents+ us from writing customized Pretty instances for type aliases like+ Relations, AndRelation, and OrRelation.++ -- David Fox <dsf@seereason.com> Fri, 04 Jan 2013 09:30:48 -0800++haskell-cabal-debian (2.6.2) unstable; urgency=low++ * Fix a bug constructing the destination pathnames that was dropping+ files that were supposed to be installed into packages.++ -- David Fox <dsf@seereason.com> Thu, 20 Dec 2012 06:49:25 -0800++haskell-cabal-debian (2.6.1) unstable; urgency=low++ * Remove the modifyAtoms field from the Flags record, we want to+ be able to create instances like Read and Show for this type.+ The modifyAtoms function is now passed separately to debianize.+ * The flags field of Server was renamed serverFlags because the+ newly exported Config record has a flags field.++ -- David Fox <dsf@seereason.com> Wed, 19 Dec 2012 09:45:22 -0800++haskell-cabal-debian (2.5.10) unstable; urgency=low++ * Filter cabal self dependencies out before generating+ Build-Depends-Indep, just as we added code to filter them out+ of Build-Depends in version 2.5.7.++ -- David Fox <dsf@seereason.com> Tue, 18 Dec 2012 13:23:39 -0800++haskell-cabal-debian (2.5.9) unstable; urgency=low++ * Always add +RTS -IO -RTS to server flags.++ -- David Fox <dsf@seereason.com> Sun, 16 Dec 2012 10:40:52 -0800++haskell-cabal-debian (2.5.8) unstable; urgency=low++ * Add a builtin list for ghc-7.6.1.++ -- David Fox <dsf@seereason.com> Sat, 15 Dec 2012 07:04:49 -0800++haskell-cabal-debian (2.5.7) unstable; urgency=low++ * Filter out cabal self-dependencies before building the debian+ dependencies. In cabal a self dependency means you need the library+ to build an executable, while in debian it means you need an older+ version installed to build the current version.++ -- David Fox <dsf@seereason.com> Thu, 29 Nov 2012 08:42:30 -0800++haskell-cabal-debian (2.5.6) unstable; urgency=low++ * Don't add --base-uri and --http-port arguments automatically, they can be+ computed by calling the oldClckwrksFlags function and adding the value to+ the flags field. Clckwrks-0.3 no longer needs the --base-uri argument.++ -- David Fox <dsf@seereason.com> Tue, 27 Nov 2012 13:34:31 -0800++haskell-cabal-debian (2.5.5) unstable; urgency=low++ * Have the debianize function return False if there is no debian/Debianize.hs file,+ but throw an exception if running it failed, so we notice bad debianization code.++ -- David Fox <dsf@seereason.com> Tue, 27 Nov 2012 07:34:51 -0800++haskell-cabal-debian (2.5.4) unstable; urgency=low++ * Insert "SetEnv proxy-sendcl 1" line into Apache config.++ -- David Fox <dsf@seereason.com> Tue, 20 Nov 2012 13:43:54 -0800++haskell-cabal-debian (2.5.3) unstable; urgency=low++ * Remove extra copy of binary from the executable debs+ * Add a sourcePackageName field to Flags, and a --source-package-name+ command line option.++ -- David Fox <dsf@seereason.com> Sat, 17 Nov 2012 00:16:21 -0800++haskell-cabal-debian (2.5.2) unstable; urgency=low++ * Fix the path to where the DHInstallTo and DHInstallCabalExecTo+ DebAtoms put their files.++ -- David Fox <dsf@seereason.com> Fri, 16 Nov 2012 18:11:45 -0800++haskell-cabal-debian (2.5.1) unstable; urgency=low++ * Add a destName field to Executable so we can give installed+ executables a different name than they had in the build.++ -- David Fox <dsf@seereason.com> Fri, 16 Nov 2012 15:37:16 -0800++haskell-cabal-debian (2.5) unstable; urgency=low++ * Add a debName field to the Executable record, before the deb+ package name had to equal the executable name.++ -- David Fox <dsf@seereason.com> Fri, 16 Nov 2012 12:32:39 -0800++haskell-cabal-debian (2.4.2) unstable; urgency=low++ * Move location of cabal install files from dist/build/install to+ debian/cabalInstall, the dist directory was getting wiped at bad+ moments.+ * Split the autobuilder function autobuilderDebianize into two+ new functions in cabal-debian: runDebianize and callDebianize.+ * Custom debianization code now goes in debian/Debianize.hs rather than+ in setup, so we can distinguish it failing from it not existing more+ easily.++ -- David Fox <dsf@seereason.com> Thu, 15 Nov 2012 11:00:08 -0800++haskell-cabal-debian (2.4.1) unstable; urgency=low++ * We need to verify that debian/compat was created after running the+ debianize function, because ghc still exits with ExitSuccess++ -- David Fox <dsf@seereason.com> Thu, 15 Nov 2012 06:34:02 -0800++haskell-cabal-debian (2.4.0) unstable; urgency=low++ * You can run a function in Setup.hs other than main using ghc -e, so we+ will use this trick to run the debianize function directly rather than+ running main.+ * Eliminate the autobuilderDebianize function.++ -- David Fox <dsf@seereason.com> Thu, 15 Nov 2012 04:05:49 -0800++haskell-cabal-debian (2.3.4) unstable; urgency=low++ * Fix the builddir used when running the cabal-debian standalone+ executable - it was dist-cabal/build, so the resulting debianization+ had files in places where cabal didn't expect them.++ -- David Fox <dsf@seereason.com> Tue, 13 Nov 2012 06:20:51 -0800++haskell-cabal-debian (2.3.3) unstable; urgency=low++ * Eliminate class MonadBuild and the BuildT monad.++ -- David Fox <dsf@seereason.com> Sun, 11 Nov 2012 17:46:31 -0800++haskell-cabal-debian (2.3.2) unstable; urgency=low++ * Fix exception that was keeping changelogs from being preserved.++ -- David Fox <dsf@seereason.com> Sat, 10 Nov 2012 10:07:50 -0800++haskell-cabal-debian (2.3.1) unstable; urgency=low++ * Fix the extension of the debhelper links files+ * Add a general mechanism for installing a file into a deb when+ we have the file's text in a String (rather than in a file.)++ -- David Fox <dsf@seereason.com> Sat, 10 Nov 2012 07:35:09 -0800++haskell-cabal-debian (2.3) unstable; urgency=low++ * Add MonadBuild.++ -- David Fox <dsf@seereason.com> Fri, 09 Nov 2012 12:21:14 -0800++haskell-cabal-debian (2.2.1) unstable; urgency=low++ * Add a modifyAtoms function to Flags that is applied to final list of+ DebAtom before writing the debianization.+ * Add DHApacheSite and DHInstallCabalExec atoms so atoms don't depend on+ the build directory+ * Add #DEBHELPER# and exit 0 to default web server postinst.++ -- David Fox <dsf@seereason.com> Fri, 09 Nov 2012 10:25:32 -0800++haskell-cabal-debian (2.2.0) unstable; urgency=low++ * Append a trailing slash to the --base-uri argument passed to the+ server. This is required by Web.Routes.Site.runSite.++ -- David Fox <dsf@seereason.com> Thu, 08 Nov 2012 04:40:08 -0800++haskell-cabal-debian (2.1.4) unstable; urgency=low++ * Merge the Executable and Script constructors of the Executable type+ * Add a destDir field to Executable to specify the destination.++ -- David Fox <dsf@seereason.com> Tue, 06 Nov 2012 13:24:25 -0800++haskell-cabal-debian (2.1.3) unstable; urgency=low++ * Don't append a slash to the base-uri.+ * Construct the name of the data directory in /usr/share from the cabal+ package name rather than the debian source package name.+ * Add a --self-depend flag to include a build dependency on this library+ in all generated debianizations.++ -- David Fox <dsf@seereason.com> Tue, 06 Nov 2012 07:07:57 -0800++haskell-cabal-debian (2.1.2) unstable; urgency=low++ * Output the server support files.++ -- David Fox <dsf@seereason.com> Tue, 06 Nov 2012 06:37:18 -0800++haskell-cabal-debian (2.1.1) unstable; urgency=low++ * Restore code that checks for version number match when validating+ a debianization. The autobuilder can now pass the version number+ to cabal-debian, so it should match.++ -- David Fox <dsf@seereason.com> Mon, 05 Nov 2012 17:42:32 -0800++haskell-cabal-debian (2.1.0) unstable; urgency=low++ * Enable processing of Script, Server and WebSite executables.++ -- David Fox <dsf@seereason.com> Mon, 05 Nov 2012 12:45:42 -0800++haskell-cabal-debian (2.0.9) unstable; urgency=low++ * Add a Library section, export all the modules.++ -- David Fox <dsf@seereason.com> Mon, 05 Nov 2012 06:41:25 -0800++haskell-cabal-debian (2.0.8) unstable; urgency=low++ * Bypass abandoned versions.++ -- David Fox <dsf@seereason.com> Sat, 03 Nov 2012 06:13:27 -0700++haskell-cabal-debian (1.26) unstable; urgency=low++ * Don't try to update the existing debianization, except for the+ changelog where we retain entries that look older than the one+ we generate.+ * Use .install files instead of adding rules to debian/rules+ * Add --depends and --conflicts options++ -- David Fox <dsf@seereason.com> Thu, 25 Oct 2012 12:03:49 -0700++haskell-cabal-debian (1.25) unstable; urgency=low++ * If the --disable-haddock flag is given omit the doc package from the+ control file.+ * The tarball that was uploaded to Hackage as version 1.24 had a (buggy)+ change which was not pushed to darcs. This resolves that confusion.++ -- David Fox <dsf@seereason.com> Sat, 16 Jun 2012 14:42:12 -0700++haskell-cabal-debian (1.24) unstable; urgency=low++ * No wonder it doesn't build on hackage - none of the source+ modules were shipped.++ -- David Fox <dsf@seereason.com> Thu, 14 Jun 2012 08:19:19 -0700++haskell-cabal-debian (1.23) unstable; urgency=low++ * Add a --quilt option to switch from native to quilt format.+ Without this option the file debian/source/format will contain+ '3.0 (native)', with it '3.0 (quilt)'.++ -- David Fox <dsf@seereason.com> Fri, 01 Jun 2012 05:53:36 -0700++haskell-cabal-debian (1.22) unstable; urgency=low++ * Bump version to make sure all changes are uploaded.++ -- David Fox <dsf@seereason.com> Wed, 23 May 2012 19:54:17 -0700++haskell-cabal-debian (1.21) unstable; urgency=low++ * fix conversion of wildcards into intersected ranges++ -- David Fox <dsf@seereason.com> Wed, 23 May 2012 19:51:34 -0700++haskell-cabal-debian (1.20) unstable; urgency=low++ * Fix generation of debian library dependencies from the Extra-Libraries+ field of the cabal file.++ -- David Fox <dsf@seereason.com> Wed, 23 May 2012 19:50:39 -0700++haskell-cabal-debian (1.19) unstable; urgency=low++ * Handle cabal equals dependencies.++ -- David Fox <dsf@seereason.com> Tue, 20 Mar 2012 14:34:58 -0700++haskell-cabal-debian (1.18) unstable; urgency=low++ * High level of confidence this time. Interesting new Interspersed+ class, and an implementation of invertVersionRanges which should be+ forwarded to the Cabal folks.+ * Removes dependency on logic-classes++ -- David Fox <dsf@seereason.com> Tue, 20 Mar 2012 08:17:25 -0700++haskell-cabal-debian (1.17) unstable; urgency=low++ * Restore code to downcase cabal package name before using it as the+ base of the debian package name.++ -- David Fox <dsf@seereason.com> Sun, 18 Mar 2012 15:32:04 -0700++haskell-cabal-debian (1.16) unstable; urgency=low++ * Remove code that implements a special case for the debian name of the+ haskell-src-exts package.++ -- David Fox <dsf@seereason.com> Sun, 18 Mar 2012 14:11:21 -0700++haskell-cabal-debian (1.15) unstable; urgency=low++ * Yet another stab at fixing the code for converting cabal dependencies+ to debian dependencies, with support for splitting version ranges of+ cabal files among different debian packages.++ -- David Fox <dsf@seereason.com> Fri, 16 Mar 2012 17:59:28 -0700++haskell-cabal-debian (1.14) unstable; urgency=low++ * Don't try to strip data files+ * Use permissions 644 for data files, not 755.++ -- David Fox <dsf@seereason.com> Wed, 07 Mar 2012 14:46:04 -0800++haskell-cabal-debian (1.13) unstable; urgency=low++ * Append the version number when constructing the directory for data+ files.++ -- David Fox <dsf@seereason.com> Wed, 07 Mar 2012 08:56:39 -0800++haskell-cabal-debian (1.12) unstable; urgency=low++ * Include any files listed in the Data-Files field of the cabal file+ in the utils package.++ -- David Fox <dsf@seereason.com> Tue, 06 Mar 2012 11:31:47 -0800++haskell-cabal-debian (1.11) unstable; urgency=low++ * Replace --epoch flag with --epoch-map, so we can specify epoch numbers+ for both the package being built and for dependency packages.++ -- David Fox <dsf@seereason.com> Thu, 09 Feb 2012 07:01:19 -0800++haskell-cabal-debian (1.10) unstable; urgency=low++ * Add bundled package list for ghc 7.4.1.++ -- David Fox <dsf@seereason.com> Sat, 04 Feb 2012 14:44:33 -0800++haskell-cabal-debian (1.9) unstable; urgency=low++ * Add --dep-map flag to allow mapping of cabal package names to the base+ of a debian package name. This modifies the name to which the prefix+ "lib" and the suffix "-dev" are added.+ * Fix dependency generation bug introduced in 1.8.++ -- David Fox <dsf@seereason.com> Mon, 23 Jan 2012 14:13:05 -0800++haskell-cabal-debian (1.8) unstable; urgency=low++ * Add a --dev-dep flag to make one or more packages install dependencies+ of the dev package.++ -- David Fox <dsf@seereason.com> Mon, 23 Jan 2012 05:00:46 -0800++haskell-cabal-debian (1.7) unstable; urgency=low++ * Add info about ghc 7.4.0 pre-release.++ -- David Fox <dsf@seereason.com> Wed, 11 Jan 2012 09:57:45 -0800++haskell-cabal-debian (1.6) unstable; urgency=low++ * Don't omit dependencies built into ghc, they should be satisfied by+ the Provides in the compiler if they are not available in the+ repository. However, we do need to make ghc an alterantive to any+ versioned dependencies that are bundled with the compiler, since the+ built in dependencies are virtual packages and thus unversioned.++ -- David Fox <dsf@seereason.com> Wed, 07 Dec 2011 06:10:17 -0800++haskell-cabal-debian (1.5) unstable; urgency=low++ * Fix the generation of build dependency version ranges by using an+ intermediate version range type.+ * If the version range for the cabal file touches two different debian+ package, don't try to write build dependencies that allow either one,+ it can't really be done. Just give the allowable versions of the+ newer package (e.g. libghc-parsec3-dev rather than libghc-parsec2-dev.)++ -- David Fox <dsf@seereason.com> Sun, 04 Dec 2011 05:59:25 -0800++haskell-cabal-debian (1.4) unstable; urgency=low++ * Add a --revision <suffix> flag which appends a (perhaps empty) string+ cabal version number to get the debian version number. Without this+ flag the string "-1~hackage1" is appended.+ * Make it an error to specify a debian version via --deb-version that is+ older than the current cabal version.++ -- David Fox <dsf@seereason.com> Sun, 20 Nov 2011 06:45:33 -0800++haskell-cabal-debian (1.3) unstable; urgency=low++ * Fix error message when compiler version is not in bundled package list.+ * Add bundled package list for compiler 7.0.4 (same as 7.0.3.)++ -- David Fox <dsf@seereason.com> Sat, 08 Oct 2011 07:58:19 -0700++haskell-cabal-debian (1.2) unstable; urgency=low++ * When computing the debian name from a package's cabal name, if we+ have no particular version number we are comparing to, use the name+ from the version split that corresponds to newer version numbers.+ * Add code to make the cabal package haskell-src-exts map to the debian+ packages libghc-src-exts-dev etc. Normally it would map to+ libghc-haskell-src-exts-dev.++ -- David Fox <dsf@seereason.com> Thu, 06 Oct 2011 09:27:02 -0700++haskell-cabal-debian (1.1) unstable; urgency=low++ * Use propositional logic package to compute normal form for dependencies+ * Make sure to correct format of cabal package synopsis before using as debian+ package description.++ -- David Fox <dsf@seereason.com> Fri, 30 Sep 2011 06:16:34 -0700++haskell-cabal-debian (1.0) unstable; urgency=low++ * Debianization generated by cabal-debian++ -- David Fox <dsf@seereason.com> Sun, 18 Sep 2011 06:40:21 -0700
src/Debian/Debianize.hs view
@@ -101,7 +101,8 @@ VersionSplits.hs -} module Debian.Debianize- ( Debian.Debianize.Finalize.debianization+ ( Debian.Debianize.Finalize.debianize+ , Debian.Debianize.Finalize.finalizeDebianization , Debian.Debianize.Output.doDebianizeAction , Debian.Debianize.Output.runDebianizeScript@@ -121,7 +122,6 @@ , Debian.Debianize.Input.inputDebianization , Debian.Debianize.Input.inputDebianizationFile , Debian.Debianize.Input.inputChangeLog- , Debian.Debianize.Input.inputMaintainer -- * Deb monad - 'Debian.Debianize.Monad' , DebT, runDebT, execDebT, evalDebT, DebM, runDebM, execDebM, evalDebM@@ -149,24 +149,13 @@ , module Debian.Debianize.Types , module Debian.Debianize.Types.Atoms , module Debian.Policy-{-- , module Debian.Debianize.Bundled- , module Debian.Debianize.ControlFile- , module Debian.Debianize.Files- , module Debian.Debianize.Finalize- , module Debian.Debianize.Interspersed- , module Debian.Debianize.VersionSplits--} ) where --- import Debian.Debianize.Bundled import Debian.Debianize.DebianName import Debian.Debianize.Details--- import Debian.Debianize.Files import Debian.Debianize.Finalize import Debian.Debianize.Goodies import Debian.Debianize.Input--- import Debian.Debianize.Interspersed import Debian.Debianize.Monad import Debian.Debianize.Prelude import Debian.Debianize.Types@@ -174,5 +163,4 @@ import Debian.Debianize.Options import Debian.Debianize.Output import Debian.Debianize.SubstVars--- import Debian.Debianize.VersionSplits import Debian.Policy
src/Debian/Debianize/Files.hs view
@@ -16,9 +16,8 @@ import Data.Maybe import Data.Monoid ((<>), mempty) import Data.Set as Set (toList, member, fold)-import Data.Text as Text (Text, pack, unpack, lines, unlines, null, intercalate, dropWhile, dropWhileEnd)+import Data.Text as Text (Text, pack, unpack, lines, unlines, null, intercalate, dropWhile, dropWhileEnd, strip) import Debian.Control (Control'(Control, unControl), Paragraph'(Paragraph), Field'(Field))-import Debian.Debianize.Goodies (makeRulesHead) import Debian.Debianize.Monad (DebT) import Debian.Debianize.Prelude (showDeps') import qualified Debian.Debianize.Types.Atoms as T@@ -139,9 +138,11 @@ rules :: (Monad m, Functor m) => FilesT m [(FilePath, Text)] rules =- do rh <- lift (access T.rulesHead) >>= maybe (lift makeRulesHead) return+ do Just rh <- lift (access T.rulesHead)+ rassignments <- lift (access T.rulesSettings) >>= return . intercalate "\n"+ rincludes <- lift (access T.rulesIncludes) >>= return . intercalate "\n" rl <- (reverse . Set.toList) <$> lift (access T.rulesFragments)- return [("debian/rules", Text.unlines (rh : rl))]+ return [("debian/rules", intercalate "\n\n" (filter (not . Text.null) (List.map strip (rh : rassignments : rincludes : rl))) <> "\n")] changelog :: (Monad m, Functor m) => FilesT m [(FilePath, Text)] changelog =@@ -180,9 +181,9 @@ depField "Build-Conflicts-Indep" (getL S.buildConflictsIndep src) ++ mField "Standards-Version" (getL S.standardsVersion src) ++ mField "Homepage" (getL S.homepage src) ++- mField "X-Description" (getL S.xDescription src) ++ List.map vcsField (Set.toList (getL S.vcsFields src)) ++- List.map xField (Set.toList (getL S.xFields src))) :+ List.map xField (Set.toList (getL S.xFields src)) +++ mField "X-Description" (getL S.xDescription src)) : List.map binary (getL S.binaryPackages src)) } where
src/Debian/Debianize/Finalize.hs view
@@ -1,8 +1,8 @@ -- | Compute the debianization of a cabal package. {-# LANGUAGE CPP, FlexibleInstances, OverloadedStrings, ScopedTypeVariables #-} module Debian.Debianize.Finalize- ( debianization- , finalizeDebianization' -- external use deprecated - used in test script+ ( debianize+ , finalizeDebianization -- external use deprecated - used in test script ) where import Control.Applicative ((<$>))@@ -12,11 +12,12 @@ import Control.Monad.State (get, modify) import Control.Monad.Trans (liftIO, MonadIO) import Data.ByteString.Lazy.UTF8 (fromString)+import Data.Char (toLower) import Data.Digest.Pure.MD5 (md5) import Data.Lens.Lazy (access, getL) import Data.List as List (intercalate, map, nub, unlines) import Data.Map as Map (delete, elems, lookup, Map, toList, insertWith)-import Data.Maybe (fromMaybe, isJust)+import Data.Maybe (fromMaybe, isJust, isNothing) import Data.Monoid ((<>), mempty) import Data.Set as Set (difference, filter, fromList, map, null, Set, singleton, toList, union, unions, fold) import Data.Set.Extra as Set (mapM_)@@ -26,33 +27,35 @@ import Debian.Debianize.Changelog (dropFutureEntries) import Debian.Debianize.DebianName (debianName, debianNameBase) import Debian.Debianize.Goodies (backupAtoms, describe, execAtoms, serverAtoms, siteAtoms, watchAtom)-import Debian.Debianize.Input (dataDir, inputCabalization, inputChangeLog, inputMaintainer)+import Debian.Debianize.Input (dataDir, inputCabalization, inputChangeLog) import Debian.Debianize.Monad as Monad (DebT) import Debian.Debianize.Options (compileCommandlineArgs, compileEnvironmentArgs) import Debian.Debianize.Prelude ((%=), (+=), fromEmpty, fromSingleton, (~=), (~?=))-import qualified Debian.Debianize.Types as T (apacheSite, backups, binaryArchitectures, binaryPackages, binarySection, breaks, buildDepends, buildDependsIndep, buildDir, builtUsing, changelog, comments, compat, conflicts, debianDescription, debVersion, depends, epochMap, executable, extraDevDeps, extraLibMap, file, install, installCabalExec, installData, installDir, installTo, intermediateFiles, link, maintainer, noDocumentationLibrary, noProfilingLibrary, omitProfVersionDeps, packageDescription, packageType, preDepends, provides, recommends, replaces, revision, rulesFragments, serverInfo, standardsVersion, source, sourceFormat, sourcePackageName, sourcePriority, sourceSection, suggests, utilsPackageNameBase, verbosity, watch, website, control, homepage, official, vcsFields)-import qualified Debian.Debianize.Types.Atoms as A (InstallFile(execName, sourceDir), showAtoms, compilerFlavors, Atom(..), atomSet)+import qualified Debian.Debianize.Types as T (apacheSite, backups, binaryArchitectures, binaryPackages, binarySection, breaks, buildDepends, buildDependsIndep, buildDir, builtUsing, changelog, comments, compat, conflicts, debianDescription, debVersion, depends, epochMap, executable, extraDevDeps, extraLibMap, file, install, installCabalExec, installData, installDir, installTo, intermediateFiles, link, maintainerOption, uploadersOption, noDocumentationLibrary, noProfilingLibrary, omitProfVersionDeps, packageDescription, packageType, preDepends, provides, recommends, replaces, revision, rulesFragments, serverInfo, standardsVersion, source, sourceFormat, sourcePackageName, sourcePriority, sourceSection, suggests, utilsPackageNameBase, verbosity, watch, website, control, homepage, official, vcsFields)+import qualified Debian.Debianize.Types.Atoms as A (InstallFile(execName, sourceDir), showAtoms, compilerFlavors, Atom(..), atomSet, rulesHead, rulesSettings, rulesIncludes) import qualified Debian.Debianize.Types.BinaryDebDescription as B (BinaryDebDescription, package, PackageType(Development, Documentation, Exec, Profiling, Source, HaskellSource, Utilities), PackageType)-import qualified Debian.Debianize.Types.SourceDebDescription as S (xDescription, VersionControlSpec(..))+import qualified Debian.Debianize.Types.SourceDebDescription as S (xDescription, VersionControlSpec(..), maintainer, uploaders) import Debian.Debianize.VersionSplits (DebBase(DebBase)) import Debian.Orphans () import Debian.Pretty (ppDisplay, PP(..))-import Debian.Policy (getDebhelperCompatLevel, haskellMaintainer, PackageArchitectures(Any, All), PackagePriority(Extra), Section(..), SourceFormat(Quilt3), parseStandardsVersion)+import Debian.Policy (getDebhelperCompatLevel, getCurrentDebianUser, haskellMaintainer, PackageArchitectures(Any, All), PackagePriority(Extra), parseMaintainer, Section(..), SourceFormat(Native3, Quilt3), parseStandardsVersion) import Debian.Relation (BinPkgName, BinPkgName(BinPkgName), SrcPkgName(SrcPkgName), Relation(Rel), Relations) import qualified Debian.Relation as D (BinPkgName(BinPkgName), Relation(..)) import Debian.Release (parseReleaseName) import Debian.Time (getCurrentLocalRFC822Time) import Debian.Version (buildDebianVersion, DebianVersion, parseDebianVersion)+import Debug.Trace (trace) import Distribution.Compiler (CompilerFlavor(GHC)) #if MIN_VERSION_Cabal(1,21,0) import Distribution.Compiler (CompilerFlavor(GHCJS)) #endif import Distribution.Package (Dependency(..), PackageIdentifier(..), PackageName(PackageName)) import Distribution.PackageDescription (PackageDescription)-import Distribution.PackageDescription as Cabal (allBuildInfo, BuildInfo(buildable, extraLibs), Executable(buildInfo, exeName))+import Distribution.PackageDescription as Cabal (allBuildInfo, BuildInfo(buildable, extraLibs), Executable(buildInfo, exeName), maintainer, author) import qualified Distribution.PackageDescription as Cabal (PackageDescription(dataDir, dataFiles, executables, library, package)) import Prelude hiding (init, log, map, unlines, unlines, writeFile, (.)) import System.FilePath ((</>), (<.>), makeRelative, splitFileName, takeDirectory, takeFileName)+import Text.ParserCombinators.Parsec.Rfc2822 (NameAddr(..)) import Text.PrettyPrint.HughesPJClass (Pretty(pPrint)) -- | Given an Atoms value, get any additional configuration@@ -60,23 +63,21 @@ -- description and possibly the debian/changelog file, then generate -- and return the new debianization (along with the data directory -- computed from the cabal package description.)-debianization :: (MonadIO m, Functor m) => DebT m () -> DebT m () -> DebT m ()-debianization init customize =+debianize :: (MonadIO m, Functor m) => DebT m () -> DebT m ()+debianize customize = do compileEnvironmentArgs compileCommandlineArgs inputCabalization inputChangeLog- inputMaintainer- init customize- finalizeDebianization'+ finalizeDebianization -- | Do some light IO and call finalizeDebianization.-finalizeDebianization' :: (MonadIO m, Functor m) => DebT m ()-finalizeDebianization' =+finalizeDebianization :: (MonadIO m, Functor m) => DebT m ()+finalizeDebianization = do date <- liftIO getCurrentLocalRFC822Time debhelperCompat <- liftIO getDebhelperCompatLevel- finalizeDebianization date debhelperCompat+ finalizeDebianization' date debhelperCompat access T.verbosity >>= \ vb -> when (vb >= 3) (get >>= liftIO . A.showAtoms) -- | Now that we know the build and data directories, we can expand@@ -87,8 +88,8 @@ -- this function is not idempotent. (Exported for use in unit tests.) -- FIXME: we should be able to run this without a PackageDescription, change -- paramter type to Maybe PackageDescription and propagate down thru code-finalizeDebianization :: (MonadIO m, Functor m) => String -> Maybe Int -> DebT m ()-finalizeDebianization date debhelperCompat =+finalizeDebianization' :: (MonadIO m, Functor m) => String -> Maybe Int -> DebT m ()+finalizeDebianization' date debhelperCompat = do -- In reality, hcs must be a singleton or many things won't work. But some day... hcs <- Set.toList <$> access A.compilerFlavors finalizeSourceName B.HaskellSource@@ -102,6 +103,7 @@ T.compat ~?= debhelperCompat finalizeChangelog date finalizeControl+ finalizeRules -- T.license ~?= Just (Cabal.license pkgDesc) expandAtoms -- Create the binary packages for the web sites, servers, backup packges, and other executables@@ -155,12 +157,19 @@ Nothing -> do let ver = ppDisplay (pkgVersion pkgId) rev <- access T.revision- let revMB = case rev of Nothing -> Nothing+ let rev' = case rev of Nothing -> Nothing Just "" -> Nothing Just "-" -> Nothing Just ('-':r) -> Just r Just _ -> error "The Debian revision needs to start with a dash"- return $ buildDebianVersion epoch ver revMB+ fmt <- access T.sourceFormat+ -- If no revision number has been set and the format+ -- is not Native3 we need to set it (see+ -- https://github.com/ddssff/cabal-debian/issues/16)+ let rev'' = maybe (case fmt of+ Just Native3 -> Nothing+ _ -> Just "1") Just rev'+ return $ buildDebianVersion epoch ver rev'' -- | Return the Debian epoch number assigned to the given cabal -- package - the 1 in version numbers like 1:3.5-2.@@ -178,17 +187,74 @@ B.Source -> debName _ -> error $ "finalizeSourceName: " ++ show typ)) -finalizeMaintainer :: Monad m => DebT m ()-finalizeMaintainer =- T.maintainer ~?= Just haskellMaintainer+-- | Try to compute a string for the the debian "Maintainer:" and+-- "Uploaders:" fields using, in this order+-- 1. the Debian Haskell Group, @pkg-haskell-maintainers\@lists.alioth.debian.org@,+-- if --official is set+-- 2. the maintainer explicitly specified using "Debian.Debianize.Monad.maintainer"+-- 3. the maintainer field of the cabal package, but only if --official is not set,+-- 4. the value returned by getDebianMaintainer, which looks in several environment variables,+-- 5. the signature from the latest entry in debian/changelog,+-- 6. the Debian Haskell Group, @pkg-haskell-maintainers\@lists.alioth.debian.org@+-- <http://www.debian.org/doc/debian-policy/ch-controlfields.html#s-f-Maintainer>+-- <http://www.debian.org/doc/debian-policy/ch-controlfields.html#s-f-Uploaders>+finalizeMaintainer :: MonadIO m => DebT m ()+finalizeMaintainer = do+ o <- access T.official+ currentUser <- liftIO getCurrentDebianUser+ Just pkgDesc <- access T.packageDescription+ maintainerOption <- access T.maintainerOption+ uploadersOption <- access T.uploadersOption+ let cabalAuthorString = takeWhile (\ c -> c /= ',' && c /= '\n') (Cabal.author pkgDesc)+ cabalMaintainerString = takeWhile (\ c -> c /= ',' && c /= '\n') (Cabal.maintainer pkgDesc)+ cabalMaintainerString' = cabalAuthorString <> " <" <> cabalMaintainerString <> ">"+ cabalMaintainerString'' = cabalAuthorString <> " " <> cabalMaintainerString+ changelogSignature <-+ do log <- get >>= return . getL T.changelog+ case log of+ Just (ChangeLog (entry : _)) ->+ case (parseMaintainer (logWho entry)) of+ Left _e -> return $ Nothing -- Just $ NameAddr (Just "Invalid signature in changelog") (show e)+ Right x -> return (Just x)+ _ -> return Nothing+ case o of+ True -> do+ (S.maintainer . T.control) ~= Just haskellMaintainer+ (S.uploaders . T.control) %= whenEmpty (maybe [] (: []) currentUser)+ False -> do+ (S.maintainer . T.control) ~?= maintainerOption+ (S.maintainer . T.control) ~?= (either (const Nothing) Just $ parseMaintainer cabalMaintainerString)+ (S.maintainer . T.control) ~?= (either (const Nothing) Just $ parseMaintainer cabalMaintainerString')+ (S.maintainer . T.control) ~?= (either (const Nothing) Just $ parseMaintainer cabalMaintainerString'')+ -- Sometimes the maintainer is just an email, if it matches the author's email we can use it+ (S.maintainer . T.control) ~?= (case parseMaintainer cabalAuthorString of+ Right x | nameAddr_addr x == cabalMaintainerString -> Just x+ _ -> Nothing)+ -- Sometimes the maintainer is just an email, try combining it with the author's name+ (S.maintainer . T.control) ~?= (case parseMaintainer cabalAuthorString of+ Right (NameAddr {nameAddr_name = Just name}) -> either (const Nothing) Just (parseMaintainer (name ++ " <" ++ cabalMaintainerString ++ ">"))+ _ -> Nothing)+ (S.maintainer . T.control) ~?= currentUser+ (S.maintainer . T.control) ~?= changelogSignature+ x <- access (S.maintainer . T.control)+ when (isNothing x) + (do liftIO $ putStrLn ("Unable to construct a debian maintainer, using nobody <nobody@nowhere>. Cabal maintainer strings tried:\n " +++ show cabalMaintainerString ++ ", " ++ show cabalMaintainerString' ++ ", " ++ show cabalMaintainerString'' +++ ", currentUser: " ++ show currentUser)+ return ())+ (S.maintainer . T.control) ~?= (either (const Nothing) Just $ parseMaintainer "nobody <nobody@nowhere>")+ (S.uploaders . T.control) %= whenEmpty uploadersOption -finalizeControl :: (Monad m, Functor m) => DebT m ()+-- | If l is the empty list return d, otherwise return l.+whenEmpty :: [a] -> [a] -> [a]+whenEmpty d [] = d+whenEmpty _ l = l++finalizeControl :: (MonadIO m, Functor m) => DebT m () finalizeControl = do finalizeMaintainer Just src <- access T.sourcePackageName- maint <- access T.maintainer >>= return . fromMaybe (error "No maintainer") T.source ~= Just src- T.maintainer ~= Just maint desc <- describe (S.xDescription . T.control) ~?= Just desc -- control %= (\ y -> y { D.source = Just src, D.maintainer = Just maint })@@ -197,15 +263,16 @@ -- source package name implied by the debianization. This means -- either adding an entry or modifying the latest entry (if its -- version number is the exact one in our debianization.)-finalizeChangelog :: (Monad m, Functor m) => String -> DebT m ()+finalizeChangelog :: (MonadIO m, Functor m) => String -> DebT m () finalizeChangelog date = do finalizeMaintainer ver <- debianVersion src <- access T.sourcePackageName- Just maint <- access T.maintainer+ Just debianMaintainer <- access (S.maintainer . T.control)+ -- pkgDesc <- access T.packageDescription >>= return . maybe Nothing (either Nothing Just . parseMaintainer . Cabal.maintainer) cmts <- access T.comments T.changelog %= fmap (dropFutureEntries ver)- T.changelog %= fixLog src ver cmts maint+ T.changelog %= fixLog src ver cmts debianMaintainer where -- Ensure that the package name is correct in the first log entry. fixLog src ver cmts _maint (Just (ChangeLog (entry : older))) | logVersion entry == ver =@@ -330,9 +397,9 @@ desc :: Text desc = Text.intercalate "\n " ["${haskell:ShortDescription}${haskell:ShortBlurb}",- " ${haskell:LongDescription}",- " .",- " ${haskell:Blurb}"]+ "${haskell:LongDescription}",+ ".",+ "${haskell:Blurb}"] -- | Make sure all data and executable files are assigned to at least -- one binary package and make sure all binary packages are in the@@ -518,6 +585,19 @@ expandExecutable = do mp <- get >>= return . getL T.executable List.mapM_ (\ (b, f) -> modify (execAtoms b f)) (Map.toList mp)++-- | Add the normal default values to the rules files.+finalizeRules :: (Monad m) => DebT m ()+finalizeRules =+ do DebBase b <- debianNameBase+ compilers <- access A.compilerFlavors+ A.rulesHead ~?= Just "#!/usr/bin/make -f"+ A.rulesSettings %= (++ ["DEB_CABAL_PACKAGE = " <> pack b])+ A.rulesSettings %= (++ (case Set.toList compilers of+ [x] -> ["DEB_DEFAULT_COMPILER = " <> pack (List.map toLower (show x))]+ _ -> []))+ A.rulesIncludes %= (++ ["include /usr/share/cdbs/1/rules/debhelper.mk",+ "include /usr/share/cdbs/1/class/hlibrary.mk"]) data Dependency_ = BuildDepends Dependency
src/Debian/Debianize/Goodies.hs view
@@ -16,23 +16,20 @@ , serverAtoms , backupAtoms , execAtoms- , makeRulesHead ) where -import Data.Char (toLower, isSpace)+import Data.Char (isSpace) import Data.Lens.Lazy (modL, access) import Data.List as List (map, intersperse, intercalate, dropWhileEnd) import Data.Map as Map (insertWith) import Data.Maybe (fromMaybe) import Data.Monoid ((<>))-import Data.Set as Set (insert, union, singleton, toList)+import Data.Set as Set (insert, union, singleton) import Data.Text as Text (Text, pack, unlines)-import Debian.Debianize.DebianName (debianNameBase) import Debian.Debianize.Monad (Atoms, DebT, execDebM) import Debian.Debianize.Prelude (stripWith, (%=), (+=), (++=), (+++=)) import qualified Debian.Debianize.Types as T import qualified Debian.Debianize.Types.Atoms as T-import Debian.Debianize.VersionSplits (DebBase(DebBase)) import Debian.Orphans () import Debian.Pretty (ppDisplay, ppDisplay') import Debian.Policy (apacheLogDirectory, apacheErrorLog, apacheAccessLog, databaseDirectory, serverAppLog, serverAccessLog)@@ -354,25 +351,3 @@ (Just s, False) -> execDebM (T.installTo b (s </> execName') (d </> destName')) r where d = fromMaybe "usr/bin" destDir'---- | Build a suitable value for the head of the rules file.-makeRulesHead :: (Monad m, Functor m) => DebT m Text-makeRulesHead =- do DebBase b <- debianNameBase- compilers <- access T.compilerFlavors- let ls = ["DEB_CABAL_PACKAGE = " <> pack b] ++- -- If there is a single entry in the compiler list we- -- can tell debian/rules what compiler to use,- -- otherwise it has to figure this out from the- -- package names in debian/control. This is required- -- to build a package without a library.- (case toList compilers of- [x] -> ["DEB_DEFAULT_COMPILER = " <> pack (map toLower (show x))]- _ -> []) ++- [""]- return $- Text.unlines $- ["#!/usr/bin/make -f", ""] ++- ls ++- ["include /usr/share/cdbs/1/rules/debhelper.mk",- "include /usr/share/cdbs/1/class/hlibrary.mk"]
src/Debian/Debianize/Input.hs view
@@ -7,7 +7,6 @@ , inputChangeLog , inputCabalization , inputCabalization'- , inputMaintainer , dataDir ) where @@ -18,19 +17,19 @@ --import Control.DeepSeq (NFData, force) import Control.Exception (bracket) import Control.Monad (when, filterM)-import Control.Monad.State (get, put)+import Control.Monad.State (put) import Control.Monad.Trans (MonadIO, liftIO) import Data.Char (isSpace, toLower)-import Data.Lens.Lazy (getL, setL, modL, access)+import Data.Lens.Lazy (setL, modL, access) import Data.Maybe (fromMaybe, mapMaybe)+import Data.Monoid ((<>)) import Data.Set as Set (Set, toList, fromList, insert, singleton) import Data.Text (Text, unpack, pack, lines, words, break, strip, null) import Data.Text.IO (readFile) --import Data.Version (showVersion, Version(Version))-import Debian.Changes (ChangeLog(..), ChangeLogEntry(logWho), parseChangeLog)+import Debian.Changes (parseChangeLog) import Debian.Control (Control'(unControl), Paragraph'(..), stripWS, parseControlFromFile, Field, Field'(..), ControlFunctions)-import qualified Debian.Debianize.Types as T (maintainer, official)-import qualified Debian.Debianize.Types.Atoms as T (changelog, makeAtoms, compilerFlavors)+import qualified Debian.Debianize.Types.Atoms as T (makeAtoms, compilerFlavors) import Debian.Debianize.Types.BinaryDebDescription (BinaryDebDescription, newBinaryDebDescription) import qualified Debian.Debianize.Types.BinaryDebDescription as B import Debian.Debianize.Types.CopyrightDescription (readCopyrightDescription, CopyrightDescription(..), FilesOrLicenseDescription(..))@@ -45,7 +44,7 @@ import Debian.GHC (newestAvailableCompilerId) import Debian.Orphans () import Debian.Policy (Section(..), parseStandardsVersion, readPriority, readSection, parsePackageArchitectures, parseMaintainer,- parseUploaders, readSourceFormat, getDebianMaintainer, haskellMaintainer, fromCabalLicense)+ parseUploaders, readSourceFormat, fromCabalLicense) import Debian.Relation (Relations, BinPkgName(..), SrcPkgName(..), parseRelations) --import Debian.Version (DebianVersion, parseDebianVersion) import Distribution.Compiler (CompilerId)@@ -53,7 +52,7 @@ import Distribution.Compiler (unknownCompilerInfo, AbiTag(NoAbiTag)) #endif import Distribution.Package (Package(packageId), PackageIdentifier(..), PackageName(PackageName), Dependency)-import qualified Distribution.PackageDescription as Cabal (PackageDescription(maintainer, package, license, copyright {-, synopsis, description-}))+import qualified Distribution.PackageDescription as Cabal (PackageDescription(package, license, copyright {-, synopsis, description-})) #if MIN_VERSION_Cabal(1,19,0) import qualified Distribution.PackageDescription as Cabal (PackageDescription(licenseFiles)) #else@@ -231,7 +230,7 @@ inputAtoms _ path | elem path ["control"] = return () inputAtoms debian name@"source/format" = liftIO (readFile (debian </> name)) >>= \ text -> either (warning +=) ((sourceFormat ~=) . Just) (readSourceFormat text) inputAtoms debian name@"watch" = liftIO (readFile (debian </> name)) >>= \ text -> watch ~= Just text-inputAtoms debian name@"rules" = liftIO (readFile (debian </> name)) >>= \ text -> rulesHead ~= (Just text)+inputAtoms debian name@"rules" = liftIO (readFile (debian </> name)) >>= \ text -> rulesHead ~= (Just $ strip text <> "\n") inputAtoms debian name@"compat" = liftIO (readFile (debian </> name)) >>= \ text -> compat ~= Just (read' (\ s -> error $ "compat: " ++ show s) (unpack text)) inputAtoms debian name@"copyright" = liftIO (readFile (debian </> name)) >>= \ text -> copyright ~= readCopyrightDescription text inputAtoms debian name@"changelog" =@@ -353,36 +352,6 @@ -- chroot :: NFData a => FilePath -> IO a -> IO a -- chroot "/" task = task -- chroot root task = useEnv root (return . force) task---- | Try to compute a string for the the debian "Maintainer:" field using, in this order--- 1. the Debian Haskell Group, @pkg-haskell-maintainers\@lists.alioth.debian.org@,--- if --official is set--- 2. the maintainer explicitly specified using "Debian.Debianize.Monad.maintainer"--- 3. the maintainer field of the cabal package, but only if --official is not set,--- 4. the value returned by getDebianMaintainer, which looks in several environment variables,--- 5. the signature from the latest entry in debian/changelog,--- 6. the Debian Haskell Group, @pkg-haskell-maintainers\@lists.alioth.debian.org@-inputMaintainer :: MonadIO m => DebT m ()-inputMaintainer =- do Just pkgDesc <- access packageDescription- let cabalMaintainer = case Cabal.maintainer pkgDesc of- "" -> Nothing- x -> either (const Nothing) Just (parseMaintainer (takeWhile (\ c -> c /= ',' && c /= '\n') x))- o <- access T.official- when o $ T.maintainer ~?= Just haskellMaintainer-- T.maintainer ~?= cabalMaintainer- debianMaintainer <- liftIO getDebianMaintainer- T.maintainer ~?= debianMaintainer- changelogMaintainer <-- do log <- get >>= return . getL T.changelog- case log of- Just (ChangeLog (entry : _)) ->- case (parseMaintainer (logWho entry)) of- Left _e -> return $ Nothing -- Just $ NameAddr (Just "Invalid signature in changelog") (show e)- Right x -> return (Just x)- _ -> return Nothing- T.maintainer ~?= changelogMaintainer -- | Compute the Cabal data directory for a Linux install from a Cabal -- package description. This needs to match the path cabal assigns to
src/Debian/Debianize/Options.hs view
@@ -18,10 +18,10 @@ import Debian.Debianize.Prelude (read', maybeRead, (+=), (~=), (%=), (++=), (+++=)) import Debian.Debianize.Types (verbosity, dryRun, debAction, noDocumentationLibrary, noProfilingLibrary,- missingDependencies, sourcePackageName, overrideDebianNameBase, cabalFlagAssignments, maintainer, buildDir, omitProfVersionDeps, omitLTDeps,+ missingDependencies, sourcePackageName, overrideDebianNameBase, cabalFlagAssignments, maintainerOption, uploadersOption, buildDir, omitProfVersionDeps, omitLTDeps, sourceFormat, buildDepends, buildDependsIndep, extraDevDeps, depends, conflicts, replaces, provides, recommends, suggests, extraLibMap, debVersion, revision, epochMap, execMap, utilsPackageNameBase,- standardsVersion, official)+ standardsVersion, official, sourceSection) import Debian.Debianize.Types.Atoms (Atoms, EnvSet(..), InstallFile(..), DebAction(..), setBuildEnv, compilerFlavors) import Debian.Debianize.VersionSplits (DebBase(DebBase)) import Debian.Orphans ()@@ -41,6 +41,7 @@ import Text.Read (readMaybe) import Text.Regex.TDFA ((=~)) +-- | Apply a list of command line arguments to the monadic state. compileArgs :: MonadIO m => [String] -> DebT m () compileArgs args = case getOpt' RequireOrder options args of@@ -49,9 +50,13 @@ ", Unrecognized: " ++ show unk ++ ", Non-Options: " ++ show non) +-- | Get a list of arguments from the CABALDEBIAN environment variable+-- and apply them to the monadic state. compileEnvironmentArgs :: MonadIO m => DebT m () compileEnvironmentArgs = withEnvironmentArgs compileArgs +-- | Get the list of command line arguments and apply them to the+-- monadic state. compileCommandlineArgs :: MonadIO m => DebT m () compileCommandlineArgs = liftIO getArgs >>= compileArgs @@ -99,11 +104,15 @@ (unlines [ "Use this name for the debian source package, the name in the Source field at the top of the" , "debian control file, and also at the very beginning of the debian/changelog file. By default" , "this is haskell-<cabalname>, where the cabal package name is downcased."]),+ Option "" ["source-section"] (ReqArg (\ name -> sourceSection ~= Just (read name)) "NAME")+ "Set the Section: field of the Debian source package.", Option "" ["disable-library-profiling"] (NoArg (noProfilingLibrary ~= True)) (unlines [ "Don't generate profiling (-prof) library packages. This has been used in one case" , "where the package code triggered a compiler bug."]),- Option "" ["maintainer"] (ReqArg (\ maint -> either (error ("Invalid maintainer string: " ++ show maint)) ((maintainer ~=) . Just) (parseMaintainer maint)) "Maintainer Name <email addr>")- (unlines [ "Override the Maintainer name and email given in $DEBEMAIL or $EMAIL or $DEBFULLNAME or $FULLNAME"]),+ Option "" ["maintainer"] (ReqArg (\ s -> either (error ("Invalid maintainer string: " ++ show s)) ((maintainerOption ~=) . Just) (parseMaintainer s)) "Maintainer Name <email addr>")+ (unlines [ "Supply a value for the Maintainer field. Final value is computed from several inputs."]),+ Option "" ["uploader"] (ReqArg (\ s -> either (error ("Invalid uploader string: " ++ show s)) (\ x -> uploadersOption %= (\ l -> l ++ [x])) (parseMaintainer s)) "Uploader Name <email addr>")+ (unlines [ "Add one entry to the uploader list"]), Option "" ["standards-version"] (ReqArg (\ sv -> standardsVersion ~= Just (parseStandardsVersion sv)) "VERSION") "Claim compatibility to this version of the Debian policy (i.e. the value of the Standards-Version field)", Option "" ["build-dep"]
src/Debian/Debianize/Output.hs view
@@ -32,7 +32,7 @@ import Debian.Debianize.Options (putEnvironmentArgs) import Debian.Debianize.Prelude (indent, replaceFile, zipMaps) import qualified Debian.Debianize.Types as T-import qualified Debian.Debianize.Types.BinaryDebDescription as B (package)+import Debian.Debianize.Types.BinaryDebDescription as B (package, canonical) import qualified Debian.Debianize.Types.SourceDebDescription as S (source) import Debian.Pretty (ppPrint, ppDisplay) import Prelude hiding (unlines, writeFile, (.))@@ -106,8 +106,8 @@ -- describing the differences. compareDebianization :: Atoms -> Atoms -> IO String compareDebianization old new =- do oldFiles <- evalDebT debianizationFileMap old- newFiles <- evalDebT debianizationFileMap new+ do oldFiles <- evalDebT debianizationFileMap (canonical old)+ newFiles <- evalDebT debianizationFileMap (canonical new) return $ concat $ Map.elems $ zipMaps doFile oldFiles newFiles where doFile :: FilePath -> Maybe Text -> Maybe Text -> Maybe String
src/Debian/Debianize/Types.hs view
@@ -22,7 +22,10 @@ , overrideDebianNameBase , revision , debVersion- , maintainer+ , debianMaintainer+ , debianUploaders+ , maintainerOption+ , uploadersOption , copyright , sourceArchitectures , sourcePriority@@ -33,6 +36,8 @@ , comments , standardsVersion , rulesHead+ , rulesSettings+ , rulesIncludes , rulesFragments , official , noProfilingLibrary@@ -187,11 +192,11 @@ builtUsing :: BinPkgName -> Lens Atoms Relations builtUsing b = B.builtUsing . B.relations . binaryDebDescription b --- | Maintainer field. Overrides any value found in the cabal file, or--- in the DEBIANMAINTAINER environment variable.--- <http://www.debian.org/doc/debian-policy/ch-controlfields.html#s-f-Maintainer>-maintainer :: Lens Atoms (Maybe NameAddr)-maintainer = S.maintainer . control+debianMaintainer :: Lens Atoms (Maybe NameAddr)+debianMaintainer = S.maintainer . control++debianUploaders :: Lens Atoms [NameAddr]+debianUploaders = S.uploaders . control -- | The architectures supported by a binary package binaryArchitectures :: BinPkgName -> Lens Atoms (Maybe PackageArchitectures)
src/Debian/Debianize/Types/Atoms.hs view
@@ -27,6 +27,7 @@ import Data.Text (Text) import Debian.Changes (ChangeLog) import Debian.Debianize.Types.CopyrightDescription+import Debian.Debianize.Types.BinaryDebDescription (Canonical(canonical)) import qualified Debian.Debianize.Types.SourceDebDescription as S import Debian.Debianize.VersionSplits (VersionSplits, DebBase) import Debian.Orphans ()@@ -110,7 +111,8 @@ -- version 0.3.0.0-1build3, we need to specify -- debVersion="0.3.0.0-1build3" or the version we produce will -- look older than the one already available upstream.- , maintainerOld_ :: Maybe NameAddr+ , maintainerOption_ :: Maybe NameAddr+ , uploadersOption_ :: [NameAddr] -- ^ Value for the maintainer field in the control file. Note that -- the cabal maintainer field can have multiple addresses, but debian -- only one. If this is not explicitly set, it is obtained from the@@ -128,6 +130,8 @@ , intermediateFiles_ :: Set (FilePath, Text) -- ^ Put this text into a file with the given name in the debianization. , rulesHead_ :: Maybe Text+ , rulesSettings_ :: [Text]+ , rulesIncludes_ :: [Text] -- ^ The header of the debian/rules file. The remainder is assembled -- from DebRulesFragment values in the atom list. , rulesFragments_ :: Set Text@@ -232,6 +236,9 @@ -- ^ Whether this packaging is created by the Debian Haskell Group } deriving (Eq, Show, Data, Typeable) +instance Canonical Atoms where+ canonical x = x {control_ = canonical (control_ x)}+ data Atom = Link BinPkgName FilePath FilePath -- ^ Create a symbolic link in the binary package@@ -286,12 +293,15 @@ , overrideDebianNameBase_ = Nothing , revision_ = Nothing , debVersion_ = Nothing- , maintainerOld_ = Nothing+ , maintainerOption_ = Nothing+ , uploadersOption_ = [] , cabalFlagAssignments_ = mempty , sourceFormat_ = Nothing , watch_ = Nothing , intermediateFiles_ = mempty , rulesHead_ = Nothing+ , rulesSettings_ = mempty+ , rulesIncludes_ = mempty , rulesFragments_ = mempty , warning_ = mempty , utilsPackageNameBase_ = Nothing@@ -470,6 +480,12 @@ execMap :: Lens Atoms (Map String Relations) execMap = lens execMap_ (\ a b -> b {execMap_ = a}) +maintainerOption :: Lens Atoms (Maybe NameAddr)+maintainerOption = lens maintainerOption_ (\ a b -> b {maintainerOption_ = a})++uploadersOption :: Lens Atoms [NameAddr]+uploadersOption = lens uploadersOption_ (\ a b -> b {uploadersOption_ = a})+ -- | Cabal flag assignments to use when loading the cabal file. cabalFlagAssignments :: Lens Atoms (Set (FlagName, Bool)) cabalFlagAssignments = lens cabalFlagAssignments_ (\ a b -> b {cabalFlagAssignments_ = a})@@ -590,9 +606,17 @@ extraDevDeps :: Lens Atoms Relations extraDevDeps = lens extraDevDeps_ (\ a b -> b {extraDevDeps_ = a}) --- | The beginning of the rules file+-- | The rules file header rulesHead :: Lens Atoms (Maybe Text) rulesHead = lens rulesHead_ (\ a b -> b {rulesHead_ = a})++-- | The rules file assignments+rulesSettings :: Lens Atoms [Text]+rulesSettings = lens rulesSettings_ (\ a b -> b {rulesSettings_ = a})++-- | The rules file include directives+rulesIncludes :: Lens Atoms [Text]+rulesIncludes = lens rulesIncludes_ (\ a b -> b {rulesIncludes_ = a}) -- | Additional fragments of the rules file rulesFragments :: Lens Atoms (Set Text)
src/Debian/Debianize/Types/BinaryDebDescription.hs view
@@ -1,7 +1,8 @@-{-# LANGUAGE DeriveDataTypeable, TemplateHaskell #-}+{-# LANGUAGE DeriveDataTypeable, FlexibleInstances, TemplateHaskell #-} {-# OPTIONS -Wall #-} module Debian.Debianize.Types.BinaryDebDescription- ( BinaryDebDescription+ ( Canonical(canonical)+ , BinaryDebDescription , newBinaryDebDescription , package , description@@ -27,14 +28,19 @@ , builtUsing ) where +import Data.Function (on) import Data.Generics (Data, Typeable) import Data.Lens.Template (makeLenses)+import Data.List (sort, sortBy) import Data.Monoid (Monoid(..)) import Data.Text (Text) import Debian.Policy (PackageArchitectures, PackagePriority, Section) import Debian.Relation (BinPkgName, Relations) import Prelude hiding ((.)) +class Canonical a where+ canonical :: a -> a+ -- | This type represents a section of the control file other than the -- first, which in turn represent one of the binary packages or debs -- produced by this debianization.@@ -85,6 +91,26 @@ , _replaces :: Relations , _builtUsing :: Relations } deriving (Eq, Ord, Read, Show, Data, Typeable)++instance Canonical [BinaryDebDescription] where+ canonical xs = sortBy (compare `on` _package) (map canonical xs)++instance Canonical BinaryDebDescription where+ canonical x = x {_relations = canonical (_relations x)}++instance Canonical PackageRelations where+ canonical x = x { _depends = canonical (_depends x)+ , _recommends = canonical (_recommends x)+ , _suggests = canonical (_suggests x)+ , _preDepends = canonical (_preDepends x)+ , _breaks = canonical (_breaks x)+ , _conflicts = canonical (_conflicts x)+ , _provides = canonical (_provides x)+ , _replaces = canonical (_replaces x)+ , _builtUsing = canonical (_builtUsing x) }++instance Canonical Relations where+ canonical xss = sort xss newBinaryDebDescription :: BinPkgName -> BinaryDebDescription newBinaryDebDescription name =
src/Debian/Debianize/Types/SourceDebDescription.hs view
@@ -1,4 +1,4 @@-{-# LANGUAGE DeriveDataTypeable, TemplateHaskell #-}+{-# LANGUAGE DeriveDataTypeable, FlexibleInstances, TemplateHaskell, TypeSynonymInstances #-} module Debian.Debianize.Types.SourceDebDescription ( SourceDebDescription , newSourceDebDescription@@ -29,7 +29,7 @@ import Data.Lens.Template (makeLenses) import Data.Set as Set (empty, Set) import Data.Text (Text)-import Debian.Debianize.Types.BinaryDebDescription (BinaryDebDescription)+import Debian.Debianize.Types.BinaryDebDescription (Canonical(canonical), BinaryDebDescription) import Debian.Orphans () import Debian.Policy (PackagePriority, Section, StandardsVersion) import Debian.Relation (Relations, SrcPkgName)@@ -72,6 +72,14 @@ , _binaryPackages :: [BinaryDebDescription] -- ^ The binary debs. This should be a map, but we may need to preserve the order } deriving (Eq, Ord, Show, Data, Typeable)++instance Canonical SourceDebDescription where+ canonical x = x { _binaryPackages = canonical (_binaryPackages x)+ , _buildDepends = canonical (_buildDepends x)+ , _buildConflicts = canonical (_buildConflicts x)+ , _buildDependsIndep = canonical (_buildDependsIndep x)+ , _buildConflictsIndep = canonical (_buildConflictsIndep x)+ } newSourceDebDescription :: SourceDebDescription newSourceDebDescription =
src/Debian/Policy.hs view
@@ -31,7 +31,7 @@ , Area(..) , parseUploaders , parseMaintainer- , getDebianMaintainer+ , getCurrentDebianUser , haskellMaintainer , License(..) , fromCabalLicense@@ -240,8 +240,8 @@ DEBEMAIL and DEBFULLNAME when using this script. -}-getDebianMaintainer :: IO (Maybe NameAddr)-getDebianMaintainer =+getCurrentDebianUser :: IO (Maybe NameAddr)+getCurrentDebianUser = do env <- map (second decodeString) `fmap` getEnvironment return $ do fullname <- lookup "DEBFULLNAME" env `mplus` lookup "NAME" env email <- lookup "DEBEMAIL" env `mplus` lookup "EMAIL" env
test-data/alex/output/debian/control view
@@ -27,6 +27,6 @@ Conflicts: ${haskell:Conflicts} Provides: ${haskell:Provides} Description: ${haskell:ShortDescription}${haskell:ShortBlurb}- ${haskell:LongDescription}- .- ${haskell:Blurb}+ ${haskell:LongDescription}+ .+ ${haskell:Blurb}
test-data/archive/output/debian/control view
@@ -31,6 +31,6 @@ Conflicts: ${haskell:Conflicts} Provides: ${haskell:Provides} Description: ${haskell:ShortDescription}${haskell:ShortBlurb}- ${haskell:LongDescription}- .- ${haskell:Blurb}+ ${haskell:LongDescription}+ .+ ${haskell:Blurb}
test-data/artvaluereport-data/output/debian/control view
@@ -147,9 +147,9 @@ Recommends: ${haskell:Recommends} Suggests: ${haskell:Suggests} Description: ${haskell:ShortDescription}${haskell:ShortBlurb}- ${haskell:LongDescription}- .- ${haskell:Blurb}+ ${haskell:LongDescription}+ .+ ${haskell:Blurb} Package: libghc-artvaluereport-data-prof Architecture: any@@ -160,9 +160,9 @@ Recommends: ${haskell:Recommends} Suggests: ${haskell:Suggests} Description: ${haskell:ShortDescription}${haskell:ShortBlurb}- ${haskell:LongDescription}- .- ${haskell:Blurb}+ ${haskell:LongDescription}+ .+ ${haskell:Blurb} Package: libghc-artvaluereport-data-doc Architecture: all@@ -173,7 +173,7 @@ Recommends: ${haskell:Recommends} Suggests: ${haskell:Suggests} Description: ${haskell:ShortDescription}${haskell:ShortBlurb}- ${haskell:LongDescription}- .- ${haskell:Blurb}+ ${haskell:LongDescription}+ .+ ${haskell:Blurb}
test-data/artvaluereport2/input/debian/Debianize.hs view
@@ -5,7 +5,7 @@ import Data.Set (singleton) import Data.Text as Text (intercalate) import Debian.Changes (ChangeLog(..))-import Debian.Debianize (debianization, doBackups, doExecutable, doServer, doWebsite, inputChangeLog, inputDebianization, debianDefaultAtoms)+import Debian.Debianize (debianize, doBackups, doExecutable, doServer, doWebsite, inputChangeLog, inputDebianization, debianDefaultAtoms) import Debian.Debianize.Types as T (changelog, binaryArchitectures, buildDependsIndep, changelog, compat, control, depends, debianDescription, installCabalExec, installData, sourcePackageName, homepage, standardsVersion)@@ -28,7 +28,7 @@ main :: IO () main = do log <- withCurrentDirectory "test-data/artvaluereport2/input" $ newAtoms >>= evalDebT (inputChangeLog >> access changelog)- new <- withCurrentDirectory "test-data/artvaluereport2/input" $ newAtoms >>= execDebT (debianization debianDefaultAtoms (customize log))+ new <- withCurrentDirectory "test-data/artvaluereport2/input" $ newAtoms >>= execDebT (debianize (debianDefaultAtoms >> customize log)) old <- withCurrentDirectory "test-data/artvaluereport2/output" $ newAtoms >>= execDebT (inputDebianization (T.EnvSet "/" "/" "/")) -- The newest log entry gets modified when the Debianization is -- generated, it won't match so drop it for the comparison.
test-data/artvaluereport2/output/debian/control view
@@ -222,9 +222,9 @@ Conflicts: ${haskell:Conflicts} Provides: ${haskell:Provides} Description: ${haskell:ShortDescription}${haskell:ShortBlurb}- ${haskell:LongDescription}- .- ${haskell:Blurb}+ ${haskell:LongDescription}+ .+ ${haskell:Blurb} Package: artvaluereport2-development Architecture: all@@ -235,9 +235,9 @@ Conflicts: ${haskell:Conflicts} Provides: ${haskell:Provides} Description: ${haskell:ShortDescription}${haskell:ShortBlurb}- ${haskell:LongDescription}- .- ${haskell:Blurb}+ ${haskell:LongDescription}+ .+ ${haskell:Blurb} Package: artvaluereport2-staging Architecture: all@@ -248,9 +248,9 @@ Conflicts: ${haskell:Conflicts} Provides: ${haskell:Provides} Description: ${haskell:ShortDescription}${haskell:ShortBlurb}- ${haskell:LongDescription}- .- ${haskell:Blurb}+ ${haskell:LongDescription}+ .+ ${haskell:Blurb} Package: appraisalscope Architecture: any
test-data/clckwrks-dot-com/output/debian/control view
@@ -67,9 +67,9 @@ Conflicts: ${haskell:Conflicts} Provides: ${haskell:Provides} Description: ${haskell:ShortDescription}${haskell:ShortBlurb}- ${haskell:LongDescription}- .- ${haskell:Blurb}+ ${haskell:LongDescription}+ .+ ${haskell:Blurb} Package: clckwrks-dot-com-backups Architecture: any@@ -83,6 +83,6 @@ Conflicts: ${haskell:Conflicts} Provides: ${haskell:Provides} Description: ${haskell:ShortDescription}${haskell:ShortBlurb}- ${haskell:LongDescription}- .- ${haskell:Blurb}+ ${haskell:LongDescription}+ .+ ${haskell:Blurb}
test-data/clckwrks-dot-com/output/debian/rules view
@@ -1,9 +1,8 @@ #!/usr/bin/make -f +DEB_SETUP_GHC_CONFIGURE_ARGS = -fbackups DEB_CABAL_PACKAGE = clckwrks-dot-com DEB_DEFAULT_COMPILER = ghc--DEB_SETUP_GHC_CONFIGURE_ARGS = -fbackups include /usr/share/cdbs/1/rules/debhelper.mk include /usr/share/cdbs/1/class/hlibrary.mk