]> git.pld-linux.org Git - packages/libdigidocpp.git/blob - libdigidocpp.spec
- removed perl and php packages (never existed in PLD, not supported in cmakefiles)
[packages/libdigidocpp.git] / libdigidocpp.spec
1 #
2 # Conditional build:
3 %bcond_without  java            # Java module
4 %bcond_without  python          # Python 3 module
5 %bcond_without  bindings        # build bindings (currently only C#/Win32 and Java/Android supported)
6 # https://github.com/open-eid/libdigidocpp/issues/231
7 %bcond_with     podofo          # outdated PoDoFo support (disabled in sources)
8
9 %if %{without bindings}
10 %undefine       with_java
11 %undefine       with_python
12 %endif
13
14 Summary:        Library for creating and validating BDoc and DDoc containers
15 Summary(pl.UTF-8):      Biblioteka do tworzenia i sprawdzania poprawności kontenerów BDoc i DDoc
16 Name:           libdigidocpp
17 Version:        3.16.0
18 Release:        1
19 License:        LGPL v2.1+
20 Group:          Libraries
21 #Source0Download: https://github.com/open-eid/libdigidocpp/releases
22 Source0:        https://github.com/open-eid/libdigidocpp/releases/download/v%{version}/%{name}-%{version}.tar.gz
23 # Source0-md5:  879590bba8b236b128646871003593cd
24 Patch0:         %{name}-link.patch
25 Patch1:         %{name}-python.patch
26 URL:            https://github.com/open-eid/libdigidocpp
27 # for tests
28 BuildRequires:  boost-devel
29 BuildRequires:  cmake >= 3.16
30 BuildRequires:  doxygen
31 BuildRequires:  libstdc++-devel
32 BuildRequires:  minizip-devel >= 1
33 BuildRequires:  openssl-devel >= 1.1.1
34 BuildRequires:  pkgconfig
35 %{?with_podofo:BuildRequires:   podofo-devel}
36 BuildRequires:  rpm-build >= 4.6
37 BuildRequires:  rpmbuild(macros) >= 1.734
38 %if %{with perl} || %{with php} || %{with python}
39 BuildRequires:  swig
40 %endif
41 BuildRequires:  xerces-c-devel
42 BuildRequires:  xml-security-c-devel
43 BuildRequires:  xsd >= 4.0
44 BuildRequires:  xxd
45 BuildRequires:  zlib-devel
46 %if %{with python}
47 BuildRequires:  python3-devel >= 1:3.2
48 BuildRequires:  swig-python >= 2
49 %endif
50 Requires:       opensc
51 BuildRoot:      %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
52
53 %description
54 libdigidocpp is a C++ library for reading, validating, and creating
55 BDoc and DDoc containers. These file formats are widespread in Estonia
56 where they are used for storing legally binding digital signatures.
57
58 %description -l pl.UTF-8
59 libdigidocpp to biblioteka C++ do odczytu, sprawdzania poprawności i
60 tworzenia kontenerów BDoc i DDoc. Te formaty plików są
61 rozpowszechnione w Estonii, gdzie służą do przechowywania umocowanych
62 prawnie podpisów cyfrowych.
63
64 %package devel
65 Summary:        Development files for libdigidocpp library
66 Summary(pl.UTF-8):      Pliki programistyczne biblioteki libdigidocpp
67 Group:          Development/Libraries
68 Requires:       %{name} = %{version}-%{release}
69 Requires:       libstdc++-devel
70
71 %description devel
72 This package contains the header files for developing applications
73 that use libdigidocpp library.
74
75 %description devel -l pl.UTF-8
76 Ten pakiet zawiera pliki nagłówkowe do tworzenia aplikacji
77 wykorzystujących bibliotekę libdigidocpp.
78
79 %package apidocs
80 Summary:        API documentation for libdigidocpp library
81 Summary(pl.UTF-8):      Dokumentacja API biblioteki libdigidocpp
82 Group:          Documentation
83 BuildArch:      noarch
84
85 %description apidocs
86 API documentation for libdigidocpp library.
87
88 %description apidocs -l pl.UTF-8
89 Dokumentacja API biblioteki libdigidocpp.
90
91 %package -n python3-digidoc
92 Summary:        Python bindings for libdigidocpp library
93 Summary(pl.UTF-8):      Wiązania Pythona do biblioteki libdigidocpp
94 Group:          Development/Languages/Python
95 Requires:       %{name} = %{version}-%{release}
96 Provides:       %{name}-python = %{version}-%{release}
97 Obsoletes:      libdigidocpp-python < 0.3.0-1
98 Obsoletes:      python-digidoc < 0.3.0-2
99
100 %description -n python3-digidoc
101 Python bindings for libdigidocpp library.
102
103 %description -n python3-digidoc -l pl.UTF-8
104 Wiązania Pythona do biblioteki libdigidocpp.
105
106 %prep
107 %setup -q
108 %patch0 -p1
109 %patch1 -p1
110
111 # Remove bundled copy of minizip
112 %{__rm} -r src/minizip
113
114 %build
115 %cmake -B build \
116         -DCMAKE_INSTALL_DOCDIR=%{_docdir}/%{name} \
117         -DPython3_SITELIB=%{py3_sitedir}
118
119 %{__make} -C build
120
121 %install
122 rm -rf $RPM_BUILD_ROOT
123
124 %{__make} -C build install \
125         DESTDIR=$RPM_BUILD_ROOT
126
127 %py3_comp $RPM_BUILD_ROOT%{py3_sitedir}
128 %py3_ocomp $RPM_BUILD_ROOT%{py3_sitedir}
129
130 # packaged as %doc
131 %{__rm} -r $RPM_BUILD_ROOT%{_docdir}/%{name}
132
133 # should be as dll not sources
134 %{__rm} -r $RPM_BUILD_ROOT%{_includedir}/digidocpp_csharp
135 # should be as jar not sources
136 %{__rm} -r $RPM_BUILD_ROOT%{_includedir}/ee/ria/libdigidocpp
137
138 %clean
139 rm -rf $RPM_BUILD_ROOT
140
141 %post   -p /sbin/ldconfig
142 %postun -p /sbin/ldconfig
143
144 %files
145 %defattr(644,root,root,755)
146 %doc AUTHORS COPYING README.md RELEASE-NOTES.md
147 %dir %{_sysconfdir}/digidocpp
148 %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/digidocpp/digidocpp.conf
149 %{_sysconfdir}/digidocpp/schema
150 %attr(755,root,root) %{_libdir}/libdigidocpp.so.*.*.*
151 %ghost %attr(755,root,root) %{_libdir}/libdigidocpp.so.1
152 %attr(755,root,root) %{_bindir}/digidoc-tool
153 %{_mandir}/man1/digidoc-tool.1*
154
155 %files devel
156 %defattr(644,root,root,755)
157 %attr(755,root,root) %{_libdir}/libdigidocpp.so
158 %{_includedir}/digidocpp
159 %{_pkgconfigdir}/libdigidocpp.pc
160
161 %files apidocs
162 %defattr(644,root,root,755)
163 %doc build/doc/*
164
165 # TODO: csharp, java bindings?
166 #%attr(755,root,root) %{_libdir}/libdigidoc_csharp.so
167 #%attr(755,root,root) %{_libdir}/libdigidoc_java.so
168
169 %if %{with python}
170 %files -n python3-digidoc
171 %defattr(644,root,root,755)
172 %attr(755,root,root) %{py3_sitedir}/_digidoc_python.so
173 %{py3_sitedir}/digidoc.py
174 %{py3_sitedir}/__pycache__/digidoc.cpython-*.py[co]
175 %endif
This page took 0.090116 seconds and 4 git commands to generate.