]> git.pld-linux.org Git - packages/inih.git/blob - inih.spec
19df7cc6f6abe466fef015927d4ad0c31a58f0b6
[packages/inih.git] / inih.spec
1 #
2 # Conditional build:
3 %bcond_without  cxx             # C++ INIReader interface
4 %bcond_without  static_libs     # static library
5 #
6 Summary:        Simple .INI file parser written in C
7 Summary(pl.UTF-8):      Prosty parser plików .INI napisany w C
8 Name:           inih
9 Version:        52
10 Release:        1
11 License:        BSD
12 Group:          Libraries
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}
18 BuildRequires:  meson
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)
23
24 %description
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.
30
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ść".
38
39 %package devel
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}
44
45 %description devel
46 Header file for inih library.
47
48 %description devel -l pl.UTF-8
49 Plik nagłówkowy biblioteki inih.
50
51 %package static
52 Summary:        Static inih library
53 Summary(pl.UTF-8):      Statyczna biblioteka inih
54 Group:          Development/Libraries
55 Requires:       %{name}-devel = %{version}-%{release}
56
57 %description static
58 Static inih library.
59
60 %description static -l pl.UTF-8
61 Statyczna biblioteka inih.
62
63 %package c++
64 Summary:        INIReader - simple .INI file parser for C++
65 Summary(pl.UTF-8):      INIReader - prosty parser plików .INI dla C++
66 Group:          Libraries
67 Requires:       %{name} = %{version}-%{release}
68
69 %description c++
70 INIReader - simple .INI file parser for C++.
71
72 %description c++ -l pl.UTF-8
73 INIReader - prosty parser plików .INI dla C++.
74
75 %package c++-devel
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
82
83 %description c++-devel
84 Header file for INIReader library.
85
86 %description c++-devel -l pl.UTF-8
87 Plik nagłówkowy biblioteki INIReader.
88
89 %package c++-static
90 Summary:        Static INIReader library
91 Summary(pl.UTF-8):      Statyczna biblioteka INIReader
92 Group:          Development/Libraries
93 Requires:       %{name}-c++-devel = %{version}-%{release}
94
95 %description c++-static
96 Static INIReader library.
97
98 %description c++-static -l pl.UTF-8
99 Statyczna biblioteka INIReader.
100
101 %prep
102 %setup -q -n %{name}-r%{version}
103
104 %{__sed} -i -e '1s,/usr/bin/env bash,/bin/sh,' examples/cpptest.sh
105
106 %build
107 %meson build \
108         %{!?with_static_libs:--default-library=shared} \
109         -Ddistro_install=true \
110         %{?with_cxx:-Dwith_INIReader=true} \
111
112 %ninja_build -C build
113
114 %install
115 rm -rf $RPM_BUILD_ROOT
116
117 %ninja_install -C build
118
119 install -d $RPM_BUILD_ROOT%{_examplesdir}
120 cp -pr examples $RPM_BUILD_ROOT%{_examplesdir}/%{name}-%{version}
121 %if %{without cxx}
122 %{__rm} $RPM_BUILD_ROOT%{_examplesdir}/%{name}-%{version}/{INIReaderExample.cpp,cpptest.sh,cpptest.txt}
123 %endif
124
125 %clean
126 rm -rf $RPM_BUILD_ROOT
127
128 %post   -p /sbin/ldconfig
129 %postun -p /sbin/ldconfig
130
131 %post   c++ -p /sbin/ldconfig
132 %postun c++ -p /sbin/ldconfig
133
134 %files
135 %defattr(644,root,root,755)
136 %doc LICENSE.txt README.md
137 %attr(755,root,root) %{_libdir}/libinih.so.0
138
139 %files devel
140 %defattr(644,root,root,755)
141 %attr(755,root,root) %{_libdir}/libinih.so
142 %{_includedir}/ini.h
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
148
149 %if %{with static_libs}
150 %files static
151 %defattr(644,root,root,755)
152 %{_libdir}/libinih.a
153 %endif
154
155 %if %{with cxx}
156 %files c++
157 %defattr(644,root,root,755)
158 %attr(755,root,root) %{_libdir}/libINIReader.so.0
159
160 %files c++-devel
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
168
169 %if %{with static_libs}
170 %files c++-static
171 %defattr(644,root,root,755)
172 %{_libdir}/libINIReader.a
173 %endif
174 %endif
This page took 0.055352 seconds and 2 git commands to generate.