[popt] - Upgrade to 1.16 (#448286, #999377) - Tight run-time dependencies between sub-packages via %{?_isa}
Robert Scheck
robert at fedoraproject.org
Sun Nov 24 17:58:59 UTC 2013
commit 5bf4c7fd86598d43dad9283b1ffdcf425f6754d0
Author: Robert Scheck <robert at fedoraproject.org>
Date: Sun Nov 24 18:58:29 2013 +0100
- Upgrade to 1.16 (#448286, #999377)
- Tight run-time dependencies between sub-packages via %{?_isa}
- Added patch for spelling mistakes in popt man page (#675567)
.gitignore | 1 +
popt-1.13-alias-equal-arg.patch | 121 ---------------------------------------
popt-1.13-execfail.patch | 70 ----------------------
popt-1.13-popt_fprintf.patch | 119 --------------------------------------
popt-1.16-execfail.patch | 71 +++++++++++++++++++++++
popt-1.16-man-page.patch | 66 +++++++++++++++++++++
popt-1.16-pkgconfig.patch | 31 ++++++++++
popt.spec | 45 ++++++++++----
sources | 2 +-
9 files changed, 202 insertions(+), 324 deletions(-)
---
diff --git a/.gitignore b/.gitignore
index 8d7d826..573d5c3 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1 +1,2 @@
popt-1.13.tar.gz
+/popt-1.16.tar.gz
diff --git a/popt-1.16-execfail.patch b/popt-1.16-execfail.patch
new file mode 100644
index 0000000..f530fab
--- /dev/null
+++ b/popt-1.16-execfail.patch
@@ -0,0 +1,71 @@
+Patch by Panu Matilainen <pmatilai at redhat.com> for popt <= 1.16 which kludges
+poptBadOption() to return something semi-meaningful on exec alias fail:
+
+- poptBadOption() is totally unaware of exec alias failures, and will return
+ either the first argument or last option, giving wonderfully misleading error
+ messages (#697435, #710267).
+- Remember execvp() first argument on failure and return that from
+ poptBadOption() if present to give the user a reasonable clue what exactly
+ went wrong.
+
+This patch was proposed to upstream: http://rpm5.org/community/popt-devel/0264.html
+
+--- popt-1.16/popt.c 2010-01-19 01:39:10.000000000 +0100
++++ popt-1.16/popt.c.execfail 2013-11-24 15:50:06.000000000 +0100
+@@ -192,6 +192,7 @@
+ con->flags = flags;
+ con->execs = NULL;
+ con->numExecs = 0;
++ con->execFail = NULL;
+ con->finalArgvAlloced = argc * 2;
+ con->finalArgv = calloc( (size_t)con->finalArgvAlloced, sizeof(*con->finalArgv) );
+ con->execAbsolute = 1;
+@@ -236,6 +237,7 @@
+ con->nextLeftover = 0;
+ con->restLeftover = 0;
+ con->doExec = NULL;
++ con->execFail = _free(con->execFail);
+
+ if (con->finalArgv != NULL)
+ for (i = 0; i < con->finalArgvCount; i++) {
+@@ -564,6 +566,7 @@
+ /*@-nullstate@*/
+ rc = execvp(argv[0], (char *const *)argv);
+ /*@=nullstate@*/
++ con->execFail = xstrdup(argv[0]);
+
+ exit:
+ if (argv) {
+@@ -1697,11 +1700,19 @@
+ const char * poptBadOption(poptContext con, unsigned int flags)
+ {
+ struct optionStackEntry * os = NULL;
++ const char *badOpt = NULL;
+
+- if (con != NULL)
+- os = (flags & POPT_BADOPTION_NOALIAS) ? con->optionStack : con->os;
++ if (con != NULL) {
++ /* Stupid hack to return something semi-meaningful from exec failure */
++ if (con->execFail) {
++ badOpt = con->execFail;
++ } else {
++ os = (flags & POPT_BADOPTION_NOALIAS) ? con->optionStack : con->os;
++ badOpt = os->argv[os->next - 1];
++ }
++ }
+
+- return (os != NULL && os->argv != NULL ? os->argv[os->next - 1] : NULL);
++ return badOpt;
+ }
+
+ const char * poptStrerror(const int error)
+--- popt-1.16/poptint.h 2010-01-19 01:39:10.000000000 +0100
++++ popt-1.16/poptint.h.execfail 2013-11-24 15:50:38.000000000 +0100
+@@ -132,6 +132,7 @@
+ /*@owned@*/ /*@null@*/
+ poptItem execs;
+ int numExecs;
++ char * execFail;
+ /*@only@*/ /*@null@*/
+ poptArgv finalArgv;
+ int finalArgvCount;
diff --git a/popt-1.16-man-page.patch b/popt-1.16-man-page.patch
new file mode 100644
index 0000000..bc8dafd
--- /dev/null
+++ b/popt-1.16-man-page.patch
@@ -0,0 +1,66 @@
+Patch by John Bradshaw <john at johnbradshaw.org> for popt <= 1.16 which fixes some
+spelling mistakes in popt man page.
+
+See https://bugzilla.redhat.com/show_bug.cgi?id=675567 for further details, please.
+This patch was proposed to upstream: http://rpm5.org/community/popt-devel/0263.html
+
+Upstream already corrected some issues with http://rpm5.org/cvs/chngview?cn=16879
+and solved the last ones with http://rpm5.org/cvs/chngview?cn=17375 now. Thus popt
+1.17 should make this patch completely obsolete.
+
+--- popt-1.16/popt.3 2009-07-25 20:52:36.000000000 +0200
++++ popt-1.16/popt.3.man-page 2013-11-24 15:59:58.000000000 +0100
+@@ -200,7 +200,7 @@
+ .RB "This macro includes another option table (via " POPT_ARG_INCLUDE_TABLE
+ ; see below) in the main one which provides the table entries for these
+ .RB "arguments. When " --usage " or " --help " are passed to programs which
+-use popt's automatical help, popt displays the appropriate message on
++use popt's automatic help, popt displays the appropriate message on
+ stderr as soon as it finds the option, and exits the program with a
+ return code of 0. If you want to use popt's automatic help generation in
+ a different way, you need to explicitly add the option entries to your programs
+@@ -210,7 +210,7 @@
+ the argument will not be shown in help output.
+ .sp
+ If the \fIargInfo\fR value is bitwise or'd with \fBPOPT_ARGFLAG_SHOW_DEFAULT\fR,
+-the inital value of the arg will be shown in help output.
++the initial value of the arg will be shown in help output.
+ .sp
+ The final structure in the table should have all the pointer values set
+ .RB "to " NULL " and all the arithmetic values set to 0, marking the "
+@@ -233,7 +233,7 @@
+ contain a overall description of the option table being included.
+ .sp
+ The other special option table entry type tells popt to call a function (a
+-callback) when any option in that table is found. This is especially usefull
++callback) when any option in that table is found. This is especially useful
+ when included option tables are being used, as the program which provides
+ the top-level option table doesn't need to be aware of the other options
+ which are provided by the included table. When a callback is set for
+@@ -473,7 +473,7 @@
+ .TP
+ .B POPT_ERROR_BADNUMBER
+ A conversion from a string to a number (int or long) failed due
+-to the string containing nonnumeric characters. This occurs when
++to the string containing non-numeric characters. This occurs when
+ .BR poptGetNextOpt() " is processing an argument of type "
+ .BR POPT_ARG_INT ", " POPT_ARG_SHORT ", " POPT_ARG_LONG ", " POPT_ARG_LONGLONG ", "
+ .RB POPT_ARG_FLOAT ", or " POPT_ARG_DOUBLE "."
+@@ -517,7 +517,7 @@
+ applications. When an error is detected from most of the functions,
+ an error message is printed along with the error string from
+ .BR poptStrerror() ". When an error occurs during argument parsing, "
+-code similiar to the following displays a useful error message:
++code similar to the following displays a useful error message:
+ .sp
+ .nf
+ fprintf(stderr, "%s: %s\\n",
+@@ -608,7 +608,7 @@
+ .RI "an " argv "-style array, some programs need to parse strings that "
+ are formatted identically to command lines. To facilitate this, popt
+ provides a function that parses a string into an array of strings,
+-using rules similiar to normal shell parsing.
++using rules similar to normal shell parsing.
+ .sp
+ .nf
+ .B "#include <popt.h>"
diff --git a/popt-1.16-pkgconfig.patch b/popt-1.16-pkgconfig.patch
new file mode 100644
index 0000000..08d05c6
--- /dev/null
+++ b/popt-1.16-pkgconfig.patch
@@ -0,0 +1,31 @@
+Patch by Robert Scheck <robert at fedoraproject.org> for popt <= 1.16 which changes
+$(pkgconfigdir) on 64 bit systems from /usr/lib/pkgconfig to /usr/lib64/pkgconfig.
+Using $(libdir)/pkgconfig rather $(prefix)/lib/pkgconfig seems to be common when
+searching on the Internet. This patch however is not really compliant with Fedora
+/%{_lib} vs. %{_libdir} handling before the UsrMove with Fedora 17. Alternatively
+--with-pkgconfigdir or similar should be implemented.
+
+This patch was proposed to upstream: http://rpm5.org/community/popt-devel/0265.html
+
+--- popt-1.16/Makefile.in 2010-05-04 22:55:59.000000000 +0200
++++ popt-1.16/Makefile.in.pkgconfig 2013-11-24 15:06:43.000000000 +0100
+@@ -370,7 +370,7 @@
+ libpopt_la_SOURCES = popt.c poptparse.c poptconfig.c popthelp.c poptint.c
+ libpopt_la_LDFLAGS = -no-undefined @LTLIBINTL@ @LTLIBICONV@ \
+ $(am__append_1)
+-pkgconfigdir = $(prefix)/lib/pkgconfig
++pkgconfigdir = $(libdir)/pkgconfig
+ pkgconfig_DATA = popt.pc
+ man_MANS = popt.3
+ BUILT_SOURCES = popt.pc # popt.lcd
+--- popt-1.16/Makefile.am 2010-05-04 22:55:54.000000000 +0200
++++ popt-1.16/Makefile.am.pkgconfig 2013-11-24 15:02:21.000000000 +0100
+@@ -47,7 +47,7 @@
+ libpopt_la_SOURCES = popt.c poptparse.c poptconfig.c popthelp.c poptint.c
+ libpopt_la_LDFLAGS = -no-undefined @LTLIBINTL@ @LTLIBICONV@
+
+-pkgconfigdir = $(prefix)/lib/pkgconfig
++pkgconfigdir = $(libdir)/pkgconfig
+ pkgconfig_DATA = popt.pc
+
+ if HAVE_LD_VERSION_SCRIPT
diff --git a/popt.spec b/popt.spec
index 2b9abca..2748ba7 100644
--- a/popt.spec
+++ b/popt.spec
@@ -1,14 +1,14 @@
Summary: C library for parsing command line parameters
Name: popt
-Version: 1.13
-Release: 15%{?dist}
+Version: 1.16
+Release: 1%{?dist}
License: MIT
Group: System Environment/Libraries
URL: http://www.rpm5.org/
Source: http://www.rpm5.org/files/%{name}/%{name}-%{version}.tar.gz
-Patch1: popt-1.13-popt_fprintf.patch
-Patch2: popt-1.13-alias-equal-arg.patch
-Patch3: popt-1.13-execfail.patch
+Patch0: popt-1.16-pkgconfig.patch
+Patch1: popt-1.16-execfail.patch
+Patch2: popt-1.16-man-page.patch
BuildRequires: gettext
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
@@ -25,7 +25,7 @@ shell-like rules.
%package devel
Summary: Development files for the popt library
Group: Development/Libraries
-Requires: %{name} = %{version}-%{release}
+Requires: %{name}%{?_isa} = %{version}-%{release}, pkgconfig
%description devel
The popt-devel package includes header files and libraries necessary
@@ -35,7 +35,7 @@ API documentation of the popt library, too.
%package static
Summary: Static library for parsing command line parameters
Group: Development/Libraries
-Requires: %{name}-devel = %{version}-%{release}
+Requires: %{name}-devel%{?_isa} = %{version}-%{release}
%description static
The popt-static package includes static libraries of the popt library.
@@ -43,18 +43,23 @@ Install it if you need to link statically with libpopt.
%prep
%setup -q
-%patch1 -p1 -b .popt_fprintf
-%patch2 -p1 -b .alias-equal-arg
-%patch3 -p1 -b .execfail
+%patch0 -p1 -b .pkgconfig
+%patch1 -p1 -b .execfail
+%patch2 -p1 -b .man-page
%build
+%if 0%{?fedora} < 17 && 0%{?rhel} < 7
%configure --libdir=/%{_lib}
+%else
+%configure
+%endif
make %{?_smp_mflags}
%install
rm -rf $RPM_BUILD_ROOT
make DESTDIR=$RPM_BUILD_ROOT install
+%if 0%{?fedora} < 17 && 0%{?rhel} < 7
# Move libpopt.{so,a} to %{_libdir}
rm -f $RPM_BUILD_ROOT/%{_lib}/libpopt.{la,so}
pushd $RPM_BUILD_ROOT/%{_lib}
@@ -62,6 +67,10 @@ mkdir -p $RPM_BUILD_ROOT%{_libdir}
ln -sf ../../%{_lib}/$(ls libpopt.so.?.?.?) $RPM_BUILD_ROOT%{_libdir}/libpopt.so
popd
mv -f $RPM_BUILD_ROOT/%{_lib}/libpopt.a $RPM_BUILD_ROOT%{_libdir}/libpopt.a
+mv -f $RPM_BUILD_ROOT/%{_lib}/pkgconfig $RPM_BUILD_ROOT%{_libdir}/pkgconfig
+%else
+rm -f $RPM_BUILD_ROOT/%{_libdir}/libpopt.la
+%endif
# Multiple popt configurations are possible
mkdir -p $RPM_BUILD_ROOT%{_sysconfdir}/popt.d
@@ -79,23 +88,33 @@ make check
%postun -p /sbin/ldconfig
%files -f %{name}.lang
-%defattr(-,root,root)
+%defattr(-,root,root,-)
%doc CHANGES COPYING
%{_sysconfdir}/popt.d
+%if 0%{?fedora} < 17 && 0%{?rhel} < 7
/%{_lib}/libpopt.so.*
+%else
+%{_libdir}/libpopt.so.*
+%endif
%files devel
-%defattr(-,root,root)
+%defattr(-,root,root,-)
%doc README
%{_libdir}/libpopt.so
+%{_libdir}/pkgconfig/%{name}.pc
%{_includedir}/popt.h
%{_mandir}/man3/popt.3*
%files static
-%defattr(-,root,root)
+%defattr(-,root,root,-)
%{_libdir}/libpopt.a
%changelog
+* Sun Nov 24 2013 Robert Scheck <robert at fedoraproject.org> 1.16-1
+- Upgrade to 1.16 (#448286, #999377)
+- Tight run-time dependencies between sub-packages via %%{?_isa}
+- Added patch for spelling mistakes in popt man page (#675567)
+
* Sun Aug 04 2013 Fedora Release Engineering <rel-eng at lists.fedoraproject.org> - 1.13-15
- Rebuilt for https://fedoraproject.org/wiki/Fedora_20_Mass_Rebuild
diff --git a/sources b/sources
index 387f6af..fbf7d3b 100644
--- a/sources
+++ b/sources
@@ -1 +1 @@
-b5c47ce0185c83f947953c77000533bf popt-1.13.tar.gz
+3743beefa3dd6247a73f8f7a32c14c33 popt-1.16.tar.gz
More information about the scm-commits
mailing list