3 %bcond_without cxx # C++ INIReader interface
4 %bcond_without static_libs # static library
6 Summary: Simple .INI file parser written in C
7 Summary(pl.UTF-8): Prosty parser plików .INI napisany w C
13 #Source0Download: https://github.com/benhoyt/inih/releases
14 Source0: https://github.com/benhoyt/inih/archive/r%{version}/%{name}-r%{version}.tar.gz
15 # Source0-md5: dc8b8638b84d990faa75b8558b34a68d
16 URL: https://github.com/benhoyt/inih
17 %{?with_cxx:BuildRequires: libstdc++-devel}
19 BuildRequires: ninja >= 1.5
20 BuildRequires: rpmbuild(macros) >= 1.736
21 BuildRequires: sed >= 4.0
22 BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
25 inih (INI Not Invented Here) is a simple .INI file parser written in
26 C. It's only a couple of pages of code, and it was designed to be
27 small and simple, so it's good for embedded systems. It's also more or
28 less compatible with Python's ConfigParser style of .INI files,
29 including RFC 822-style multi-line syntax and `name: value` entries.
31 %description -l pl.UTF-8
32 inih (INI Not Invented Here - INI nie wynalezione tutaj) to prosty
33 parser plików .INI, napisany w C. Jest to tylko kilka stron kodu,
34 zaprojektowane jako mała i prosta biblioteka, dobra do systemów
35 wbudowanych. Jest mniej więcej kompatybilna z plikami .INI w stylu
36 pythonowego ConfigParsera, włącznie ze składnią wielowierszową w
37 stylu RFC 822 oraz wpisami "nazwa: wartość".
40 Summary: Header file for inih library
41 Summary(pl.UTF-8): Plik nagłówkowy biblioteki inih
42 Group: Development/Libraries
43 Requires: %{name} = %{version}-%{release}
46 Header file for inih library.
48 %description devel -l pl.UTF-8
49 Plik nagłówkowy biblioteki inih.
52 Summary: Static inih library
53 Summary(pl.UTF-8): Statyczna biblioteka inih
54 Group: Development/Libraries
55 Requires: %{name}-devel = %{version}-%{release}
60 %description static -l pl.UTF-8
61 Statyczna biblioteka inih.
64 Summary: INIReader - simple .INI file parser for C++
65 Summary(pl.UTF-8): INIReader - prosty parser plików .INI dla C++
67 Requires: %{name} = %{version}-%{release}
70 INIReader - simple .INI file parser for C++.
72 %description c++ -l pl.UTF-8
73 INIReader - prosty parser plików .INI dla C++.
76 Summary: Header file for INIReader library
77 Summary(pl.UTF-8): Plik nagłówkowy biblioteki INIReader
78 Group: Development/Libraries
79 Requires: %{name}-c++ = %{version}-%{release}
80 Requires: %{name}-devel = %{version}-%{release}
81 Requires: libstdc++-devel
83 %description c++-devel
84 Header file for INIReader library.
86 %description c++-devel -l pl.UTF-8
87 Plik nagłówkowy biblioteki INIReader.
90 Summary: Static INIReader library
91 Summary(pl.UTF-8): Statyczna biblioteka INIReader
92 Group: Development/Libraries
93 Requires: %{name}-c++-devel = %{version}-%{release}
95 %description c++-static
96 Static INIReader library.
98 %description c++-static -l pl.UTF-8
99 Statyczna biblioteka INIReader.
102 %setup -q -n %{name}-r%{version}
104 %{__sed} -i -e '1s,/usr/bin/env bash,/bin/sh,' examples/cpptest.sh
108 %{!?with_static_libs:--default-library=shared} \
109 -Ddistro_install=true \
110 %{?with_cxx:-Dwith_INIReader=true} \
112 %ninja_build -C build
115 rm -rf $RPM_BUILD_ROOT
117 %ninja_install -C build
119 install -d $RPM_BUILD_ROOT%{_examplesdir}
120 cp -pr examples $RPM_BUILD_ROOT%{_examplesdir}/%{name}-%{version}
122 %{__rm} $RPM_BUILD_ROOT%{_examplesdir}/%{name}-%{version}/{INIReaderExample.cpp,cpptest.sh,cpptest.txt}
126 rm -rf $RPM_BUILD_ROOT
128 %post -p /sbin/ldconfig
129 %postun -p /sbin/ldconfig
131 %post c++ -p /sbin/ldconfig
132 %postun c++ -p /sbin/ldconfig
135 %defattr(644,root,root,755)
136 %doc LICENSE.txt README.md
137 %attr(755,root,root) %{_libdir}/libinih.so.0
140 %defattr(644,root,root,755)
141 %attr(755,root,root) %{_libdir}/libinih.so
143 %{_pkgconfigdir}/inih.pc
144 %dir %{_examplesdir}/%{name}-%{version}
145 %{_examplesdir}/%{name}-%{version}/*.c
146 %{_examplesdir}/%{name}-%{version}/config.def
147 %{_examplesdir}/%{name}-%{version}/test.ini
149 %if %{with static_libs}
151 %defattr(644,root,root,755)
157 %defattr(644,root,root,755)
158 %attr(755,root,root) %{_libdir}/libINIReader.so.0
161 %defattr(644,root,root,755)
162 %attr(755,root,root) %{_libdir}/libINIReader.so
163 %{_includedir}/INIReader.h
164 %{_pkgconfigdir}/INIReader.pc
165 %{_examplesdir}/%{name}-%{version}/INIReaderExample.cpp
166 %attr(755,root,root) %{_examplesdir}/%{name}-%{version}/cpptest.sh
167 %{_examplesdir}/%{name}-%{version}/cpptest.txt
169 %if %{with static_libs}
171 %defattr(644,root,root,755)
172 %{_libdir}/libINIReader.a