]>
Commit | Line | Data |
---|---|---|
919f854a ER |
1 | # TODO |
2 | # - use ca-certificates certs and drop /etc/digidocpp/certs | |
3 | # | |
4 | # Conditional build: | |
5 | %bcond_without perl # perl module | |
6 | %bcond_without php # php module | |
7 | %bcond_without python # python module | |
17b72937 | 8 | %bcond_with bindings # build bindings |
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 | |
17 | Name: libdigidocpp | |
a38f41ba ER |
18 | Version: 3.9.0.1237 |
19 | Release: 1 | |
919f854a ER |
20 | License: LGPL v2+ |
21 | Group: Libraries | |
a38f41ba ER |
22 | Source0: https://installer.id.ee/media/sources/%{name}-%{version}.tar.gz |
23 | # Source0-md5: a6558eb5df8211ac5757104c6c5f24d7 | |
24 | URL: http://www.ria.ee/ | |
919f854a | 25 | BuildRequires: cmake |
a38f41ba | 26 | BuildRequires: libdigidoc-devel >= 3.9 |
919f854a ER |
27 | BuildRequires: libp11-devel |
28 | BuildRequires: minizip-devel | |
29 | BuildRequires: openssl-devel | |
30 | BuildRequires: rpmbuild(macros) >= 1.519 | |
31 | BuildRequires: xml-security-c-devel | |
32 | BuildRequires: xsd | |
919f854a ER |
33 | %if %{with perl} || %{with php} || %{with python} |
34 | BuildRequires: swig | |
35 | %endif | |
36 | %if %{with perl} | |
37 | BuildRequires: perl-devel | |
38 | %endif | |
39 | %if %{with php} | |
40 | BuildRequires: php-devel >= 4:5.0.4 | |
41 | %endif | |
42 | %if %{with python} | |
43 | BuildRequires: python-devel | |
44 | %endif | |
a38f41ba | 45 | Requires: libdigidoc >= 3.9 |
919f854a | 46 | Requires: opensc |
a38f41ba | 47 | BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n) |
919f854a ER |
48 | |
49 | %description | |
50 | libdigidocpp is a C++ library for reading, validating, and creating | |
51 | BDoc and DDoc containers. These file formats are widespread in Estonia | |
52 | where they are used for storing legally binding digital signatures. | |
53 | ||
54 | %package devel | |
55 | Summary: Development files for %{name} | |
56 | Group: Development/Libraries | |
57 | Requires: %{name} = %{version}-%{release} | |
58 | Requires: libdigidoc-devel | |
59 | Requires: libp11-devel | |
60 | Requires: openssl-devel | |
61 | Requires: xml-security-c-devel | |
62 | Requires: xsd | |
63 | ||
64 | %description devel | |
65 | The %{name}-devel package contains libraries and header files for | |
66 | developing applications that use %{name}. | |
67 | ||
68 | %package -n perl-digidoc | |
69 | Summary: Perl bindings for %{name} | |
70 | Group: Development/Languages | |
71 | Requires: %{name} = %{version}-%{release} | |
72 | Provides: %{name}-perl = %{version}-%{release} | |
73 | Obsoletes: libdigidocpp-perl < 0.3.0-1 | |
74 | ||
75 | %description -n perl-digidoc | |
76 | The perl-digidoc package contains Perl bindings for the %{name} | |
77 | library. | |
78 | ||
79 | %package -n php-digidoc | |
80 | Summary: PHP bindings for %{name} | |
81 | Group: Development/Languages | |
82 | Requires: %{name} = %{version}-%{release} | |
83 | %{?requires_php_extension} | |
84 | Provides: %{name}-php = %{version}-%{release} | |
85 | Obsoletes: libdigidocpp-php < 0.3.0-1 | |
86 | ||
87 | %description -n php-digidoc | |
88 | The php-digidoc package contains PHP bindings for the %{name} library. | |
89 | ||
90 | %package -n python-digidoc | |
91 | Summary: Python bindings for %{name} | |
92 | Group: Development/Languages | |
93 | Requires: %{name} = %{version}-%{release} | |
94 | Provides: %{name}-python = %{version}-%{release} | |
95 | Obsoletes: libdigidocpp-python < 0.3.0-1 | |
96 | ||
97 | %description -n python-digidoc | |
98 | The python-digidoc package contains Python bindings for the %{name} | |
99 | library. | |
100 | ||
101 | %prep | |
a38f41ba ER |
102 | %setup -qc |
103 | mv libdigidocpp/* . | |
919f854a ER |
104 | |
105 | # Remove bundled copy of minizip | |
a38f41ba | 106 | rm -r src/minizip |
919f854a ER |
107 | |
108 | %build | |
109 | install -d build | |
110 | cd build | |
111 | %cmake .. \ | |
112 | %{!?with_bindings:-DENABLE_BINDINGS=NO} | |
113 | %{__make} | |
114 | ||
115 | %install | |
116 | rm -rf $RPM_BUILD_ROOT | |
117 | %{__make} -C build install \ | |
118 | DESTDIR=$RPM_BUILD_ROOT | |
119 | ||
120 | %clean | |
121 | rm -rf $RPM_BUILD_ROOT | |
122 | ||
123 | %post -p /sbin/ldconfig | |
124 | %postun -p /sbin/ldconfig | |
125 | ||
126 | %files | |
127 | %defattr(644,root,root,755) | |
a38f41ba | 128 | %doc AUTHORS README RELEASE-NOTES.txt |
919f854a ER |
129 | %dir %{_sysconfdir}/digidocpp |
130 | %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/digidocpp/digidocpp.conf | |
a38f41ba ER |
131 | # XXX ? |
132 | %{_sysconfdir}/digidocpp/37242.p12 | |
919f854a | 133 | %{_sysconfdir}/digidocpp/schema |
a38f41ba ER |
134 | %attr(755,root,root) %{_libdir}/libdigidocpp.so.*.*.* |
135 | %ghost %attr(755,root,root) %{_libdir}/libdigidocpp.so.0 | |
136 | %attr(755,root,root) %{_bindir}/digidoc-tool | |
137 | %{_mandir}/man1/digidoc-tool.1* | |
138 | ||
139 | # XXX ca-certificates or drop? | |
140 | %dir %{_datadir}/esteid | |
141 | %{_datadir}/esteid/certs | |
919f854a ER |
142 | |
143 | %files devel | |
144 | %defattr(644,root,root,755) | |
a38f41ba | 145 | %{_libdir}/libdigidocpp.so |
919f854a | 146 | %{_includedir}/digidocpp |
a38f41ba | 147 | %{_pkgconfigdir}/libdigidocpp.pc |
919f854a ER |
148 | |
149 | %if %{with perl} | |
150 | %files -n perl-digidoc | |
151 | %defattr(644,root,root,755) | |
152 | %{perl_vendorarch}/* | |
153 | %{perl_vendorlib}/* | |
154 | %endif | |
155 | ||
156 | %if %{with php} | |
157 | %files -n php-digidoc | |
158 | %defattr(644,root,root,755) | |
159 | %{php_extdir}/* | |
160 | %{php_data_dir}/* | |
161 | %{_sysconfdir}/php.d/digidoc.ini | |
162 | %endif | |
163 | ||
164 | %if %{with python} | |
165 | %files -n python-digidoc | |
166 | %defattr(644,root,root,755) | |
167 | %{py_sitedir}/* | |
168 | %endif |