#!/usr/bin/env python
# -*- coding: utf-8 -*-
# Copyright (c) 2012-2019 SoftBank Robotics. All rights reserved.
# Use of this source code is governed by a BSD-style license (see the COPYING file).
""" QiBuild Setup """
from __future__ import absolute_import
from __future__ import unicode_literals
from __future__ import print_function

import os
from setuptools import setup, find_packages


def get_qibuild_cmake_files():
    """ Get QiBuild CMake Files """
    res = list()
    cmake_dest = 'share/cmake'
    for (root, _dirs, filenames) in os.walk('cmake'):
        rel_root = os.path.relpath(root, 'cmake')
        if rel_root == ".":
            rel_root = ""
        rel_filenames = [os.path.join('cmake', rel_root, x) for x in filenames]
        rel_dest = os.path.join(cmake_dest, rel_root)
        res.append((rel_dest, rel_filenames))
    return res


setup(
    name="qibuild",
    version="3.13",
    description="The Meta Build Framework",
    url="http://doc.aldebaran.com/qibuild",
    author="SoftBank Robotics",
    author_email="qibuild-dev@aldebaran-robotics.com",
    py_modules=["qicd"],
    packages=find_packages("python"),
    package_dir={"": str("python")},
    include_package_data=True,
    install_requires=[
        "six>=1.11",
        "sphinx<=1.3.1",
        "sphinx_intl<=0.9.5",
        "tabulate>=0.8",
        "virtualenv>=16",
        "python-minifier>=2.1",
    ],
    data_files=get_qibuild_cmake_files(),
    license="BSD",
    entry_points={
        "console_scripts": [
            "qidoc        = qisys.main:main",
            "qilinguist   = qisys.main:main",
            "qisrc        = qisys.main:main",
            "qibuild      = qisys.main:main",
            "qipkg        = qisys.main:main",
            "qipy         = qisys.main:main",
            "qitest       = qisys.main:main",
            "qitoolchain  = qisys.main:main",
        ]
    }
)

@@ -903,16 +903,35 @@
 %223.13%22,%0A
+    license=%22BSD%22,%0A
     desc
@@ -966,16 +966,16 @@
 ework%22,%0A
-
     url=
@@ -1197,16 +1197,58 @@
 hon%22)%7D,%0A
+    data_files=get_qibuild_cmake_files(),%0A
     incl
@@ -1467,63 +1467,641 @@
     
-data_files=get_qibuild_cmake_files(),%0A    license=%22BSD%22
+classifiers=%5B%0A          'Development Status :: 5 - Production/Stable',%0A          'Environment :: Console',%0A          'Intended Audience :: End Users/Desktop',%0A          'Intended Audience :: Developers',%0A          'Intended Audience :: Science/Research',%0A          'Operating System :: MacOS :: MacOS X',%0A          'Operating System :: Microsoft :: Windows',%0A          'Operating System :: POSIX',%0A          'Programming Language :: Python :: 2',%0A          'Programming Language :: Python :: 3',%0A          'Topic :: Software Development :: Build Tools',%0A          'Topic :: Software Development :: Version Control :: Git'%0A          %5D
 ,%0A  

add classifier to setup.py