commit:     ece7f4be67e6d3cd3c75bee6ca1db73b12efd232
Author:     Michael Orlitzky <mjo <AT> gentoo <DOT> org>
AuthorDate: Tue Aug  2 14:43:37 2016 +0000
Commit:     Michael Orlitzky <mjo <AT> gentoo <DOT> org>
CommitDate: Tue Aug  2 14:43:53 2016 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=ece7f4be

app-text/convertlit: new revision fixing -Wformat-security warnings.

Gentoo-Bug: 521246

Package-Manager: portage-2.2.28

 app-text/convertlit/convertlit-1.8-r2.ebuild       | 44 ++++++++++++++++++++++
 .../files/convertlit-1.8-respectflags-r1.patch     | 28 ++++++++++++++
 .../files/fix-Wformat-security-warnings.patch      | 34 +++++++++++++++++
 3 files changed, 106 insertions(+)

diff --git a/app-text/convertlit/convertlit-1.8-r2.ebuild 
b/app-text/convertlit/convertlit-1.8-r2.ebuild
new file mode 100644
index 0000000..29ada51
--- /dev/null
+++ b/app-text/convertlit/convertlit-1.8-r2.ebuild
@@ -0,0 +1,44 @@
+# Copyright 1999-2016 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=6
+
+inherit toolchain-funcs
+
+MY_P="clit${PV//./}"
+
+DESCRIPTION="CLit converts MS ebook .lit files to .opf (xml+html+png+jpg)"
+HOMEPAGE="http://www.convertlit.com/";
+SRC_URI="http://www.convertlit.com/${MY_P}src.zip";
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="~alpha ~amd64 ~arm ~hppa ~ia64 ~ppc ~ppc64 ~x86 ~amd64-fbsd 
~amd64-linux ~x86-linux ~ppc-macos"
+IUSE=""
+
+RDEPEND=">=dev-libs/libtommath-0.36-r1"
+
+DEPEND="${RDEPEND}
+       app-arch/unzip"
+
+S="${WORKDIR}"
+
+PATCHES=(
+       "${FILESDIR}/${P}-respectflags-r1.patch"
+       "${FILESDIR}/fix-Wformat-security-warnings.patch"
+)
+
+src_compile() {
+       tc-export CC
+
+       cd "${S}/lib" || die "failed to change into ${S}/lib directory"
+       emake
+       cd "${S}/${MY_P}" || die "failed to change into ${S}/${MY_P} directory"
+       emake
+}
+
+src_install() {
+       einstalldocs
+       dobin "${MY_P}/clit"
+}

diff --git a/app-text/convertlit/files/convertlit-1.8-respectflags-r1.patch 
b/app-text/convertlit/files/convertlit-1.8-respectflags-r1.patch
new file mode 100644
index 0000000..faedfa0
--- /dev/null
+++ b/app-text/convertlit/files/convertlit-1.8-respectflags-r1.patch
@@ -0,0 +1,28 @@
+Index: clit18/Makefile
+===================================================================
+--- a/clit18/Makefile
++++ b/clit18/Makefile
+@@ -1,9 +1,9 @@
+ all: clit
+ 
+-CFLAGS=-funsigned-char -Wall -O2 -I ../libtommath-0.30/ -I ../lib -I 
../lib/des -I .
++CFLAGS+=-funsigned-char -I ../lib -I ../lib/des -I . 
+ clean:
+       rm -f *.o clit
+ 
+ clit: clit.o hexdump.o drm5.o explode.o transmute.o display.o utils.o 
manifest.o ../lib/openclit.a 
+-      gcc -o clit $^  ../libtommath-0.30/libtommath.a
++      $(CC) $(LDFLAGS) -o clit $^ -ltommath
+ 
+Index: lib/Makefile
+===================================================================
+--- a/lib/Makefile
++++ b/lib/Makefile
+@@ -1,6 +1,6 @@
+ all: openclit.a
+ 
+-CFLAGS=-O3 -Wall -Ides -Isha -Inewlzx -I.
++CFLAGS+=-Ides -Isha -Inewlzx -I.
+ clean:
+       rm -f *.o openclit.a des/*.o lzx/*.o sha/*.o
+ 

diff --git a/app-text/convertlit/files/fix-Wformat-security-warnings.patch 
b/app-text/convertlit/files/fix-Wformat-security-warnings.patch
new file mode 100644
index 0000000..78410a9
--- /dev/null
+++ b/app-text/convertlit/files/fix-Wformat-security-warnings.patch
@@ -0,0 +1,34 @@
+From 79ab07db8d91b6c6e0c36358c8030893c28510ba Mon Sep 17 00:00:00 2001
+From: Michael Orlitzky <[email protected]>
+Date: Tue, 2 Aug 2016 10:32:53 -0400
+Subject: [PATCH 1/1] clit.c: fix -Wformat-security warnings.
+
+Two uses of printf() in clit.c were triggering -Wformat-security
+warnings due to a missing "%s" format string. This was causing
+compilation to fail with -Werror=format-security, so they have
+been fixed.
+
+Gentoo-Bug: 521246
+---
+ clit18/clit.c | 4 ++--
+ 1 file changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/clit18/clit.c b/clit18/clit.c
+index c13a75d..48b749f 100644
+--- a/clit18/clit.c
++++ b/clit18/clit.c
+@@ -125,9 +125,9 @@ int main(int argc, char ** argv)
+             dir_program[i+1] = '\0'; break;
+         }
+     }
+-    printf(sTitle);
++    printf("%s", sTitle);
+     if (argc < 3) { 
+-        printf(sUsage);
++        printf("%s", sUsage);
+         return -1;
+     }
+     base = 1;
+-- 
+2.7.3
+

Reply via email to