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