]>
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 | |
18 | Version: 0.3.0 | |
07a93909 | 19 | Release: 2 |
919f854a ER |
20 | License: LGPL v2+ |
21 | Group: Libraries | |
22 | URL: http://code.google.com/p/esteid/ | |
23 | Source0: http://esteid.googlecode.com/files/%{name}-%{version}.tar.bz2 | |
24 | # Source0-md5: a567fd16d2ce6205b179850e98c26971 | |
25 | BuildRequires: cmake | |
26 | BuildRequires: libdigidoc-devel | |
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 | |
33 | BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n) | |
34 | %if %{with perl} || %{with php} || %{with python} | |
35 | BuildRequires: swig | |
36 | %endif | |
37 | %if %{with perl} | |
38 | BuildRequires: perl-devel | |
39 | %endif | |
40 | %if %{with php} | |
41 | BuildRequires: php-devel >= 4:5.0.4 | |
42 | %endif | |
43 | %if %{with python} | |
44 | BuildRequires: python-devel | |
45 | %endif | |
46 | Requires: libdigidoc | |
47 | Requires: opensc | |
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 | |
102 | %setup -q | |
103 | ||
104 | # Remove bundled copy of minizip | |
105 | rm -rf src/minizip | |
106 | ||
107 | %build | |
108 | install -d build | |
109 | cd build | |
110 | %cmake .. \ | |
111 | %{!?with_bindings:-DENABLE_BINDINGS=NO} | |
112 | %{__make} | |
113 | ||
114 | %install | |
115 | rm -rf $RPM_BUILD_ROOT | |
116 | %{__make} -C build install \ | |
117 | DESTDIR=$RPM_BUILD_ROOT | |
118 | ||
119 | %clean | |
120 | rm -rf $RPM_BUILD_ROOT | |
121 | ||
122 | %post -p /sbin/ldconfig | |
123 | %postun -p /sbin/ldconfig | |
124 | ||
125 | %files | |
126 | %defattr(644,root,root,755) | |
127 | %doc AUTHORS NEWS README | |
128 | %attr(755,root,root) %{_libdir}/libdigidocpp.so.*.*.* | |
129 | %ghost %attr(755,root,root) %{_libdir}/libdigidocpp.so.0 | |
130 | %dir %{_sysconfdir}/digidocpp | |
131 | %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/digidocpp/digidocpp.conf | |
132 | %{_sysconfdir}/digidocpp/certs | |
133 | %{_sysconfdir}/digidocpp/schema | |
134 | ||
135 | %files devel | |
136 | %defattr(644,root,root,755) | |
137 | %{_libdir}/*.so | |
138 | %{_includedir}/digidocpp | |
139 | %{_pkgconfigdir}/lib*.pc | |
140 | ||
141 | %if %{with perl} | |
142 | %files -n perl-digidoc | |
143 | %defattr(644,root,root,755) | |
144 | %{perl_vendorarch}/* | |
145 | %{perl_vendorlib}/* | |
146 | %endif | |
147 | ||
148 | %if %{with php} | |
149 | %files -n php-digidoc | |
150 | %defattr(644,root,root,755) | |
151 | %{php_extdir}/* | |
152 | %{php_data_dir}/* | |
153 | %{_sysconfdir}/php.d/digidoc.ini | |
154 | %endif | |
155 | ||
156 | %if %{with python} | |
157 | %files -n python-digidoc | |
158 | %defattr(644,root,root,755) | |
159 | %{py_sitedir}/* | |
160 | %endif |