]>
Commit | Line | Data |
---|---|---|
2962afc5 JB |
1 | # |
2 | # Conditional build: | |
3 | %bcond_without static_libs # static library | |
4 | # | |
5 | Summary: Little fail-safe filesystem designed for microcontrollers | |
6 | Summary(pl.UTF-8): Mały, odporny na awarie zasilania system plików dla mikrokontrolerów | |
7 | Name: littlefs | |
8 | Version: 2.9.1 | |
9 | Release: 1 | |
10 | License: BSD | |
11 | Group: Libraries | |
12 | #Source0Download: https://github.com/littlefs-project/littlefs/releases | |
13 | Source0: https://github.com/littlefs-project/littlefs/archive/v%{version}/%{name}-%{version}.tar.gz | |
14 | # Source0-md5: a870347a97de9b3f909bc5b45e6fb886 | |
15 | URL: https://github.com/littlefs-project/littlefs | |
16 | BuildRequires: libtool | |
17 | BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n) | |
18 | ||
19 | %description | |
20 | Little fail-safe filesystem designed for microcontrollers. | |
21 | ||
22 | %description -l pl.UTF-8 | |
23 | Mały, odporny na awarie zasilania system plików zaprojektowany z myślą | |
24 | o mikrokontrolerach. | |
25 | ||
26 | %package devel | |
27 | Summary: Header files for littlefs library | |
28 | Summary(pl.UTF-8): Pliki nagłówkowe biblioteki littlefs | |
29 | Group: Development/Libraries | |
30 | Requires: %{name} = %{version}-%{release} | |
31 | ||
32 | %description devel | |
33 | Header files for littlefs library. | |
34 | ||
35 | %description devel -l pl.UTF-8 | |
36 | Pliki nagłówkowe biblioteki littlefs. | |
37 | ||
38 | %package static | |
39 | Summary: Static littlefs library | |
40 | Summary(pl.UTF-8): Statyczna biblioteka littlefs | |
41 | Group: Development/Libraries | |
42 | Requires: %{name}-devel = %{version}-%{release} | |
43 | ||
44 | %description static | |
45 | Static littlefs library. | |
46 | ||
47 | %description static -l pl.UTF-8 | |
48 | Statyczna biblioteka littlefs. | |
49 | ||
50 | %prep | |
51 | %setup -q | |
52 | ||
53 | %build | |
54 | libtool --mode=compile %{__cc} %{rpmcflags} %{rpmcppflags} -Wall -Wextra -pedantic -Wmissing-prototypes -c lfs.c -o lfs.lo | |
55 | libtool --mode=compile %{__cc} %{rpmcflags} %{rpmcppflags} -Wall -Wextra -pedantic -Wmissing-prototypes -c lfs_util.c -o lfs_util.lo | |
56 | libtool --mode=link %{__cc} %{!?with_static_libs:-shared} %{rpmldflags} %{rpmcflags} -o liblfs.la lfs.lo lfs_util.lo -rpath %{_libdir} | |
57 | ||
58 | %install | |
59 | rm -rf $RPM_BUILD_ROOT | |
60 | install -d $RPM_BUILD_ROOT{%{_includedir},%{_libdir}} | |
61 | ||
62 | cp -p lfs.h lfs_util.h $RPM_BUILD_ROOT%{_includedir} | |
63 | ||
64 | libtool --mode=install install liblfs.la $RPM_BUILD_ROOT%{_libdir} | |
65 | ||
66 | # no external dependencies | |
67 | %{__rm} $RPM_BUILD_ROOT%{_libdir}/liblfs.la | |
68 | ||
69 | %clean | |
70 | rm -rf $RPM_BUILD_ROOT | |
71 | ||
72 | %post -p /sbin/ldconfig | |
73 | %postun -p /sbin/ldconfig | |
74 | ||
75 | %files | |
76 | %defattr(644,root,root,755) | |
77 | %doc DESIGN.md LICENSE.md README.md SPEC.md | |
78 | %attr(755,root,root) %{_libdir}/liblfs.so.*.*.* | |
79 | %attr(755,root,root) %ghost %{_libdir}/liblfs.so.0 | |
80 | ||
81 | %files devel | |
82 | %defattr(644,root,root,755) | |
83 | %attr(755,root,root) %{_libdir}/liblfs.so | |
84 | %{_includedir}/lfs.h | |
85 | %{_includedir}/lfs_util.h | |
86 | ||
87 | %if %{with static_libs} | |
88 | %files static | |
89 | %defattr(644,root,root,755) | |
90 | %{_libdir}/liblfs.a | |
91 | %endif |