1
|
|
|
# coding=utf-8 |
2
|
|
|
|
3
|
|
|
######################################################################################################################## |
4
|
|
|
# Do not forget to adjust the following variables to your own plugin. |
5
|
|
|
|
6
|
|
|
# The plugin's identifier, has to be unique |
7
|
|
|
plugin_identifier = "auth_ldap" |
8
|
|
|
|
9
|
|
|
# The plugin's python package, should be "octoprint_<plugin identifier>", has to be unique |
10
|
|
|
plugin_package = "octoprint_%s" % plugin_identifier |
11
|
|
|
|
12
|
|
|
# The plugin's human readable name. Can be overwritten within OctoPrint's internal data via __plugin_name__ in the |
13
|
|
|
# plugin module |
14
|
|
|
plugin_name = "Auth LDAP" |
15
|
|
|
|
16
|
|
|
# The plugin's version. Can be overwritten within OctoPrint's internal data via __plugin_version__ in the plugin module |
17
|
|
|
plugin_version = "1.1.0" |
18
|
|
|
|
19
|
|
|
# The plugin's description. Can be overwritten within OctoPrint's internal data via __plugin_description__ in the plugin |
20
|
|
|
# module |
21
|
|
|
plugin_description = "LDAP Auth provider" |
22
|
|
|
|
23
|
|
|
# The plugin's author. Can be overwritten within OctoPrint's internal data via __plugin_author__ in the plugin module |
24
|
|
|
plugin_author = "Guillaume Gill, Seth Battis, Paul K. Stelis" |
25
|
|
|
|
26
|
|
|
# The plugin's author's mail address. |
27
|
|
|
plugin_author_email = "[email protected]" |
28
|
|
|
|
29
|
|
|
# The plugin's homepage URL. Can be overwritten within OctoPrint's internal data via __plugin_url__ in the plugin module |
30
|
|
|
plugin_url = "https://github.com/battis/OctoPrint-LDAP" |
31
|
|
|
|
32
|
|
|
# The plugin's license. Can be overwritten within OctoPrint's internal data via __plugin_license__ in the plugin module |
33
|
|
|
plugin_license = "AGPLv3" |
34
|
|
|
|
35
|
|
|
# Any additional requirements besides OctoPrint should be listed here |
36
|
|
|
plugin_requires = ["python-ldap"] |
37
|
|
|
# TODO figure out how to automate installation of these dependencies? |
38
|
|
|
# To get python-ldap installed, you need its development/build dependencies installed: |
39
|
|
|
# apt-get install libsasl2-dev python-dev libldap2-dev libssl-dev |
40
|
|
|
|
41
|
|
|
### -------------------------------------------------------------------------------------------------------------------- |
42
|
|
|
### More advanced options that you usually shouldn't have to touch follow after this point |
43
|
|
|
### -------------------------------------------------------------------------------------------------------------------- |
44
|
|
|
|
45
|
|
|
# Additional package data to install for this plugin. The subfolders "templates", "static" and "translations" will |
46
|
|
|
# already be installed automatically if they exist. Note that if you add something here you'll also need to update |
47
|
|
|
# MANIFEST.in to match to ensure that python setup.py sdist produces a source distribution that contains all your |
48
|
|
|
# files. This is sadly due to how python's setup.py works, see also http://stackoverflow.com/a/14159430/2028598 |
49
|
|
|
plugin_additional_data = [] |
50
|
|
|
|
51
|
|
|
# Any additional python packages you need to install with your plugin that are not contained in <plugin_package>.* |
52
|
|
|
plugin_additional_packages = [] |
53
|
|
|
|
54
|
|
|
# Any python packages within <plugin_package>.* you do NOT want to install with your plugin |
55
|
|
|
plugin_ignored_packages = [] |
56
|
|
|
|
57
|
|
|
# Additional parameters for the call to setuptools.setup. If your plugin wants to register additional entry points, |
58
|
|
|
# define dependency links or other things like that, this is the place to go. Will be merged recursively with the |
59
|
|
|
# default setup parameters as provided by octoprint_setuptools.create_plugin_setup_parameters using |
60
|
|
|
# octoprint.util.dict_merge. |
61
|
|
|
# |
62
|
|
|
# Example: |
63
|
|
|
# plugin_requires = ["someDependency==dev"] |
64
|
|
|
# additional_setup_parameters = {"dependency_links": ["https://github.com/someUser/someRepo/archive/master.zip#egg=someDependency-dev"]} |
65
|
|
|
additional_setup_parameters = {} |
66
|
|
|
|
67
|
|
|
######################################################################################################################## |
68
|
|
|
|
69
|
|
|
from setuptools import setup |
70
|
|
|
|
71
|
|
|
try: |
72
|
|
|
import octoprint_setuptools |
73
|
|
|
except: |
74
|
|
|
print("Could not import OctoPrint's setuptools, are you sure you are running that under " |
75
|
|
|
"the same python installation that OctoPrint is installed under?") |
76
|
|
|
import sys |
77
|
|
|
|
78
|
|
|
sys.exit(-1) |
79
|
|
|
|
80
|
|
|
setup_parameters = octoprint_setuptools.create_plugin_setup_parameters( |
81
|
|
|
identifier=plugin_identifier, |
82
|
|
|
package=plugin_package, |
83
|
|
|
name=plugin_name, |
84
|
|
|
version=plugin_version, |
85
|
|
|
description=plugin_description, |
86
|
|
|
author=plugin_author, |
87
|
|
|
mail=plugin_author_email, |
88
|
|
|
url=plugin_url, |
89
|
|
|
license=plugin_license, |
90
|
|
|
requires=plugin_requires, |
91
|
|
|
additional_packages=plugin_additional_packages, |
92
|
|
|
ignored_packages=plugin_ignored_packages, |
93
|
|
|
additional_data=plugin_additional_data |
94
|
|
|
) |
95
|
|
|
|
96
|
|
|
if len(additional_setup_parameters): |
97
|
|
|
from octoprint.util import dict_merge |
98
|
|
|
|
99
|
|
|
setup_parameters = dict_merge(setup_parameters, additional_setup_parameters) |
100
|
|
|
|
101
|
|
|
setup(**setup_parameters) |
102
|
|
|
|