Fix mandoc install error
This commit is contained in:
parent
6c7fc41029
commit
e9911bbc0f
25
0001-add-compile-option.patch
Normal file
25
0001-add-compile-option.patch
Normal file
@ -0,0 +1,25 @@
|
|||||||
|
From b67c8c1b249046b92966b0ad7768c07cbad59445 Mon Sep 17 00:00:00 2001
|
||||||
|
From: zhangchao13 <chaozhangm@isoftstone.com>
|
||||||
|
Date: Thu, 6 Apr 2023 14:48:07 +0800
|
||||||
|
Subject: [PATCH] fix
|
||||||
|
|
||||||
|
---
|
||||||
|
configure | 2 +-
|
||||||
|
1 file changed, 1 insertion(+), 1 deletion(-)
|
||||||
|
|
||||||
|
diff --git a/configure b/configure
|
||||||
|
index 5cf4e08..b8566dd 100644
|
||||||
|
--- a/configure
|
||||||
|
+++ b/configure
|
||||||
|
@@ -42,7 +42,7 @@ OSNAME=
|
||||||
|
UTF8_LOCALE=
|
||||||
|
|
||||||
|
AR=ar
|
||||||
|
-CC=cc
|
||||||
|
+CC=$CC
|
||||||
|
CFLAGS=
|
||||||
|
FATAL=0
|
||||||
|
LDADD=
|
||||||
|
--
|
||||||
|
2.39.2.windows.1
|
||||||
|
|
||||||
160
mandoc.spec
160
mandoc.spec
@ -1,23 +1,25 @@
|
|||||||
Name: mandoc
|
Name: mandoc
|
||||||
Version: 1.14.6
|
Version: 1.14.6
|
||||||
Release: 1
|
Release: 5
|
||||||
Summary: A suite of tools for compiling mdoc and man
|
Summary: A suite of tools for compiling mdoc and man
|
||||||
|
|
||||||
License: ISC
|
License: ISC
|
||||||
URL: https://mandoc.bsd.lv/
|
URL: https://mandoc.bsd.lv/
|
||||||
Source0: https://mandoc.bsd.lv/snapshots/mandoc-%{version}.tar.gz
|
Source0: https://mandoc.bsd.lv/snapshots/mandoc-%{version}.tar.gz
|
||||||
|
Patch0: 0001-add-compile-option.patch
|
||||||
|
|
||||||
BuildRequires: gcc
|
BuildRequires: gcc
|
||||||
BuildRequires: make
|
BuildRequires: make
|
||||||
|
BuildRequires: clang
|
||||||
BuildRequires: zlib-devel
|
BuildRequires: zlib-devel
|
||||||
|
|
||||||
# requirements for %%check
|
# requirements for %%check
|
||||||
BuildRequires: perl-interpreter
|
BuildRequires: perl-interpreter
|
||||||
BuildRequires: perl(IPC::Open3)
|
BuildRequires: perl(IPC::Open3)
|
||||||
|
|
||||||
Requires(post): %{_sbindir}/update-alternatives
|
Requires(post): %{_sbindir}/update-alternatives
|
||||||
Requires(postun): %{_sbindir}/update-alternatives
|
Requires(postun): %{_sbindir}/update-alternatives
|
||||||
Requires(preun): %{_sbindir}/update-alternatives
|
Requires(preun): %{_sbindir}/update-alternatives
|
||||||
|
|
||||||
# The shared library package has been removed per discussion with the
|
# The shared library package has been removed per discussion with the
|
||||||
# upstream maintainer. If using the library, the static library is
|
# upstream maintainer. If using the library, the static library is
|
||||||
@ -68,7 +70,12 @@ echo 'INSTALL_DATA="${INSTALL} -m 0644"' >> configure.local
|
|||||||
|
|
||||||
echo 'INSTALL_LIBMANDOC=1' >> configure.local
|
echo 'INSTALL_LIBMANDOC=1' >> configure.local
|
||||||
|
|
||||||
|
%ifarch riscv64
|
||||||
|
echo 'CFLAGS="%{optflags} -fPIC -Werror=implicit-function-declaration"' >> configure.local
|
||||||
|
%else
|
||||||
echo 'CFLAGS="%{optflags} -fPIC"' >> configure.local
|
echo 'CFLAGS="%{optflags} -fPIC"' >> configure.local
|
||||||
|
%endif
|
||||||
|
export CC=clang
|
||||||
./configure
|
./configure
|
||||||
%make_build
|
%make_build
|
||||||
|
|
||||||
@ -78,125 +85,76 @@ echo 'CFLAGS="%{optflags} -fPIC"' >> configure.local
|
|||||||
# Ensure headers do not have the execute bit set
|
# Ensure headers do not have the execute bit set
|
||||||
chmod -x %{buildroot}%{_includedir}/*.h
|
chmod -x %{buildroot}%{_includedir}/*.h
|
||||||
|
|
||||||
# Rename files for alternative usage
|
# rename files for alternative usage
|
||||||
mv %{buildroot}%{_bindir}/man %{buildroot}%{_bindir}/man.mandoc
|
for f in man apropos whatis soelim; do
|
||||||
mv %{buildroot}%{_bindir}/apropos %{buildroot}%{_bindir}/apropos.mandoc
|
# Rename binary executables
|
||||||
mv %{buildroot}%{_bindir}/whatis %{buildroot}%{_bindir}/whatis.mandoc
|
mv %{buildroot}%{_bindir}/$f %{buildroot}%{_bindir}/$f.%{name}
|
||||||
mv %{buildroot}%{_bindir}/soelim %{buildroot}%{_bindir}/soelim.mandoc
|
|
||||||
mv %{buildroot}%{_sbindir}/makewhatis %{buildroot}%{_sbindir}/makewhatis.mandoc
|
|
||||||
mv %{buildroot}%{_mandir}/man1/apropos.1 %{buildroot}%{_mandir}/man1/apropos.mandoc.1
|
|
||||||
mv %{buildroot}%{_mandir}/man1/man.1 %{buildroot}%{_mandir}/man1/man.mandoc.1
|
|
||||||
mv %{buildroot}%{_mandir}/man1/soelim.1 %{buildroot}%{_mandir}/man1/soelim.mandoc.1
|
|
||||||
mv %{buildroot}%{_mandir}/man1/whatis.1 %{buildroot}%{_mandir}/man1/whatis.mandoc.1
|
|
||||||
mv %{buildroot}%{_mandir}/man7/man.7 %{buildroot}%{_mandir}/man7/man.mandoc.7
|
|
||||||
mv %{buildroot}%{_mandir}/man7/roff.7 %{buildroot}%{_mandir}/man7/roff.mandoc.7
|
|
||||||
mv %{buildroot}%{_mandir}/man7/eqn.7 %{buildroot}%{_mandir}/man7/eqn.mandoc.7
|
|
||||||
mv %{buildroot}%{_mandir}/man7/tbl.7 %{buildroot}%{_mandir}/man7/tbl.mandoc.7
|
|
||||||
mv %{buildroot}%{_mandir}/man8/makewhatis.8 %{buildroot}%{_mandir}/man8/makewhatis.mandoc.8
|
|
||||||
|
|
||||||
# Touch all the locations that update-alternatives will use
|
# Rename corresponding man pages
|
||||||
touch %{buildroot}%{_bindir}/man
|
mv %{buildroot}%{_mandir}/man1/$f.1 %{buildroot}%{_mandir}/man1/$f.%{name}.1
|
||||||
touch %{buildroot}%{_bindir}/apropos
|
done
|
||||||
touch %{buildroot}%{_bindir}/whatis
|
|
||||||
touch %{buildroot}%{_bindir}/soelim
|
|
||||||
touch %{buildroot}%{_sbindir}/makewhatis
|
|
||||||
touch %{buildroot}%{_mandir}/man1/apropos.1
|
|
||||||
touch %{buildroot}%{_mandir}/man1/man.1
|
|
||||||
touch %{buildroot}%{_mandir}/man1/soelim.1
|
|
||||||
touch %{buildroot}%{_mandir}/man1/whatis.1
|
|
||||||
touch %{buildroot}%{_mandir}/man7/man.7
|
|
||||||
touch %{buildroot}%{_mandir}/man7/roff.7
|
|
||||||
touch %{buildroot}%{_mandir}/man7/eqn.7
|
|
||||||
touch %{buildroot}%{_mandir}/man7/tbl.7
|
|
||||||
touch %{buildroot}%{_mandir}/man8/makewhatis.8
|
|
||||||
|
|
||||||
%check
|
%check
|
||||||
env LD_LIBRARY_PATH="$PWD" %make_build regress
|
env LD_LIBRARY_PATH="$PWD" %make_build regress
|
||||||
|
|
||||||
%postun
|
%pre
|
||||||
if [ $1 -ge 1 ]; then
|
for f in man apropos whatis; do
|
||||||
if [ "$(readlink %{_sysconfdir}/alternatives/man)" = "%{_bindir}/man.mandoc" ]; then
|
[ -L %{_bindir}/$f ] || %{__rm} -f %{_bindir}/$f >/dev/null 2>&1 || :
|
||||||
%{_sbindir}/alternatives --set man %{_bindir}/man.mandoc
|
[ -L %{_mandir}/man1/$f.1.gz ] || %{__rm} -f %{_mandir}/man1/$f.1.gz >/dev/null 2>&1 || :
|
||||||
fi
|
done
|
||||||
|
|
||||||
if [ "$(readlink %{_sysconfdir}/alternatives/soelim)" = "%{_bindir}/soelim.mandoc" ]; then
|
if [ -e /usr/lib/systemd/system/mandb.timer ]; then
|
||||||
%{_sbindir}/alternatives --set soelim %{_bindir}/soelim.mandoc
|
if test -d /run/systemd; then
|
||||||
fi
|
systemctl stop man-db.timer >/dev/null 2>&1 || :
|
||||||
|
systemctl -q disable man-db.timer >/dev/null 2>&1 || :
|
||||||
if [ "$(readlink %{_sysconfdir}/alternatives/roff.7.gz)" = "%{_mandir}/man7/roff.mandoc.7.gz" ]; then
|
|
||||||
%{_sbindir}/alternatives --set roff.7.gz %{_mandir}/man7/roff.mandoc.7.gz
|
|
||||||
fi
|
|
||||||
|
|
||||||
if [ "$(readlink %{_sysconfdir}/alternatives/man.7.gz)" = "%{_mandir}/man7/man.mandoc.7.gz" ]; then
|
|
||||||
%{_sbindir}/alternatives --set man.7.gz %{_mandir}/man7/man.mandoc.7.gz
|
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
||||||
%post
|
|
||||||
%{_sbindir}/update-alternatives --install %{_bindir}/man man %{_bindir}/man.mandoc 200 \
|
|
||||||
--slave %{_bindir}/apropos apropos %{_bindir}/apropos.mandoc \
|
|
||||||
--slave %{_bindir}/whatis whatis %{_bindir}/whatis.mandoc \
|
|
||||||
--slave %{_sbindir}/makewhatis makewhatis %{_sbindir}/makewhatis.mandoc \
|
|
||||||
--slave %{_mandir}/man1/apropos.1.gz apropos.1.gz %{_mandir}/man1/apropos.mandoc.1.gz \
|
|
||||||
--slave %{_mandir}/man1/man.1.gz man.1.gz %{_mandir}/man1/man.mandoc.1.gz \
|
|
||||||
--slave %{_mandir}/man1/whatis.1.gz whatis.1.gz %{_mandir}/man1/whatis.mandoc.1.gz \
|
|
||||||
--slave %{_mandir}/man8/makewhatis.8.gz makewhatis.8.gz %{_mandir}/man8/makewhatis.mandoc.8.gz
|
|
||||||
|
|
||||||
%{_sbindir}/update-alternatives --install %{_bindir}/soelim soelim %{_bindir}/soelim.mandoc 200 \
|
|
||||||
--slave %{_mandir}/man1/soelim.1.gz soelim.1.gz %{_mandir}/man1/soelim.mandoc.1.gz
|
|
||||||
|
|
||||||
%{_sbindir}/update-alternatives --install %{_mandir}/man7/roff.7.gz roff.7.gz %{_mandir}/man7/roff.mandoc.7.gz 200 \
|
|
||||||
--slave %{_mandir}/man7/eqn.7.gz eqn.7.gz %{_mandir}/man7/eqn.mandoc.7.gz \
|
|
||||||
--slave %{_mandir}/man7/tbl.7.gz tbl.7.gz %{_mandir}/man7/tbl.mandoc.7.gz
|
|
||||||
|
|
||||||
%{_sbindir}/update-alternatives --install %{_mandir}/man7/man.7.gz man.7.gz %{_mandir}/man7/man.mandoc.7.gz 200
|
|
||||||
|
|
||||||
%preun
|
%preun
|
||||||
if [ $1 -eq 0 ]; then
|
if [ $1 -eq 0 ]; then
|
||||||
%{_sbindir}/update-alternatives --remove man %{_bindir}/man.mandoc
|
%{_sbindir}/update-alternatives --remove man %{_bindir}/man.%{name} >/dev/null 2>&1 || :
|
||||||
%{_sbindir}/update-alternatives --remove soelim %{_bindir}/soelim.mandoc
|
|
||||||
%{_sbindir}/update-alternatives --remove roff.7.gz %{_mandir}/man7/roff.mandoc.7.gz
|
|
||||||
%{_sbindir}/update-alternatives --remove man.7.gz %{_mandir}/man7/man.mandoc.7.gz
|
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
%post
|
||||||
|
# set up the alternatives files
|
||||||
|
%{_sbindir}/update-alternatives --install %{_bindir}/man man %{_bindir}/man.%{name} 300 \
|
||||||
|
--slave %{_bindir}/apropos apropos %{_bindir}/apropos.%{name} \
|
||||||
|
--slave %{_bindir}/whatis whatis %{_bindir}/whatis.%{name} \
|
||||||
|
--slave %{_mandir}/man1/man.1.gz man.1.gz %{_mandir}/man1/man.%{name}.1.gz \
|
||||||
|
--slave %{_mandir}/man1/apropos.1.gz apropos.1.gz %{_mandir}/man1/apropos.%{name}.1.gz \
|
||||||
|
--slave %{_mandir}/man1/whatis.1.gz whatis.1.gz %{_mandir}/man1/whatis.%{name}.1.gz \
|
||||||
|
--slave %{_mandir}/man1/soelim.1.gz soelim.1.gz %{_mandir}/man1/soelim.%{name}.1.gz \
|
||||||
|
>/dev/null 2>&1 || :
|
||||||
|
|
||||||
%files
|
%files
|
||||||
%license LICENSE
|
%license LICENSE
|
||||||
%{_bindir}/demandoc
|
%{_bindir}/demandoc
|
||||||
%{_bindir}/mandoc
|
%{_bindir}/mandoc
|
||||||
%{_bindir}/apropos.mandoc
|
|
||||||
%ghost %{_bindir}/apropos
|
%ghost %{_bindir}/apropos
|
||||||
%{_bindir}/man.mandoc
|
%{_bindir}/apropos.%{name}
|
||||||
%ghost %{_bindir}/man
|
%ghost %{_bindir}/man
|
||||||
%{_bindir}/soelim.mandoc
|
%{_bindir}/man.%{name}
|
||||||
%ghost %{_bindir}/soelim
|
%ghost %{_bindir}/soelim
|
||||||
%{_bindir}/whatis.mandoc
|
%{_bindir}/soelim.%{name}
|
||||||
%ghost %{_bindir}/whatis
|
%ghost %{_bindir}/whatis
|
||||||
%{_sbindir}/makewhatis.mandoc
|
%{_bindir}/whatis.%{name}
|
||||||
%ghost %{_sbindir}/makewhatis
|
%{_sbindir}/makewhatis
|
||||||
%{_mandir}/man1/demandoc.1.gz
|
%{_mandir}/man1/demandoc.1.gz
|
||||||
%{_mandir}/man1/mandoc.1.gz
|
%{_mandir}/man1/mandoc.1.gz
|
||||||
%{_mandir}/man1/apropos.mandoc.1.gz
|
%ghost %{_mandir}/man1/soelim.1*
|
||||||
%ghost %{_mandir}/man1/apropos.1.gz
|
%{_mandir}/man1/soelim.%{name}.*
|
||||||
%{_mandir}/man1/man.mandoc.1.gz
|
%{_mandir}/man1/man.%{name}.1*
|
||||||
%ghost %{_mandir}/man1/man.1.gz
|
%{_mandir}/man1/apropos.%{name}.1*
|
||||||
%{_mandir}/man1/soelim.mandoc.1.gz
|
%{_mandir}/man1/whatis.%{name}.1*
|
||||||
%ghost %{_mandir}/man1/soelim.1.gz
|
|
||||||
%{_mandir}/man1/whatis.mandoc.1.gz
|
|
||||||
%ghost %{_mandir}/man1/whatis.1.gz
|
|
||||||
%{_mandir}/man5/mandoc.conf.5.gz
|
%{_mandir}/man5/mandoc.conf.5.gz
|
||||||
%{_mandir}/man5/mandoc.db.5.gz
|
%{_mandir}/man5/mandoc.db.5.gz
|
||||||
%{_mandir}/man7/eqn.mandoc.7.gz
|
%{_mandir}/man7/eqn.7.gz
|
||||||
%ghost %{_mandir}/man7/eqn.7.gz
|
|
||||||
%{_mandir}/man7/mandoc_char.7.gz
|
%{_mandir}/man7/mandoc_char.7.gz
|
||||||
%{_mandir}/man7/man.mandoc.7.gz
|
%{_mandir}/man7/man.7.gz
|
||||||
%ghost %{_mandir}/man7/man.7.gz
|
|
||||||
%{_mandir}/man7/mdoc.7.gz
|
%{_mandir}/man7/mdoc.7.gz
|
||||||
%{_mandir}/man7/roff.mandoc.7.gz
|
%{_mandir}/man7/roff.7.gz
|
||||||
%ghost %{_mandir}/man7/roff.7.gz
|
%{_mandir}/man7/tbl.7.gz
|
||||||
%{_mandir}/man7/tbl.mandoc.7.gz
|
%{_mandir}/man8/makewhatis.8.gz
|
||||||
%ghost %{_mandir}/man7/tbl.7.gz
|
|
||||||
%{_mandir}/man8/makewhatis.mandoc.8.gz
|
|
||||||
%ghost %{_mandir}/man8/makewhatis.8.gz
|
|
||||||
|
|
||||||
%files -n libmandoc-devel
|
%files -n libmandoc-devel
|
||||||
%license LICENSE
|
%license LICENSE
|
||||||
@ -217,6 +175,18 @@ fi
|
|||||||
%{_mandir}/man3/tbl.3*
|
%{_mandir}/man3/tbl.3*
|
||||||
|
|
||||||
%changelog
|
%changelog
|
||||||
|
* Mon Apr 22 2024 lilong <lilong@kylinos.cn> - 1.14.6-5
|
||||||
|
- Fix low-level dependency compilation failure
|
||||||
|
|
||||||
|
* Mon Apr 15 2024 lilong <lilong@kylinos.cn> - 1.14.6-4
|
||||||
|
- Fix crash when mandoc install
|
||||||
|
|
||||||
|
* Mon Oct 9 2023 laokz <zhangkai@iscas.ac.cn> - 1.14.6-3
|
||||||
|
- add CFLAGS for riscv64 to workaround fragile test-strptime.c
|
||||||
|
|
||||||
|
* Thu Apr 6 2023 changzhangm <chaozhangm@isoftstone.com> - 1.14.6-2
|
||||||
|
- Update to 1.14.6-2
|
||||||
|
|
||||||
* Fri Sep 23 2022 chendexi <chendexi@kylinos.cn> - 1.14.6-1
|
* Fri Sep 23 2022 chendexi <chendexi@kylinos.cn> - 1.14.6-1
|
||||||
- Initial package
|
- Initial package
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user