File libcue.spec of Package libcue
#
# spec file for package libcue
#
# Copyright (c) 2023 SUSE LLC
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
# upon. The license for this file, and modifications and additions to the
# file, is the same license as for the pristine package itself (unless the
# license for the pristine package is not an Open Source License, in which
# case the license is the MIT License). An "Open Source License" is a
# license that conforms to the Open Source Definition (Version 1.9)
# published by the Open Source Initiative.
# Please submit bugfixes or comments via https://bugs.opensuse.org/
#
Name: libcue
%define lname libcue2
Version: 2.3.0
Release: 0
Summary: CUE sheet parsing library
License: GPL-2.0-only
Group: Development/Libraries/C and C++
URL: https://github.com/lipnitsk/libcue
Source: https://github.com/lipnitsk/libcue/archive/v%version.tar.gz
BuildRoot: %{_tmppath}/%{name}-%{version}-build
BuildRequires: bison
BuildRequires: cmake
BuildRequires: flex
BuildRequires: pkg-config
%description
libcue parses so-called cue sheets from a char string or a FILE
pointer. This project is meant as a fork of (defunct) cuetools.
%package -n %lname
Summary: CUE sheet parsing library
Group: System/Libraries
%description -n %lname
libcue parses so-called cue sheets from a char string or a FILE
pointer.
%package devel
Summary: Development files for libcue, a CUE sheet parsing library
Group: Development/Libraries/C and C++
Requires: %lname = %version
%description devel
libcue parses so-called cue sheets from a char string or a FILE
pointer.
This package contains the development library symlink and header
files.
%prep
%autosetup -p1
%build
mkdir build && cd build
cmake .. \
-DCMAKE_INSTALL_PREFIX:PATH=%{_prefix} \
-DINCLUDE_INSTALL_DIR:PATH=%{_includedir} \
-DLIB_INSTALL_DIR:PATH=%{_libdir} \
-DSYSCONF_INSTALL_DIR:PATH=%{_sysconfdir} \
-DSHARE_INSTALL_PREFIX:PATH=%{_datadir} \
-DCMAKE_INSTALL_LIBDIR:PATH=%{_libdir} \
-DCMAKE_BUILD_TYPE=RelWithDebInfo \
-DCMAKE_C_FLAGS="${CFLAGS:-%optflags} -DNDEBUG" \
-DCMAKE_CXX_FLAGS="${CXXFLAGS:-%optflags} -DNDEBUG" \
-DBUILD_SHARED_LIBS=1 \
%if "%{?_lib}" == "lib64"
-DLIB_SUFFIX=64 \
%endif
make %{?_smp_mflags}
%install
make VERBOSE=1 DESTDIR=%{buildroot} install/fast -C build
rm -f "%buildroot/%_libdir"/*.la
%check
export LD_LIBRARY_PATH="$LD_LIBRARY_PATH:%buildroot/%_libdir"
cd build
ctest --output-on-failure --force-new-ctest-process
%post -n %lname -p /sbin/ldconfig
%postun -n %lname -p /sbin/ldconfig
%files -n %lname
%_libdir/libcue.so.2*
%files devel
%_includedir/libcue.h
%_includedir/libcue*/
%_libdir/libcue.so
%_libdir/pkgconfig/*.pc
%changelog