diff --git a/doxygen-1.9.7-unicode-test.ptch b/doxygen-1.9.7-unicode-test.ptch
new file mode 100644
index 0000000000000000000000000000000000000000..1d390b89e8185ca5cf6e0f360a5fd955d1832e5b
--- /dev/null
+++ b/doxygen-1.9.7-unicode-test.ptch
@@ -0,0 +1,34 @@
+diff -Nur doxygen-1.9.7-bug/doc_internal/releases.md doxygen-1.9.7/doc_internal/releases.md
+--- doxygen-1.9.7-bug/doc_internal/releases.md 2023-05-18 20:19:49.000000000 +0200
++++ doxygen-1.9.7/doc_internal/releases.md 2023-05-18 21:16:40.000000000 +0200
+@@ -2,7 +2,7 @@
+
+ The following table gives an overview of the doxygen releases with together with the release dates.
+
+-- Release 1.9.7 18-05-2022
++- Release 1.9.7 18-05-2023
+ - Release 1.9.6 27-12-2022
+ - Release 1.9.5 26-08-2022
+ - Release 1.9.4 05-05-2022
+diff -Nur "doxygen-1.9.7-bug/testing/061_U\314\201nicod\342\202\254_file.cpp" "doxygen-1.9.7/testing/061_U\314\201nicod\342\202\254_file.cpp"
+--- "doxygen-1.9.7-bug/testing/061_U\314\201nicod\342\202\254_file.cpp" 2023-01-02 20:08:23.760982526 +0100
++++ "doxygen-1.9.7/testing/061_U\314\201nicod\342\202\254_file.cpp" 1970-01-01 01:00:00.000000000 +0100
+@@ -1,7 +0,0 @@
+-// objective: test a file with unicode characters in the name
+-// check: 061___xC3_x9Anicod_xE2_x82_xAC__file_8cpp.xml
+-
+-class Test
+-{
+-};
+-
+diff -Nur "doxygen-1.9.7-bug/testing/061_\303\232nicod\342\202\254_file.cpp" "doxygen-1.9.7/testing/061_\303\232nicod\342\202\254_file.cpp"
+--- "doxygen-1.9.7-bug/testing/061_\303\232nicod\342\202\254_file.cpp" 1970-01-01 01:00:00.000000000 +0100
++++ "doxygen-1.9.7/testing/061_\303\232nicod\342\202\254_file.cpp" 2023-01-02 20:08:23.000000000 +0100
+@@ -0,0 +1,7 @@
++// objective: test a file with unicode characters in the name
++// check: 061___xC3_x9Anicod_xE2_x82_xAC__file_8cpp.xml
++
++class Test
++{
++};
++
diff --git a/doxygen-1.9.6.src.tar.gz b/doxygen-1.9.7.src.tar.gz
similarity index 41%
rename from doxygen-1.9.6.src.tar.gz
rename to doxygen-1.9.7.src.tar.gz
index 50d904054e6f764ccc833b29fde20d27edf824ea..62fd22d2dc5fa15ceab05ac24eef23f516c0f214 100644
Binary files a/doxygen-1.9.6.src.tar.gz and b/doxygen-1.9.7.src.tar.gz differ
diff --git a/doxygen.spec b/doxygen.spec
index 77e844f9e90f01207c4169db890c4f1f5a6dd1c8..b56950faf7765f4e1e0c5ad5c45b7f5ae3294190 100644
--- a/doxygen.spec
+++ b/doxygen.spec
@@ -1,105 +1,158 @@
-%global xapian_core_support "ON"
-%global BuildDir "Out"
+%global xapian_core_support OFF
%global clang_support OFF
-Name: doxygen
-Epoch: 1
-Version: 1.9.6
-Release: 1
-Summary: A documentation system for C/C++
-License: GPL+
-Url: https://www.doxygen.nl
-Source0: https://www.doxygen.nl/files/%{name}-%{version}.src.tar.gz
-Source1: doxywizard.desktop
-Source2: doxywizard-icons.tar.xz
-
-BuildRequires: python3 ImageMagick gcc-c++ gcc perl-interpreter
-BuildRequires: python3-libxml2 texlive-bibtex
-BuildRequires: desktop-file-utils graphviz flex bison cmake
-%if %{xapian_core_support} == "ON"
-BuildRequires: xapian-core-devel zlib-devel
+%global build_wizard OFF
+
+Summary: A documentation system for C/C++
+Name: doxygen
+Epoch: 1
+Version: 1.9.7
+Release: 1
+# No version is specified.
+License: GPL-1.0-or-later
+Url: https://github.com/doxygen
+Source0: https://sourceforge.net/projects/doxygen/files/rel-%{version}/%{name}-%{version}.src.tar.gz
+# this icon is part of kdesdk
+Source1: doxywizard.desktop
+# these icons are part of doxygen and converted from doxywizard.ico
+Source2: doxywizard-icons.tar.xz
+
+# upstream patches
+Patch0: doxygen-1.9.7-unicode-test.ptch
+
+BuildRequires: python3
+BuildRequires: perl-interpreter, perl-open
+BuildRequires: texlive-bibtex
+
+BuildRequires: zlib-devel
+BuildRequires: flex
+BuildRequires: bison
+BuildRequires: cmake
+BuildRequires: git
+%if "x%{?xapian_core_support}" == "xON"
+BuildRequires: xapian-core-devel
%endif
%if "x%{?clang_support}" == "xON"
-BuildRequires: llvm-devel
-BuildRequires: clang-devel
+BuildRequires: llvm-devel
+BuildRequires: clang-devel
+%else
+BuildRequires: gcc-c++ gcc
%endif
-
-Requires: perl-interpreter
-Requires: graphviz
+Requires: perl-interpreter
+Requires: graphviz
%description
-Doxygen is the de facto standard tool for generating documentation from
-annotated C++ sources, but it also supports other popular programming
-languages such as C, Objective-C, C#, PHP, Java, Python, IDL (Corba,
-Microsoft, and UNO/OpenOffice flavors), Fortran, VHDL, Tcl, and to some
-extent D.
+Doxygen can generate an online class browser (in HTML) and/or a
+reference manual (in LaTeX) from a set of documented source files. The
+documentation is extracted directly from the sources. Doxygen can
+also be configured to extract the code structure from undocumented
+source files.
+%if "x%{build_wizard}" == "xON"
%package doxywizard
-Summary: A GUI for creating and editing configuration files
-Requires: %{name} = %{epoch}:%{version}-%{release}
-BuildRequires: qt5-qtbase-devel
+Summary: A GUI for creating and editing configuration files
+Requires: %{name} = %{epoch}:%{version}-%{release}
+BuildRequires: qt5-qtbase-devel
+
%description doxywizard
-Doxywizard is a graphical front-end to read/edit/write doxygen
-configuration files.
+Doxywizard is a GUI for creating and editing configuration files that
+are used by doxygen.
+%endif
+
+%if ! 0%{?_module_build}
+%package latex
+Summary: Support for producing latex/pdf output from doxygen
+Requires: %{name} = %{epoch}:%{version}-%{release}
+Requires: tex(latex)
+Requires: tex(dvips)
+Requires: texlive-wasy
+
+%description latex
+%{summary}.
+%endif
+
%prep
-%autosetup -p1
+%autosetup -p1 -a2
+
+# convert into utf-8
iconv --from=ISO-8859-1 --to=UTF-8 LANGUAGE.HOWTO > LANGUAGE.HOWTO.new
touch -r LANGUAGE.HOWTO LANGUAGE.HOWTO.new
mv LANGUAGE.HOWTO.new LANGUAGE.HOWTO
%build
-install -d %{BuildDir}
-cd %{BuildDir}
%cmake \
+ -Duse_libclang=%{clang_support} \
-Dbuild_doc=OFF \
- -Dbuild_wizard=ON \
+ -Dbuild_wizard=OFF \
-Dbuild_xmlparser=ON \
- -Dbuild_search=%{xapian_core_support} \
+ -Dbuild_search=OFF \
-DMAN_INSTALL_DIR=%{_mandir}/man1 \
-DCMAKE_INSTALL_PREFIX:PATH=%{_prefix} \
-DBUILD_SHARED_LIBS=OFF \
- -Duse_libclang=%{clang_support} \
- ..
-cd -
-%make_build -C %{BuildDir}
+
+%make_build %{?_smp_mflags}
%install
-%make_install -C %{BuildDir}
-convert addon/doxywizard/doxywizard.ico doxywizard.png
+%make_install
+
+# install man pages
+mkdir -p %{buildroot}/%{_mandir}/man1
+cp doc/*.1 %{buildroot}/%{_mandir}/man1/
+
+%if "x%{build_wizard}" == "xOFF"
+rm -f %{buildroot}/%{_mandir}/man1/doxywizard.1*
+%else
+# install icons
icondir=%{buildroot}%{_datadir}/icons/hicolor
-install -m755 -d $icondir/{16x16,32x32,48x48,128x128}/apps
+mkdir -m755 -p $icondir/{16x16,32x32,48x48,128x128}/apps
install -m644 -p -D doxywizard-6.png $icondir/16x16/apps/doxywizard.png
install -m644 -p -D doxywizard-5.png $icondir/32x32/apps/doxywizard.png
install -m644 -p -D doxywizard-4.png $icondir/48x48/apps/doxywizard.png
install -m644 -p -D doxywizard-3.png $icondir/128x128/apps/doxywizard.png
-install -d %{buildroot}/%{_mandir}/man1
-cp doc/*.1 %{buildroot}/%{_mandir}/man1/
-%if %{xapian_core_support} == "OFF"
+desktop-file-install --dir=%{buildroot}%{_datadir}/applications %{SOURCE1}
+%endif
+
+%if "x%{?xapian_core_support}" == "xOFF"
rm -f %{buildroot}/%{_mandir}/man1/doxyindexer.1* %{buildroot}/%{_mandir}/man1/doxysearch.1*
%endif
-desktop-file-install --dir=%{buildroot}%{_datadir}/applications %{SOURCE1}
+
+# remove duplicate
+rm -rf %{buildroot}/%{_docdir}/packages
%check
-/usr/bin/ctest --test-dir %{BuildDir} --output-on-failure --force-new-ctest-process -j6
%files
%doc LANGUAGE.HOWTO README.md
%license LICENSE
+%if ! 0%{?_module_build}
+%if "x%{?xapian_core_support}" == "xON"
+%{_bindir}/doxyindexer
+%{_bindir}/doxysearch*
+%endif
+%endif
%{_bindir}/doxygen
%{_mandir}/man1/doxygen.1*
-%if %{xapian_core_support} == "ON"
-%{_bindir}/{doxyindexer,doxysearch*}
-%{_mandir}/man1/{doxyindexer.1*,doxysearch.1*}
+%if "x%{?xapian_core_support}" == "xON"
+%{_mandir}/man1/doxyindexer.1*
+%{_mandir}/man1/doxysearch.1*
%endif
-%exclude %{_docdir}/packages
-
+%if "x%{build_wizard}" == "xON"
%files doxywizard
%{_bindir}/doxywizard
%{_mandir}/man1/doxywizard*
%{_datadir}/applications/doxywizard.desktop
%{_datadir}/icons/hicolor/*/apps/doxywizard.png
+%endif
+
+%if ! 0%{?_module_build}
+%files latex
+# intentionally left blank
+%endif
%changelog
+* Tue Jul 25 2023 wangqia - 1:1.9.7-1
+- Upgrade package to 1.9.7 version
+
* Mon Apr 24 2023 xu_ping <707078654@qq.com> - 1:1.9.6-1
- Upgrade package to 1.9.6 version