Files
desktop/libbsd/libbsd.spec
2025-12-23 01:27:28 +08:00

99 lines
2.9 KiB
RPMSpec

# SPDX-FileCopyrightText: (C) 2025 Institute of Software, Chinese Academy of Sciences (ISCAS)
# SPDX-FileCopyrightText: (C) 2025 openRuyi Project Contributors
# SPDX-FileContributor: jingyupu <pujingyu@iscas.ac.cn>
#
# SPDX-License-Identifier: MulanPSL-2.0
%define lname libbsd0
Name: libbsd
Version: 0.11.7
Release: %autorelease
Summary: Library with functions commonly found on BSD systems
License: BSD-3-Clause
Group: Development/Libraries/C and C++
URL: https://libbsd.freedesktop.org/
#!RemoteAsset
Source0: https://libbsd.freedesktop.org/releases/libbsd-%{version}.tar.xz
Patch0: libbsd-glibc-2.34-closefrom.patch
BuildRequires: fdupes
BuildRequires: libmd-devel
BuildRequires: openssl-devel
BuildRequires: pkgconfig
%description
This library provides functions commonly found on BSD systems, and
lacking on others like GNU systems, thus making it easier to port projects
with strong BSD origins, without needing to embed the same code over and
over again on each project.
%package -n %{lname}
Summary: Library with functions commonly found on BSD systems
Group: System/Libraries
%description -n %{lname}
This library provides functions commonly found on BSD systems, and
lacking on others like GNU systems, thus making it easier to port projects
with strong BSD origins, without needing to embed the same code over and
over again on each project.
%package devel
Summary: Development headers and files for libbsd
Group: Development/Libraries/C and C++
Requires: %{lname} = %{version}
Requires: glibc-devel
Requires: libmd-devel
%description devel
This library provides functions commonly found on BSD systems, and
lacking on others like GNU systems, thus making it easier to port projects
with strong BSD origins, without needing to embed the same code over and
over again on each project.
%package ctor-static
Summary: Development headers and files for libbsd
Group: Development/Libraries/C and C++
Requires: %{lname} = %{version}-%{release}
Requires: pkgconfig
%description ctor-static
The libbsd-ctor static library is required if setproctitle() is to be used
when libbsd is loaded via dlopen() from a threaded program. This can be
configured using "pkg-config --libs libbsd-ctor".
%prep
%autosetup -p1
%build
export CFLAGS="%{optflags} -ffat-lto-objects"
%configure --disable-static
%make_build
%install
%make_install
%fdupes -s %{buildroot}
%check
%make_build check
%post -n %{lname} -p /sbin/ldconfig
%postun -n %{lname} -p /sbin/ldconfig
%files -n %{lname}
%license COPYING
%doc ChangeLog
%{_libdir}/libbsd.so.0*
%files devel
%{_includedir}/bsd
%{_libdir}/libbsd.so
%{_mandir}/man3/*
%{_mandir}/man7/*
%{_libdir}/pkgconfig/libbsd.pc
%{_libdir}/pkgconfig/libbsd-overlay.pc
%files ctor-static
%{_libdir}/libbsd-ctor.a
%{_libdir}/pkgconfig/libbsd-ctor.pc
%changelog
%{?autochangelog}