%{!?with_x:%global with_x 1} Summary: A document formatting system Name: groff Version: 1.23.0 Release: 7%{?dist} # Everything is under GPL-3.0-or-later, except for the following files: # MIT license # -- tmac/hyphen.den # tmac/hyphen.det # GFDL license # -- contrib/mom/momdoc/* # contrib/pdfmark/pdfmark.ms # contrib/pdfmark/pdfroff.1.man # contrib/hdtbl/groff_hdtbl.7.man # tmac/groff_trace.7.man # src/roff/groff/groff.1.man # src/roff/troff/troff.1.man # man/groff_diff.7.man # man/ditroff.7.man # man/groff_out.5.man # man/groff_tmac.5.man # man/groff.7.man # man/roff.7.man # doc/fdl.texi # doc/groff.texi # BSD-4-Clause-UC # -- tmac/doc.tmac # tmac/doc-old.tmac # tmac/doc-common # tmac/doc-ditroff # tmac/doc-nroff # tmac/doc-syms # tmac/groff_mdoc.man # tmac/e.tmac # tmac/groff_me.man # doc/meintro.me # doc/meintro_fr.me # doc/meref.me # X11 license # -- src/devices/xditview/* # Public domain # -- src/preproc/grn # contrib/grap2graph/grap2graph.sh # contrib/pic2graph/pic2graph.sh # contrib/eqn2graph/eqn2graph.sh 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: http://www.gnu.org/software/groff/ Source: 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 Requires: coreutils, groff-base = %{version}-%{release} Recommends: psutils Requires(post): /usr/sbin/update-alternatives Requires(postun): /usr/sbin/update-alternatives Requires(preun): /usr/sbin/update-alternatives BuildRequires: gcc, gcc-c++ BuildRequires: bison, texinfo BuildRequires: git, netpbm-progs, perl-generators, psutils, ghostscript Provides: nroff-i18n = %{version}-%{release} Provides: bundled(gnulib) %global __requires_exclude %{?__requires_exclude:%__requires_exclude|}^perl\\([^.]*\\.pl\\) %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. Groff can also be used to format man pages. If you are going to use groff with the X Window System, you will also need to install the groff-x11 package. %package base Summary: Parts of the groff formatting system required to display manual pages Requires(post): /usr/sbin/update-alternatives Requires(postun): /usr/sbin/update-alternatives Requires(preun): /usr/sbin/update-alternatives %description base The groff-base package contains only necessary parts of groff formatting system which are required to display manual pages, and the groff's default display device (PostScript). %package perl Summary: Parts of the groff formatting system that require Perl Requires: groff-base = %{version}-%{release} %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), groffer (tool for displaying groff files), grog (utility that can be used to automatically determine groff command-line options), chem (groff preprocessor for producing chemical structure diagrams), mmroff (reference preprocessor) and roff2dvi roff2html roff2pdf roff2ps roff2text roff2x (roff code converters). %if %{with_x} %package x11 Summary: Parts of the groff formatting system that require X Windows System Requires: groff-base = %{version}-%{release} BuildRequires: libXaw-devel, libXmu-devel BuildRequires: make Provides: groff-gxditview = %{version}-%{release} Obsoletes: groff-gxditview < 1.20.1 %description x11 The groff-x11 package contains the parts of the groff text processor package that require X Windows System. These include gxditview (display groff intermediate output files on X Window System display) and xtotroff (converts X font metrics into groff font metrics). %endif %package doc Summary: Documentation for groff document formatting system BuildArch: noarch Requires: groff = %{version}-%{release} %description doc The groff-doc package includes additional documentation for groff text processor package. It contains examples, documentation for PIC language and documentation for creating PDF files. %prep %setup -q git init git config user.email groff-owner@fedoraproject.org git config user.name "groff owner" git add . git commit -n -m "release %{version}" git am %{patches} for file in NEWS src/devices/grolbp/grolbp.1.man doc/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 %configure \ --docdir=%{_pkgdocdir} \ --with-appdefdir=%{_datadir}/X11/app-defaults \ --with-grofferdir=%{_datadir}/%{name}/%{version}/groffer %make_build %install %make_install # rename files for alternative usage mv %{buildroot}%{_bindir}/soelim %{buildroot}%{_bindir}/soelim.%{name} touch %{buildroot}%{_bindir}/soelim mv %{buildroot}%{_mandir}/man1/soelim.1 %{buildroot}%{_mandir}/man1/soelim.%{name}.1 touch %{buildroot}%{_mandir}/man1/soelim.1 mv %{buildroot}%{_mandir}/man7/roff.7 %{buildroot}%{_mandir}/man7/roff.%{name}.7 touch %{buildroot}%{_mandir}/man7/roff.7 # 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 # remove unnecessary files rm -f %{buildroot}%{_infodir}/dir # remove CreationDate from documentation pushd %{buildroot}%{_pkgdocdir} find -name "*.html" | xargs sed -i "/^