File: setup.py

package info (click to toggle)
dh-cmake 0.6.1
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, bullseye, sid
  • size: 392 kB
  • sloc: python: 2,252; perl: 26; makefile: 6; ansic: 6; sh: 2
file content (69 lines) | stat: -rwxr-xr-x 2,241 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
#!/usr/bin/env python3

# This file is part of dh-cmake, and is distributed under the OSI-approved
# BSD 3-Clause license. See top-level LICENSE file or
# https://gitlab.kitware.com/debian/dh-cmake/blob/master/LICENSE for details.

from setuptools import setup
import debian.changelog
import os.path


def get_current_version():
    root_dir = os.path.dirname(os.path.abspath(__file__))
    changelog_file = os.path.join(root_dir, "debian/changelog")
    with open(changelog_file) as f:
        changelog = debian.changelog.Changelog(f)
    return str(changelog.version)


def debian_version_to_python_version(version_str):
    if version_str[-1] == "~":
        return version_str[:-1] + ".dev1"
    return version_str


setup(
    name="dh-cmake",
    version=debian_version_to_python_version(get_current_version()),
    description="Debhelper program for CMake projects",
    url="https://gitlab.kitware.com/debian/dh-cmake",
    author="Kyle Edwards",
    author_email="kyle.edwards@kitware.com",
    maintainer="Kitware Debian Maintainers",
    maintainer_email="debian@kitware.com",
    classifiers=[
        "License :: OSI Approved :: BSD License",
    ],
    packages=["dhcmake"],
    test_suite="dhcmake.tests",
    install_requires=["python-debian"],
    entry_points={
        "console_scripts": [
            "dh_cmake_install=dhcmake.cmake:install",
            "dh_ctest_clean=dhcmake.ctest:clean",
            "dh_ctest_start=dhcmake.ctest:start",
            "dh_ctest_update=dhcmake.ctest:update",
            "dh_ctest_configure=dhcmake.ctest:configure",
            "dh_ctest_build=dhcmake.ctest:build",
            "dh_ctest_test=dhcmake.ctest:test",
            "dh_ctest_submit=dhcmake.ctest:submit",
            "dh_cpack_generate=dhcmake.cpack:generate",
            "dh_cpack_substvars=dhcmake.cpack:substvars",
            "dh_cpack_install=dhcmake.cpack:install",
        ],
    },
    package_data={
        "dhcmake": ["dh_ctest_driver.cmake"],
    },
    data_files=[
        ("share/perl5/Debian/Debhelper/Sequence", [
            "sequence/cmake.pm",
            "sequence/ctest.pm",
            "sequence/cpack.pm",
        ]),
        ("share/doc/dh-cmake", [
            "README.md",
        ]),
    ],
)