[packages/libccd] - obsolete -static, added -apidocs and man page
qboosh
qboosh at pld-linux.org
Sun Mar 15 09:16:30 CET 2026
commit 1776759ee92de3786f38a41d6b7b9d7757e451c5
Author: Jakub Bogusz <qboosh at pld-linux.org>
Date: Sun Mar 15 09:16:38 2026 +0100
- obsolete -static, added -apidocs and man page
libccd-man.patch | 22 ++++++++++++++++++++
libccd.spec | 61 ++++++++++++++++++++++++++++++++++++++++++++++++--------
2 files changed, 75 insertions(+), 8 deletions(-)
---
diff --git a/libccd.spec b/libccd.spec
index 5ecaec3..1190517 100644
--- a/libccd.spec
+++ b/libccd.spec
@@ -1,3 +1,7 @@
+#
+# Conditional build:
+%bcond_without doc # HTML and man documentation
+
Summary: Library for a collision detection between two convex shapes
Summary(pl.UTF-8): Biblioteka do wykrywania kolizji między dwoma bryłami wypukłymi
Name: libccd
@@ -5,10 +9,19 @@ Version: 2.1
Release: 1
License: BSD
Group: Libraries
+#Source0Download: https://github.com/danfis/libccd/tags
+# TODO: use
+#Source0: https://github.com/danfis/libccd/archive/%{version}/libccd-%{version}.tar.gz
Source0: https://github.com/danfis/libccd/archive/refs/tags/v%{version}.tar.gz
# Source0-md5: fe8ea5024956044a3af6bcbab312950f
+Patch0: %{name}-man.patch
URL: https://github.com/danfis/libccd
-BuildRequires: cmake >= 2.8
+BuildRequires: cmake >= 2.8.11
+BuildRequires: rpm-build >= 4.6
+BuildRequires: rpmbuild(macros) >= 1.605
+%if %{with doc}
+BuildRequires: sphinx-pdg >= 2
+%endif
BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
%description
@@ -30,6 +43,7 @@ Summary: Header files for %{name} library
Summary(pl.UTF-8): Pliki nagłówkowe biblioteki %{name}
Group: Development/Libraries
Requires: %{name} = %{version}-%{release}
+Obsoletes: libccd-static < 2.1
%description devel
Header files for %{name} library.
@@ -37,21 +51,42 @@ Header files for %{name} library.
%description devel -l pl.UTF-8
Pliki nagłówkowe biblioteki %{name}.
+%package apidocs
+Summary: API documentation for libccd library
+Summary(pl.UTF-8): Dokumentacja API biblioteki libccd
+Group: Documentation
+BuildArch: noarch
+
+%description apidocs
+API documentation for libccd library.
+
+%description apidocs -l pl.UTF-8
+Dokumentacja API biblioteki libccd.
+
%prep
%setup -q
+%patch -P0 -p1
%build
# autotools build system doesn't install .pc file, use cmake instead
-%cmake .
+install -d build
+cd build
+# use relative include,lib dirs for correct .pc file
+%cmake .. \
+ %{?with_doc:-DBUILD_DOCUMENTATION=ON} \
+ -DCMAKE_INSTALL_INCLUDEDIR=include \
+ -DCMAKE_INSTALL_LIBDIR=%{_lib}
+
%{__make}
%install
rm -rf $RPM_BUILD_ROOT
-%{__make} install \
+%{__make} -C build install \
DESTDIR=$RPM_BUILD_ROOT
-%{__rm} -rf $RPM_BUILD_ROOT%{_docdir}/ccd
+# packaged as %doc
+%{__rm} -r $RPM_BUILD_ROOT%{_docdir}/ccd
%clean
rm -rf $RPM_BUILD_ROOT
@@ -62,12 +97,22 @@ rm -rf $RPM_BUILD_ROOT
%files
%defattr(644,root,root,755)
%doc BSD-LICENSE README.md
-%attr(755,root,root) %{_libdir}/libccd.so.*.*
-%attr(755,root,root) %ghost %{_libdir}/libccd.so.2
+%{_libdir}/libccd.so.*.*
+%ghost %{_libdir}/libccd.so.2
%files devel
%defattr(644,root,root,755)
-%attr(755,root,root) %{_libdir}/libccd.so
+%{_libdir}/libccd.so
%{_includedir}/ccd
%{_pkgconfigdir}/ccd.pc
-%{_libdir}/ccd
+%dir %{_libdir}/ccd
+%{_libdir}/ccd/*.cmake
+%if %{with doc}
+%{_mandir}/man3/libccd.3*
+%endif
+
+%if %{with doc}
+%files apidocs
+%defattr(644,root,root,755)
+%doc build/doc/html/{_static,*.html,*.js}
+%endif
diff --git a/libccd-man.patch b/libccd-man.patch
new file mode 100644
index 0000000..9e018af
--- /dev/null
+++ b/libccd-man.patch
@@ -0,0 +1,22 @@
+--- libccd-2.1/doc/CMakeLists.txt.orig 2018-12-22 13:13:45.000000000 +0100
++++ libccd-2.1/doc/CMakeLists.txt 2026-03-15 09:13:37.374788503 +0100
+@@ -30,7 +30,7 @@ if(NOT WIN32)
+ add_dependencies(doc man)
+
+ install(DIRECTORY "${CCD_MAN_OUTPUT_DIR}/"
+- DESTINATION "${CMAKE_INSTALL_MANDIR}/man1")
++ DESTINATION "${CMAKE_INSTALL_MANDIR}/man3")
+
+ list(APPEND CCD_DOC_ADDITIONAL_MAKE_CLEAN_FILES "${CCD_MAN_OUTPUT_DIR}")
+ endif()
+--- libccd-2.1/doc/conf.py.orig 2018-12-22 13:13:45.000000000 +0100
++++ libccd-2.1/doc/conf.py 2026-03-15 09:13:45.368078533 +0100
+@@ -302,7 +302,7 @@ latex_documents = [
+ # (source start file, name, description, authors, manual section).
+ man_pages = [
+ (master_doc, 'libccd', u'libccd Documentation',
+- [author], 1)
++ [author], 3)
+ ]
+
+ # If true, show URL addresses after external links.
================================================================
---- gitweb:
http://git.pld-linux.org/gitweb.cgi/packages/libccd.git/commitdiff/1776759ee92de3786f38a41d6b7b9d7757e451c5
More information about the pld-cvs-commit
mailing list