File di.spec of Package di

#
# spec file for package di
#
# Copyright (c) 2025 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:           di
Version:        6.0.0
Release:        0
Summary:        Disk Information Utility
License:        MIT
Group:          System/Filesystems
URL:            http://gentoo.com/%{name}/
Source0:        %{name}-%{version}.tar.xz
BuildRequires:  cmake
%if 0%{?suse_version} && 0%{?suse_version} > 1500
BuildRequires:  pkgconfig(gmp)
%else
BuildRequires:  gmp-devel
%endif

%define soname 6

%description
'di' is a disk information utility, displaying everything (and more) that your 'df' command does. It features the ability to display your disk usage in whatever format you prefer. It also checks the user and group quotas, so that the user sees the space available for their use, not the system wide disk space. It is designed to be portable across many platforms and is great for heterogenous networks.

%package -n lib%{name}%{soname}
Summary:        Disk Information Library
Group:          System/Libraries

%description -n lib%{name}%{soname}
This package provides shared consensus libraries for %{name}.

%package -n lib%{name}-devel
Summary:        Development files for lib%{name}
Group:          Development/Libraries/C and C++
Requires:       lib%{name}%{soname} = %{version}

%description -n lib%{name}-devel
The lib%{name}-devel package contains libraries and header files for developing applications that use lib%{name}.

%prep
%setup -q

%build
%make_build -e PREFIX=%{_usr}
%{__strip} build/%{name}
%{__strip} build/lib%{name}.so.%{soname}.*

%install
%make_install -e PREFIX=%{_usr}
%find_lang %{name}

%check

%post -n lib%{name}%{soname}
/sbin/ldconfig

%postun -n lib%{name}%{soname}
/sbin/ldconfig

%files -f %{name}.lang
%defattr(-,root,root,-)
%attr(755,root,root) %{_bindir}/%{name}
%{_mandir}/man1/%{name}.1.gz
%license LICENSE.txt

%files -n lib%{name}%{soname}
%defattr(-,root,root,-)
%{_libdir}/lib%{name}.so.*
%license LICENSE.txt

%files -n lib%{name}-devel
%defattr(-,root,root,-)
%{_includedir}/%{name}.h
%{_libdir}/lib%{name}.so
%{_libdir}/pkgconfig/%{name}.pc
%{_mandir}/man3/lib%{name}.3.gz
%doc README.txt
%license LICENSE.txt

%changelog
openSUSE Build Service is sponsored by