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