Compare commits

...

10 Commits

Author SHA1 Message Date
openeuler-ci-bot
9f1bb89100
!30 Tune QUtil::hex_encode
From: @lixiaoyong1 
Reviewed-by: @caodongxia 
Signed-off-by: @caodongxia
2024-05-20 09:28:36 +00:00
lixiaoyong
49d49ab687 Tune QUtil::hex_encode 2024-05-10 01:10:33 +08:00
openeuler-ci-bot
bbc9e7620e
!23 [sync] PR-22: Add BIND_NOW,PIE,SP secure compilation options
From: @openeuler-sync-bot 
Reviewed-by: @lyn1001 
Signed-off-by: @lyn1001
2023-03-06 06:57:14 +00:00
wk333
e8d3792a2a Add BIND_NOW,PIE,SP secure compilation options
(cherry picked from commit 247921843245df589754ae9b654abdaec341086a)
2023-03-06 14:34:20 +08:00
openeuler-ci-bot
33a41f6637
!18 qpdf在master进行升级,到11.1.0
From: @lordvv 
Reviewed-by: @Charlie_li 
Signed-off-by: @Charlie_li
2022-12-27 02:23:12 +00:00
lordvv
fe0199c150 update qpdf version 2022-10-17 19:45:07 +08:00
openeuler-ci-bot
6a8df7aafa
!13 modify changlog error
From: @peijiankang 
Reviewed-by: @licihua 
Signed-off-by: @licihua
2022-06-14 11:20:48 +00:00
peijiankang
74ed92201d modify changlog error 2022-06-08 14:38:26 +08:00
openeuler-ci-bot
42c97ff4b2 !10 [sync] PR-5: 修复 x86_64 和 aarch64 平台source rpm 不一致的问题
Merge pull request !10 from openeuler-sync-bot/sync-pr5-openEuler-20.03-LTS-SP3-to-master
2022-01-04 01:20:48 +00:00
caodongxia
6a9f3dac80 fix rpmbuild missing patches due to different arch
(cherry picked from commit 2089e7834a641d99193b952b0e20c68a20cf3905)
2021-12-16 10:32:26 +08:00
5 changed files with 71 additions and 192 deletions

View File

@ -0,0 +1,33 @@
From ae800361fefb6d30d054f5d90af310c85765b044 Mon Sep 17 00:00:00 2001
From: m-holger <m-holger@kubitscheck.org>
Date: Thu, 22 Sep 2022 20:13:51 +0100
Subject: [PATCH] Tune QUtil::hex_encode
Reference: https://github.com/qpdf/qpdf/commit/ae800361fefb6d30d054f5d90af310c85765b044
---
libqpdf/QUtil.cc | 8 +++++---
1 file changed, 5 insertions(+), 3 deletions(-)
diff --git a/libqpdf/QUtil.cc b/libqpdf/QUtil.cc
index 98a8f318..bcf4aa4e 100644
--- a/libqpdf/QUtil.cc
+++ b/libqpdf/QUtil.cc
@@ -769,10 +769,12 @@ QUtil::make_unique_cstr(std::string const& str)
std::string
QUtil::hex_encode(std::string const& input)
{
+ static auto constexpr hexchars = "0123456789abcdef";
std::string result;
- for (unsigned int i = 0; i < input.length(); ++i) {
- result += QUtil::int_to_string_base(
- QIntC::to_int(static_cast<unsigned char>(input.at(i))), 16, 2);
+ result.reserve(2 * input.length());
+ for (const char c: input) {
+ result += hexchars[static_cast<unsigned char>(c) >> 4];
+ result += hexchars[c & 0x0f];
}
return result;
}
--
2.39.3

View File

@ -1,30 +0,0 @@
diff -up qpdf-8.2.1/manual/fix-qdf.1.in.doc qpdf-8.2.1/manual/fix-qdf.1.in
--- qpdf-8.2.1/manual/fix-qdf.1.in.doc 2018-08-18 16:56:19.000000000 +0200
+++ qpdf-8.2.1/manual/fix-qdf.1.in 2018-09-24 14:24:26.340341484 +0200
@@ -14,5 +14,4 @@ the same file with stream lengths, cross
object stream offset tables regenerated.
.PP
For details about fix-qdf and about PDF files in QDF mode, please see
-the qpdf manual, which can be found in @docdir@/qpdf-manual.html or
-@docdir@/qpdf-manual.pdf.
+the qpdf manual, which can be found in qpdf-doc package.
diff -up qpdf-8.2.1/manual/qpdf.1.in.doc qpdf-8.2.1/manual/qpdf.1.in
--- qpdf-8.2.1/manual/qpdf.1.in.doc 2018-09-24 14:24:26.340341484 +0200
+++ qpdf-8.2.1/manual/qpdf.1.in 2018-09-24 14:26:18.171462618 +0200
@@ -16,4 +16,4 @@ useful primarily to PDF developers.
.PP
For a summary of qpdf's options, please run
\fBqpdf \-\-help\fR. A complete manual can be found in
-@docdir@/qpdf-manual.html or @docdir@/qpdf-manual.pdf.
+qpdf-doc package.
diff -up qpdf-8.2.1/manual/zlib-flate.1.in.doc qpdf-8.2.1/manual/zlib-flate.1.in
--- qpdf-8.2.1/manual/zlib-flate.1.in.doc 2018-08-18 16:56:19.000000000 +0200
+++ qpdf-8.2.1/manual/zlib-flate.1.in 2018-09-24 14:24:26.340341484 +0200
@@ -21,6 +21,6 @@ This program should not be used as a gen
tool. Use something like gzip(1) instead.
.PP
For details about qpdf, please see the qpdf manual, which can be found
-in @docdir@/qpdf-manual.html or @docdir@/qpdf-manual.pdf.
+in qpdf-doc package.
.SH "SEE ALSO"
qpdf(1), gzip(1)

View File

@ -1,142 +0,0 @@
diff -up qpdf-8.1.0/examples/qtest/filter-tokens.test.erase-tests-with-generated-object-stream qpdf-8.1.0/examples/qtest/filter-tokens.test
--- qpdf-8.1.0/examples/qtest/filter-tokens.test.erase-tests-with-generated-object-stream 2018-06-26 16:25:29.028242814 +0200
+++ qpdf-8.1.0/examples/qtest/filter-tokens.test 2018-06-26 16:27:17.456366872 +0200
@@ -13,8 +13,4 @@ $td->runtest("filter tokens",
{$td->COMMAND => "pdf-filter-tokens in.pdf a.pdf"},
{$td->STRING => "", $td->EXIT_STATUS => 0});
-$td->runtest("check output",
- {$td->FILE => "a.pdf"},
- {$td->FILE => "out.pdf"});
-
-$td->report(2);
+$td->report(1);
diff -up qpdf-8.1.0/examples/qtest/invert-images.test.erase-tests-with-generated-object-stream qpdf-8.1.0/examples/qtest/invert-images.test
--- qpdf-8.1.0/examples/qtest/invert-images.test.erase-tests-with-generated-object-stream 2018-06-23 13:50:11.000000000 +0200
+++ qpdf-8.1.0/examples/qtest/invert-images.test 2018-06-26 16:25:15.832347910 +0200
@@ -19,13 +19,13 @@ $td->runtest("double page size",
$td->EXIT_STATUS => 0},
$td->NORMALIZE_NEWLINES);
-$td->runtest("check output",
- {$td->FILE => "a.pdf"},
- {$td->FILE => "out.pdf"});
+#$td->runtest("check output",
+# {$td->FILE => "a.pdf"},
+# {$td->FILE => "out.pdf"});
cleanup();
-$td->report(2);
+$td->report(1);
sub cleanup
{
diff -up qpdf-8.1.0/examples/qtest/set-form-values.test.erase-tests-with-generated-object-stream qpdf-8.1.0/examples/qtest/set-form-values.test
--- qpdf-8.1.0/examples/qtest/set-form-values.test.erase-tests-with-generated-object-stream 2018-06-26 16:25:24.971275053 +0200
+++ qpdf-8.1.0/examples/qtest/set-form-values.test 2018-06-26 16:27:26.641291590 +0200
@@ -14,13 +14,10 @@ cleanup();
$td->runtest("set form values",
{$td->COMMAND => "pdf-set-form-values form-in.pdf a.pdf soup"},
{$td->STRING => "", $td->EXIT_STATUS => 0});
-$td->runtest("compare files",
- {$td->FILE => "a.pdf"},
- {$td->FILE => "form-out.pdf"});
cleanup();
-$td->report(2);
+$td->report(1);
sub cleanup
{
diff -up qpdf-8.1.0/libqpdf/qpdf-c.cc.erase-tests-with-generated-object-stream qpdf-8.1.0/libqpdf/qpdf-c.cc
--- qpdf-8.1.0/libqpdf/qpdf-c.cc.erase-tests-with-generated-object-stream 2018-06-23 13:50:11.000000000 +0200
+++ qpdf-8.1.0/libqpdf/qpdf-c.cc 2018-06-26 16:25:15.832347910 +0200
@@ -302,7 +302,6 @@ QPDF_ERROR_CODE qpdf_read_memory(qpdf_da
qpdf->size = size;
qpdf->password = password;
status = trap_errors(qpdf, &call_read_memory);
- QTC::TC("qpdf", "qpdf-c called qpdf_read_memory", status);
return status;
}
@@ -515,7 +514,6 @@ unsigned char const* qpdf_get_buffer(qpd
void qpdf_set_object_stream_mode(qpdf_data qpdf, qpdf_object_stream_e mode)
{
- QTC::TC("qpdf", "qpdf-c called qpdf_set_object_stream_mode");
qpdf->qpdf_writer->setObjectStreamMode(mode);
}
diff -up qpdf-8.1.0/libqpdf/QPDFWriter.cc.erase-tests-with-generated-object-stream qpdf-8.1.0/libqpdf/QPDFWriter.cc
--- qpdf-8.1.0/libqpdf/QPDFWriter.cc.erase-tests-with-generated-object-stream 2018-06-23 13:50:11.000000000 +0200
+++ qpdf-8.1.0/libqpdf/QPDFWriter.cc 2018-06-26 16:25:15.833347901 +0200
@@ -3221,8 +3221,6 @@ QPDFWriter::writeLinearized()
{
if (this->m->deterministic_id)
{
- QTC::TC("qpdf", "QPDFWriter linearized deterministic ID",
- need_xref_stream ? 0 : 1);
computeDeterministicIDData();
popPipelineStack();
assert(this->m->md5_pipeline == 0);
@@ -3426,8 +3424,6 @@ QPDFWriter::writeStandard()
if (this->m->deterministic_id)
{
- QTC::TC("qpdf", "QPDFWriter standard deterministic ID",
- this->m->object_stream_to_objects.empty() ? 0 : 1);
popPipelineStack();
assert(this->m->md5_pipeline == 0);
}
diff -up qpdf-8.1.0/qpdf/qpdf.testcov.erase-tests-with-generated-object-stream qpdf-8.1.0/qpdf/qpdf.testcov
--- qpdf-8.1.0/qpdf/qpdf.testcov.erase-tests-with-generated-object-stream 2018-06-23 13:50:11.000000000 +0200
+++ qpdf-8.1.0/qpdf/qpdf.testcov 2018-06-26 16:25:15.833347901 +0200
@@ -126,7 +126,6 @@ qpdf-c called qpdf_get_user_password 0
qpdf-c called qpdf_is_linearized 0
qpdf-c called qpdf_is_encrypted 0
qpdf-c called qpdf_init_write 3
-qpdf-c called qpdf_set_object_stream_mode 0
qpdf-c called qpdf_set_stream_data_mode 0
qpdf-c called qpdf_set_content_normalization 0
qpdf-c called qpdf_set_qdf_mode 0
@@ -180,7 +179,6 @@ QPDFObjectHandle append page contents 0
QPDF_Stream getRawStreamData 0
QPDF_Stream getStreamData 0
QPDF_Stream expand filter abbreviation 0
-qpdf-c called qpdf_read_memory 0
QPDF stream without newline 0
QPDF stream with CR only 0
QPDF stream with CRNL 0
@@ -264,8 +262,6 @@ qpdf pages range omitted at end 0
qpdf pages range omitted in middle 0
qpdf npages 0
QPDF already reserved object 0
-QPDFWriter standard deterministic ID 1
-QPDFWriter linearized deterministic ID 1
QPDFWriter deterministic with no data 0
qpdf-c called qpdf_set_deterministic_ID 0
QPDFObjectHandle indirect with 0 objid 0
diff -up qpdf-8.1.0/qpdf/qtest/qpdf.test.erase-tests-with-generated-object-stream qpdf-8.1.0/qpdf/qtest/qpdf.test
--- qpdf-8.1.0/qpdf/qtest/qpdf.test.erase-tests-with-generated-object-stream 2018-06-23 13:50:11.000000000 +0200
+++ qpdf-8.1.0/qpdf/qtest/qpdf.test 2018-06-26 16:25:15.834347893 +0200
@@ -1713,7 +1713,6 @@ my @capi = (
[3, 'normalized content'],
[4, 'ignore xref streams'],
[5, 'linearized'],
- [6, 'object streams'],
[7, 'qdf'],
[8, 'no original object ids'],
[9, 'uncompressed streams'],
@@ -1757,8 +1756,8 @@ $td->runtest("write damaged",
show_ntests();
# ----------
$td->notify("--- Deterministic ID Tests ---");
-$n_tests += 11;
-foreach my $d ('nn', 'ny', 'yn', 'yy')
+$n_tests += 7;
+foreach my $d ('nn', 'yn')
{
my $linearize = ($d =~ m/^y/);
my $ostream = ($d =~ m/y$/);

View File

@ -1,19 +1,16 @@
Name: qpdf
Version: 8.4.2
Release: 2
Version: 11.1.0
Release: 3
Summary: A command-line program to transform PDF files
License: (Artistic 2.0 or ASL 2.0) and MIT
URL: http://qpdf.sourceforge.net/
Source0: http://downloads.sourceforge.net/sourceforge/qpdf/qpdf-%{version}.tar.gz
Patch0000: qpdf-doc.patch
%ifarch aarch64
Patch0001: qpdf-erase-tests-with-generated-object-stream.patch
%endif
Patch0001: 0001-Tune-QUtil-hex_encode.patch
BuildRequires: gcc gcc-c++ zlib-devel libjpeg-turbo-devel pcre-devel
BuildRequires: perl-interpreter perl-generators perl(Digest::MD5)
BuildRequires: autoconf automake libtool
BuildRequires: cmake gnutls-devel
Provides: %{name}-libs = %{version}-%{release}
Obsoletes: %{name}-libs < %{version}-%{release}
@ -42,26 +39,34 @@ Obsoletes: %{name}-doc < %{version}-%{release}
This package contains some man help and other files for %{name}.
%prep
%autosetup -p1
sed -i '1c#!/usr/bin/perl' qpdf/fix-qdf
%autosetup -n %{name}-%{version} -p1
%build
autoreconf --verbose --force --install
./autogen.sh
export CFLAGS="${RPM_OPT_FLAGS}"
export CXXFLAGS="${RPM_OPT_FLAGS}"
export LDFLAGS="${RPM_LD_FLAGS}"
%configure --disable-static --enable-show-failed-test-output
%make_build
cmake -S . -B build \
-DCMAKE_C_FLAGS_RELEASE:STRING=-DNDEBUG \
-DCMAKE_CXX_FLAGS_RELEASE:STRING=-DNDEBUG \
-DCMAKE_Fortran_FLAGS_RELEASE:STRING=-DNDEBUG \
-DCMAKE_VERBOSE_MAKEFILE:BOOL=ON \
-DCMAKE_INSTALL_DO_STRIP:BOOL=OFF \
-DCMAKE_BUILD_TYPE=RelWithDebInfo \
-DBUILD_STATIC_LIBS=0 \
-DREQUIRE_CRYPTO_GNUTLS=1 \
-DUSE_IMPLICIT_CRYPTO=0 \
-DSHOW_FAILED_TEST_OUTPUT=1 \
-DINSTALL_CMAKE_PACKAGE=0
cmake --build build
%install
%make_install
cmake --install build --prefix %{buildroot}/usr
rm -rf %{buildroot}/usr/lib64/cmake
rm -rf %{buildroot}/usr/lib64/libqpdf.a
%delete_la
%check
make check
%post -p /sbin/ldconfig
%postun -p /sbin/ldconfig
@ -83,8 +88,21 @@ make check
%{_mandir}/man1/*
%changelog
* Wed Dec 16 2019 catastrowings <jianghuhao1994@163.com> - 8.4.2-2
* Fri May 10 2024 lixiaoyong <lixiaoyong@kylinos.cn> - 11.1.0-3
- Tune QUtil::hex_encode
* Mon Mar 06 2023 wangkai <wangkai385@h-partners.com> - 11.1.0-2
- Add BIND_NOW,PIE,SP secure compilation options
* Wed Oct 12 2022 humengfei <humengfei@tju.edu.cn> - 11.1.0-1
- update
* Sun Dec 15 2019 caodongxia <caodongxia@huawei.com> - 8.4.2-3
- fix rpmbuild missing patches due to different arch
* Mon Dec 16 2019 catastrowings <jianghuhao1994@163.com> - 8.4.2-2
- fix build fail
* Wed Dec 11 2019 catastrowings <jianghuhao1994@163.com> - 8.2.1-2
- openEuler init