# clean old caches when groff =< %{cache_clean_ver} # is uninstalled. %define cache_clean_ver 1.18.1.1-4%{?_dist_release} %global __requires_exclude perl\\(.*\\.pl\\)$ Summary: A document formatting system. Summary(ja): GNU groff 日本語対応版 Name: groff Version: 1.23.0 Release: 1%{?_dist_release} Group: publishing Vendor: Project Vine Distribution: Vine Linux Packager: daisuke License: GPL-3.0-or-later AND GFDL-1.3-or-later AND BSD-4-Clause-UC AND MIT AND X11 AND LicenseRef-Fedora-Public-Domain URL: https://www.gnu.org/software/groff/ Source0: https://ftp.gnu.org/gnu/groff/groff-%{version}.tar.gz # resolves: #530788 Patch0: 0001-missing-groff-x11-info-message-when-gxditview-not-fo.patch Patch1: 0002-load-site-font-and-site-tmac-from-etc-groff.patch # resolves: #709413, #720058, #720057 Patch2: 0003-various-security-fixes.patch # resolves: #987069 Patch3: 0004-don-t-use-usr-bin-env-in-shebang.patch # allow to specify custom docdir Patch4: 0005-do-not-overwrite-docdir.patch # Revert upstream change of mapping special characters for UTF-8 devices # Debian commit: https://salsa.debian.org/debian/groff/-/commit/d5394c68d70e6c5199b01d2522e094c8fd52e64e Patch5: 0006-Revert-upstream-change-of-mapping-special-characters.patch Buildroot: %{_tmppath}/%{name}-%{version}-root BuildRequires: libXmu-devel BuildRequires: libXaw-devel BuildRequires: psutils, bison, imake, netpbm-progs, ghostscript BuildRequires: texinfo Requires(postun): findutils Obsoletes: groff-tools %description Groff is a document formatting system. Groff takes standard text and formatting commands as input and produces formatted output. The created documents can be shown on a display or printed on a printer. Groff's formatting commands allow you to specify font type and size, bold type, italic type, the number and size of columns on a page, and more. You should install groff if you want to use it as a document formatting system. Groff can also be used to format man pages. If you are going to use groff with the X Window System, you'll also need to install the groff-gxditview package. %description -l ja GNU roff (groff) 日本語対応版です。日本語で書かれたマニュアルを表示す るのに必要です. %package perl Summary: Parts of the groff formatting system that require Perl. Group: publishing Requires: %{name} = %{version} Requires: mktemp %description perl The groff-perl package contains the parts of the groff text processor package that require Perl. These include the afmtodit font processor for creating PostScript font files, the grog utility that can be used to automatically determine groff command-line options, and the troff-to-ps print filter. %package gxditview Summary: An X previewer for groff text processor output. Group: publishing Requires: %{name} = %{version} %description gxditview Gxditview displays the groff text processor's output on an X Window System display. If you are going to use groff as a text processor, you should install gxditview so that you preview your processed text files in X. You'll also need to install the groff package and the X Window System. %debug_package %prep %setup -q %autopatch -p1 for file in NEWS src/devices/grolbp/grolbp.1.man doc/{groff.texi*,webpage.ms} \ contrib/mm/*.man contrib/mom/examples/{README.txt,*.mom,mom.vim} do iconv -f iso-8859-1 -t utf-8 < "$file" > "${file}_" mv "${file}_" "$file" done %build export PAGE=A4 export YACC='bison -y' %configure \ --docdir=%{_pkgdocdir} \ --with-appdefdir=%{_datadir}/X11/app-defaults \ --with-grofferdir=%{_datadir}/%{name}/%{version}/groffer %make_build %install %make_install # some binaries need alias with 'g' or 'z' prefix for file in g{nroff,troff,tbl,pic,eqn,neqn,refer,lookbib,indxbib,soelim} zsoelim; do ln -s ${file#?} %{buildroot}%{_bindir}/${file} ln -s ${file#?}.1.gz %{buildroot}%{_mandir}/man1/${file}.1.gz done # fix absolute symlink to relative symlink rm -f %{buildroot}%{_pkgdocdir}/pdf/mom-pdf.pdf ln -s ../examples/mom/mom-pdf.pdf %{buildroot}%{_pkgdocdir}/pdf/mom-pdf.pdf # rename groff downloadable postscript fonts to meet Fedora Font Packaging guidelines, # as these files are more PS instructions, than general-purpose fonts (bz #477394) for file in $(find %{buildroot}%{_datadir}/%{name}/%{version}/font/devps -name "*.pfa"); do mv ${file} ${file}_ done sed --in-place 's/\.pfa$/.pfa_/' %{buildroot}%{_datadir}/%{name}/%{version}/font/devps/download # perl dependent files in /usr/bin will be in separate package rm -f files-perl files-nonperl for file in %{buildroot}%{_bindir}/*; do # package selection if grep -q -m1 '^#!.*\' $file; then output_file=files-perl else output_file=files-nonperl fi echo %{_bindir}/$(basename $file) >> $output_file # manpage availability manfile=%{buildroot}%{_mandir}/man1/$(basename $file).\* if [ -f $manfile -o -L $manfile ]; then echo %{_mandir}/man1/$(basename $file).\* >> $output_file fi done # install info install -d $RPM_BUILD_ROOT%{_infodir} install -m644 doc/groff.info* $RPM_BUILD_ROOT%{_infodir} # remove unnecessary files and fix privileges rm -f %{buildroot}%{_infodir}/dir # remove CreationDate from documentation pushd %{buildroot}%{_pkgdocdir} find -name "*.html" | xargs sed -i "/^