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