Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
CIRCLE
/
libocci
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
2
Merge Requests
0
Pipelines
Wiki
Members
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit
d29bcc7f
authored
Mar 19, 2017
by
Czémán Arnold
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Rework build pipe, add setup.py
parent
e21fed0a
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
126 additions
and
16 deletions
+126
-16
.gitignore
+5
-2
Makefile
+28
-14
gen_restclient-cpp_version.sh
+6
-0
setup.py
+87
-0
No files found.
.gitignore
View file @
d29bcc7f
*.pyc
*.pyc
*.py
*.sw[pon]
*.sw[pon]
*.o
*.o
*.cxx
*.so
*.so
*.a
libocci.egg-info
restclient-cpp
build
dist
Makefile
View file @
d29bcc7f
CPP
=
g++
CPP
=
g++
CC
=
gcc
CC
=
gcc
AR
=
ar
CFLAGS
=
-fPIC
-Ofast
CFLAGS
=
-fPIC
-Ofast
CPPFLAGS
=
-fPIC
--std
=
c++11
-Ofast
CPPFLAGS
=
-fPIC
--std
=
c++11
-Ofast
-Irestclient-cpp
/include
LDFLAGS
=
--shared
LDFLAGS
=
--shared
LIBS
=
-lrestclient-cpp
LIBS
=
-lrestclient-cpp
-lcurl
SONAME
=
_occi.so
SONAME
=
_occi.so
SOURCES
=
occilib.cpp
SOURCES
=
occilib.cpp
SWIG
=
swig
SWIG
=
swig
SWIG_INTERFACES
=
occilib.i
SWIG_INTERFACES
=
occilib.i
WRAPPER_SOURCES
=
occilib_wrap.c
xx
WRAPPER_SOURCES
=
occilib_wrap.c
pp
WRAPPER_INCLUDES
=
`
pkg-config python
--cflags
`
WRAPPER_INCLUDES
=
`
pkg-config python
--cflags
`
default
:
test
RESTCLIENT_CPP_URL
=
https://github.com/fuximo/restclient-cpp.git
RESTCLIENT_CPP_TAG
=
master
compile
:
$(CPP)
$(CPPFLAGS)
-c
$(SOURCES)
test
:
compile
default
:
python
$(CPP)
$(CPPFLAGS)
-o
test
test.cpp
*
.o
$(LIBS)
python
:
python
:
$(SWIG)
-python
-c
++
$(SWIG_INTERFACES)
python setup.py build
$(CPP)
$(CPPFLAGS)
-c
$(WRAPPER_SOURCES)
$(WRAPPER_INCLUDES)
$(CPP)
$(LDFLAGS)
-o
$(SONAME)
occilib_wrap.o
$(LIBS)
restclient-cpp
:
git clone
--depth
=
1
$(RESTCLIENT_CPP_URL)
-b
$(RESTCLIENT_CPP_TAG)
bash gen_restclient-cpp_version.sh
$(RESTCLIENT_CPP_TAG)
build-restclient-cpp
:
restclient-cpp
cd
restclient-cpp
;
\
$(CPP)
$(CPPFLAGS)
-c
source
/
*
.cc
-Iinclude
$(AR)
rcs librestclient-cpp.a restclient-cpp/
*
.o
deps
:
build-restclient-cpp
clean
:
clean
:
rm
-f
*
.o
rm
-f
*
.o
rm
-f
$(WRAPPER_SOURCES)
rm
-f
$(WRAPPER_SOURCES)
rm
-f
$(SONAME)
rm
-f
occi.py
rm
-Rf
build
mrproper
:
clean clean_deps
rm
-Rf
dist libocci.egg-info
mrproper
:
clean
clean_deps
:
rm
-
f
occi.py occi.pyc
rm
-
Rf
restclient-cpp
rm
-f
_occi.so
rm
-f
librestclient-cpp.a
gen_restclient-cpp_version.sh
0 → 100755
View file @
d29bcc7f
cat
>
restclient-cpp/include/restclient-cpp/version.h
<<
EOF
#ifndef INCLUDE_RESTCLIENT_CPP_VERSION_H_
#define INCLUDE_RESTCLIENT_CPP_VERSION_H_
#define RESTCLIENT_VERSION "
${
1
}
"
#endif // INCLUDE_RESTCLIENT_CPP_VERSION_H_
EOF
setup.py
0 → 100644
View file @
d29bcc7f
"""A setuptools based setup module.
See:
https://packaging.python.org/en/latest/distributing.html
https://github.com/pypa/sampleproject
"""
# Always prefer setuptools over distutils
from
setuptools
import
setup
,
find_packages
,
Extension
from
setuptools.command.build_ext
import
build_ext
from
subprocess
import
check_call
import
sys
_occi
=
Extension
(
'_occi'
,
sources
=
[
'occilib.i'
],
include_dirs
=
[
'restclient-cpp/include'
],
library_dirs
=
[
'.'
],
swig_opts
=
[
'-c++'
],
extra_compile_args
=
[
'-std=c++11'
,
'-Ofast'
],
libraries
=
[
'restclient-cpp'
,
'curl'
]
)
class
Build
(
build_ext
):
def
run
(
self
):
check_call
([
'make'
,
'deps'
])
build_ext
.
run
(
self
)
setup
(
name
=
'libocci'
,
# Versions should comply with PEP440. For a discussion on single-sourcing
# the version across setup.py and the project code, see
# https://packaging.python.org/en/latest/single_source_version.html
version
=
'1.0.0'
,
description
=
'OCCI client library for CIRCLE cloud'
,
# The project's main homepage.
url
=
'https://git.ik.bme.hu/circle/libocci'
,
# Author details
author
=
'BME IK'
,
author_email
=
'cloud@ik.bme.hu'
,
# Choose your license
license
=
'GPLv3'
,
# See https://pypi.python.org/pypi?%3Aaction=list_classifiers
classifiers
=
[
# How mature is this project? Common values are
# 3 - Alpha
# 4 - Beta
# 5 - Production/Stable
'Development Status :: 5 - Production/Stable'
,
# Indicate who your project is intended for
'Intended Audience :: Developers'
,
'Topic :: Software Development :: Libraries'
,
# Pick your license as you wish (should match "license" above)
'License :: OSI Approved :: GNU General Public License v3 (GPLv3)'
,
# Specify the Python versions you support here. In particular, ensure
# that you indicate whether you support Python 2, Python 3 or both.
'Programming Language :: Python :: 2'
,
'Programming Language :: Python :: 2.7'
,
# 'Programming Language :: Python :: 3',
# 'Programming Language :: Python :: 3.3',
# 'Programming Language :: Python :: 3.4',
# 'Programming Language :: Python :: 3.5',
],
# What does your project relate to?
keywords
=
'libocci occi OCCI CIRCLE cloud'
,
# You can just specify the packages manually here if your project is
# simple. Or you can use find_packages().
# packages=find_packages(exclude=['contrib', 'docs', 'tests']),
# Alternatively, if you want to distribute just a my_module.py, uncomment
# this:
py_modules
=
[
"occi"
],
ext_modules
=
[
_occi
],
cmdclass
=
{
'build_ext'
:
Build
},
)
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment