File dparse-ldc2.spec of Package dparse-ldc2

%define MAJOR_VERSION 0
%define BASE_NAME dparse
%define DC ldc2
%define SO lib%{BASE_NAME}-%{DC}.so
Name:           %{BASE_NAME}-%{DC}
Version:        0.25.1
Summary:        Library for lexing and parsing D source code, version for ldc2
License:        BSL-1.0
URL:            https://github.com/dlang-community/libdparse

%global SOURCE_DATE_EPOCH %(date +%s)

Release:        1%{?dist}
Source0:        %{name}-%{version}.tar.xz
Patch0:         add-makefile.patch
Patch1:         add-make-helper.patch

BuildRequires:  meson ldc patchelf
%if 0%{?suse_version}
BuildRequires:  openSUSE-release lsb-release
BuildRequires:  ldc-bash-completion ldc-phobos-devel ldc-runtime-devel
%else
BuildRequires:  generic-release redhat-lsb util-linux
%endif

%description
Library for lexing and parsing D source code.
This version is for the ldc2 compiler.

%global debug_package %{nil}

%package -n lib%{name}-%{MAJOR_VERSION}
Summary:        Shared library of the dparse project
Provides:       %{name} = %{version}-%{release}

%description -n lib%{name}-%{MAJOR_VERSION}
Library for lexing and parsing D source code, version for ldc2.
This package provides shared library for the ldc2 compiler.

%prep
%autosetup -p1

%build
%make_build

%install
%make_install

%files -n lib%{name}-%{MAJOR_VERSION}
%_libdir/lib%{name}.so.%{MAJOR_VERSION}
%_libdir/lib%{name}.so.%{version}


%package devel
Summary:        Development files of the dparse library
Requires:       lib%{name}-%{MAJOR_VERSION} = %{version} pkg-config

%post -n lib%{name}-%{MAJOR_VERSION} -p /sbin/ldconfig
%postun -n lib%{name}-%{MAJOR_VERSION} -p /sbin/ldconfig

%files devel
%dir %_includedir/d
%_includedir/d/dparse
%_libdir/lib%{name}.so
%_libdir/lib%{name}.a
%_libdir/pkgconfig/%{name}.pc
%_libdir/pkgconfig/%{name}-static.pc

%description devel
Library for lexing and parsing D source code, version for ldc2.
This package is for development.


%changelog
* Wed Feb 25 2026 Eugene 'Vindex' Stulin <tech.vindex@gmail.com> 0.25.1
- new upstream release.
openSUSE Build Service is sponsored by