Commit 1e0be74d authored by Anders Blomdell's avatar Anders Blomdell
Browse files

Add makefile and .srpm building

parent 4fddaf6d
DYNAMIXEL_VERSION=$(shell git describe --tags | sed -e 's/^v//;s/-/_/g' )
all:
.PHONY: model
model:
echo Add wget rules
.PHONY: TAR
TAR:
git archive \
--prefix dynamixel-$(DYNAMIXEL_VERSION)/ \
--output dynamixel-$(DYNAMIXEL_VERSION).tar.gz -- HEAD
.PHONY: dynamixel-$(DYNAMIXEL_VERSION).spec
dynamixel-$(DYNAMIXEL_VERSION).spec: dynamixel.spec.template Makefile
sed -e 's/__DYNAMIXEL_VERSION__/$(DYNAMIXEL_VERSION)/' $< > $@
.PHONY: SRPM
SRPM: dynamixel-$(DYNAMIXEL_VERSION).spec TAR
rpmbuild --define "_sourcedir $$(pwd)" -bs $<
clean:
rm -f *~
rm -f dynamixel-*.spec
rm -f dynamixel-*.tar.gz
Name: dynamixel
Version: 0.1
Release: 1
Summary: Wrapper for Dynamixel SDK
License: Apache 2.0
Source0: https://gitlab.control.lth.se/anders_blomdell/dynamixel/-/archive/master/dynamixel-0.1.tar.gz
%define debug_package %{nil}
%if 0%{!?python3_pkgversion:1}
%define python3_pkgversion 3
%endif
BuildRequires: python3-devel
Requires: dynamixel-sdk
%description
Wrapper for Dynamixel SDK
%package python%{python3_pkgversion}
Summary: Python3 support files for %{name}
Requires: %{name} = %{version}-%{release}
%description python%{python3_pkgversion}
Wrapper for Dynamixel SDK
%prep
%setup -q -n %{name}-0.1
%build
make DYNAMIXEL_VERSION=%{version}
%install
rm -rf ${RPM_BUILD_ROOT}
# Python
export DYNAMIXEL_VERSION=%{version}
%{__python3} setup.py install -O1 \
--root=$RPM_BUILD_ROOT --prefix /usr \
--record=INSTALLED_python3
%files
%files python%{python3_pkgversion} -f INSTALLED_python3
%defattr(-,root,root,-)
Name: dynamixel
Version: __DYNAMIXEL_VERSION__
Release: 1
Summary: Wrapper for Dynamixel SDK
License: Apache 2.0
Source0: https://gitlab.control.lth.se/anders_blomdell/dynamixel/-/archive/master/dynamixel-__DYNAMIXEL_VERSION__.tar.gz
%define debug_package %{nil}
%if 0%{!?python3_pkgversion:1}
%define python3_pkgversion 3
%endif
BuildRequires: python3-devel
Requires: dynamixel-sdk
%description
Wrapper for Dynamixel SDK
%package python%{python3_pkgversion}
Summary: Python3 support files for %{name}
Requires: %{name} = %{version}-%{release}
%description python%{python3_pkgversion}
Wrapper for Dynamixel SDK
%prep
%setup -q -n %{name}-__DYNAMIXEL_VERSION__
%build
make DYNAMIXEL_VERSION=%{version}
%install
rm -rf ${RPM_BUILD_ROOT}
# Python
export DYNAMIXEL_VERSION=%{version}
%{__python3} setup.py install -O1 \
--root=$RPM_BUILD_ROOT --prefix /usr \
--record=INSTALLED_python3
%files
%files python%{python3_pkgversion} -f INSTALLED_python3
%defattr(-,root,root,-)
......@@ -3,7 +3,7 @@ from dynamixel.servo import Servo
from dynamixel.servo import Row, RWRow, IndirectRow
from dynamixel.channel import Protocol2
class MX_106T_R_2.0(Servo):
class MX_106T_R_2_0(Servo):
EEPROM = {
'model_number': Row(name='model_number', address=0, size=2, default=321),
'model_information': Row(name='model_information', address=2, size=4, default=None),
......@@ -65,4 +65,4 @@ class MX_106T_R_2.0(Servo):
PROTOCOL = Protocol2
def __init__(self, channel, id):
super(MX_106T_R_2.0, self).__init__(channel=channel, id=id)
super(MX_106T_R_2_0, self).__init__(channel=channel, id=id)
......@@ -3,7 +3,7 @@ from dynamixel.servo import Servo
from dynamixel.servo import Row, RWRow, IndirectRow
from dynamixel.channel import Protocol2
class MX_28T_R_AT_AR_2.0(Servo):
class MX_28T_R_AT_AR_2_0(Servo):
EEPROM = {
'model_number': Row(name='model_number', address=0, size=2, default=30),
'model_information': Row(name='model_information', address=2, size=4, default=None),
......@@ -63,4 +63,4 @@ class MX_28T_R_AT_AR_2.0(Servo):
PROTOCOL = Protocol2
def __init__(self, channel, id):
super(MX_28T_R_AT_AR_2.0, self).__init__(channel=channel, id=id)
super(MX_28T_R_AT_AR_2_0, self).__init__(channel=channel, id=id)
......@@ -3,7 +3,7 @@ from dynamixel.servo import Servo
from dynamixel.servo import Row, RWRow, IndirectRow
from dynamixel.channel import Protocol2
class MX_64T_R_AT_AR_2.0(Servo):
class MX_64T_R_AT_AR_2_0(Servo):
EEPROM = {
'model_number': Row(name='model_number', address=0, size=2, default=311),
'model_information': Row(name='model_information', address=2, size=4, default=None),
......@@ -65,4 +65,4 @@ class MX_64T_R_AT_AR_2.0(Servo):
PROTOCOL = Protocol2
def __init__(self, channel, id):
super(MX_64T_R_AT_AR_2.0, self).__init__(channel=channel, id=id)
super(MX_64T_R_AT_AR_2_0, self).__init__(channel=channel, id=id)
#!/usr/bin/env python
from distutils.core import setup, Extension
try:
import os
VERSION=os.environ['DYNAMIXEL_VERSION']
except KeyError:
VERSION='_UNKNOWN_'
pass
setup(
name = 'python-dynamixel',
version = VERSION,
description = 'Python wrapper to the Dynamixel I/O library',
long_description = 'Python wrapper to the Dynamixel I/O library',
author = 'Anders Blomdell',
author_email = 'anders.blomdell@control.lth.se',
url = 'http://gitlab.control.lth.se/anders_blomdell/dynamixel.git',
license = 'Apache 2.0',
platforms = 'Linux',
packages = [ 'dynamixel',
'dynamixel.channel',
'dynamixel.model',
'dynamixel.servo' ]
)
......@@ -179,7 +179,8 @@ def Parse(path):
.replace('/', '_')
.replace('(', '_')
.replace(')', '')
.replace('+', ''))
.replace('+', '')
.replace('.', '_'))
if m := re.match('^2(.*)$', title):
title = f'DUAL-{m.group(1)}'
pass
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment