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