]>
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 | |
ae9bebb1 JB |
56 | libtool --mode=compile %{__cc} %{rpmcflags} %{rpmcppflags} -Wall -Wextra -pedantic -Wmissing-prototypes -c bd/lfs_filebd.c -o lfs_filebd.lo -I. |
57 | libtool --mode=compile %{__cc} %{rpmcflags} %{rpmcppflags} -Wall -Wextra -pedantic -Wmissing-prototypes -c bd/lfs_rambd.c -o lfs_rambd.lo -I. | |
4d66194d | 58 | libtool --mode=link %{__cc} %{!?with_static_libs:-shared} %{rpmldflags} %{rpmcflags} -o liblfs.la lfs.lo lfs_util.lo lfs_filebd.lo lfs_rambd.lo -rpath %{_libdir} |
2962afc5 JB |
59 | |
60 | %install | |
61 | rm -rf $RPM_BUILD_ROOT | |
62 | install -d $RPM_BUILD_ROOT{%{_includedir},%{_libdir}} | |
63 | ||
4d66194d | 64 | cp -p lfs.h lfs_util.h bd/lfs_filebd.h bd/lfs_rambd.h $RPM_BUILD_ROOT%{_includedir} |
2962afc5 JB |
65 | |
66 | libtool --mode=install install liblfs.la $RPM_BUILD_ROOT%{_libdir} | |
67 | ||
68 | # no external dependencies | |
69 | %{__rm} $RPM_BUILD_ROOT%{_libdir}/liblfs.la | |
70 | ||
71 | %clean | |
72 | rm -rf $RPM_BUILD_ROOT | |
73 | ||
74 | %post -p /sbin/ldconfig | |
75 | %postun -p /sbin/ldconfig | |
76 | ||
77 | %files | |
78 | %defattr(644,root,root,755) | |
79 | %doc DESIGN.md LICENSE.md README.md SPEC.md | |
80 | %attr(755,root,root) %{_libdir}/liblfs.so.*.*.* | |
81 | %attr(755,root,root) %ghost %{_libdir}/liblfs.so.0 | |
82 | ||
83 | %files devel | |
84 | %defattr(644,root,root,755) | |
85 | %attr(755,root,root) %{_libdir}/liblfs.so | |
86 | %{_includedir}/lfs.h | |
4d66194d JB |
87 | %{_includedir}/lfs_filebd.h |
88 | %{_includedir}/lfs_rambd.h | |
2962afc5 JB |
89 | %{_includedir}/lfs_util.h |
90 | ||
91 | %if %{with static_libs} | |
92 | %files static | |
93 | %defattr(644,root,root,755) | |
94 | %{_libdir}/liblfs.a | |
95 | %endif |