[tn5250] - spec cleanup, update scriptlets - remove rpath - fix build with -Werror=format-security (#1037360)
Dan Horák
sharkcz at fedoraproject.org
Thu Dec 5 14:14:19 UTC 2013
commit 957f7a698d2e336bdc79951df457c4555fd9e1ac
Author: Dan Horák <dan at danny.cz>
Date: Thu Dec 5 15:14:14 2013 +0100
- spec cleanup, update scriptlets
- remove rpath
- fix build with -Werror=format-security (#1037360)
- move generating terminfo to pkg build time, fixes file ownership
tn5250-0.17.4-format.patch | 39 +++++++++++++++++++++++++++++
tn5250.spec | 59 +++++++++++++++++++++++++++++---------------
2 files changed, 78 insertions(+), 20 deletions(-)
---
diff --git a/tn5250-0.17.4-format.patch b/tn5250-0.17.4-format.patch
new file mode 100644
index 0000000..a7131ab
--- /dev/null
+++ b/tn5250-0.17.4-format.patch
@@ -0,0 +1,39 @@
+diff -up tn5250-0.17.4/curses/cursesterm.c.format tn5250-0.17.4/curses/cursesterm.c
+--- tn5250-0.17.4/curses/cursesterm.c.format 2013-12-03 16:26:11.000000000 +0100
++++ tn5250-0.17.4/curses/cursesterm.c 2013-12-03 16:26:44.000000000 +0100
+@@ -640,9 +640,9 @@ static void curses_terminal_update(Tn525
+ if(This->data->is_xterm) {
+ if (This->data->font_132!=NULL) {
+ if (tn5250_display_width (display)>100)
+- printf(This->data->font_132);
++ printf("%s",This->data->font_132);
+ else
+- printf(This->data->font_80);
++ printf("%s",This->data->font_80);
+ }
+ printf ("\x1b[8;%d;%dt", tn5250_display_height (display)+1,
+ tn5250_display_width (display));
+diff -up tn5250-0.17.4/lib5250/sslstream.c.format tn5250-0.17.4/lib5250/sslstream.c
+--- tn5250-0.17.4/lib5250/sslstream.c.format 2013-12-03 16:23:27.000000000 +0100
++++ tn5250-0.17.4/lib5250/sslstream.c 2013-12-03 16:24:01.000000000 +0100
+@@ -307,7 +307,7 @@ static void ssl_log_SB_buf(unsigned char
+
+ if (!tn5250_logfile)
+ return;
+- fprintf(tn5250_logfile,ssl_getTelOpt(type=*buf++));
++ fprintf(tn5250_logfile,"%s",ssl_getTelOpt(type=*buf++));
+ switch (c=*buf++) {
+ case IS:
+ fputs("<IS>",tn5250_logfile);
+diff -up tn5250-0.17.4/lib5250/telnetstr.c.format tn5250-0.17.4/lib5250/telnetstr.c
+--- tn5250-0.17.4/lib5250/telnetstr.c.format 2013-12-03 16:25:10.000000000 +0100
++++ tn5250-0.17.4/lib5250/telnetstr.c 2013-12-03 16:25:23.000000000 +0100
+@@ -282,7 +282,7 @@ static void log_SB_buf(unsigned char *bu
+
+ if (!tn5250_logfile)
+ return;
+- fprintf(tn5250_logfile,getTelOpt(type=*buf++));
++ fprintf(tn5250_logfile,"%s",getTelOpt(type=*buf++));
+ switch (c=*buf++) {
+ case IS:
+ fputs("<IS>",tn5250_logfile);
diff --git a/tn5250.spec b/tn5250.spec
index d249f1b..657f5aa 100644
--- a/tn5250.spec
+++ b/tn5250.spec
@@ -1,41 +1,56 @@
Summary: 5250 Telnet protocol and Terminal
Name: tn5250
Version: 0.17.4
-Release: 9%{?dist}
+Release: 10%{?dist}
License: LGPLv2+
Group: Applications/Internet
-Source: http://prdownloads.sourceforge.net/%{name}/%{name}-%{version}.tar.gz
+Source: http://downloads.sourceforge.net/%{name}/%{name}-%{version}.tar.gz
Source1: xt5250.desktop
Patch0: tn5250-0.16.5-bhc.patch
+# https://bugzilla.redhat.com/show_bug.cgi?id=1037360
+Patch1: tn5250-0.17.4-format.patch
Url: http://tn5250.sourceforge.net/
Requires: dialog, xterm, hicolor-icon-theme
Requires(post): /usr/bin/tic
Requires(post): /sbin/ldconfig
Requires(preun): coreutils
-BuildRequires: ncurses-devel, openssl-devel, desktop-file-utils
+BuildRequires: ncurses-devel
+BuildRequires: openssl-devel
+BuildRequires: desktop-file-utils
+
%description
tn5250 is an implementation of the 5250 Telnet protocol.
It provides the 5250 library and a 5250 terminal emulation.
+
%package devel
Group: Development/Libraries
Summary: Development tools for the 5250 protocol
-Requires: automake, pkgconfig, ncurses-devel, openssl-devel
+Requires: ncurses-devel
+Requires: openssl-devel
Requires: %{name} = %{version}-%{release}
%description devel
Libraries and header files to use with lib5250.
+
%prep
-%setup -q
+%setup -q
%patch0 -p1
+%patch1 -p1 -b .format
+
%build
-touch -r aclocal.m4 configure configure.in
%configure CPPFLAGS="-I/usr/kerberos/include" CFLAGS="$RPM_OPT_FLAGS" --with-x=yes --disable-static
+
+# kill 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}
+
%install
make install DESTDIR=$RPM_BUILD_ROOT INSTALL="install -p"
@@ -54,28 +69,23 @@ desktop-file-install \
#--add-category "Application;Network;X-Red-Hat-Base"
cp -pf linux/README README.Linux
+/usr/bin/tic -o $RPM_BUILD_ROOT/%{_datadir}/terminfo linux/5250.terminfo
+
+
%post
-unset TERMINFO
-/usr/bin/tic %{_datadir}/%{name}/5250.terminfo 2>/dev/null ||:
/sbin/ldconfig
-touch --no-create %{_datadir}/icons/hicolor ||:
-if [ -x %{_bindir}/gtk-update-icon-cache ] ; then
-%{_bindir}/gtk-update-icon-cache --quiet %{_datadir}/icons/hicolor || :
-fi
+/bin/touch --no-create %{_datadir}/icons/hicolor &>/dev/null || :
%postun
/sbin/ldconfig
-touch --no-create %{_datadir}/icons/hicolor ||:
-if [ -x %{_bindir}/gtk-update-icon-cache ] ; then
-%{_bindir}/gtk-update-icon-cache --quiet %{_datadir}/icons/hicolor || :
+if [ $1 -eq 0 ] ; then
+ /bin/touch --no-create %{_datadir}/icons/hicolor &>/dev/null
+ /usr/bin/gtk-update-icon-cache %{_datadir}/icons/hicolor &>/dev/null || :
fi
+%posttrans
+/usr/bin/gtk-update-icon-cache %{_datadir}/icons/hicolor &>/dev/null || :
-%preun
-if [ $1 = 0 ]; then
-rm -f %{_datadir}/terminfo/5/5250
-rm -f %{_datadir}/terminfo/X/xterm-5250
-fi
%files
%doc AUTHORS COPYING ChangeLog NEWS README* TODO
@@ -87,12 +97,21 @@ fi
%dir %{_datadir}/%{name}
%{_datadir}/%{name}/*
%{_datadir}/applications/*
+%{_datadir}/terminfo/5/5250
+%{_datadir}/terminfo/x/xterm-5250
%files devel
%{_includedir}/*
%{_libdir}/*.so
+
%changelog
+* Tue Dec 03 2013 Dan Horák <dan[at]danny.cz> - 0.17.4-10
+- spec cleanup, update scriptlets
+- remove rpath
+- fix build with -Werror=format-security (#1037360)
+- move generating terminfo to pkg build time, fixes file ownership
+
* Sun Aug 04 2013 Fedora Release Engineering <rel-eng at lists.fedoraproject.org> - 0.17.4-9
- Rebuilt for https://fedoraproject.org/wiki/Fedora_20_Mass_Rebuild
More information about the scm-commits
mailing list