-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathlibsavl.spec
75 lines (61 loc) · 2.09 KB
/
libsavl.spec
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
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
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
%define so_ver 0.7
%define subver 1
Name: libsavl
Summary: Simple AVL tree library for C programs
Version: %{so_ver}.%{subver}
Release: 1%{?dist}
License: GPLv2+
Source0: https://github.com/ipilcher/libsavl/archive/v%{version}/%{name}-%{version}.tar.gz
BuildRequires: gcc doxygen
%description
A simple, lightweight, low-level AVL tree implementation for C programs.
%package devel
Summary: Development files for libsavl
%description devel
The files required to build programs that use libsavl.
%package doc
Summary: API documentation for libsavl
%description doc
API documentation for libsavl, in HTML format.
%prep
%autosetup -n %{name}-%{version}
%build
# Build the library
gcc %optflags -std=gnu99 -Wall -Wextra -Wcast-align -shared -fPIC \
-Wl,-soname,%{name}.so.%{so_ver} -o %{name}.so.%{version} savl.c
# Build the API docs
doxygen Doxyfile
%install
# Main package
%__mkdir_p %{buildroot}%{_libdir}
%__cp %{name}.so.%{version} %{buildroot}%{_libdir}
%__ln_s %{name}.so.%{version} %{buildroot}%{_libdir}/%{name}.so.%{so_ver}
%__mkdir_p %{buildroot}%{_docdir}/%{name}
%__cp LICENSE README.md %{buildroot}%{_docdir}/%{name}
# devel
%__mkdir_p %{buildroot}%{_includedir}
%__cp savl.h %{buildroot}%{_includedir}
%__ln_s %{name}.so.%{version} %{buildroot}%{_libdir}/%{name}.so
# API docs
%__cp -r docs/html %{buildroot}%{_docdir}/%{name}
%files
%attr(0755,root,root) %{_libdir}/%{name}.so.%{version}
%{_libdir}/%{name}.so.%{so_ver}
%doc %dir %attr(0755,root,root) %{_docdir}/%{name}
%doc %attr(0644,root,root) %{_docdir}/%{name}/LICENSE
%doc %attr(0644,root,root) %{_docdir}/%{name}/README.md
%files devel
%attr(0644,root,root) %{_includedir}/savl.h
%{_libdir}/%{name}.so
%files doc
%defattr(0644,root,root,0755)
%doc %{_docdir}/%{name}/html
%changelog
* Tue Feb 22 2022 Ian Pilcher <[email protected]> - 0.7.1-1
- Prepare for subversion bump
* Tue Feb 22 2022 Ian Pilcher <[email protected]> - 0.7.0-3
- Add LICENSE and README.md to main package
* Tue Feb 22 2022 Ian Pilcher <[email protected]> - 0.7.0-2
- Add doc subpackage
* Mon Feb 21 2022 Ian Pilcher <[email protected]> - 0.7.0-1
- Initial SPEC file