Commit d36e10c9 authored by Ian D. Bollinger's avatar Ian D. Bollinger

Add the text of the MIT license to cabal init.

parent ba8b8a9f
......@@ -67,7 +67,7 @@ import Language.Haskell.Extension ( Language(..) )
import Distribution.Client.Init.Types
( InitFlags(..), PackageType(..), Category(..) )
import Distribution.Client.Init.Licenses
( bsd2, bsd3, gplv2, gplv3, lgpl2, lgpl3, agplv3, apache20, mpl20 )
( bsd2, bsd3, gplv2, gplv3, lgpl2, lgpl3, agplv3, apache20, mit, mpl20 )
import Distribution.Client.Init.Heuristics
( guessPackageName, guessAuthorNameMail, SourceFileEntry(..),
scanForModules, neededBuildPrograms )
......@@ -562,6 +562,9 @@ writeLicense flags = do
Flag (Apache (Just (Version {versionBranch = [2, 0]})))
-> Just apache20
Flag MIT
-> Just $ mit authors year
Flag (MPL (Version {versionBranch = [2, 0]}))
-> Just mpl20
......
......@@ -8,6 +8,7 @@ module Distribution.Client.Init.Licenses
, lgpl3
, agplv3
, apache20
, mit
, mpl20
) where
......@@ -2624,6 +2625,30 @@ apache20 = unlines
, " limitations under the License."
]
mit :: String -> String -> License
mit authors year = unlines
[ "Copyright (c) " ++ year ++ " " ++ authors
, ""
, "Permission is hereby granted, free of charge, to any person obtaining"
, "a copy of this software and associated documentation files (the"
, "\"Software\"), to deal in the Software without restriction, including"
, "without limitation the rights to use, copy, modify, merge, publish,"
, "distribute, sublicense, and/or sell copies of the Software, and to"
, "permit persons to whom the Software is furnished to do so, subject to"
, "the following conditions:"
, ""
, "The above copyright notice and this permission notice shall be included"
, "in all copies or substantial portions of the Software."
, ""
, "THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,"
, "EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF"
, "MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT."
, "IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY"
, "CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,"
, "TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE"
, "SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE."
]
mpl20 :: License
mpl20 = unlines
[ "Mozilla Public License Version 2.0"
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment