diff --git a/CHANGELOG.md b/CHANGELOG.md
new file mode 100644
index 0000000..493b9c5
--- /dev/null
+++ b/CHANGELOG.md
@@ -0,0 +1,7 @@
+# Changelog
+
+## [1.1.0] - 2018-07-14
+
+* Added proper packaging
+* made sg PEP8 compatible
+* Changed license from GPL to MIT
diff --git a/LICENSE b/LICENSE
new file mode 100644
index 0000000..9b36f16
--- /dev/null
+++ b/LICENSE
@@ -0,0 +1,21 @@
+MIT License
+
+Copyright (c) 2018 Bastian Venthur
+
+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.
diff --git a/requirements.txt b/requirements.txt
new file mode 100644
index 0000000..ff68e86
--- /dev/null
+++ b/requirements.txt
@@ -0,0 +1 @@
+markdown==2.6.11
diff --git a/setup.py b/setup.py
new file mode 100644
index 0000000..42568b4
--- /dev/null
+++ b/setup.py
@@ -0,0 +1,41 @@
+#!/usr/bin/env python
+
+
+from setuptools import setup
+
+meta = {}
+exec(open('./sg/version.py').read(), meta)
+meta['long_description'] = open('./README.md').read()
+
+setup(
+ name='sg',
+ version=meta['__VERSION__'],
+ description='Simple static site generator.',
+ long_description=meta['long_description'],
+ long_description_content_type='text/markdown',
+ keywords='markdown site generator cli',
+ author='Bastian Venthur',
+ author_email='mail@venthur.de',
+ url='https://github.com/venthur/sg',
+ python_requires='>=3',
+ extras_require={
+ 'dev': [
+ 'pytest',
+ 'pytest-cov',
+ 'flake8',
+ ]
+ },
+ packages=['sg'],
+ entry_points={
+ 'console_scripts': [
+ 'sg = sg.__main__:main'
+ ]
+ },
+ license='MIT',
+ classifiers=[
+ 'Development Status :: 5 - Production/Stable',
+ 'Intended Audience :: Developers',
+ 'License :: OSI Approved :: MIT License',
+ 'Programming Language :: Python :: 3',
+ ],
+)
diff --git a/sg/__init__.py b/sg/__init__.py
new file mode 100644
index 0000000..e69de29
diff --git a/sg/__main__.py b/sg/__main__.py
new file mode 100644
index 0000000..6e9d453
--- /dev/null
+++ b/sg/__main__.py
@@ -0,0 +1,15 @@
+import logging
+
+from sg import sg
+
+
+def main():
+ logging.basicConfig(level=logging.DEBUG,
+ format="%(levelname)s\t%(message)s")
+ sg.prepare_site()
+ sg.copy_static_content()
+ sg.generate_site()
+
+
+if __name__ == '__main__':
+ main()
diff --git a/sg.py b/sg/sg.py
similarity index 83%
rename from sg.py
rename to sg/sg.py
index b276504..b8f8538 100755
--- a/sg.py
+++ b/sg/sg.py
@@ -1,29 +1,11 @@
#!/usr/bin/env python
-# sg.py -- small, static website generator
-# Copyright (C) 2010 Bastian Venthur
-#
-# This program is free software: you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation, either version 3 of the License, or
-# (at your option) any later version.
-#
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program. If not, see .
-
-
"""Small static site generator.
"""
__author__ = "Bastian Venthur "
-__version__ = "1.0"
import os
@@ -185,11 +167,3 @@ def render_page(path):
txt = process_embed_meta(txt, meta)
check_unused_variables(txt)
return txt
-
-
-if __name__ == "__main__":
- logging.basicConfig(level=logging.DEBUG,
- format="%(levelname)s\t%(message)s")
- prepare_site()
- copy_static_content()
- generate_site()
diff --git a/sg/version.py b/sg/version.py
new file mode 100644
index 0000000..dece747
--- /dev/null
+++ b/sg/version.py
@@ -0,0 +1 @@
+__VERSION__ = '1.1.0'