diff --git a/psutils-p17-paper.patch b/psutils-p17-paper.patch new file mode 100644 index 0000000..6e47a31 --- /dev/null +++ b/psutils-p17-paper.patch @@ -0,0 +1,202 @@ +--- psutils/pstops.man.paper Tue Mar 11 23:53:04 1997 ++++ psutils/pstops.man Thu Jul 19 15:21:51 2001 +@@ -108,10 +108,11 @@ + The + .I \-p + option can be used as an alternative, to set the paper size to +-.B a3, a4, a5, b5, letter, legal, tabloid, statement, executive, folio, quarto ++.B a3, a4, a5, b5, letter, legal, tabloid, statement, executive, folio, quarto, 10x14 + or +-.B 10x14. +-The default paper size is ++.B _glibc, ++where latter one means the format of the current locale. The default ++paper size is + .B @PAPER@. + .PP + The +@@ -154,6 +155,12 @@ + 4:1L@.7(21cm,0)+-2L@.7(21cm,14.85cm) + .sp + for the reverse sides (or join them with a comma for duplex printing). ++.SH "ENVIRONMENT VARIABLES" ++.TP ++.B LC_ALL, LC_PAPER ++These variables are specifying the papertype when used paper is ++.B _glibc. ++For details see the locale(7) manpage. + .SH AUTHOR + Copyright (C) Angus J. C. Duggan 1991-1995 + .SH "SEE ALSO" +--- psutils/psutil.c.paper Tue Mar 11 23:53:04 1997 ++++ psutils/psutil.c Thu Jul 19 15:21:51 2001 +@@ -21,6 +21,11 @@ + #include + #include + ++#ifdef HAVE_LANGINFO_H ++# include ++# include ++#endif ++ + #define iscomment(x,y) (strncmp(x,y,strlen(y)) == 0) + + extern char *program ; +@@ -31,6 +36,16 @@ + extern char pagelabel[BUFSIZ]; + extern int pageno; + ++#ifdef HAVE_LANGINFO_H ++/* When using papertype _glibc we are comparing floating point values. Therefore ++ * and because values in the papersize table are not exactly we are needing an ++ * epsilon value. */ ++static float PT_EPSILON = 2.0; ++ ++/* The factor needed to convert lengths given in mm to length in pt.*/ ++static float MM_TO_PT_FACTOR = 72/25.4; ++#endif /* HAVE_LANGINFO_H */ ++ + static char buffer[BUFSIZ]; + static long bytes = 0; + static long pagescmt = 0; +@@ -64,16 +79,52 @@ + { NULL, 0, 0 } + }; + ++#ifdef HAVE_LANGINFO_H ++/* Called if papertype is '_glibc'. It uses the current locale to determine the ++ * height and width of the current LC_PAPER and compares it with the items of ++ * the 'papersizes' list. */ ++Paper* findpaperglibc() ++{ ++ float height, width; ++ char *old_locale = setlocale (LC_PAPER, ""); ++ Paper *result = 0, *pp; ++ ++ height = MM_TO_PT_FACTOR * (unsigned int)(nl_langinfo(_NL_PAPER_HEIGHT)); ++ width = MM_TO_PT_FACTOR * (unsigned int)(nl_langinfo(_NL_PAPER_WIDTH)); ++ ++ for (pp = papersizes; PaperName(pp) && result==0; pp++) { ++ if ( abs(PaperWidth(pp)-width) header ++# or does not know nl_langinfo() ++LANGINFO_FLAG = -DHAVE_LANGINFO_H + + # Makefile for PSUtils under Unix + +@@ -39,7 +43,7 @@ + MANDIR = $(DESTDIR)/usr/man/man$(MANEXT) + + CC = gcc +-CFLAGS = -DPAPER=\"$(PAPER)\" -DUNIX $(RPM_OPT_FLAGS) -Wall ++CFLAGS = -DPAPER=\"$(PAPER)\" -DUNIX $(RPM_OPT_FLAGS) $(LANGINFO_FLAG) -Wall + + BIN = psbook psselect pstops epsffit psnup \ + psresize diff --git a/psutils.spec b/psutils.spec index 420d39f..4f2fb73 100644 --- a/psutils.spec +++ b/psutils.spec @@ -1,17 +1,15 @@ Summary: PostScript Utilities Name: psutils Version: 1.17 -Release: 11 -Copyright: distributable +Release: 13 +License: distributable Group: Applications/Publishing Source: ftp://ftp.dcs.ed.ac.uk/pub/ajcd/psutils-p17.tar.gz Patch0: psutils-p17-Makefile.patch Patch1: psutils-p17-misc.patch +Patch2: psutils-p17-paper.patch BuildRoot: %{_tmppath}/psutils-root -# Patch1 derived from -# jurix.jura.uni-sb.de/pub/linux/source/networking/printing/psutils.dif - %description This archive contains some utilities for manipulating PostScript documents. Page selection and rearrangement are supported, including arrangement into @@ -19,8 +17,9 @@ signatures for booklet printing, and page merging for n-up printing. %prep %setup -q -n psutils -%patch0 -p1 -%patch1 -p1 +%patch0 -p1 -b .makefile +%patch1 -p1 -b .misc +%patch2 -p1 -b .paper %build make -f Makefile.unix RPM_OPT_FLAGS="$RPM_OPT_FLAGS" @@ -28,7 +27,9 @@ make -f Makefile.unix RPM_OPT_FLAGS="$RPM_OPT_FLAGS" %install rm -rf $RPM_BUILD_ROOT -make -f Makefile.unix MANDIR=$RPM_BUILD_ROOT/usr/share/man/man1 DESTDIR=$RPM_BUILD_ROOT install +make -f Makefile.unix \ + MANDIR=$RPM_BUILD_ROOT%{_mandir}/man1 \ + DESTDIR=$RPM_BUILD_ROOT install %clean rm -rf $RPM_BUILD_ROOT @@ -37,10 +38,18 @@ rm -rf $RPM_BUILD_ROOT %defattr(0644, root, root, 0755) %doc README LICENSE %attr(0755, root, root) /usr/bin/* -/usr/share/man/*/* +%{_mandir}/*/* /usr/lib/psutils %changelog +* Thu Jul 19 2001 Than Ngo 1.17-13 +- add patch from enrico.scholz@informatik.tu-chemnitz.de + +* Fri Jul 13 2001 Than Ngo 1.17-12 +- media size as letter (Bug #48831) +- Copyright->License +- don't hardcode manpath + * Sun Jun 24 2001 Elliot Lee - Bump release + rebuild.