RHEL 9.0.0 Alpha bootstrap

The content of this branch was automatically imported from Fedora ELN
with the following as its source:
https://src.fedoraproject.org/rpms/psutils#4a41fa629a9c91238ac8a9d1581a96a4e76403e3
This commit is contained in:
Troy Dawson 2020-10-14 16:34:54 -07:00
parent 6d696d329e
commit f06732b37a
5 changed files with 548 additions and 0 deletions

3
.gitignore vendored
View File

@ -0,0 +1,3 @@
psutils-p17-clean.tar.gz
/psutils-1.21.tar.xz
/psutils-1.23.tar.xz

202
psutils-p17-paper.patch Normal file
View File

@ -0,0 +1,202 @@
--- psutils/pstops.1.paper Tue Mar 11 23:53:04 1997
+++ psutils/pstops.1 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 <sys/types.h>
#include <sys/stat.h>
+#ifdef HAVE_LANGINFO_H
+# include <langinfo.h>
+# include <locale.h>
+#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)<PT_EPSILON &&
+ abs(PaperHeight(pp)-height)<PT_EPSILON )
+ result = pp;
+ }
+
+ setlocale(LC_PAPER, old_locale);
+
+ return result;
+}
+#endif /* HAVE_LANGINFO_H */
+
/* return pointer to paper size struct or NULL */
Paper* findpaper(char *name)
{
- Paper *pp;
- for (pp = papersizes; PaperName(pp); pp++) {
- if (strcmp(PaperName(pp), name) == 0) {
+ Paper *pp = 0;
+
+#ifdef HAVE_LANGINFO_H
+ if (strcmp(name, "_glibc") == 0) {
+ pp = findpaperglibc();
+ if (pp==0) name = "a4"; /* Paper in C locale */
+ }
+#endif /* HAVE_LANGINFO_H */
+
+ if (pp==0) {
+ for (pp = papersizes; PaperName(pp); pp++) {
+ if (strcmp(PaperName(pp), name) == 0) {
return pp;
- }
+ }
+ }
}
- return (Paper *)NULL;
+
+ return pp;
}
/* Make a file seekable, using temporary files if necessary */
--- psutils/psresize.1.paper Tue Mar 11 23:53:03 1997
+++ psutils/psresize.1 Thu Jul 19 15:21:51 2001
@@ -42,10 +42,11 @@
The
.I \-p
option can be used as an alternative, to set the output 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, 10x24
or
-.B 10x14.
-The default output paper size is
+.B _glibc,
+where latter one means the format of the current locale. The default
+output paper size is
.B @PAPER@.
.PP
The
@@ -69,6 +70,12 @@
.sp
psresize -PA4 -pletter in.ps out.ps
.sp
+.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/psnup.1.paper Tue Mar 11 23:53:02 1997
+++ psutils/psnup.1 Thu Jul 19 15:21:51 2001
@@ -61,9 +61,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,
+.B 10x14
or
-.B 10x14.
+.B _glibc,
+where latter one means the format of the current locale.
The default paper size is
.B @PAPER@.
The
@@ -148,6 +150,12 @@
on the first output page and
pages 2 then 3 of the input document
on the second output page.
+.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/Makefile.unix.paper Thu Jul 19 15:21:51 2001
+++ psutils/Makefile.unix Thu Jul 19 15:24:07 2001
@@ -19,7 +19,11 @@
# psnup puts multiple logical pages on one physical page
# psresize scales and moves pages to fit on different paper sizes
-PAPER=a4
+PAPER="_glibc"
+
+# Comment it out if your machine does not have the <langutil.h> 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

40
psutils-paperconf.patch Normal file
View File

@ -0,0 +1,40 @@
diff -up psutils-1.23/configure.paperconf psutils-1.23/configure
--- psutils-1.23/configure.paperconf 2014-01-22 10:31:58.000000000 +0100
+++ psutils-1.23/configure 2015-05-20 14:25:40.636115433 +0200
@@ -15700,7 +15700,7 @@ fi
if test -z "$PAPER"; then
- PAPER=paper
+ PAPER=paperconf
fi
diff -up psutils-1.23/psutil.c.paperconf psutils-1.23/psutil.c
--- psutils-1.23/psutil.c.paperconf 2014-01-16 11:20:54.000000000 +0100
+++ psutils-1.23/psutil.c 2015-05-29 13:24:12.834350330 +0200
@@ -88,13 +87,21 @@ int paper_size(const char *paper_name, d
int res = 0;
if (paper_name == NULL) /* Use default paper name */
paper_name = pgetline(PAPER);
- if (paper_name && (cmd = xasprintf(PAPER " --unit=pt --size %s", paper_name)) && (l = pgetline(cmd)))
- res = sscanf(l, "%lg %lg", width, height);
+ if (paper_name && (cmd = xasprintf(PAPER " -s %s", paper_name)) && (l = pgetline(cmd)))
+ {
+ for (int i = 0; i < strlen(l); i++)
+ {
+ if (l[i] == ',')
+ {
+ l[i] = '.';
+ }
+ }
+ res = sscanf(l, "%lg %lg", width, height);
+ }
free(l);
free(cmd);
return res == 2;
}
-
/* Make a file seekable, using temporary files if necessary */
FILE *seekable(FILE *fp)
{

302
psutils.spec Normal file
View File

@ -0,0 +1,302 @@
Summary: PostScript Utilities
Name: psutils
Version: 1.23
Release: 18%{?dist}
License: psutils
# We can't follow https://fedoraproject.org/wiki/Packaging:SourceURL#Github
# and use upstream tarball for building because ./bootstrap downloads gnulib.
# wget https://github.com/rrthomas/psutils/archive/master.zip && unzip master.zip && cd psutils-master/
# ./bootstrap && autoreconf -vfi && ./configure && make dist-xz
Source: psutils-%{version}.tar.xz
URL: https://github.com/rrthomas/psutils
# BZ#1072371
# https://github.com/rrthomas/psutils/commit/cca570c806bf4bde07f400b2bab9266e02998145
Patch0: psutils-paperconf.patch
BuildRequires: gcc
BuildRequires: perl-generators
BuildRequires: perl(File::Basename)
BuildRequires: perl(Getopt::Long)
BuildRequires: perl(strict)
BuildRequires: perl(warnings)
Requires: /usr/bin/paperconf
# copylib - https://fedorahosted.org/fpc/ticket/174
Provides: bundled(gnulib)
%description
Utilities for manipulating PostScript documents.
Page selection and rearrangement are supported, including arrangement into
signatures for booklet printing, and page merging for n-up printing.
%package perl
Summary: psutils scripts requiring perl
BuildArch: noarch
%description perl
Various scripts from the psutils distribution that require perl.
%prep
%setup -q
%patch0 -p1 -b .paperconf
# Use /usr/bin/perl instead of /usr/bin/env perl
sed -i -e 's,/usr/bin/env perl,%{__perl},' \
extractres psjoin
%build
%configure
%{__make} %{?_smp_mflags}
%install
%{__make} install DESTDIR=%{buildroot}
%files
%doc README LICENSE
%{_bindir}/epsffit
%{_bindir}/psbook
%{_bindir}/psnup
%{_bindir}/psresize
%{_bindir}/psselect
%{_bindir}/pstops
%{_mandir}/man1/epsffit.1*
%{_mandir}/man1/psbook.1*
%{_mandir}/man1/psnup.1*
%{_mandir}/man1/psresize.1*
%{_mandir}/man1/psselect.1*
%{_mandir}/man1/pstops.1*
%{_mandir}/man1/psutils.1*
%files perl
%doc LICENSE
%{_bindir}/extractres
%{_bindir}/includeres
%{_bindir}/psjoin
%{_mandir}/man1/extractres.1*
%{_mandir}/man1/includeres.1*
%{_mandir}/man1/psjoin.1*
%changelog
* Tue Jul 28 2020 Fedora Release Engineering <releng@fedoraproject.org> - 1.23-18
- Rebuilt for https://fedoraproject.org/wiki/Fedora_33_Mass_Rebuild
* Thu Jan 30 2020 Fedora Release Engineering <releng@fedoraproject.org> - 1.23-17
- Rebuilt for https://fedoraproject.org/wiki/Fedora_32_Mass_Rebuild
* Fri Jul 26 2019 Fedora Release Engineering <releng@fedoraproject.org> - 1.23-16
- Rebuilt for https://fedoraproject.org/wiki/Fedora_31_Mass_Rebuild
* Sat Feb 02 2019 Fedora Release Engineering <releng@fedoraproject.org> - 1.23-15
- Rebuilt for https://fedoraproject.org/wiki/Fedora_30_Mass_Rebuild
* Fri Jul 13 2018 Fedora Release Engineering <releng@fedoraproject.org> - 1.23-14
- Rebuilt for https://fedoraproject.org/wiki/Fedora_29_Mass_Rebuild
* Fri Feb 09 2018 Fedora Release Engineering <releng@fedoraproject.org> - 1.23-13
- Rebuilt for https://fedoraproject.org/wiki/Fedora_28_Mass_Rebuild
* Thu Aug 03 2017 Fedora Release Engineering <releng@fedoraproject.org> - 1.23-12
- Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Binutils_Mass_Rebuild
* Thu Jul 27 2017 Fedora Release Engineering <releng@fedoraproject.org> - 1.23-11
- Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Mass_Rebuild
* Sat Feb 11 2017 Fedora Release Engineering <releng@fedoraproject.org> - 1.23-10
- Rebuilt for https://fedoraproject.org/wiki/Fedora_26_Mass_Rebuild
* Thu Feb 04 2016 Fedora Release Engineering <releng@fedoraproject.org> - 1.23-9
- Rebuilt for https://fedoraproject.org/wiki/Fedora_24_Mass_Rebuild
* Thu Jun 18 2015 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1.23-8
- Rebuilt for https://fedoraproject.org/wiki/Fedora_23_Mass_Rebuild
* Fri May 29 2015 Jiri Popelka <jpopelka@redhat.com> - 1.23-7
- Correctly parse paper sizes returned by paperconf (#1208985)
* Sun Aug 17 2014 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1.23-6
- Rebuilt for https://fedoraproject.org/wiki/Fedora_21_22_Mass_Rebuild
* Sat Jun 07 2014 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1.23-5
- Rebuilt for https://fedoraproject.org/wiki/Fedora_21_Mass_Rebuild
* Wed Apr 23 2014 Jiri Popelka <jpopelka@redhat.com> - 1.23-4
- move psjoin to perl subpackage (#226324#c16)
* Thu Apr 10 2014 Ralf Corsépius <corsepiu@fedoraproject.org> - 1.23-3
- Use /usr/bin/perl instead of /usr/bin/env perl.
- Add BR: perl(*).
- Use wildcards instead of hardcoded *.gz for man-pages.
* Tue Mar 04 2014 Jiri Popelka <jpopelka@redhat.com> - 1.23-2
- use paperconf instead of paper binary (#1072371)
* Wed Jan 22 2014 Jiri Popelka <jpopelka@redhat.com> - 1.23-1
- 1.23
* Tue Oct 22 2013 Jiri Popelka <jpopelka@redhat.com> - 1.21-1
- new upstream
- version 1.21
* Sun Aug 04 2013 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1.17-43
- Rebuilt for https://fedoraproject.org/wiki/Fedora_20_Mass_Rebuild
* Tue Mar 26 2013 Jiri Popelka <jpopelka@redhat.com> - 1.17-42
- few usage/man page fixes
* Thu Feb 14 2013 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1.17-41
- Rebuilt for https://fedoraproject.org/wiki/Fedora_19_Mass_Rebuild
* Thu Nov 29 2012 Jiri Popelka <jpopelka@redhat.com> - 1.17-40
- fix dist tag and URL
- put psutils-copyright.patch among sources as it's used only in
psutils-remove-copyrighted-files
- no need to define BuildRoot and clean it in %%clean and %%install anymore
- %%defattr no longer needed in %%files
* Sat Jul 21 2012 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1.17-39
- Rebuilt for https://fedoraproject.org/wiki/Fedora_18_Mass_Rebuild
* Sat Jan 14 2012 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1.17-38
- Rebuilt for https://fedoraproject.org/wiki/Fedora_17_Mass_Rebuild
* Wed Feb 09 2011 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1.17-37
- Rebuilt for https://fedoraproject.org/wiki/Fedora_15_Mass_Rebuild
* Thu Jul 08 2010 Tomas Smetana <tsmetana@redhat.com> 1.17-36
- add the LICENSE file to the perl subpackage
* Thu Apr 22 2010 Daniel Novotny <dnovotny@redhat.com> 1.17-35
- renamed "clean" tarball to psutils-p17-clean.tar.gz
(merge review: #226324)
* Tue Jan 26 2010 Daniel Novotny <dnovotny@redhat.com> 1.17-34
- remove Apple copyrighted files (merge review: #226324)
- fixed URLs to upstream
* Mon Aug 10 2009 Ville Skyttä <ville.skytta@iki.fi> - 1.17-33
- Convert specfile to UTF-8.
* Sun Jul 26 2009 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1.17-32
- Rebuilt for https://fedoraproject.org/wiki/Fedora_12_Mass_Rebuild
* Wed Jul 22 2009 Adam Jackson <ajax@redhat.com> 1.17-31
- Split perl scripts to a subpackage.
* Thu Feb 26 2009 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1.17-30
- Rebuilt for https://fedoraproject.org/wiki/Fedora_11_Mass_Rebuild
* Fri Aug 29 2008 Tom "spot" Callaway <tcallawa@redhat.com> - 1.17-29
- fix license tag
* Wed Feb 13 2008 Tomas Smetana <tsmetana@redhat.com> - 1.17-28
- rebuild (gcc-4.3)
* Tue Sep 18 2007 Martin Bacovsky <mbacovsk@redhat.com> - 1.17-27
- fixed Source url pointing to non-existing site
* Wed Jul 12 2006 Jesse Keating <jkeating@redhat.com> - 1.17-26.1
- rebuild
* Mon Jun 12 2006 Jitka Kudrnacova <jkudrnac@redhat.com> - 1.17-26
- new implementation of psmerge by Peter Williams
* Fri Feb 10 2006 Jesse Keating <jkeating@redhat.com> - 1.17-25.2.1
- bump again for double-long bug on ppc(64)
* Tue Feb 07 2006 Jesse Keating <jkeating@redhat.com> - 1.17-25.2
- rebuilt for new gcc4.1 snapshot and glibc changes
* Fri Dec 09 2005 Jesse Keating <jkeating@redhat.com>
- rebuilt
* Wed Mar 16 2005 Tim Waugh <twaugh@redhat.com> 1.17-25
- Rebuild for new GCC.
* Mon Jan 10 2005 Tim Waugh <twaugh@redhat.com> 1.17-24
- Manpage correction for psresize (bug #144582).
* Tue Jun 15 2004 Elliot Lee <sopwith@redhat.com>
- rebuilt
* Fri Feb 13 2004 Elliot Lee <sopwith@redhat.com>
- rebuilt
* Tue Jun 17 2003 Tim Waugh <twaugh@redhat.com> 1.17-21
- Rebuilt.
* Wed Jun 04 2003 Elliot Lee <sopwith@redhat.com>
- rebuilt
* Wed Jan 22 2003 Tim Powers <timp@redhat.com>
- rebuilt
* Wed Dec 11 2002 Tim Powers <timp@redhat.com> 1.17-18
- rebuild on all arches
* Fri Jun 21 2002 Tim Powers <timp@redhat.com>
- automated rebuild
* Thu Jun 20 2002 Than Ngo <than@redhat.com> 1.17-16
- Don't forcibly strip binaries
* Thu May 23 2002 Tim Powers <timp@redhat.com>
- automated rebuild
* Wed Jan 09 2002 Tim Powers <timp@redhat.com>
- automated rebuild
* Thu Jul 19 2001 Than Ngo <than@redhat.com> 1.17-13
- add patch from enrico.scholz@informatik.tu-chemnitz.de
* Fri Jul 13 2001 Than Ngo <than@redhat.com> 1.17-12
- media size as letter (Bug #48831)
- Copyright->License
- don't hardcode manpath
* Sun Jun 24 2001 Elliot Lee <sopwith@redhat.com>
- Bump release + rebuild.
* Fri Dec 8 2000 Tim Powers <timp@redhat.com>
- built for dist-7.1
* Mon Jul 24 2000 Prospector <prospector@redhat.com>
- rebuilt
* Mon Jul 10 2000 Tim Powers <timp@redhat.com>
- rebuilt
* Mon Jul 03 2000 Prospector <bugzilla@redhat.com>
- automatic rebuild
* Fri May 26 2000 Tim Powers <timp@redhat.com>
- man pages in /usr/share/man (FHS compliant location)
- grabbed spec from contrib
- initial build for Powertools
* Wed May 12 1999 Peter Soos <sp@osb.hu>
- Corrected the file and directory attributes to rebuild the package
under RedHat Linux 6.0
* Fri Dec 25 1998 Peter Soos <sp@osb.hu>
- Corrected the file and directory attributes
* Tue Jun 23 1998 Peter Soos <sp@osb.hu>
- Using %%attr for ability to rebuild the package as an ordinary user.
* Wed Jun 04 1997 Timo Karjalainen <timok@iki.fi>
- Reverted back to un-gzipped man-pages (Redhat style)
- Added patch to compile everything cleanly
- Some minor changes to specfile
* Thu Mar 27 1997 Tomasz Kłoczko <kloczek@rudy.mif.pg.gda.pl>
- new version:
Patchlevel 17 had some minor bugfixes and improvements
- Trailer information now put before %%EOF comments if no %%Trailer
- psselect can now add blank pages.
- Piped input works in Linux
- spec file rewrited for using Buildroot,
- man pages gziped.

1
sources Normal file
View File

@ -0,0 +1 @@
eedd282973a58ac6bbf890316a3b02d8 psutils-1.23.tar.xz