moberg.spec.template 2.08 KB
Newer Older
Anders Blomdell's avatar
Anders Blomdell committed
1
2
3
4
5
6
7
8
9
10
Name:           moberg
Version:        __MOBERG_VERSION__
Release:        1
Summary:        Library for abstracting physical I/O
License:        GPLv3
Source0:        https://gitlab.control.lth.se/anders_blomdell/moberg/-/archive/master/moberg-__MOBERG_VERSION__.tar.gz

BuildRequires:  gcc
BuildRequires:  comedilib-devel
BuildRequires:  valgrind
11
BuildRequires:  libxdg-basedir-devel
Anders Blomdell's avatar
Anders Blomdell committed
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60

%description
Shared library for abstracting physical process I/O (analog, digital
and encoders)

%package comedi
Summary: Comedi support for %{name}
Requires: %{name} = %{version}-%{release}
Requires:       comedilib

%description comedi
Comedi support for for %{name}

%package devel
Summary: Development files for %{name}
Requires: %{name} = %{version}-%{release}

%description devel
Development files for %{name}

%package matlab
Summary: Matlab development files for %{name}
Requires: %{name} = %{version}-%{release}
Requires: %{name}-devel = %{version}-%{release}

%description matlab
Matlab development files for %{name}


%prep
%setup -q -n %{name}-__MOBERG_VERSION__


%build
make MOBERG_VERSION=__MOBERG_VERSION__

%check
make test

%install
rm -rf ${RPM_BUILD_ROOT}

mkdir -p ${RPM_BUILD_ROOT}%{_libdir}
cp build/libmoberg*.so ${RPM_BUILD_ROOT}%{_libdir}

mkdir -p ${RPM_BUILD_ROOT}%{_includedir}
cp moberg.h ${RPM_BUILD_ROOT}%{_includedir}

mkdir -p ${RPM_BUILD_ROOT}/opt/matlab/src/moberg
Anders Blomdell's avatar
Anders Blomdell committed
61
62
63
64
65
66
mkdir -p ${RPM_BUILD_ROOT}%{_includedir}
cp adaptors/matlab/moberg4simulink.h ${RPM_BUILD_ROOT}%{_includedir}
cp adaptors/matlab/realtimer.c ${RPM_BUILD_ROOT}/opt/matlab/src/moberg
cp adaptors/matlab/*in.c ${RPM_BUILD_ROOT}/opt/matlab/src/moberg
cp adaptors/matlab/*out.c ${RPM_BUILD_ROOT}/opt/matlab/src/moberg
cp adaptors/matlab/Makefile.mex ${RPM_BUILD_ROOT}/opt/matlab/src/moberg/Makefile
Anders Blomdell's avatar
Anders Blomdell committed
67
68
69

%files
%defattr(-,root,root,-)
Anders Blomdell's avatar
Anders Blomdell committed
70
71
%{_libdir}/libmoberg.so
%{_libdir}/libmoberg_serial2002.so
Anders Blomdell's avatar
Anders Blomdell committed
72
73
74

%files comedi
%defattr(-,root,root,-)
Anders Blomdell's avatar
Anders Blomdell committed
75
%{_libdir}/libmoberg_comedi.so
Anders Blomdell's avatar
Anders Blomdell committed
76
77
78

%files devel
%defattr(-,root,root,-)
Anders Blomdell's avatar
Anders Blomdell committed
79
%{_includedir}/moberg.h
Anders Blomdell's avatar
Anders Blomdell committed
80
81
82

%files matlab
%defattr(-,root,root,-)
Anders Blomdell's avatar
Anders Blomdell committed
83
84
85
%{_libdir}/libmoberg4simulink.so
/opt/matlab/src/moberg/*
%{_includedir}/moberg4simulink.h