# On every new version, we need to do a local build to make # the PDF docs, and update the source files in CVS. %define makedocs 0 Name: lout Summary: A document formatting system Version: 3.39 Release: 1 License: GPLv2+ Group: Applications/Publishing URL: ftp://ftp.cs.usyd.edu.au/jeff/lout/ Source0: ftp://ftp.cs.usyd.edu.au/jeff/lout/%{name}-%{version}.tar.gz Source1: ftp://ftp.cs.usyd.edu.au/jeff/lout/%{name}-%{version}.tar.gz.sig %if !%{makedocs} Source2: %{name}-%{version}-design.pdf Source3: %{name}-%{version}-expert-guide.pdf Source4: %{name}-%{version}-user-guide.pdf Source5: %{name}-%{version}-slides.pdf %endif Patch0: %{name}-%{version}-aix.patch BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root BuildRequires: ghostscript %description Lout is a document formatting system designed and implemented by Jeffrey Kingston at the Basser Department of Computer Science, University of Sydney, Australia. The system reads a high-level description of a document similar in style to LaTeX and produces a PostScript file which can be printed on most laser printers and graphic display devices. Plain text output is also available, PDF output is limited but working (e.g. no graphics). Lout is inherently multilingual. Adding new languages is easy. %prep %setup -q %patch0 %build make COPTS="${CFLAGS}" \ BINDIR=%{_bindir} \ LOUTLIBDIR=%{_datadir}/%{name} \ LOUTDOCDIR=%{_datadir}/%{name}/doc \ MANDIR=%{_mandir}/man1 \ prg2lout lout function render_docs { subdir=$1 pdf_file=$2 passes=$3 curdir=$(pwd) cd doc/$subdir # We need to set the PATH variable here, because lout eventually exec's # prg2lout. In order for lout to find the latter, we have to set the # PATH. # We also need to tell lout where to find its files, since we haven't # installed them in their final location under /usr/share/lout/ yet. PATH=$curdir lout \ -I $curdir/include \ -D $curdir/data \ -F $curdir/font \ -H $curdir/hyph \ -C $curdir/maps \ -r${passes} all > outfile.ps # Note that the above clobbers the prebuilt file outfile.ps that is # included in Lout's source tarball. ps2pdf -sPAPERSIZE=a4 outfile.ps ../${pdf_file} rm *.li *.ld outfile.ps cd ../.. } # For some reason, ps2pdf segfaults in koji. %if %{makedocs} render_docs design design.pdf 3 render_docs expert expert-guide.pdf 4 render_docs slides slides.pdf 2 render_docs user user-guide.pdf 6 %else cp %{SOURCE2} %{SOURCE3} %{SOURCE4} %{SOURCE5} doc/ %endif %install [ "${RPM_BUILD_ROOT}" != "/" ] && rm -rf ${RPM_BUILD_ROOT} mkdir -p ${RPM_BUILD_ROOT}%{_bindir} mkdir -p ${RPM_BUILD_ROOT}%{_datadir}/%{name}/doc mkdir -p ${RPM_BUILD_ROOT}%{_mandir}/man1 make BINDIR=${RPM_BUILD_ROOT}%{_bindir} \ LOUTLIBDIR=${RPM_BUILD_ROOT}%{_datadir}/%{name} \ LOUTDOCDIR=${RPM_BUILD_ROOT}%{_datadir}/%{name}/doc \ MANDIR=${RPM_BUILD_ROOT}%{_mandir}/man1 \ install installman installdoc /usr/bin/strip ${RPM_BUILD_ROOT}%{_bindir}/* || : # looks like a vim swap file rm -rf ${RPM_BUILD_ROOT}%{_datadir}/%{name}/doc/user/.README.swp cd ${RPM_BUILD_ROOT} mkdir -p usr/bin cd usr/bin ln -sf ../..%{_bindir}/* . %clean [ "${RPM_BUILD_ROOT}" != "/" ] && rm -rf ${RPM_BUILD_ROOT} %files %defattr(-,root,system,-) %doc gpl.txt README READMEPDF %{_bindir}/* %{_datadir}/%{name} %{_mandir}/man1/*.1 /usr/bin/* %changelog * Thu Jan 13 2011 Michael Perzl - 3.39-1 - first version for AIX5L v5.1 and higher