3 %bcond_without static_libs # static library
4 %bcond_without python2 # CPython 2.x module
6 Summary: A library to check account numbers and bank codes of German banks
7 Summary(pl.UTF-8): Biblioteka do sprawdzania numerów kont i kodów bankowych niemieckich banków
13 Source0: https://downloads.sourceforge.net/ktoblzcheck/%{name}-%{version}.tar.gz
14 # Source0-md5: 5cedb258370acd22ec3d0c90e0e66fec
15 Patch0: %{name}-static.patch
16 Patch1: %{name}-python.patch
17 URL: https://ktoblzcheck.sourceforge.net/
18 BuildRequires: cmake >= 3.0
19 BuildRequires: doxygen
20 BuildRequires: libstdc++-devel
21 %{?with_python2:BuildRequires: python-modules >= 1:2.6}
22 BuildRequires: python3-devel >= 1:3.2
23 BuildRequires: rpm-build >= 4.6
24 BuildRequires: rpm-pythonprov
25 BuildRequires: rpmbuild(macros) >= 1.714
26 BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
29 KtoBLZCheck is a library to check account numbers and bank codes of
32 Both a library for other programs as well as a short command-line tool
33 is available. It is possible to check pairs of account numbers and
34 bank codes (BLZ) of German banks, and to map bank codes (BLZ) to the
35 clear-text name and location of the bank.
37 %description -l pl.UTF-8
38 KtoBLZCheck to biblioteka do sprawdzania numerów kont i kodów
39 bankowych niemieckich banków.
41 Dostępna jest zarówno biblioteka jak i proste narzędzie działające z
42 linii poleceń. Pozwalają na sprawdzenie par numerów kont i kodów
43 bankowych (BLZ) niemieckich banków oraz na zamianę kodów bankowych
44 (BLZ) na tekstową nazwę oraz lokalizację banku.
47 Summary: Header files for KtoBLZCheck library
48 Summary(pl.UTF-8): Pliki nagłówkowe biblioteki KtoBLZCheck
49 Group: Development/Libraries
50 Requires: %{name} = %{version}-%{release}
51 Requires: libstdc++-devel
54 Header files for KtoBLZCheck library.
56 %description devel -l pl.UTF-8
57 Pliki nagłówkowe biblioteki KtoBLZCheck.
60 Summary: Static KtoBLZCheck library
61 Summary(pl.UTF-8): Statyczna biblioteka KtoBLZCheck
62 Group: Development/Libraries
63 Requires: %{name}-devel = %{version}-%{release}
66 Static KtoBLZCheck library.
68 %description static -l pl.UTF-8
69 Statyczna biblioteka KtoBLZCheck.
72 Summary: API documentation for KtoBLZCheck library
73 Summary(pl.UTF-8): Dokumentacja API biblioteki KtoBLZCheck
78 API documentation for KtoBLZCheck library.
80 %description apidocs -l pl.UTF-8
81 Dokumentacja API biblioteki KtoBLZCheck.
83 %package -n python-ktoblzcheck
84 Summary: Python 2 binding for KtoBLZCheck library
85 Summary(pl.UTF-8): Wiązanie Pythona 2 dla biblioteki KtoBLZCheck
86 Group: Development/Languages/Python
87 Requires: %{name} = %{version}-%{release}
88 Requires: python-modules >= 1:2.6
90 %description -n python-ktoblzcheck
91 Python binding for KtoBLZCheck library.
93 %description -n python-ktoblzcheck -l pl.UTF-8
94 Wiązanie Pythona dla biblioteki KtoBLZCheck.
96 %package -n python3-ktoblzcheck
97 Summary: Python 3 binding for KtoBLZCheck library
98 Summary(pl.UTF-8): Wiązanie Pythona 3 dla biblioteki KtoBLZCheck
99 Group: Development/Languages/Python
100 Requires: %{name} = %{version}-%{release}
101 Requires: python3-modules >= 1:3.2
103 %description -n python3-ktoblzcheck
104 Python binding for KtoBLZCheck library.
106 %description -n python3-ktoblzcheck -l pl.UTF-8
107 Wiązanie Pythona dla biblioteki KtoBLZCheck.
114 # drop pythondir, wrongly joined
115 %{__sed} -i -e '/^pythondir=/d' ktoblzcheck.pc.in
118 %if %{with static_libs}
119 install -d build-static
123 -DENABLE_BANKDATA_DOWNLOAD=OFF
132 -DCMAKE_INSTALL_BINDIR=bin \
133 -DCMAKE_INSTALL_DATADIR=share \
134 -DCMAKE_INSTALL_INCLUDEDIR=include \
135 -DCMAKE_INSTALL_LIBDIR=%{_lib} \
136 -DENABLE_BANKDATA_DOWNLOAD=OFF
141 rm -rf $RPM_BUILD_ROOT
143 %if %{with static_libs}
144 %{__make} -C build-static install \
145 DESTDIR=$RPM_BUILD_ROOT
147 # use the one from shared build
148 %{__rm} $RPM_BUILD_ROOT%{_pkgconfigdir}/ktoblzcheck.pc
151 %{__make} -C build install \
152 DESTDIR=$RPM_BUILD_ROOT
154 %py3_comp $RPM_BUILD_ROOT%{py3_sitescriptdir}
155 %py3_ocomp $RPM_BUILD_ROOT%{py3_sitescriptdir}
158 # module supports CPython 2.6+, but cmake prefers python3, in such case python2 module must be installed manually
159 install -d $RPM_BUILD_ROOT%{py_sitescriptdir}
160 cp -p src/python/ktoblzcheck.py $RPM_BUILD_ROOT%{py_sitescriptdir}
161 %py_comp $RPM_BUILD_ROOT%{py_sitescriptdir}
162 %py_ocomp $RPM_BUILD_ROOT%{py_sitescriptdir}
167 rm -rf $RPM_BUILD_ROOT
169 %post -p /sbin/ldconfig
170 %postun -p /sbin/ldconfig
173 %defattr(644,root,root,755)
174 %doc AUTHORS ChangeLog NEWS README.md
175 %attr(755,root,root) %{_bindir}/ibanchk
176 %attr(755,root,root) %{_bindir}/ktoblzcheck
177 %attr(755,root,root) %{_libdir}/libktoblzcheck.so.*.*.*
178 %attr(755,root,root) %ghost %{_libdir}/libktoblzcheck.so.1
179 %dir %{_datadir}/%{name}
180 %{_datadir}/%{name}/*.txt
181 %{_mandir}/man1/ibanchk.1*
182 %{_mandir}/man1/ktoblzcheck.1*
185 %defattr(644,root,root,755)
186 %attr(755,root,root) %{_libdir}/libktoblzcheck.so
187 %{_includedir}/iban.h
188 %{_includedir}/ktoblzcheck.h
189 %{_libdir}/cmake/KtoBlzCheck
190 %{_pkgconfigdir}/ktoblzcheck.pc
192 %if %{with static_libs}
194 %defattr(644,root,root,755)
195 %{_libdir}/libktoblzcheck.a
199 %defattr(644,root,root,755)
200 %{_docdir}/ktoblzcheck
203 %files -n python-ktoblzcheck
204 %defattr(644,root,root,755)
205 %{py_sitescriptdir}/ktoblzcheck.py[co]
208 %files -n python3-ktoblzcheck
209 %defattr(644,root,root,755)
210 %{py3_sitescriptdir}/ktoblzcheck.py
211 %{py3_sitescriptdir}/__pycache__/ktoblzcheck.cpython-*.py[co]