-
Notifications
You must be signed in to change notification settings - Fork 0
/
setup.py
executable file
·35 lines (29 loc) · 1.1 KB
/
setup.py
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
from distutils.core import setup, Extension
import platform
def platform_correct(plat=platform.platform()):
if plat.lower().find('armv6l') > -1:
print("Platform: Rasberry Pi\n")
return True
if plat.lower().find('raspberry_pi') > -1:
print("Platform: Rasberry Pi\n")
return True
if plat.lower().find('armv7l') > -1:
print("Platform: Banana Pi\n")
return True
else:
return False
if not platform_correct():
print('Cannot build. You are required to have a Rasberry Pi or Bananna Pi platform.')
exit(0)
module1 = Extension('dht11_sensor',
sources = ['_dht11_sensor.c','dht11_sensor.c']
,libraries=['wiringPi']
,extra_compile_args=['-std=gnu99'])
setup (name = 'WiringPi_DHT_Sensor',
version = '1.0',
author = 'Hein Puth',
author_email = '[email protected]',
license = 'MIT',
url = 'https://github.com/warkanum/WiringPi_DHT_Sensor_PyMod',
description = 'Python C module to read DHT Sensor with WiringPi',
ext_modules = [module1])