File dtk6widget.spec of Package dtk6widget

#
# spec file for package dtk6widget
#
# Copyright (c) 2024 SUSE LLC
# Copyright (c) 2024 Hillwood Yang <hillwood@opensuse.org>
#
# 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/
#


%define libver 6
%define dtkver 6

Name:           dtk6widget
Version:        6.0.44
Release:        0
Summary:        Deepin graphical user interface library
License:        LGPL-3.0-or-later
Group:          System/GUI/Other
URL:            https://github.com/linuxdeepin/dtk6widget
Source0:        https://github.com/linuxdeepin/dtk6widget/archive/%{version}/%{name}-%{version}.tar.gz
# Patch0:         qt-6.9.patch
BuildRequires:  fdupes
BuildRequires:  gtest
BuildRequires:  doxygen
BuildRequires:  dtkcommon
BuildRequires:  qt6-tools-linguist
BuildRequires:  qt6-core-private-devel 
BuildRequires:  qt6-declarative-private-devel 
BuildRequires:  qt6-multimedia-devel
BuildRequires:  qt6-printsupport-private-devel
BuildRequires:  cmake(Qt6LinguistTools)
BuildRequires:  cmake(Qt6ToolsTools)
BuildRequires:  cmake(Qt6UiPlugin)
BuildRequires:  pkgconfig(Qt6Concurrent)
BuildRequires:  pkgconfig(Qt6PrintSupport)
BuildRequires:  pkgconfig(Qt6Svg)
BuildRequires:  pkgconfig(Qt6Widgets)
BuildRequires:  pkgconfig(dframeworkdbus)
BuildRequires:  pkgconfig(dtk6core) >= %{dtkver}
BuildRequires:  pkgconfig(dtk6gui) >= %{dtkver}
BuildRequires:  pkgconfig(gsettings-qt)
BuildRequires:  pkgconfig(librsvg-2.0)
BuildRequires:  pkgconfig(libstartup-notification-1.0)
BuildRequires:  pkgconfig(xcb-util)
BuildRequires:  pkgconfig(xext)
BuildRequires:  pkgconfig(xi)
%if 0%{?suse_version} < 1600
BuildRequires:  gcc13-c++
%endif
BuildRoot:      %{_tmppath}/%{name}-%{version}-build

%description
Deepint Tool Kit (Dtk) is the base devlopment tool of all C++/Qt Developer 
work on Deepin.

%package -n lib%{name}%{libver}
Summary:        Libraries for dtkwidget
Group:          System/Libraries
Recommends:     %{name}-lang
Requires:       %{name} = %{version}

%description -n lib%{name}%{libver}
The dtkwidget-devel package contains the header files and developer
docs for dtkcore.

%package devel
Summary:        Development tools for dtkwidget
Group:          Development/Libraries/C and C++
Requires:       lib%{name}%{libver} = %{version}

%description devel
The dtkwidget-devel package contains the header files and developer
docs for dtkcore.

%lang_package

%prep
%autosetup -p1

%build
%if 0%{?suse_version} < 1600
    export CXX=g++-13
%endif
%cmake -DDTK_VERSION=%{version}
%cmake_build

%install
%cmake_install

%check

# Remove useless files
rm -rf %{buildroot}/usr/tests

%find_lang dtkwidget --with-qt
%fdupes %{buildroot}

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

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

%files
%defattr(-,root,root,-)
%doc README.md CHANGELOG.md
%license LICENSE
%{_libdir}/dtk6
%dir %{_datadir}/qt6/doc
%{_datadir}/qt6/doc/dtkwidget.qch

%files -n lib%{name}%{libver}
%defattr(-,root,root,-)
%{_libdir}/lib%{name}.so.*

%files devel
%doc README.md CHANGELOG.md
%license LICENSE
%defattr(-,root,root,-)
%dir %{_includedir}/dtk6
%{_includedir}/dtk6/DWidget
%{_libdir}/pkgconfig/%{name}.pc
%{_libdir}/lib%{name}.so
%dir %{_libdir}/cmake
%{_libdir}/cmake/*
%dir %{_libdir}/qt6
%dir %{_libdir}/qt6/mkspecs
%{_libdir}/qt6/mkspecs/modules

%files lang -f dtkwidget.lang
%defattr(-,root,root,-)
%dir %{_datadir}/dtk6
%dir %{_datadir}/dtk6/DWidget
%dir %{_datadir}/dtk6/DWidget/translations
%{_datadir}/dtk6/DWidget/translations/dtkwidget.qm
%if %{?suse_version} < 1600
%lang(ady) %{_datadir}/dtk6/DWidget/translations/dtkwidget_ady.qm
%lang(ast) %{_datadir}/dtk6/DWidget/translations/dtkwidget_ast.qm
%lang(bqi) %{_datadir}/dtk6/DWidget/translations/dtkwidget_bqi.qm
%lang(fil) %{_datadir}/dtk6/DWidget/translations/dtkwidget_fil.qm
%lang(pam) %{_datadir}/dtk6/DWidget/translations/dtkwidget_pam.qm
%endif

%changelog
openSUSE Build Service is sponsored by