[packages/libscfg] new
atler
atler at pld-linux.org
Thu Mar 7 19:58:44 CET 2024
commit f5e02f16bcf3ee08609249f584e392d5fa22f436
Author: Jan Palus <atler at pld-linux.org>
Date: Thu Mar 7 19:37:40 2024 +0100
new
lib-version.patch | 37 ++++++++++++++++++++++++++
libscfg.spec | 78 +++++++++++++++++++++++++++++++++++++++++++++++++++++++
2 files changed, 115 insertions(+)
---
diff --git a/libscfg.spec b/libscfg.spec
new file mode 100644
index 0000000..fa98a08
--- /dev/null
+++ b/libscfg.spec
@@ -0,0 +1,78 @@
+#
+# Conditional build:
+%bcond_without static_libs # static library
+
+Summary: A C library for scfg
+Name: libscfg
+Version: 0.1.1
+Release: 1
+License: MIT
+Group: Libraries
+Source0: https://git.sr.ht/~emersion/libscfg/archive/v%{version}.tar.gz
+# Source0-md5: 8ef49c4566816029e5bb3da06d5fac38
+Patch0: lib-version.patch
+URL: https://wayland.emersion.fr/libscfg/
+BuildRequires: meson >= 0.54.0
+BuildRequires: ninja
+BuildRequires: rpmbuild(macros) >= 1.736
+BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
+
+%description
+A C library for scfg (simple configuration file format).
+
+%package devel
+Summary: Header files for libscfg library
+Group: Development/Libraries
+Requires: %{name}%{?_isa} = %{version}-%{release}
+
+%description devel
+Header files for libscfg library.
+
+%package static
+Summary: Static libscfg library
+Group: Development/Libraries
+Requires: %{name}-devel%{?_isa} = %{version}-%{release}
+
+%description static
+Static libscfg library.
+
+%prep
+%setup -q -n %{name}-v%{version}
+%patch0 -p1
+
+%build
+%meson build \
+ %{!?with_static_libs:--default-library=shared} \
+ -Dwerror=false
+
+%ninja_build -C build
+
+%install
+rm -rf $RPM_BUILD_ROOT
+
+%ninja_install -C build
+
+%clean
+rm -rf $RPM_BUILD_ROOT
+
+%post -p /sbin/ldconfig
+%postun -p /sbin/ldconfig
+
+
+%files
+%defattr(644,root,root,755)
+%doc LICENSE README.md
+%attr(755,root,root) %{_libdir}/libscfg.so.*.*.*
+%attr(755,root,root) %ghost %{_libdir}/libscfg.so.1
+
+%files devel
+%defattr(644,root,root,755)
+%attr(755,root,root) %{_libdir}/libscfg.so
+%{_includedir}/scfg.h
+%{_pkgconfigdir}/scfg.pc
+
+%if %{with static_libs}
+%files static
+%defattr(644,root,root,755)
+%{_libdir}/libscfg.a
+%endif
diff --git a/lib-version.patch b/lib-version.patch
new file mode 100644
index 0000000..75e2882
--- /dev/null
+++ b/lib-version.patch
@@ -0,0 +1,37 @@
+From 3bdba8c2bc3c3625d9751501ab42b047ec01addf Mon Sep 17 00:00:00 2001
+From: Simon Ser <contact at emersion.fr>
+Date: Wed, 6 Mar 2024 19:22:45 +0100
+Subject: [PATCH] build: set library version and soversion
+
+---
+ meson.build | 7 +++++++
+ 1 file changed, 7 insertions(+)
+
+diff --git a/meson.build b/meson.build
+index f426e0c..8877259 100644
+--- a/meson.build
++++ b/meson.build
+@@ -11,6 +11,11 @@ project(
+ ],
+ )
+
++version = meson.project_version()
++version_major = version.split('.')[0]
++version_minor = version.split('.')[1]
++assert(version_major == '0')
++
+ cc = meson.get_compiler('c')
+
+ add_project_arguments(cc.get_supported_arguments([
+@@ -28,6 +33,8 @@ scfg_lib = library(
+ files('scfg.c'),
+ include_directories: scfg_inc,
+ install: true,
++ version: version,
++ soversion: version_minor,
+ )
+
+ scfg = declare_dependency(
+--
+2.38.5
+
================================================================
---- gitweb:
http://git.pld-linux.org/gitweb.cgi/packages/libscfg.git/commitdiff/f5e02f16bcf3ee08609249f584e392d5fa22f436
More information about the pld-cvs-commit
mailing list