summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorjwijenbergh <jeroenwijenbergh@protonmail.com>2022-07-08 16:03:50 +0200
committerjwijenbergh <jeroenwijenbergh@protonmail.com>2022-07-08 16:03:50 +0200
commita6cba736913dd78a8ac6907e0b0572cf90aee866 (patch)
tree71209a03c7fddc268ed412c8d851a64d625bc520
parent65dffc1f09af640417727d5d346e08edc6c2772e (diff)
RPM & Setup: Separate eduVPN and common name with a - or _
-rw-r--r--Makefile8
-rw-r--r--docs/src/api/python/README.md4
-rw-r--r--eduvpncommon.spec11
-rw-r--r--wrappers/python/main.py2
-rwxr-xr-xwrappers/python/setup.py8
-rw-r--r--wrappers/python/tests.py2
6 files changed, 18 insertions, 17 deletions
diff --git a/Makefile b/Makefile
index cc6afcc..1da08f0 100644
--- a/Makefile
+++ b/Makefile
@@ -35,10 +35,10 @@ srpm:
rm -rf dist/*
# Archive code with vendored dependencies
- git clone . dist/libeduvpncommon-0.1.0
+ git clone . dist/libeduvpn-common-0.1.0
go mod vendor
- cp -r vendor dist/libeduvpncommon-0.1.0/vendor
- tar -zcvf ~/rpmbuild/SOURCES/libeduvpncommon.tar.gz -C dist .
+ cp -r vendor dist/libeduvpn-common-0.1.0/vendor
+ tar -zcvf ~/rpmbuild/SOURCES/libeduvpn-common.tar.gz -C dist .
# Cleanup
rm -rf dist/*
@@ -54,7 +54,7 @@ rpm: srpm
echo "Done building RPM, go to ./dist/ to view them"
rpm-mock: srpm
- mock -r "$(MOCK_TARGET)" --resultdir ./dist rebuild ~/rpmbuild/SRPMS/libeduvpncommon*.src.rpm
+ mock -r "$(MOCK_TARGET)" --resultdir ./dist rebuild ~/rpmbuild/SRPMS/libeduvpn-common*.src.rpm
echo "Done building RPM, go to ./dist/ to view them"
# Enable parallelism if -j is specified, but first execute build
diff --git a/docs/src/api/python/README.md b/docs/src/api/python/README.md
index 01a14a0..e15511f 100644
--- a/docs/src/api/python/README.md
+++ b/docs/src/api/python/README.md
@@ -1,10 +1,10 @@
# Python
As the Go library is build as a *shared* library, it can be loaded by other languages. We have created wrapper code for Python to use this library. We define the functions and then give a similar example to the Go example.
-The functions that we will discuss are all part of the `EduVPN` class defined in eduvpncommon.main. You can import it like so:
+The functions that we will discuss are all part of the `EduVPN` class defined in `eduvpn_common.main`. You can import it like so:
```python
-import eduvpncommon.main as eduvpn
+import eduvpn_common.main as eduvpn
# Then use eduvpn.EduVPN
```
diff --git a/eduvpncommon.spec b/eduvpncommon.spec
index 26c5535..064c587 100644
--- a/eduvpncommon.spec
+++ b/eduvpncommon.spec
@@ -1,7 +1,8 @@
-%global modname eduvpncommon
+%global name eduvpn-common
+%global modname eduvpn_common
%global sum eduVPN common Go library
-Name: lib%{modname}
+Name: lib%{name}
Version: 0.1.0
Release: 1%{?dist}
Summary: %{sum}
@@ -38,14 +39,14 @@ popd
%prep
%autosetup -n %{name}-%{version}
-%package -n python3-%{modname}
+%package -n python3-%{name}
BuildArch: noarch
Requires: %{name}
Summary: Python3 eduvpncommon wrapper
-%description -n python3-%{modname}
+%description -n python3-%{name}
The python wrapper for the eduVPN common Go shared library
-%files -n python3-%{modname}
+%files -n python3-%{name}
%{python3_sitelib}/%{modname}/
%{python3_sitelib}/%{modname}-%{version}*
diff --git a/wrappers/python/main.py b/wrappers/python/main.py
index d75504f..58e8b95 100644
--- a/wrappers/python/main.py
+++ b/wrappers/python/main.py
@@ -1,4 +1,4 @@
-import eduvpncommon.main as eduvpn
+import eduvpn_common.main as eduvpn
import webbrowser
import json
import sys
diff --git a/wrappers/python/setup.py b/wrappers/python/setup.py
index 2b682cd..b2214e7 100755
--- a/wrappers/python/setup.py
+++ b/wrappers/python/setup.py
@@ -100,11 +100,11 @@ class bdist_wheel(_bdist_wheel):
setup(
- name="eduvpncommon",
+ name="eduvpn_common",
version="0.1.0",
- packages=["eduvpncommon"],
+ packages=["eduvpn_common"],
python_requires=">=3.6",
- package_dir={"eduvpncommon": "src"},
- package_data={"eduvpncommon": [f"lib/*{_libname}*"]},
+ package_dir={"eduvpn_common": "src"},
+ package_data={"eduvpn_common": [f"lib/*{_libname}*"]},
cmdclass={"bdist_wheel": bdist_wheel},
)
diff --git a/wrappers/python/tests.py b/wrappers/python/tests.py
index e58e67d..cbec370 100644
--- a/wrappers/python/tests.py
+++ b/wrappers/python/tests.py
@@ -1,7 +1,7 @@
#!/usr/bin/env python3
import unittest
-import eduvpncommon.main as eduvpn
+import eduvpn_common.main as eduvpn
import webbrowser
import sys
import os