diff --git a/LICENSE b/LICENSE
new file mode 100644
--- /dev/null
+++ b/LICENSE
@@ -0,0 +1,26 @@
+Copyright (c) 2014, Jan Matejka <yac@blesmrt.net>
+All rights reserved.
+
+Redistribution and use in source and binary forms, with or without
+modification, are permitted provided that the following conditions are met:
+
+1. Redistributions of source code must retain the above copyright notice,
+   this list of conditions and the following disclaimer.
+2. Redistributions in binary form must reproduce the above copyright
+   notice, this list of conditions and the following disclaimer in the
+   documentation and/or other materials provided with the distribution.
+3. Neither the name of the cbugzilla nor the names of its
+   contributors may be used to endorse or promote products derived from
+   this software without specific prior written permission.
+
+THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
+LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+POSSIBILITY OF SUCH DAMAGE.
diff --git a/Setup.hs b/Setup.hs
new file mode 100644
--- /dev/null
+++ b/Setup.hs
@@ -0,0 +1,2 @@
+import Distribution.Simple
+main = defaultMain
diff --git a/library/System/OsRelease.hs b/library/System/OsRelease.hs
new file mode 100644
--- /dev/null
+++ b/library/System/OsRelease.hs
@@ -0,0 +1,19 @@
+module System.OsRelease
+    ( detect
+    , OsRelease (..)
+    , detect'
+    )
+where
+
+data OsRelease = OpenSUSE
+    deriving (Eq, Show)
+
+detect :: IO (Maybe OsRelease)
+detect = do
+    osr <- readFile "/etc/os-release"
+    return . detect' $ lines osr
+
+detect' :: [String] -> Maybe OsRelease
+detect' [] = Nothing
+detect' ("NAME=openSUSE":_) = Just OpenSUSE
+detect' (_:xs) = detect' xs
diff --git a/os-release.cabal b/os-release.cabal
new file mode 100644
--- /dev/null
+++ b/os-release.cabal
@@ -0,0 +1,78 @@
+author:         Jan Matějka
+category:       System
+license-file:   LICENSE
+build-type:     Simple
+cabal-version:  >= 1.16
+copyright:      2014 Jan Matějka <yac@blesmrt.net>
+license:        BSD3
+maintainer:     <yac@blesmrt.net>
+homepage:       https://github.com/yaccz/os-release
+name:           os-release
+synopsis:       /etc/os-release helpers
+version:        0.1.0
+description:    /etc/os-release helpers
+
+
+source-repository head
+  type:     git
+  location: https://github.com/yaccz/os-release.git
+
+library
+    build-depends:
+      base < 5
+    default-language:   Haskell2010
+    exposed-modules:    System.OsRelease
+    ghc-options:
+        -Wall
+    ghc-prof-options:
+        -auto-all
+        -prof
+    hs-source-dirs:     library
+
+test-suite tests
+    build-depends:
+        base < 5
+      , os-release
+      , hspec
+    default-language:
+        Haskell2010
+    ghc-options:
+        -Wall
+        -Werror
+    hs-source-dirs:
+        library
+        tests
+    main-is:
+        Spec.hs
+    other-modules:
+        System.OsRelease
+        OsReleaseSpec
+    type:
+        exitcode-stdio-1.0
+
+test-suite documentation
+    build-depends:
+        base < 5
+      , process == 1.*
+      , regex-compat == 0.*
+    default-language:
+        Haskell2010
+    hs-source-dirs:
+        tests
+    main-is:
+        Haddock.hs
+    type:
+        exitcode-stdio-1.0
+
+test-suite style
+    build-depends:
+        base < 5
+      , hlint == 1.*
+    default-language:
+        Haskell2010
+    hs-source-dirs:
+        tests
+    main-is:
+        HLint.hs
+    type:
+        exitcode-stdio-1.0
diff --git a/tests/HLint.hs b/tests/HLint.hs
new file mode 100644
--- /dev/null
+++ b/tests/HLint.hs
@@ -0,0 +1,16 @@
+module Main (main) where
+
+import           Language.Haskell.HLint (hlint)
+import           System.Exit            (exitFailure, exitSuccess)
+
+arguments :: [String]
+arguments =
+    [
+      "library"
+    , "tests"
+    ]
+
+main :: IO ()
+main = do
+    hints <- hlint arguments
+    if null hints then exitSuccess else exitFailure
diff --git a/tests/Haddock.hs b/tests/Haddock.hs
new file mode 100644
--- /dev/null
+++ b/tests/Haddock.hs
@@ -0,0 +1,30 @@
+module Main (main) where
+
+import           Data.List      (genericLength)
+import           Data.Maybe     (catMaybes)
+import           System.Exit    (exitFailure, exitSuccess)
+import           System.Process (readProcess)
+import           Text.Regex     (matchRegex, mkRegex)
+
+arguments :: [String]
+arguments =
+    [ "haddock"
+    ]
+
+average :: (Fractional a, Real b) => [b] -> a
+average xs = realToFrac (sum xs) / genericLength xs
+
+expected :: Fractional a => a
+expected = 0
+
+main :: IO ()
+main = do
+    output <- readProcess "cabal" arguments ""
+    if average (match output) >= expected
+        then exitSuccess
+        else putStr output >> exitFailure
+
+match :: String -> [Int]
+match = fmap read . concat . catMaybes . fmap (matchRegex pattern) . lines
+  where
+    pattern = mkRegex "^ *([0-9]*)% "
diff --git a/tests/OsReleaseSpec.hs b/tests/OsReleaseSpec.hs
new file mode 100644
--- /dev/null
+++ b/tests/OsReleaseSpec.hs
@@ -0,0 +1,13 @@
+module OsReleaseSpec (spec) where
+
+import           Test.Hspec
+import           System.OsRelease
+
+spec :: Spec
+spec = do
+    describe "detect" $ do
+        it "parses" $ do
+            detect' ["NAME=openSUSE"]      `shouldBe` Just OpenSUSE
+            detect' []                     `shouldBe` Nothing
+            detect' ["NAME=open"]          `shouldBe` Nothing
+            detect' ["NAME=\"openSUSE\""]  `shouldBe` Nothing
diff --git a/tests/Spec.hs b/tests/Spec.hs
new file mode 100644
--- /dev/null
+++ b/tests/Spec.hs
@@ -0,0 +1,1 @@
+{-# OPTIONS_GHC -F -pgmF hspec-discover #-}
