]>
Commit | Line | Data |
---|---|---|
b8d48d75 JB |
1 | # |
2 | # Conditional build: | |
3 | %bcond_without static_libs # static library | |
7c8fff8d | 4 | %bcond_without python2 # CPython 2.x module |
b8d48d75 | 5 | # |
2a3de659 | 6 | Summary: A library to check account numbers and bank codes of German banks |
73f0235f | 7 | Summary(pl.UTF-8): Biblioteka do sprawdzania numerów kont i kodów bankowych niemieckich banków |
2a3de659 | 8 | Name: ktoblzcheck |
7c8fff8d | 9 | Version: 1.53 |
b8d48d75 | 10 | Release: 1 |
2a3de659 JB |
11 | License: LGPL v2+ |
12 | Group: Libraries | |
7c8fff8d JB |
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 | |
2a3de659 | 20 | BuildRequires: libstdc++-devel |
7c8fff8d JB |
21 | %{?with_python2:BuildRequires: python-modules >= 1:2.6} |
22 | BuildRequires: python3-devel >= 1:3.2 | |
23 | BuildRequires: rpm-build >= 4.6 | |
2a3de659 | 24 | BuildRequires: rpm-pythonprov |
7c8fff8d | 25 | BuildRequires: rpmbuild(macros) >= 1.714 |
2a3de659 JB |
26 | BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n) |
27 | ||
28 | %description | |
29 | KtoBLZCheck is a library to check account numbers and bank codes of | |
30 | German banks. | |
31 | ||
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. | |
36 | ||
c45bdc01 JR |
37 | %description -l pl.UTF-8 |
38 | KtoBLZCheck to biblioteka do sprawdzania numerów kont i kodów | |
39 | bankowych niemieckich banków. | |
2a3de659 | 40 | |
c45bdc01 JR |
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. | |
2a3de659 JB |
45 | |
46 | %package devel | |
47 | Summary: Header files for KtoBLZCheck library | |
73f0235f | 48 | Summary(pl.UTF-8): Pliki nagłówkowe biblioteki KtoBLZCheck |
2a3de659 JB |
49 | Group: Development/Libraries |
50 | Requires: %{name} = %{version}-%{release} | |
51 | Requires: libstdc++-devel | |
52 | ||
53 | %description devel | |
54 | Header files for KtoBLZCheck library. | |
55 | ||
c45bdc01 JR |
56 | %description devel -l pl.UTF-8 |
57 | Pliki nagłówkowe biblioteki KtoBLZCheck. | |
2a3de659 JB |
58 | |
59 | %package static | |
60 | Summary: Static KtoBLZCheck library | |
73f0235f | 61 | Summary(pl.UTF-8): Statyczna biblioteka KtoBLZCheck |
2a3de659 JB |
62 | Group: Development/Libraries |
63 | Requires: %{name}-devel = %{version}-%{release} | |
64 | ||
65 | %description static | |
66 | Static KtoBLZCheck library. | |
67 | ||
c45bdc01 | 68 | %description static -l pl.UTF-8 |
2a3de659 JB |
69 | Statyczna biblioteka KtoBLZCheck. |
70 | ||
7c8fff8d JB |
71 | %package apidocs |
72 | Summary: API documentation for KtoBLZCheck library | |
73 | Summary(pl.UTF-8): Dokumentacja API biblioteki KtoBLZCheck | |
74 | Group: Documentation | |
75 | BuildArch: noarch | |
76 | ||
77 | %description apidocs | |
78 | API documentation for KtoBLZCheck library. | |
79 | ||
80 | %description apidocs -l pl.UTF-8 | |
81 | Dokumentacja API biblioteki KtoBLZCheck. | |
82 | ||
2a3de659 | 83 | %package -n python-ktoblzcheck |
7c8fff8d JB |
84 | Summary: Python 2 binding for KtoBLZCheck library |
85 | Summary(pl.UTF-8): Wiązanie Pythona 2 dla biblioteki KtoBLZCheck | |
2a3de659 JB |
86 | Group: Development/Languages/Python |
87 | Requires: %{name} = %{version}-%{release} | |
7c8fff8d | 88 | Requires: python-modules >= 1:2.6 |
2a3de659 JB |
89 | |
90 | %description -n python-ktoblzcheck | |
91 | Python binding for KtoBLZCheck library. | |
92 | ||
c45bdc01 JR |
93 | %description -n python-ktoblzcheck -l pl.UTF-8 |
94 | Wiązanie Pythona dla biblioteki KtoBLZCheck. | |
2a3de659 | 95 | |
7c8fff8d JB |
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 | |
102 | ||
103 | %description -n python3-ktoblzcheck | |
104 | Python binding for KtoBLZCheck library. | |
105 | ||
106 | %description -n python3-ktoblzcheck -l pl.UTF-8 | |
107 | Wiązanie Pythona dla biblioteki KtoBLZCheck. | |
108 | ||
2a3de659 JB |
109 | %prep |
110 | %setup -q | |
7c8fff8d JB |
111 | %patch0 -p1 |
112 | %patch1 -p1 | |
113 | ||
114 | # drop pythondir, wrongly joined | |
115 | %{__sed} -i -e '/^pythondir=/d' ktoblzcheck.pc.in | |
2a3de659 JB |
116 | |
117 | %build | |
7c8fff8d JB |
118 | %if %{with static_libs} |
119 | install -d build-static | |
120 | cd build-static | |
121 | %cmake .. \ | |
122 | -DBUILD_STATIC=ON \ | |
123 | -DENABLE_BANKDATA_DOWNLOAD=OFF | |
124 | ||
125 | %{__make} | |
126 | cd .. | |
127 | %endif | |
128 | ||
129 | install -d build | |
130 | cd build | |
131 | %cmake .. \ | |
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 | |
137 | ||
2a3de659 JB |
138 | %{__make} |
139 | ||
140 | %install | |
141 | rm -rf $RPM_BUILD_ROOT | |
142 | ||
7c8fff8d JB |
143 | %if %{with static_libs} |
144 | %{__make} -C build-static install \ | |
145 | DESTDIR=$RPM_BUILD_ROOT | |
146 | ||
147 | # use the one from shared build | |
148 | %{__rm} $RPM_BUILD_ROOT%{_pkgconfigdir}/ktoblzcheck.pc | |
149 | %endif | |
150 | ||
151 | %{__make} -C build install \ | |
2a3de659 JB |
152 | DESTDIR=$RPM_BUILD_ROOT |
153 | ||
7c8fff8d JB |
154 | %py3_comp $RPM_BUILD_ROOT%{py3_sitescriptdir} |
155 | %py3_ocomp $RPM_BUILD_ROOT%{py3_sitescriptdir} | |
b8d48d75 | 156 | |
7c8fff8d JB |
157 | %if %{with python2} |
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} | |
9068fc9a | 163 | %py_postclean |
7c8fff8d | 164 | %endif |
2a3de659 JB |
165 | |
166 | %clean | |
167 | rm -rf $RPM_BUILD_ROOT | |
168 | ||
169 | %post -p /sbin/ldconfig | |
170 | %postun -p /sbin/ldconfig | |
171 | ||
172 | %files | |
173 | %defattr(644,root,root,755) | |
7c8fff8d JB |
174 | %doc AUTHORS ChangeLog NEWS README.md |
175 | %attr(755,root,root) %{_bindir}/ibanchk | |
2a3de659 JB |
176 | %attr(755,root,root) %{_bindir}/ktoblzcheck |
177 | %attr(755,root,root) %{_libdir}/libktoblzcheck.so.*.*.* | |
d2274f4b | 178 | %attr(755,root,root) %ghost %{_libdir}/libktoblzcheck.so.1 |
2a3de659 JB |
179 | %dir %{_datadir}/%{name} |
180 | %{_datadir}/%{name}/*.txt | |
7c8fff8d | 181 | %{_mandir}/man1/ibanchk.1* |
2a3de659 JB |
182 | %{_mandir}/man1/ktoblzcheck.1* |
183 | ||
184 | %files devel | |
185 | %defattr(644,root,root,755) | |
186 | %attr(755,root,root) %{_libdir}/libktoblzcheck.so | |
d2274f4b JB |
187 | %{_includedir}/iban.h |
188 | %{_includedir}/ktoblzcheck.h | |
7c8fff8d | 189 | %{_libdir}/cmake/KtoBlzCheck |
d4b4785e | 190 | %{_pkgconfigdir}/ktoblzcheck.pc |
2a3de659 | 191 | |
b8d48d75 | 192 | %if %{with static_libs} |
2a3de659 JB |
193 | %files static |
194 | %defattr(644,root,root,755) | |
195 | %{_libdir}/libktoblzcheck.a | |
b8d48d75 | 196 | %endif |
2a3de659 | 197 | |
7c8fff8d JB |
198 | %files apidocs |
199 | %defattr(644,root,root,755) | |
200 | %{_docdir}/ktoblzcheck | |
201 | ||
202 | %if %{with python2} | |
2a3de659 JB |
203 | %files -n python-ktoblzcheck |
204 | %defattr(644,root,root,755) | |
205 | %{py_sitescriptdir}/ktoblzcheck.py[co] | |
7c8fff8d JB |
206 | %endif |
207 | ||
208 | %files -n python3-ktoblzcheck | |
209 | %defattr(644,root,root,755) | |
210 | %{py3_sitescriptdir}/ktoblzcheck.py | |
211 | %{py3_sitescriptdir}/__pycache__/ktoblzcheck.cpython-*.py[co] |