[pspp] Fixed FTBFS

Peter Lemenkov peter at fedoraproject.org
Sun Feb 24 19:07:30 UTC 2013


commit 8bbb8373a74b96839afe70f0b42f0f342db225e0
Author: Peter Lemenkov <lemenkov at gmail.com>
Date:   Sun Feb 24 23:07:21 2013 +0400

    Fixed FTBFS
    
    Signed-off-by: Peter Lemenkov <lemenkov at gmail.com>

 pspp-0001-stdio-don-t-assume-gets-any-more.patch |   72 ++++++++++++++++++++++
 pspp.spec                                        |   34 +++++-----
 2 files changed, 89 insertions(+), 17 deletions(-)
---
diff --git a/pspp-0001-stdio-don-t-assume-gets-any-more.patch b/pspp-0001-stdio-don-t-assume-gets-any-more.patch
new file mode 100644
index 0000000..7b2f192
--- /dev/null
+++ b/pspp-0001-stdio-don-t-assume-gets-any-more.patch
@@ -0,0 +1,72 @@
+From 6989ea85cf0ca6e1290e1673244305ef6bab523a Mon Sep 17 00:00:00 2001
+From: Eric Blake <eblake at redhat.com>
+Date: Thu, 29 Mar 2012 13:30:41 -0600
+Subject: [PATCH 1/1] stdio: don't assume gets any more
+
+Gnulib intentionally does not have a gets module, and now that C11
+and glibc have dropped it, we should be more proactive about warning
+any user on a platform that still has a declaration of this dangerous
+interface.
+
+* m4/stdio_h.m4 (gl_STDIO_H, gl_STDIO_H_DEFAULTS): Drop gets
+support.
+* modules/stdio (Makefile.am): Likewise.
+* lib/stdio-read.c (gets): Likewise.
+* tests/test-stdio-c++.cc: Likewise.
+* m4/warn-on-use.m4 (gl_WARN_ON_USE_PREPARE): Fix comment.
+* lib/stdio.in.h (gets): Make warning occur in more places.
+* doc/posix-functions/gets.texi (gets): Update documentation.
+Reported by Christer Solskogen.
+
+Signed-off-by: Eric Blake <eblake at redhat.com>
+---
+ gl/stdio.in.h | 25 +++++++------------------
+ 1 file changed, 7 insertions(+), 18 deletions(-)
+
+diff --git a/gl/stdio.in.h b/gl/stdio.in.h
+index 473c84c..c0c2e47 100644
+--- a/gl/stdio.in.h
++++ b/gl/stdio.in.h
+@@ -679,22 +679,11 @@ _GL_WARN_ON_USE (getline, "getline is unportable - "
+ # endif
+ #endif
+ 
+-#if @GNULIB_GETS@
+-# if @REPLACE_STDIO_READ_FUNCS@ && @GNULIB_STDIO_H_NONBLOCKING@
+-#  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+-#   undef gets
+-#   define gets rpl_gets
+-#  endif
+-_GL_FUNCDECL_RPL (gets, char *, (char *s) _GL_ARG_NONNULL ((1)));
+-_GL_CXXALIAS_RPL (gets, char *, (char *s));
+-# else
+-_GL_CXXALIAS_SYS (gets, char *, (char *s));
+-#  undef gets
+-# endif
+-_GL_CXXALIASWARN (gets);
+ /* It is very rare that the developer ever has full control of stdin,
+-   so any use of gets warrants an unconditional warning.  Assume it is
+-   always declared, since it is required by C89.  */
++   so any use of gets warrants an unconditional warning; besides, C11
++   removed it.  */
++#undef gets
++#if HAVE_RAW_DECL_GETS
+ _GL_WARN_ON_USE (gets, "gets is a security hole - use fgets instead");
+ #endif
+ 
+@@ -1016,9 +1005,9 @@ _GL_WARN_ON_USE (snprintf, "snprintf is unportable - "
+ # endif
+ #endif
+ 
+-/* Some people would argue that sprintf should be handled like gets
+-   (for example, OpenBSD issues a link warning for both functions),
+-   since both can cause security holes due to buffer overruns.
++/* Some people would argue that all sprintf uses should be warned about
++   (for example, OpenBSD issues a link warning for it),
++   since it can cause security holes due to buffer overruns.
+    However, we believe that sprintf can be used safely, and is more
+    efficient than snprintf in those safe cases; and as proof of our
+    belief, we use sprintf in several gnulib modules.  So this header
+-- 
+1.8.1.4
+
diff --git a/pspp.spec b/pspp.spec
index 16bc24b..fc51818 100644
--- a/pspp.spec
+++ b/pspp.spec
@@ -1,6 +1,6 @@
 Name:           pspp
 Version:        0.7.9
-Release:        4%{?dist}
+Release:        5%{?dist}
 Summary:        A program for statistical analysis of sampled data
 Group:          Applications/Engineering
 License:        GPLv3+
@@ -8,7 +8,7 @@ URL:            http://www.gnu.org/software/pspp/
 Source0:        ftp://alpha.gnu.org/gnu/%{name}/%{name}-%{version}.tar.gz
 Source1:        ftp://alpha.gnu.org/gnu/%{name}/%{name}-%{version}.tar.gz.sig
 Source3:        pspp.svg
-BuildRoot:      %(mktemp -ud %{_tmppath}/%{name}-%{version}-%{release}-XXXXXX)
+Patch1:         pspp-0001-stdio-don-t-assume-gets-any-more.patch
 BuildRequires:  plotutils-devel, ncurses-devel, readline-devel
 BuildRequires:  gsl-devel >= 1.11-2
 BuildRequires:  postgresql-devel
@@ -17,6 +17,7 @@ BuildRequires:  gettext, desktop-file-utils
 BuildRequires:  perl(ExtUtils::MakeMaker)
 BuildRequires:	autoconf automake libtool gettext-devel texinfo libxml2
 BuildRequires:	gtksourceview2-devel
+Provides:       bundled(gnulib)
 Requires:	hicolor-icon-theme
 Requires(post): info
 Requires(preun): info
@@ -34,6 +35,7 @@ support is currently limited, but growing.
 
 %prep
 %setup -q
+%patch1 -p1 -b .nowarn_gets_fgets
 
 TMPTHANKS=$(mktemp %{name}.XXXXXXXX)
 iconv -f ISO-8859-1 -t UTF-8 THANKS >$TMPTHANKS
@@ -51,26 +53,22 @@ make %{?_smp_mflags}
 
 
 %install
-rm -rf $RPM_BUILD_ROOT
-make install DESTDIR=$RPM_BUILD_ROOT
+make install DESTDIR=%{buildroot}
 # don't own /usr/share/info/dir
-rm $RPM_BUILD_ROOT%{_infodir}/dir
+rm %{buildroot}%{_infodir}/dir
 
 # don't lala
-find $RPM_BUILD_ROOT%{_libdir}/ \
+find %{buildroot}%{_libdir}/ \
    -name \*.la -delete
 
 # desktop file
-desktop-file-validate ${RPM_BUILD_ROOT}%{_datadir}/applications/pspp.desktop
+desktop-file-validate %{buildroot}%{_datadir}/applications/pspp.desktop
 
 # localization
 %find_lang %{name}
 
 # clean up some stuff
-rm -f ${RPM_BUILD_ROOT}%{_datadir}/icons/hicolor/icon-theme.cache
-rm -rf ${RPM_BUILD_ROOT}%{_datadir}/doc/pspp/
-#rm -f ${RPM_BUILD_ROOT}%{_libdir}/libpspp.so
-#rm -f ${RPM_BUILD_ROOT}%{_libdir}/libpspp-core.so
+rm -f %{buildroot}%{_datadir}/icons/hicolor/icon-theme.cache
 
 
 %check
@@ -99,12 +97,7 @@ if [ $1 = 0 ] ; then
 fi
 
 
-%clean
-rm -rf $RPM_BUILD_ROOT
-
-
 %files -f %{name}.lang
-%defattr(-,root,root,-)
 %doc AUTHORS COPYING NEWS ONEWS README THANKS
 %{_bindir}/pspp
 %{_bindir}/psppire
@@ -116,9 +109,16 @@ rm -rf $RPM_BUILD_ROOT
 %{_datadir}/icons/hicolor/16x16/apps/%{name}.png
 %{_datadir}/icons/hicolor/16x16/%{name}/
 %{_datadir}/pspp/
+# FIXME this should be marked as doc
+%{_datadir}/doc/pspp/
 
 
 %changelog
+* Sun Feb 24 2013 Peter Lemenkov <lemenkov at gmail.com> - 0.7.9-5
+- Fixed FTBFS in Rawhide / Fedora 19 (see rhbz #914398)
+- Added provides(gnulib) (see rhbz #821785)
+- Added accidentally removed pspp docs (see rhbz #822610)
+
 * Thu Feb 14 2013 Fedora Release Engineering <rel-eng at lists.fedoraproject.org> - 0.7.9-4
 - Rebuilt for https://fedoraproject.org/wiki/Fedora_19_Mass_Rebuild
 
@@ -184,7 +184,7 @@ rm -rf $RPM_BUILD_ROOT
 * Sat Jun 14 2008 Matěj Cepl <mcepl at redhat.com> 0.6.0-5
 - Approved version with fixed duplicate %%{_sysconfdir}/pspp
 
-* Thu Jun 13 2008 Matěj Cepl <mcepl at redhat.com> 0.6.0-4
+* Fri Jun 13 2008 Matěj Cepl <mcepl at redhat.com> 0.6.0-4
 - Second wave of Package Review -- .desktop file
 - Mysterious libraries eliminated
 


More information about the scm-commits mailing list