--- /dev/null
+--- libdigidoc-3.10.2/CMakeLists.txt.orig 2016-02-01 11:43:08.000000000 +0100
++++ libdigidoc-3.10.2/CMakeLists.txt 2017-11-25 09:17:52.191901184 +0100
+@@ -1,5 +1,5 @@
+ cmake_minimum_required( VERSION 2.8 )
+-project( libdigidoc )
++project( libdigidoc C)
+
+ set( CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR}/cmake/modules" )
+ set( CMAKE_FIND_ROOT_PATH ${CMAKE_OSX_SYSROOT} )
+--- libdigidoc-3.10.2/libdigidoc/CMakeLists.txt.orig 2016-02-01 11:43:08.000000000 +0100
++++ libdigidoc-3.10.2/libdigidoc/CMakeLists.txt 2017-11-25 09:18:35.061900692 +0100
+@@ -95,7 +95,6 @@
+
+ if( BUILD_TOOLS )
+ add_executable(cdigidoc cdigidoc.c cdigidoc.rc)
+- set_target_properties(cdigidoc PROPERTIES INSTALL_RPATH "@loader_path/../../../..;@loader_path/../..")
+ target_link_libraries(cdigidoc digidoc)
+ endif()
+
+--- libdigidoc-3.10.2/cmake/modules/VersionInfo.cmake.orig 2016-02-01 11:43:09.000000000 +0100
++++ libdigidoc-3.10.2/cmake/modules/VersionInfo.cmake 2017-11-25 09:23:11.785230866 +0100
+@@ -69,14 +69,14 @@
+
+ if(CMAKE_COMPILER_IS_GNUCC OR __COMPILER_GNU)
+ if(NOT DEFINED ENABLE_VISIBILITY)
+- set(CMAKE_C_FLAGS "${CMAKE_CXX_FLAGS} -fvisibility=hidden")
++ set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fvisibility=hidden")
+ set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fvisibility=hidden -fvisibility-inlines-hidden")
+ #set( CMAKE_C_VISIBILITY_PRESET hidden )
+ #set( CMAKE_CXX_VISIBILITY_PRESET hidden )
+ #set( CMAKE_VISIBILITY_INLINES_HIDDEN 1 )
+ endif()
+
+- if(NOT DISABLE_CXX11)
++ if(FALSE)
+ include(CheckCXXCompilerFlag)
+ CHECK_CXX_COMPILER_FLAG(-std=c++11 C11)
+ CHECK_CXX_COMPILER_FLAG(-std=c++0x C0X)
-#
-# Conditional build:
-%bcond_with static_libs # build static libraries
-
Summary: XAdES digital signature standard library
+Summary(pl.UTF-8): Biblioteka obsługująca standard podpisów cyfrowych XAdES
Name: libdigidoc
+# Note: 3.10.3 is tagged, but release tarball is not published;
+# as it doesn't have substantial improvements on Linux and requires git submodules,
+# stick to 3.10.2 for now.
Version: 3.10.2
-Release: 1
-License: LGPL v2+
+Release: 2
+License: LGPL v2.1+
Group: Libraries
+#Source0Download: https://github.com/open-eid/libdigidoc/releases
Source0: https://github.com/open-eid/libdigidoc/releases/download/v%{version}/%{name}-%{version}.tar.gz
# Source0-md5: 987a21c44a8b627794b6f810bf15465f
+Patch0: %{name}-cmake.patch
URL: https://github.com/open-eid/libdigidoc
-BuildRequires: cmake
-BuildRequires: libstdc++-devel
-BuildRequires: libxml2-devel
+BuildRequires: cmake >= 2.8
+BuildRequires: libxml2-devel >= 2
BuildRequires: openssl-devel
BuildRequires: pkgconfig
BuildRequires: zlib-devel
DigiDoc is a generic library implementing the XAdES digital signature
standard. It allows to create, sign, verify, and modify digidoc XML
containers. Support for doing hardware cryptographic signing
-operations is porivded via PKCS#11.
+operations is provided via PKCS#11.
+
+%description -l pl.UTF-8
+DigiDoc to ogólna biblioteka implementująca standard podpisów
+cyfrowych XAdES. Pozwala na tworzenie, podpisywanie, sprawdzanie i
+modyfikowanie kontenerów XML digidoc. Obsługa podpisywania przy użyciu
+kryptografii sprzętowej jest zapewniana poprzez PKCS#11.
%package devel
-Summary: Header files and development documentation for libdigidoc
+Summary: Header files for libdigidoc library
+Summary(pl.UTF-8): Pliki nagłówkowe biblioteki libdigidoc
Group: Development/Libraries
Requires: %{name} = %{version}-%{release}
+Requires: openssl-devel
+Requires: libxml2-devel >= 2
%description devel
-Header files and development documentation for libdigidoc.
+Header files for libdigidoc library.
-%package static
-Summary: Static libdigidoc library
-Group: Development/Libraries
-Requires: %{name}-devel = %{version}-%{release}
+%description devel -l pl.UTF-8
+Pliki nagłówkowe biblioteki libdigidoc.
+
+%package apidocs
+Summary: Development documentation for libdigidoc
+Summary(pl.UTF-8): Dokumentacja programistyczna biblioteki libdigidoc
+Group: Documentation
-%description static
-Static libdigidoc library.
+%description apidocs
+Development documentation for libdigidoc.
+
+%description apidocs -l pl.UTF-8
+Dokumentacja programistyczna biblioteki libdigidoc.
%prep
%setup -q
+%patch0 -p1
%build
install -d build
%install
rm -rf $RPM_BUILD_ROOT
+
%{__make} -C build install \
DESTDIR=$RPM_BUILD_ROOT
# certs come from ca-certificates package
-rm -r $RPM_BUILD_ROOT%{_datadir}/%{name}/*.crt
+%{__rm} $RPM_BUILD_ROOT%{_datadir}/%{name}/*.crt
%clean
rm -rf $RPM_BUILD_ROOT
%defattr(644,root,root,755)
%doc AUTHORS README.md RELEASE-NOTES.txt
%config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/digidoc.conf
-%attr(755,root,root) %{_libdir}/%{name}.so.*.*
-%attr(755,root,root) %ghost %{_libdir}/%{name}.so.2
+%attr(755,root,root) %{_libdir}/libdigidoc.so.*.*
+%attr(755,root,root) %ghost %{_libdir}/libdigidoc.so.2
%attr(755,root,root) %{_bindir}/cdigidoc
%{_mandir}/man1/cdigidoc.1*
%files devel
%defattr(644,root,root,755)
-%doc doc/*
-%defattr(644,root,root,755)
-%attr(755,root,root) %{_libdir}/%{name}.so
-%{_includedir}/%{name}
-%{_pkgconfigdir}/%{name}.pc
+%attr(755,root,root) %{_libdir}/libdigidoc.so
+%{_includedir}/libdigidoc
+%{_pkgconfigdir}/libdigidoc.pc
-%if %{with static_libs}
-%files static
+%files apidocs
%defattr(644,root,root,755)
-%{_libdir}/libdigidoc.a
-%endif
+%doc doc/{SK-CDD-PRG-GUIDE.pdf,SK-COM-PRG-GUIDE.pdf,sample_files_CDD.zip}