Compare commits

...

No commits in common. "c8s" and "c10s" have entirely different histories.
c8s ... c10s

10 changed files with 289 additions and 73 deletions

1
.fmf/version Normal file
View File

@ -0,0 +1 @@
1

11
.gitignore vendored
View File

@ -1,2 +1,11 @@
SOURCES/libpaper_1.1.24+nmu4.tar.gz
libpaper_1.1.24.tar.gz
/libpaper_1.1.24+nmu1.tar.gz
/libpaper_1.1.24+nmu3.tar.gz
/libpaper_1.1.24+nmu4.tar.gz
/libpaper_1.1.28.tar.gz
/libpaper-2.0.4.tar.gz
/libpaper-2.0.8.tar.gz
/libpaper-2.0.9.tar.gz
/libpaper-2.0.10.tar.gz
/libpaper-2.1.0.tar.gz
/libpaper-2.1.1.tar.gz

1
ci.fmf Normal file
View File

@ -0,0 +1 @@
resultsdb-testcase: separate

View File

@ -1,7 +1,25 @@
--- !Policy
product_versions:
- rhel-8
- fedora-*
decision_context: bodhi_update_push_testing
subject_type: koji_build
rules:
- !PassingTestCaseRule {test_case_name: fedora-ci.koji-build./plans/tier1-public.functional}
#Rawhide
--- !Policy
product_versions:
- fedora-*
decision_context: bodhi_update_push_stable
subject_type: koji_build
rules:
- !PassingTestCaseRule {test_case_name: fedora-ci.koji-build./plans/tier1-public.functional}
#gating rhel
--- !Policy
product_versions:
- rhel-*
decision_context: osci_compose_gate
rules:
- !PassingTestCaseRule {test_case_name: baseos-ci.brew-build.tier1.functional}
- !PassingTestCaseRule {test_case_name: baseos-ci.brew-build.tedude.validation}
- !PassingTestCaseRule {test_case_name: osci.brew-build./plans/tier1-public.functional}
- !PassingTestCaseRule {test_case_name: osci.brew-build./plans/tier1-internal.functional}

View File

@ -0,0 +1,12 @@
diff -up libpaper-2.0.4/configure.ac.duplicate-fix libpaper-2.0.4/configure.ac
--- libpaper-2.0.4/configure.ac.duplicate-fix 2023-01-08 00:30:33.008254489 -0500
+++ libpaper-2.0.4/configure.ac 2023-01-08 00:30:38.938302181 -0500
@@ -78,8 +78,6 @@ esac
AC_MSG_RESULT([$native_win32])
AM_CONDITIONAL(OS_WIN32, test "x$native_win32" = "xyes")
-AM_CONDITIONAL([SHLIBS_IN_BINDIR], [case "$host_os" in mingw* | cygwin*) true;; *) false;; esac])
-
dnl Relocation support
AM_CONDITIONAL([SHLIBS_IN_BINDIR],
[case "$host_os" in mingw* | cygwin*) true;; *) false;; esac])

View File

@ -1,16 +0,0 @@
diff --git a/lib/paper.c b/lib/paper.c
index 57db599..8817aea 100644
--- a/lib/paper.c
+++ b/lib/paper.c
@@ -211,7 +211,10 @@ PAPERSIZEVAR, fall-back to the old behaviour.
fclose(ps);
paperstr = malloc((strlen(papername) + 1) * sizeof(char));
- if (! paperstr) return 0;
+ if (! paperstr) {
+ free(papername);
+ return 0;
+ }
strcpy(paperstr, papername);
free(papername);

View File

@ -1,93 +1,204 @@
%global nmu +nmu4
Name: libpaper
Version: 1.1.24
Release: 22%{?dist}
Version: 2.1.1
Release: 7%{?dist}
# Needed to replace separate paper package
Epoch: 1
Summary: Library and tools for handling papersize
License: GPLv2
URL: http://packages.qa.debian.org/libp/libpaper.html
Source0: http://ftp.debian.org/debian/pool/main/libp/libpaper/%{name}_%{version}%{nmu}.tar.gz
# Filed upstream as:
# http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=481213
Patch2: libpaper-useglibcfallback.patch
# Memory leak
Patch3: libpaper-file-leak.patch
# 1606989 - Please review important issues found by covscan in "libpaper-1.1.24-21.el8+7" package
Patch4: libpaper-covscan.patch
# libpaper is LGPL-2.1+
# bundled libgnu is LGPL-2.1+, LGPL-2+ and GPL-3+
# paperspecs is Public Domain
# localepaper.c is FSFAP
License: LGPL-2.1-or-later AND LicenseRef-Fedora-Public-Domain AND GPL-3.0-or-later AND LGPL-2.0-or-later AND FSFAP
URL: https://github.com/rrthomas/libpaper/
Source0: https://github.com/rrthomas/libpaper/archive/v%{version}/%{name}-%{version}.tar.gz
# Pulled from paper
Source1: localepaper.c
# gcc is no longer in buildroot by default
BuildRequires: gcc
BuildRequires: libtool, gettext, gawk
# use git for autosetup
BuildRequires: git-core
# uses make
BuildRequires: make
BuildRequires: libtool, gettext, gawk, autoconf, automake
BuildRequires: help2man, tar, gnupg2, perl-interpreter
Provides: bundled(gnulib)
%description
The paper library and accompanying files are intended to provide a
simple way for applications to take actions based on a system- or
user-specified paper size. This release is quite minimal, its purpose
being to provide really basic functions (obtaining the system paper name
and getting the height and width of a given kind of paper) that
applications can immediately integrate.
The libpaper package enables users to indicate their preferred paper
size and specifies system-wide and per-user paper size catalogues, which can
also be used directly (see paperspecs(5)).
%package devel
Summary: Headers/Libraries for developing programs that use libpaper
Requires: %{name} = %{version}-%{release}
Requires: %{name}%{?_isa} = %{epoch}:%{version}-%{release}
%description devel
This package contains headers and libraries that programmers will need
This package contains headers and libraries that programmers will need
to develop applications which use libpaper.
%package -n paper
Summary: Print paper size information
Requires: %{name}%{?_isa} = %{epoch}:%{version}-%{release}
# This is licensed differently from libpaper.
# paper.c is GPL-3.0-or-later
# paperconf.c is GPL 2.0 only
# localepaper.c is FSFAP (except it is missing the warranty disclaimer... but the intent is clear)
License: GPL-3.0-or-later AND FSFAP AND GPL-2.0-only
%description -n paper
The paper(1) utility can be used to find the user's preferred
default paper size and give information about known sizes.
%prep
%setup -q -n %{name}-%{version}%{nmu}
%patch2 -p1 -b .useglibcfallback
%patch3 -p1 -b .file-leak
%patch4 -p1 -b .covscan
libtoolize
%autosetup -S git
cp %{SOURCE1} src/
%if 0
sed -i 's|gnulib_tool=$gnulib_path/gnulib-tool|gnulib_tool=%{_bindir}/gnulib-tool|g' bootstrap
sed -i 's|./gnulib/gnulib-tool|%{_bindir}/gnulib-tool|g' bootstrap.conf
sed -i '/doc\/INSTALL/d' bootstrap
./bootstrap --gnulib-srcdir=%{_datadir}/gnulib/ --skip-git
%endif
%build
touch AUTHORS NEWS
aclocal
autoconf
automake -a
%configure --disable-static
# Disable rpath
sed -i 's|^hardcode_libdir_flag_spec=.*|hardcode_libdir_flag_spec=""|g' libtool
sed -i 's|^runpath_var=LD_RUN_PATH|runpath_var=DIE_RPATH_DIE|g' libtool
make %{?_smp_mflags}
%make_build
# localepaper
pushd src
%{__cc} %{optflags} -I.. -Ilibgnu -o localepaper localepaper.c libgnu/.libs/libgnupaper.a %{_hardening_ldflags}
popd
%check
# No upstream tests
echo "Testing localepaper tool"
locale width height > expected
./src/localepaper | tr ' ' "\n" > got
diff -u expected got
# No real way to test the paper tool
%install
make DESTDIR=$RPM_BUILD_ROOT install
%make_install
rm $RPM_BUILD_ROOT%{_libdir}/*.la
mkdir -p $RPM_BUILD_ROOT%{_sysconfdir}
echo '# Simply write the paper name. See papersize(5) for possible values' > $RPM_BUILD_ROOT%{_sysconfdir}/papersize
mkdir -p $RPM_BUILD_ROOT%{_sysconfdir}/libpaper.d
# maybe someday the translations will return
%if 0
for i in cs da de es fr gl hu it ja nl pt_BR sv tr uk vi; do
mkdir -p $RPM_BUILD_ROOT%{_datadir}/locale/$i/LC_MESSAGES/;
msgfmt debian/po/$i.po -o $RPM_BUILD_ROOT%{_datadir}/locale/$i/LC_MESSAGES/%{name}.mo;
done
%find_lang %{name}
%endif
mkdir %{buildroot}%{_libexecdir}
install -m0755 src/localepaper %{buildroot}%{_libexecdir}
%ldconfig_scriptlets
%files -f %{name}.lang
%files
%doc ChangeLog README
%license COPYING
%config(noreplace) %{_sysconfdir}/papersize
%dir %{_sysconfdir}/libpaper.d
%{_bindir}/paperconf
%{_libdir}/libpaper.so.1.1.2
%{_libdir}/libpaper.so.1
%{_sbindir}/paperconfig
%{_mandir}/man1/*
%{_mandir}/man5/*
%{_mandir}/man8/*
%config(noreplace) %{_sysconfdir}/paperspecs
%{_libdir}/libpaper.so.2*
%files devel
%{_includedir}/paper.h
%{_libdir}/libpaper.so
%{_mandir}/man3/*
%files -n paper
%{_bindir}/paper
%{_bindir}/paperconf
%{_libexecdir}/localepaper
%{_mandir}/man1/*
%{_mandir}/man5/*
%changelog
* Mon Dec 03 2018 Zdenek Dohnal <zdohnal@redhat.com> - 1.1.24-22
- 1606989 - Please review important issues found by covscan in "libpaper-1.1.24-21.el8+7" package
* Tue Oct 29 2024 Troy Dawson <tdawson@redhat.com> - 1:2.1.1-7
- Bump release for October 2024 mass rebuild:
Resolves: RHEL-64018
* Mon Jun 24 2024 Troy Dawson <tdawson@redhat.com> - 1:2.1.1-6
- Bump release for June 2024 mass rebuild
* Mon May 13 2024 Zdenek Dohnal <zdohnal@redhat.com> - 1:2.1.1-5
- remove gnulib dependency and use bundled one
* Tue Apr 23 2024 Zdenek Dohnal <zdohnal@redhat.com> - 1:2.1.1-4
- RHEL-33500 - apply hardening ldflags for localepaper
* Thu Jan 25 2024 Fedora Release Engineering <releng@fedoraproject.org> - 1:2.1.1-3
- Rebuilt for https://fedoraproject.org/wiki/Fedora_40_Mass_Rebuild
* Sun Jan 21 2024 Fedora Release Engineering <releng@fedoraproject.org> - 1:2.1.1-2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_40_Mass_Rebuild
* Tue Jul 25 2023 Zdenek Dohnal <zdohnal@redhat.com> - 1:2.1.1-1
- 2.1.1
* Thu Jul 20 2023 Fedora Release Engineering <releng@fedoraproject.org> - 1:2.1.0-2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_39_Mass_Rebuild
* Fri Apr 14 2023 Tom Callaway <spot@fedoraproject.org> - 1:2.1.0-1
- update to 2.1.0
* Fri Mar 3 2023 Tom Callaway <spot@fedoraproject.org> - 1:2.0.10-1
- update to 2.0.10
* Thu Feb 23 2023 Tom Callaway <spot@fedoraproject.org> - 1:2.0.9-1
- update to 2.0.9
* Tue Feb 14 2023 Tom Callaway <spot@fedoraproject.org> - 1:2.0.8-1
- update to 2.0.8
* Thu Jan 19 2023 Fedora Release Engineering <releng@fedoraproject.org> - 1:2.0.4-3
- Rebuilt for https://fedoraproject.org/wiki/Fedora_38_Mass_Rebuild
* Mon Jan 9 2023 Tom Callaway <spot@fedoraproject.org> - 2.0.4-2
- move /etc/paperspecs to libpaper to ensure proper functionality in cases where paper subpackage
is not installed
- fix Requires to include epoch
* Sun Jan 8 2023 Tom Callaway <spot@fedoraproject.org> - 2.0.4-1
- update to 2.0.4
* Thu Jul 21 2022 Fedora Release Engineering <releng@fedoraproject.org> - 1.1.28-5
- Rebuilt for https://fedoraproject.org/wiki/Fedora_37_Mass_Rebuild
* Thu Jan 20 2022 Fedora Release Engineering <releng@fedoraproject.org> - 1.1.28-4
- Rebuilt for https://fedoraproject.org/wiki/Fedora_36_Mass_Rebuild
* Thu Jul 22 2021 Fedora Release Engineering <releng@fedoraproject.org> - 1.1.28-3
- Rebuilt for https://fedoraproject.org/wiki/Fedora_35_Mass_Rebuild
* Tue Jan 26 2021 Fedora Release Engineering <releng@fedoraproject.org> - 1.1.28-2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_34_Mass_Rebuild
* Thu Nov 05 2020 Zdenek Dohnal <zdohnal@redhat.com> - 1.1.28-1
- 1.1.28
* Tue Jul 28 2020 Fedora Release Engineering <releng@fedoraproject.org> - 1.1.24-28
- Rebuilt for https://fedoraproject.org/wiki/Fedora_33_Mass_Rebuild
* Mon Jul 13 2020 Tom Stellard <tstellar@redhat.com> - 1.1.24-27
- Use make macros
- https://fedoraproject.org/wiki/Changes/UseMakeBuildInstallMacro
* Wed Jan 29 2020 Fedora Release Engineering <releng@fedoraproject.org> - 1.1.24-26
- Rebuilt for https://fedoraproject.org/wiki/Fedora_32_Mass_Rebuild
* Thu Jul 25 2019 Fedora Release Engineering <releng@fedoraproject.org> - 1.1.24-25
- Rebuilt for https://fedoraproject.org/wiki/Fedora_31_Mass_Rebuild
* Fri Feb 01 2019 Fedora Release Engineering <releng@fedoraproject.org> - 1.1.24-24
- Rebuilt for https://fedoraproject.org/wiki/Fedora_30_Mass_Rebuild
* Mon Dec 03 2018 Zdenek Dohnal <zdohnal@redhat.com> - 1.1.24-23
- fixing covscan issue - memory leak
* Fri Jul 13 2018 Fedora Release Engineering <releng@fedoraproject.org> - 1.1.24-22
- Rebuilt for https://fedoraproject.org/wiki/Fedora_29_Mass_Rebuild
* Fri Mar 09 2018 Zdenek Dohnal <zdohnal@redhat.com> - 1.1.24-21
- remove nmu5 from .gitignore and sources

44
localepaper.c Normal file
View File

@ -0,0 +1,44 @@
/*
* localepaper: print the dimensions in mm of the current locale's
* paper size, if possible.
*
* Based on a patch by Caolan McNamara:
* http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=481213
*
* Copyright (C) Reuben Thomas <rrt@sc3d.org>, 2013.
*
* Copying and distribution of this file, with or without modification,
* are permitted in any medium without royalty provided the copyright
* notice and this notice are preserved.
*/
#include <config.h>
#include <stdio.h>
#include <stdlib.h>
#include <locale.h>
#if defined LC_PAPER && defined _GNU_SOURCE
#include <langinfo.h>
#endif
#include "progname.h"
int main(int argc, char *argv[])
{
set_program_name(argv[0]);
argc = argc; /* Avoid a compiler warning. */
#if defined LC_PAPER && defined _GNU_SOURCE
setlocale(LC_ALL, "");
#define NL_PAPER_GET(x) \
((union { char *string; unsigned word; })nl_langinfo(x)).word
printf("%d %d\n", NL_PAPER_GET(_NL_PAPER_WIDTH), NL_PAPER_GET(_NL_PAPER_HEIGHT));
return EXIT_SUCCESS;
#else
printf("%s: locale paper size information is not supported on this system", program_name);
return EXIT_FAILURE;
#endif
}

36
plans.fmf Normal file
View File

@ -0,0 +1,36 @@
/tier1-internal:
plan:
import:
url: https://src.fedoraproject.org/tests/libpaper.git
name: /plans/tier1/internal
/tier1-public:
plan:
import:
url: https://src.fedoraproject.org/tests/libpaper.git
name: /plans/tier1/public
/tier2-tier3-internal:
plan:
import:
url: https://src.fedoraproject.org/tests/libpaper.git
name: /plans/tier2-tier3/internal
/tier2-tier3-public:
plan:
import:
url: https://src.fedoraproject.org/tests/libpaper.git
name: /plans/tier2-tier3/public
/others-internal:
plan:
import:
url: https://src.fedoraproject.org/tests/libpaper.git
name: /plans/others/internal
/others-public:
plan:
import:
url: https://src.fedoraproject.org/tests/libpaper.git
name: /plans/others/public

View File

@ -1 +1 @@
SHA512 (libpaper_1.1.24+nmu4.tar.gz) = 4412139ffab7b9658f186a825c7d4ae3ba397ff32852a66decccef7b74647dd365573b9f00145fe2fa95dd16e30c280a8aeeac90a14006ed140f5b85e2f0e508
SHA512 (libpaper-2.1.1.tar.gz) = 90fabb586115d99c9fb4d4ecee87ac0d1b2ac17ddf0c89287eb82e21834b0a2bc7cd5049fb73f3e20e4b494c374413c388b28c3274ceb278ce81928e17fde288