]>
Commit | Line | Data |
---|---|---|
919f854a ER |
1 | # |
2 | # Conditional build: | |
1785bb97 JB |
3 | %bcond_without java # Java module |
4 | %bcond_with perl # Perl module | |
5 | %bcond_with php # PHP module | |
6 | %bcond_without python # Python 3 module | |
7 | %bcond_without bindings # build bindings (currently only C#/Win32 and Java/Android supported) | |
3cb39951 | 8 | # https://github.com/open-eid/libdigidocpp/issues/231 |
1785bb97 | 9 | %bcond_with podofo # outdated PoDoFo support (disabled in sources) |
919f854a ER |
10 | |
11 | %if %{without bindings} | |
1785bb97 | 12 | %undefine with_java |
919f854a ER |
13 | %undefine with_perl |
14 | %undefine with_php | |
15 | %undefine with_python | |
16 | %endif | |
17 | ||
18 | Summary: Library for creating and validating BDoc and DDoc containers | |
ed0be3f9 | 19 | Summary(pl.UTF-8): Biblioteka do tworzenia i sprawdzania poprawności kontenerów BDoc i DDoc |
919f854a | 20 | Name: libdigidocpp |
1785bb97 JB |
21 | Version: 3.16.0 |
22 | Release: 1 | |
ed0be3f9 | 23 | License: LGPL v2.1+ |
919f854a | 24 | Group: Libraries |
1785bb97 | 25 | #Source0Download: https://github.com/open-eid/libdigidocpp/releases |
6f450f53 | 26 | Source0: https://github.com/open-eid/libdigidocpp/releases/download/v%{version}/%{name}-%{version}.tar.gz |
1785bb97 | 27 | # Source0-md5: 879590bba8b236b128646871003593cd |
ed0be3f9 | 28 | Patch0: %{name}-link.patch |
1785bb97 | 29 | Patch1: %{name}-python.patch |
6f450f53 | 30 | URL: https://github.com/open-eid/libdigidocpp |
ed0be3f9 | 31 | # for tests |
d6f713b6 | 32 | BuildRequires: boost-devel |
1785bb97 | 33 | BuildRequires: cmake >= 3.16 |
ed0be3f9 | 34 | BuildRequires: doxygen |
ed0be3f9 | 35 | BuildRequires: libstdc++-devel |
1785bb97 JB |
36 | BuildRequires: minizip-devel >= 1 |
37 | BuildRequires: openssl-devel >= 1.1.1 | |
38 | %if %{with perl} | |
39 | BuildRequires: perl-devel | |
40 | %endif | |
41 | %if %{with php} | |
42 | BuildRequires: php-devel >= 4:5.0.4 | |
43 | %endif | |
d6f713b6 | 44 | BuildRequires: pkgconfig |
3cb39951 | 45 | %{?with_podofo:BuildRequires: podofo-devel} |
1785bb97 | 46 | BuildRequires: rpm-build >= 4.6 |
b9d8bcdb | 47 | BuildRequires: rpmbuild(macros) >= 1.734 |
1785bb97 JB |
48 | %if %{with perl} || %{with php} || %{with python} |
49 | BuildRequires: swig | |
50 | %endif | |
ed0be3f9 | 51 | BuildRequires: xerces-c-devel |
919f854a | 52 | BuildRequires: xml-security-c-devel |
ed0be3f9 | 53 | BuildRequires: xsd >= 4.0 |
d6f713b6 | 54 | BuildRequires: xxd |
ed0be3f9 | 55 | BuildRequires: zlib-devel |
919f854a | 56 | %if %{with python} |
1785bb97 JB |
57 | BuildRequires: python3-devel >= 1:3.2 |
58 | BuildRequires: swig-python >= 2 | |
919f854a | 59 | %endif |
919f854a | 60 | Requires: opensc |
a38f41ba | 61 | BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n) |
919f854a ER |
62 | |
63 | %description | |
64 | libdigidocpp is a C++ library for reading, validating, and creating | |
65 | BDoc and DDoc containers. These file formats are widespread in Estonia | |
66 | where they are used for storing legally binding digital signatures. | |
67 | ||
ed0be3f9 JB |
68 | %description -l pl.UTF-8 |
69 | libdigidocpp to biblioteka C++ do odczytu, sprawdzania poprawności i | |
70 | tworzenia kontenerów BDoc i DDoc. Te formaty plików są | |
71 | rozpowszechnione w Estonii, gdzie służą do przechowywania umocowanych | |
72 | prawnie podpisów cyfrowych. | |
73 | ||
919f854a | 74 | %package devel |
ed0be3f9 JB |
75 | Summary: Development files for libdigidocpp library |
76 | Summary(pl.UTF-8): Pliki programistyczne biblioteki libdigidocpp | |
919f854a ER |
77 | Group: Development/Libraries |
78 | Requires: %{name} = %{version}-%{release} | |
ed0be3f9 | 79 | Requires: libstdc++-devel |
919f854a ER |
80 | |
81 | %description devel | |
ed0be3f9 JB |
82 | This package contains the header files for developing applications |
83 | that use libdigidocpp library. | |
84 | ||
85 | %description devel -l pl.UTF-8 | |
86 | Ten pakiet zawiera pliki nagłówkowe do tworzenia aplikacji | |
87 | wykorzystujących bibliotekę libdigidocpp. | |
88 | ||
89 | %package apidocs | |
90 | Summary: API documentation for libdigidocpp library | |
91 | Summary(pl.UTF-8): Dokumentacja API biblioteki libdigidocpp | |
92 | Group: Documentation | |
1785bb97 | 93 | BuildArch: noarch |
ed0be3f9 JB |
94 | |
95 | %description apidocs | |
96 | API documentation for libdigidocpp library. | |
97 | ||
98 | %description apidocs -l pl.UTF-8 | |
99 | Dokumentacja API biblioteki libdigidocpp. | |
919f854a ER |
100 | |
101 | %package -n perl-digidoc | |
ed0be3f9 JB |
102 | Summary: Perl bindings for libdigidocpp library |
103 | Summary(pl.UTF-8): Wiązania Perla do biblioteki libdigidocpp | |
104 | Group: Development/Languages/Perl | |
919f854a ER |
105 | Requires: %{name} = %{version}-%{release} |
106 | Provides: %{name}-perl = %{version}-%{release} | |
107 | Obsoletes: libdigidocpp-perl < 0.3.0-1 | |
108 | ||
109 | %description -n perl-digidoc | |
ed0be3f9 JB |
110 | Perl bindings for libdigidocpp library. |
111 | ||
112 | %description -n perl-digidoc -l pl.UTF-8 | |
113 | Wiązania Perla do biblioteki libdigidocpp. | |
919f854a ER |
114 | |
115 | %package -n php-digidoc | |
ed0be3f9 JB |
116 | Summary: PHP bindings for libdigidocpp library |
117 | Summary(pl.UTF-8): Wiązania PHP do biblioteki libdigidocpp | |
118 | Group: Development/Languages/PHP | |
919f854a ER |
119 | Requires: %{name} = %{version}-%{release} |
120 | %{?requires_php_extension} | |
121 | Provides: %{name}-php = %{version}-%{release} | |
122 | Obsoletes: libdigidocpp-php < 0.3.0-1 | |
123 | ||
124 | %description -n php-digidoc | |
ed0be3f9 JB |
125 | PHP bindings for libdigidocpp library. |
126 | ||
127 | %description -n php-digidoc -l pl.UTF-8 | |
128 | Wiązania PHP do biblioteki libdigidocpp. | |
919f854a | 129 | |
1785bb97 | 130 | %package -n python3-digidoc |
ed0be3f9 JB |
131 | Summary: Python bindings for libdigidocpp library |
132 | Summary(pl.UTF-8): Wiązania Pythona do biblioteki libdigidocpp | |
133 | Group: Development/Languages/Python | |
919f854a ER |
134 | Requires: %{name} = %{version}-%{release} |
135 | Provides: %{name}-python = %{version}-%{release} | |
136 | Obsoletes: libdigidocpp-python < 0.3.0-1 | |
1785bb97 | 137 | Obsoletes: python-digidoc < 0.3.0-2 |
919f854a | 138 | |
1785bb97 | 139 | %description -n python3-digidoc |
ed0be3f9 JB |
140 | Python bindings for libdigidocpp library. |
141 | ||
1785bb97 | 142 | %description -n python3-digidoc -l pl.UTF-8 |
ed0be3f9 | 143 | Wiązania Pythona do biblioteki libdigidocpp. |
919f854a ER |
144 | |
145 | %prep | |
6f450f53 | 146 | %setup -q |
ed0be3f9 | 147 | %patch0 -p1 |
b7bd693f | 148 | %patch1 -p1 |
919f854a ER |
149 | |
150 | # Remove bundled copy of minizip | |
ed0be3f9 | 151 | %{__rm} -r src/minizip |
919f854a ER |
152 | |
153 | %build | |
1785bb97 JB |
154 | %cmake -B build \ |
155 | -DCMAKE_INSTALL_DOCDIR=%{_docdir}/%{name} \ | |
156 | -DPython3_SITELIB=%{py3_sitedir} | |
ed0be3f9 | 157 | |
1785bb97 | 158 | %{__make} -C build |
919f854a ER |
159 | |
160 | %install | |
161 | rm -rf $RPM_BUILD_ROOT | |
ed0be3f9 | 162 | |
919f854a ER |
163 | %{__make} -C build install \ |
164 | DESTDIR=$RPM_BUILD_ROOT | |
165 | ||
1785bb97 JB |
166 | %py3_comp $RPM_BUILD_ROOT%{py3_sitedir} |
167 | %py3_ocomp $RPM_BUILD_ROOT%{py3_sitedir} | |
168 | ||
ed0be3f9 JB |
169 | # packaged as %doc |
170 | %{__rm} -r $RPM_BUILD_ROOT%{_docdir}/%{name} | |
171 | ||
1785bb97 JB |
172 | # should be as dll not sources |
173 | %{__rm} -r $RPM_BUILD_ROOT%{_includedir}/digidocpp_csharp | |
174 | # should be as jar not sources | |
175 | %{__rm} -r $RPM_BUILD_ROOT%{_includedir}/ee/ria/libdigidocpp | |
176 | ||
919f854a ER |
177 | %clean |
178 | rm -rf $RPM_BUILD_ROOT | |
179 | ||
180 | %post -p /sbin/ldconfig | |
181 | %postun -p /sbin/ldconfig | |
182 | ||
183 | %files | |
184 | %defattr(644,root,root,755) | |
ed0be3f9 | 185 | %doc AUTHORS COPYING README.md RELEASE-NOTES.md |
919f854a ER |
186 | %dir %{_sysconfdir}/digidocpp |
187 | %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/digidocpp/digidocpp.conf | |
919f854a | 188 | %{_sysconfdir}/digidocpp/schema |
a38f41ba | 189 | %attr(755,root,root) %{_libdir}/libdigidocpp.so.*.*.* |
6f450f53 | 190 | %ghost %attr(755,root,root) %{_libdir}/libdigidocpp.so.1 |
a38f41ba ER |
191 | %attr(755,root,root) %{_bindir}/digidoc-tool |
192 | %{_mandir}/man1/digidoc-tool.1* | |
193 | ||
919f854a ER |
194 | %files devel |
195 | %defattr(644,root,root,755) | |
ed0be3f9 | 196 | %attr(755,root,root) %{_libdir}/libdigidocpp.so |
919f854a | 197 | %{_includedir}/digidocpp |
a38f41ba | 198 | %{_pkgconfigdir}/libdigidocpp.pc |
919f854a | 199 | |
ed0be3f9 JB |
200 | %files apidocs |
201 | %defattr(644,root,root,755) | |
202 | %doc build/doc/* | |
203 | ||
1785bb97 JB |
204 | # TODO: csharp, java bindings? |
205 | #%attr(755,root,root) %{_libdir}/libdigidoc_csharp.so | |
206 | #%attr(755,root,root) %{_libdir}/libdigidoc_java.so | |
207 | ||
919f854a ER |
208 | %if %{with perl} |
209 | %files -n perl-digidoc | |
210 | %defattr(644,root,root,755) | |
211 | %{perl_vendorarch}/* | |
212 | %{perl_vendorlib}/* | |
213 | %endif | |
214 | ||
215 | %if %{with php} | |
216 | %files -n php-digidoc | |
217 | %defattr(644,root,root,755) | |
6f450f53 | 218 | %{php_extensiondir}/* |
919f854a ER |
219 | %{php_data_dir}/* |
220 | %{_sysconfdir}/php.d/digidoc.ini | |
221 | %endif | |
222 | ||
223 | %if %{with python} | |
1785bb97 | 224 | %files -n python3-digidoc |
919f854a | 225 | %defattr(644,root,root,755) |
1785bb97 JB |
226 | %attr(755,root,root) %{py3_sitedir}/_digidoc_python.so |
227 | %{py3_sitedir}/digidoc.py | |
228 | %{py3_sitedir}/__pycache__/digidoc.cpython-*.py[co] | |
919f854a | 229 | %endif |