-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathlibsavl-dev.spec~
81 lines (64 loc) · 2.3 KB
/
libsavl-dev.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
76
77
78
79
80
81
%global __os_install_post %{nil}
%define git_ver %(git describe --tags --abbrev=0 | tr -d v)
%define git_dir %(pwd)
%define so_ver %(echo %git_ver | sed 's/\.[[:digit:]]*$//')
Name: libsavl
Summary: Simple AVL tree library - development version
Version: %git_ver
Release: 3.dev%{?dist}
License: GPLv2+
Source0: https://github.com/ipilcher/%{name}/archive/refs/tags/%{version}.tar.gz
BuildRequires: git-core gcc sed coreutils
%description
A simple low-level AVL tree library for C programs. This is a
non-optimized, development version of the library.
%package devel
Summary: Development files for libsavl
%description devel
The files required to build programs that use libsavl.
%prep
%build
cd %{git_dir}
git checkout v%{git_ver}
gcc -std=gnu99 -g -O0 -Wall -Wextra -shared -Wcast-align -fPIC \
-Wl,-soname,%{name}.so.%{so_ver} -o %{name}.so.%{version} savl.c
git checkout main
%install
cd %{git_dir}
rm -rf %{buildroot}
# library
mkdir -p mkdir -p %{buildroot}%{_libdir}
cp %{name}.so.%{version} %{buildroot}%{_libdir}/
ln -s %{name}.so.%{version} %{buildroot}%{_libdir}/%{name}.so.%{so_ver}
# devel
mkdir -p %{buildroot}%{_includedir}
cp savl.h %{buildroot}%{_includedir}/
ln -s %{name}.so.%{version} %{buildroot}%{_libdir}/%{name}.so
%files
%attr(0755,root,root) %{_libdir}/%{name}.so.%{version}
%{_libdir}/%{name}.so.%{so_ver}
%files devel
%{_libdir}/%{name}.so
%attr(0644,root,root) %{_includedir}/savl.h
%changelog
* Tue Feb 22 2022 Ian Pilcher <[email protected]> - ?.?.?-3.dev
- Add .dev tag to RPM release
* Tue Feb 22 2022 Ian Pilcher <[email protected]> - ?.?.?-3
- Accomodate 3-digit versions, with 2-digit sonames
* Thu Feb 10 2022 Ian Pilcher <[email protected]> - ?.?-2
- Build with -std=gnu99 to make restrict keyword work on EL7
* Thu Feb 3 2022 Ian Pilcher <[email protected]> - ?.?-1
- Auto-detect latest git tag
- Move git checkout to %build section
- Don't leave repo in detached HEAD state
* Thu Feb 3 2022 Ian Pilcher <[email protected]> - 0.3-0
- 0.3
- Disable optimization & binary stripping
* Thu Feb 3 2022 Ian Pilcher <[email protected]> - 0.2-0
- 0.2
- Fix savl_free() SEGFAULT on empty tree
* Tue Feb 1 2022 Ian Pilcher <[email protected]> - 0.1-0
- 0.1
- Change ldconfig path to /sbin/ to make DNF happy
* Thu Dec 9 2021 Ian Pilcher <[email protected]> - 0.0-0
- Initial SPEC