]> git.pld-linux.org Git - packages/ktoblzcheck.git/blob - ktoblzcheck.spec
- updated to 1.53 (uses cmake now); added python3- package
[packages/ktoblzcheck.git] / ktoblzcheck.spec
1 #
2 # Conditional build:
3 %bcond_without  static_libs     # static library
4 %bcond_without  python2         # CPython 2.x module
5 #
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
8 Name:           ktoblzcheck
9 Version:        1.53
10 Release:        1
11 License:        LGPL v2+
12 Group:          Libraries
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)
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
37 %description -l pl.UTF-8
38 KtoBLZCheck to biblioteka do sprawdzania numerów kont i kodów
39 bankowych niemieckich banków.
40
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.
45
46 %package devel
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
52
53 %description devel
54 Header files for KtoBLZCheck library.
55
56 %description devel -l pl.UTF-8
57 Pliki nagłówkowe biblioteki KtoBLZCheck.
58
59 %package static
60 Summary:        Static KtoBLZCheck library
61 Summary(pl.UTF-8):      Statyczna biblioteka KtoBLZCheck
62 Group:          Development/Libraries
63 Requires:       %{name}-devel = %{version}-%{release}
64
65 %description static
66 Static KtoBLZCheck library.
67
68 %description static -l pl.UTF-8
69 Statyczna biblioteka KtoBLZCheck.
70
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
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
89
90 %description -n python-ktoblzcheck
91 Python binding for KtoBLZCheck library.
92
93 %description -n python-ktoblzcheck -l pl.UTF-8
94 Wiązanie Pythona dla biblioteki KtoBLZCheck.
95
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
109 %prep
110 %setup -q
111 %patch0 -p1
112 %patch1 -p1
113
114 # drop pythondir, wrongly joined
115 %{__sed} -i -e '/^pythondir=/d' ktoblzcheck.pc.in
116
117 %build
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
138 %{__make}
139
140 %install
141 rm -rf $RPM_BUILD_ROOT
142
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 \
152         DESTDIR=$RPM_BUILD_ROOT
153
154 %py3_comp $RPM_BUILD_ROOT%{py3_sitescriptdir}
155 %py3_ocomp $RPM_BUILD_ROOT%{py3_sitescriptdir}
156
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}
163 %py_postclean
164 %endif
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)
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*
183
184 %files devel
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
191
192 %if %{with static_libs}
193 %files static
194 %defattr(644,root,root,755)
195 %{_libdir}/libktoblzcheck.a
196 %endif
197
198 %files apidocs
199 %defattr(644,root,root,755)
200 %{_docdir}/ktoblzcheck
201
202 %if %{with python2}
203 %files -n python-ktoblzcheck
204 %defattr(644,root,root,755)
205 %{py_sitescriptdir}/ktoblzcheck.py[co]
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]
This page took 0.113425 seconds and 3 git commands to generate.