Compare commits

..

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

12 changed files with 334 additions and 59 deletions

1
.fmf/version Normal file
View File

@ -0,0 +1 @@
1

7
.gitignore vendored
View File

@ -1,2 +1,5 @@
SOURCES/paps-0.6.8.tar.gz
/paps-0.6.8.tar.gz
*rpm
*gz
*bz2
paps-0.6.6.tar.gz
paps-0.6.8.tar.gz

View File

@ -1,6 +1,6 @@
--- !Policy
product_versions:
- rhel-8
- rhel-10
decision_context: osci_compose_gate
rules:
- !PassingTestCaseRule {test_case_name: desktop-qe.desktop-ci.tier1-gating.functional}

44
paps-c99.patch Normal file
View File

@ -0,0 +1,44 @@
Use AC_USE_SYSTEM_EXTENSIONS and include <config.h>, so that <wchar.h>
makes a declaration of wcwidth available. Include <glib/gprintf.h>
for a declaration of g_vasprintf. This avoids implicit function
declarations and build failures with future compilers.
No need to upstream this because it only impacts the bundled 0.6.8
sources, the later 0.8.0 version has already been fixed upstream. The
g_vasprintf call was introduced in the paps-0.6.6-lcnumeric.patch
downstream patch.
diff -ur paps-0.8.0.orig/paps-0.6.8/configure.in paps-0.8.0/paps-0.6.8/configure.in
--- paps-0.8.0.orig/paps-0.6.8/configure.in 2023-04-13 11:56:29.571277839 +0200
+++ paps-0.8.0/paps-0.6.8/configure.in 2023-04-13 12:00:03.228135149 +0200
@@ -6,6 +6,7 @@
AC_LANG_C
AC_PROG_CC
AM_PROG_LIBTOOL
+AC_USE_SYSTEM_EXTENSIONS
dnl ======================================================
dnl check for CUPS
diff -ur paps-0.8.0.orig/paps-0.6.8/src/paps.c paps-0.8.0/paps-0.6.8/src/paps.c
--- paps-0.8.0.orig/paps-0.6.8/src/paps.c 2023-04-13 11:56:29.583277719 +0200
+++ paps-0.8.0/paps-0.6.8/src/paps.c 2023-04-13 12:02:28.958673663 +0200
@@ -20,7 +20,7 @@
*
*/
-
+#include <config.h>
#include <pango/pango.h>
#include <pango/pangoft2.h>
#include "libpaps.h"
diff -ur paps-0.8.0.orig/paps-0.6.8/src/libpaps.c paps-0.8.0/paps-0.6.8/src/libpaps.c
--- paps-0.8.0.orig/paps-0.6.8/src/libpaps.c 2023-04-13 11:56:29.581277739 +0200
+++ paps-0.8.0/paps-0.6.8/src/libpaps.c 2023-04-13 12:07:17.504779917 +0200
@@ -23,6 +23,7 @@
#include "libpaps.h"
+#include <glib/gprintf.h>
#include <pango/pango.h>
#include <pango/pangoft2.h>
#include <ft2build.h>

85
paps-fix-build.patch Normal file
View File

@ -0,0 +1,85 @@
From e2180b2e1493abc2a8d1165e10bf264d50fac0ae Mon Sep 17 00:00:00 2001
From: Akira TAGOH <akira@tagoh.org>
Date: Wed, 1 Mar 2023 15:24:27 +0900
Subject: [PATCH] Fix the build issue
Some code ignores a return value of g_string_free() and that causes:
ignoring return value of 'gchar* g_string_free_and_steal(GString*)' declared with attribute 'warn_unused_result' [-Wunused-result]
This fixes it.
---
src/paps.cc | 21 ++++++++++++---------
1 file changed, 12 insertions(+), 9 deletions(-)
diff --git a/src/paps.cc b/src/paps.cc
index cb48ddc..429b764 100644
--- a/src/paps.cc
+++ b/src/paps.cc
@@ -368,6 +368,7 @@ copy_pango_parse_enum (GType type,
{
int i;
GString *s = g_string_new (nullptr);
+ gchar *gstr;
for (i = 0, v = g_enum_get_value (klass, i); v;
i++ , v = g_enum_get_value (klass, i))
@@ -382,10 +383,10 @@ copy_pango_parse_enum (GType type,
G_ENUM_CLASS_TYPE_NAME(klass),
s->str);
- if (possible_values)
- *possible_values = s->str;
+ gstr = g_string_free (s, possible_values ? false : true);
- g_string_free (s, possible_values ? false : true);
+ if (possible_values)
+ *possible_values = gstr;
}
}
@@ -1001,7 +1002,7 @@ read_file (FILE *file,
if (ferror (file))
{
fprintf(stderr, _("%s: Error reading file.\n"), g_get_prgname ());
- g_string_free (inbuf, true);
+ (void) g_string_free (inbuf, true);
exit(1);
}
else if (bp == nullptr)
@@ -1043,8 +1044,7 @@ read_file (FILE *file,
if (inbuf->len && inbuf->str[inbuf->len-1] != '\n')
g_string_append(inbuf, "\n");
- text = inbuf->str;
- g_string_free (inbuf, false);
+ text = g_string_free (inbuf, false);
if (encoding != nullptr && cvh != nullptr)
g_iconv_close(cvh);
@@ -1671,7 +1671,11 @@ get_date()
fprintf(stderr, _("%1$s: Error while converting date string from '%2$s' to UTF-8.\n"),
g_get_prgname(), get_encoding());
/* Return the unconverted string. */
- g_string_free(inbuf, false);
+ /*
+ * inbuf isn't used here, but a few memory is
+ * allocated by default. so it should be freed anyway.
+ */
+ (void) g_string_free(inbuf, true);
g_iconv_close(cvh);
return date;
}
@@ -1679,8 +1683,7 @@ get_date()
obuffer[BUFSIZE * 6 - 1 - oblen] = 0;
g_string_append(inbuf, bp);
- date_utf8 = inbuf->str;
- g_string_free(inbuf, false);
+ date_utf8 = g_string_free(inbuf, false);
g_iconv_close(cvh);
}
--
2.39.2

View File

@ -310,7 +310,7 @@ index 334d547..72dbaad 100644
+
+ para->length = i;
+ next = g_utf8_offset_to_pointer(para->text, para->length);
+ wc = g_utf8_prev_char(next);
+ wc = g_utf8_get_char(g_utf8_prev_char(next));
+ } else {
+ pango_layout_set_text(para->layout, para->text, para->length);
+ }

View File

@ -0,0 +1,18 @@
diff -pruN paps-0.8.0.orig/scripts/src-to-paps paps-0.8.0/scripts/src-to-paps
--- paps-0.8.0.orig/scripts/src-to-paps 2023-02-09 16:27:38.000000000 +0900
+++ paps-0.8.0/scripts/src-to-paps 2023-03-01 15:00:27.801416563 +0900
@@ -1,4 +1,4 @@
-#!/usr/bin/python
+#!/usr/bin/python3
######################################################################
# Use GNU source-hightlight to turn source code into pango markup
@@ -49,7 +49,7 @@ def arg_if_not_none(param_name, val):
# Defaults
# TBD - Make this a configuration variable
-pango_outlang_path = '/usr/local/share/paps/pango_markup.outlang'
+pango_outlang_path = '/usr/share/paps/pango_markup.outlang'
parser = argparse.ArgumentParser(description='Process a file')
parser.add_argument('-o', '--output',

202
paps.spec
View File

@ -1,13 +1,16 @@
Name: paps
Version: 0.6.8
Release: 41%{?dist}
Version: 0.8.0
Release: 10%{?dist}
License: LGPLv2+
URL: http://paps.sourceforge.net/
Source0: http://downloads.sourceforge.net/%{name}/%{name}-%{version}.tar.gz
License: LGPL-2.0-or-later
URL: https://github.com/dov/paps
Source0: https://github.com/dov/paps/archive/v%{name}/%{name}-%{version}.tar.gz
Source1: paps.convs
Source2: 29-paps.conf
BuildRequires: pango-devel automake autoconf libtool doxygen cups-devel
Source2: 29-paps.conf
Source3: http://downloads.sourceforge.net/%{name}/%{name}-0.6.8.tar.gz
BuildRequires: make
BuildRequires: pango-devel automake autoconf libtool doxygen cups-devel intltool
BuildRequires: fmt-devel gcc-c++
## https://sourceforge.net/tracker/index.php?func=detail&aid=1832897&group_id=153049&atid=786241
Patch0: paps-0.6.8-shared.patch
## https://sourceforge.net/tracker/index.php?func=detail&aid=1832924&group_id=153049&atid=786241
@ -40,62 +43,72 @@ Patch59: %{name}-ft-header.patch
Patch60: %{name}-a3.patch
## rhbz#1214939
Patch61: %{name}-fix-paper-size-truncate.patch
Patch62: paps-c99.patch
### For paps
Patch100: %{name}-fix-src-to-paps.patch
Patch101: %{name}-fix-build.patch
Summary: Plain Text to PostScript converter
Group: Applications/Publishing
Requires: %{name}-libs = %{version}-%{release}
Requires: cups-filesystem fontpackages-filesystem
%description
paps is a PostScript converter from plain text file using Pango.
%package libs
Summary: Libraries for paps
Group: Development/Libraries
%description libs
%package -n texttopaps
Summary: CUPS filter based on paps
Obsoletes: %{name}-libs < %{version}
Obsoletes: %{name}-devel < %{version}
Requires: cups-filesystem fontpackages-filesystem
%description -n texttopaps
paps is a PostScript converter from plain text file using Pango.
This package contains the library for paps.
This package contains a CUPS filter based on paps.
%package devel
Summary: Development files for paps
Group: Development/Libraries
Requires: %{name}-libs = %{version}-%{release}
%description devel
paps is a PostScript converter from plain text file using Pango.
This package contains the development files that is necessary to develop
applications using paps API.
%prep
%setup -q
%patch0 -p1 -b .shared
%patch1 -p1 -b .wordwrap
%patch2 -p1 -b .langinfo
%patch3 -p1 -b .lcnumeric
%patch4 -p1 -b .exitcode
%patch5 -p1 -b .manpage
%patch50 -p1 -b .cups
%patch51 -p1 -b .cpilpi
%patch52 -p1 -b .dsc
%patch53 -p1 -b .autoconf262
%patch54 -p1 -b .fixcpi
%patch55 -p1 -b .loop
%patch56 -p1 -b .tab
%patch57 -p1 -b .weak-symbol
%patch58 -p1 -b .fsf
%patch59 -p1 -b .ft-header
%patch60 -p1 -b .a3
%patch61 -p1 -b .paper-size
%setup -q -a 3
%patch 100 -p1 -b .src-to-paps
%patch 101 -p1 -b .build
pushd %{name}-0.6.8
%patch 0 -p1 -b .shared
%patch 1 -p1 -b .wordwrap
%patch 2 -p1 -b .langinfo
%patch 3 -p1 -b .lcnumeric
%patch 4 -p1 -b .exitcode
%patch 5 -p1 -b .manpage
%patch 50 -p1 -b .cups
%patch 51 -p1 -b .cpilpi
%patch 52 -p1 -b .dsc
%patch 53 -p1 -b .autoconf262
%patch 54 -p1 -b .fixcpi
%patch 55 -p1 -b .loop
%patch 56 -p1 -b .tab
%patch 57 -p1 -b .weak-symbol
%patch 58 -p1 -b .fsf
%patch 59 -p1 -b .ft-header
%patch 60 -p1 -b .a3
%patch 61 -p1 -b .paper-size
%patch 62 -p2 -b .configure-c99
libtoolize -f -c
autoreconf -f -i
popd
%build
./autogen.sh
%set_build_flags
%if 0%{?rhel}
CXXFLAGS="$CXXFLAGS -DFMT_HEADER_ONLY"
%endif
%configure --disable-static
make %{?_smp_mflags}
pushd %{name}-0.6.8
%configure --disable-static
make %{?_smp_mflags}
popd
%install
pushd %{name}-0.6.8
make install DESTDIR=$RPM_BUILD_ROOT INSTALL="/usr/bin/install -p"
# remove unnecessary files
@ -103,7 +116,8 @@ rm $RPM_BUILD_ROOT%{_libdir}/libpaps.la
# make a symlink for CUPS filter
install -d $RPM_BUILD_ROOT%{_cups_serverbin}/filter # Not libdir
ln -s %{_bindir}/paps $RPM_BUILD_ROOT%{_cups_serverbin}/filter/texttopaps
mv $RPM_BUILD_ROOT%{_bindir}/paps $RPM_BUILD_ROOT%{_cups_serverbin}/filter/texttopaps
mv $RPM_BUILD_ROOT%{_mandir}/man1/paps.1 $RPM_BUILD_ROOT%{_mandir}/man1/texttopaps.1
install -d $RPM_BUILD_ROOT%{_datadir}/cups/mime
install -p -m0644 %{SOURCE1} $RPM_BUILD_ROOT%{_datadir}/cups/mime/
@ -111,28 +125,106 @@ install -p -m0644 %{SOURCE1} $RPM_BUILD_ROOT%{_datadir}/cups/mime/
install -d $RPM_BUILD_ROOT%{_sysconfdir}/fonts/conf.d
install -p -m0644 %{SOURCE2} $RPM_BUILD_ROOT%{_sysconfdir}/fonts/conf.d/
rm -rf $RPM_BUILD_ROOT%{_includedir}
rm $RPM_BUILD_ROOT%{_libdir}/libpaps.so
popd
%post libs -p /sbin/ldconfig
%postun libs -p /sbin/ldconfig
make install DESTDIR=$RPM_BUILD_ROOT INSTALL="/usr/bin/install -p"
%ldconfig_scriptlets libs
%files
%doc AUTHORS COPYING.LIB README TODO
%doc AUTHORS COPYING.LIB README
%{_bindir}/paps
%{_bindir}/src-to-paps
%{_datadir}/paps/pango_markup.outlang
%{_mandir}/man1/paps.1*
%files -n texttopaps
%doc %{name}-0.6.8/COPYING.LIB %{name}-0.6.8/AUTHORS %{name}-0.6.8/README
%{_mandir}/man1/texttopaps.1*
%{_libdir}/libpaps.so.*
%{_cups_serverbin}/filter/texttopaps
%{_datadir}/cups/mime/paps.convs
%{_sysconfdir}/fonts/conf.d/29-paps.conf
%files libs
%doc COPYING.LIB
%{_libdir}/libpaps.so.*
%files devel
%doc COPYING.LIB
%{_includedir}/libpaps.h
%{_libdir}/libpaps.so
%changelog
* Tue Oct 29 2024 Troy Dawson <tdawson@redhat.com> - 0.8.0-10
- Bump release for October 2024 mass rebuild:
Resolves: RHEL-64018
* Mon Jun 24 2024 Troy Dawson <tdawson@redhat.com> - 0.8.0-9
- Bump release for June 2024 mass rebuild
* Thu Jan 25 2024 Fedora Release Engineering <releng@fedoraproject.org> - 0.8.0-8
- Rebuilt for https://fedoraproject.org/wiki/Fedora_40_Mass_Rebuild
* Sun Jan 21 2024 Fedora Release Engineering <releng@fedoraproject.org> - 0.8.0-7
- Rebuilt for https://fedoraproject.org/wiki/Fedora_40_Mass_Rebuild
* Wed Jan 17 2024 Akira TAGOH <tagoh@redhat.com> - 0.8.0-6
- Fix C type error in paps 0.6.8.
Resolves: rhbz#2256906
* Mon Aug 14 2023 Yaakov Selkowitz <yselkowi@redhat.com> - 0.8.0-5
- Use fmt in header-only mode in RHEL builds
* Thu Jul 20 2023 Fedora Release Engineering <releng@fedoraproject.org> - 0.8.0-4
- Rebuilt for https://fedoraproject.org/wiki/Fedora_39_Mass_Rebuild
* Wed Jun 28 2023 Vitaly Zaitsev <vitaly@easycoding.org> - 0.8.0-3
- Rebuilt due to fmt 10 update.
* Thu Apr 13 2023 Florian Weimer <fweimer@redhat.com> - 0.8.0-2
- C99 compatibility fixes for paps 0.6.8
* Wed Mar 1 2023 Akira TAGOH <tagoh@redhat.com> - 0.8.0-1
- New upstream release.
Resolves: rhbz#2168726
* Tue Feb 7 2023 Akira TAGOH <tagoh@redhat.com> - 0.7.9-1
- New upstream release.
Resolves: rhbz#2164212
* Thu Jan 19 2023 Fedora Release Engineering <releng@fedoraproject.org> - 0.7.1-7
- Rebuilt for https://fedoraproject.org/wiki/Fedora_38_Mass_Rebuild
* Mon Dec 5 2022 Akira TAGOH <tagoh@redhat.com> - 0.7.1-6
- Convert License tag to SPDX.
* Fri Jul 22 2022 Fedora Release Engineering <releng@fedoraproject.org> - 0.7.1-5
- Rebuilt for https://fedoraproject.org/wiki/Fedora_37_Mass_Rebuild
* Thu Jan 20 2022 Fedora Release Engineering <releng@fedoraproject.org> - 0.7.1-4
- Rebuilt for https://fedoraproject.org/wiki/Fedora_36_Mass_Rebuild
* Thu Jul 22 2021 Fedora Release Engineering <releng@fedoraproject.org> - 0.7.1-3
- Rebuilt for https://fedoraproject.org/wiki/Fedora_35_Mass_Rebuild
* Tue Jan 26 2021 Fedora Release Engineering <releng@fedoraproject.org> - 0.7.1-2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_34_Mass_Rebuild
* Thu Oct 8 2020 Akira TAGOH <tagoh@redhat.com> - 0.7.1-1
- New upstream release.
Resolves: rhbz#1254352
- Sub-package texttopaps with old code.
* Tue Jul 28 2020 Fedora Release Engineering <releng@fedoraproject.org> - 0.6.8-46
- Rebuilt for https://fedoraproject.org/wiki/Fedora_33_Mass_Rebuild
* Wed Jan 29 2020 Fedora Release Engineering <releng@fedoraproject.org> - 0.6.8-45
- Rebuilt for https://fedoraproject.org/wiki/Fedora_32_Mass_Rebuild
* Fri Jul 26 2019 Fedora Release Engineering <releng@fedoraproject.org> - 0.6.8-44
- Rebuilt for https://fedoraproject.org/wiki/Fedora_31_Mass_Rebuild
* Fri Feb 01 2019 Fedora Release Engineering <releng@fedoraproject.org> - 0.6.8-43
- Rebuilt for https://fedoraproject.org/wiki/Fedora_30_Mass_Rebuild
* Fri Jul 13 2018 Fedora Release Engineering <releng@fedoraproject.org> - 0.6.8-42
- Rebuilt for https://fedoraproject.org/wiki/Fedora_29_Mass_Rebuild
* Thu Feb 08 2018 Fedora Release Engineering <releng@fedoraproject.org> - 0.6.8-41
- Rebuilt for https://fedoraproject.org/wiki/Fedora_28_Mass_Rebuild

5
plans/basic.fmf Normal file
View File

@ -0,0 +1,5 @@
summary: Basic smoke test
discover:
how: fmf
execute:
how: tmt

View File

@ -1 +1,2 @@
SHA512 (paps-0.6.8.tar.gz) = db657d90179e11fe42bbcdbebe09a84f1927c99d0b539c9e29b66b3cb8ffcf33ff500c9d81835ae5a0880382bf8f24801f04742517b76b8e005b125a139d8bba
SHA512 (paps-0.8.0.tar.gz) = 33afad0e3dae9cef0fb3afb9994650bf1a7326e72782346e05ab91f7c84f092145247658cdf57868105df47a1bd08e1a961c1ef4c07a2a8fd01eaf8ecd9d948a

5
tests/basic/main.fmf Normal file
View File

@ -0,0 +1,5 @@
summary: Basic test
require:
- paps
test: ./test.sh
framework: beakerlib

21
tests/basic/test.sh Executable file
View File

@ -0,0 +1,21 @@
#!/bin/bash
# vim: dict+=/usr/share/beakerlib/dictionary.vim cpt=.,w,b,u,t,i,k
. /usr/share/beakerlib/beakerlib.sh || exit 1
rlJournalStart
rlPhaseStartSetup
rlRun "tmp=\$(mktemp -d)" 0 "Create tmp directory"
rlRun "pushd $tmp"
rlRun "set -o pipefail"
rlPhaseEnd
rlPhaseStartTest
rlRun "paps --help | tee output" 0 "Check help message"
rlAssertGrep "paps" "output"
rlPhaseEnd
rlPhaseStartCleanup
rlRun "popd"
rlRun "rm -r $tmp" 0 "Remove tmp directory"
rlPhaseEnd
rlJournalEnd