General packaging improvements
- Switch to GitHub release archive; as a result, we must now run autoreconf - Patch additional allocation-related issues - Switch BR’s to pkgconfig(…) - Drop obsolete macros and workarounds - General tidying - Don’t glob over the .so version
This commit is contained in:
parent
ebf7199f77
commit
b77712bb23
2
.gitignore
vendored
2
.gitignore
vendored
@ -1,3 +1,5 @@
|
|||||||
libmetalink-0.0.3.tar.bz2
|
libmetalink-0.0.3.tar.bz2
|
||||||
/libmetalink-0.1.2.tar.bz2
|
/libmetalink-0.1.2.tar.bz2
|
||||||
/libmetalink-0.1.3.tar.bz2
|
/libmetalink-0.1.3.tar.bz2
|
||||||
|
/libmetalink-0.1.3.tar.gz
|
||||||
|
/libmetalink-release-0.1.3.tar.gz
|
||||||
|
54
0001-fix-covscan-issues.patch
Normal file
54
0001-fix-covscan-issues.patch
Normal file
@ -0,0 +1,54 @@
|
|||||||
|
From 204c580643f7c52364520926b9df3a621fab6df7 Mon Sep 17 00:00:00 2001
|
||||||
|
From: Martin Sehnoutka <msehnout@redhat.com>
|
||||||
|
Date: Tue, 24 Jul 2018 15:10:40 +0200
|
||||||
|
Subject: [PATCH] fix covscan issues
|
||||||
|
|
||||||
|
---
|
||||||
|
lib/libexpat_metalink_parser.c | 3 +++
|
||||||
|
lib/metalink_pctrl.c | 2 ++
|
||||||
|
2 files changed, 5 insertions(+)
|
||||||
|
|
||||||
|
diff --git a/lib/libexpat_metalink_parser.c b/lib/libexpat_metalink_parser.c
|
||||||
|
index 4e73aef..79b091c 100644
|
||||||
|
--- a/lib/libexpat_metalink_parser.c
|
||||||
|
+++ b/lib/libexpat_metalink_parser.c
|
||||||
|
@@ -29,6 +29,7 @@
|
||||||
|
|
||||||
|
#include <string.h>
|
||||||
|
#include <unistd.h>
|
||||||
|
+#include <stdlib.h>
|
||||||
|
#include <errno.h>
|
||||||
|
#include <assert.h>
|
||||||
|
|
||||||
|
@@ -56,6 +57,8 @@ static void split_ns_name(const char** localname,
|
||||||
|
*localname = sep+1;
|
||||||
|
len = sep-src;
|
||||||
|
temp = malloc((len+1) * sizeof **ns_uri);
|
||||||
|
+ if (temp == NULL)
|
||||||
|
+ exit(EXIT_FAILURE);
|
||||||
|
memcpy(temp, src, len);
|
||||||
|
temp[len] = '\0';
|
||||||
|
*ns_uri = temp;
|
||||||
|
diff --git a/lib/metalink_pctrl.c b/lib/metalink_pctrl.c
|
||||||
|
index c25989b..e6fb8f8 100644
|
||||||
|
--- a/lib/metalink_pctrl.c
|
||||||
|
+++ b/lib/metalink_pctrl.c
|
||||||
|
@@ -469,6 +469,7 @@ metalink_error_t metalink_pctrl_file_set_language(metalink_pctrl_t* ctrl, const
|
||||||
|
l = strdup(language);
|
||||||
|
ctrl->languages = metalink_list_new();
|
||||||
|
if(!ctrl->languages || !l || metalink_list_append(ctrl->languages, l) != 0) {
|
||||||
|
+ if (l) free(l);
|
||||||
|
return METALINK_ERR_BAD_ALLOC;
|
||||||
|
}
|
||||||
|
|
||||||
|
@@ -486,6 +487,7 @@ metalink_error_t metalink_pctrl_file_set_os(metalink_pctrl_t* ctrl, const char*
|
||||||
|
o = strdup(os);
|
||||||
|
ctrl->oses = metalink_list_new();
|
||||||
|
if(!ctrl->oses || !o || metalink_list_append(ctrl->oses, o) != 0) {
|
||||||
|
+ if (o) free(o);
|
||||||
|
return METALINK_ERR_BAD_ALLOC;
|
||||||
|
}
|
||||||
|
|
||||||
|
--
|
||||||
|
2.17.1
|
||||||
|
|
@ -1,66 +1,93 @@
|
|||||||
Name: libmetalink
|
Name: libmetalink
|
||||||
Version: 0.1.3
|
Version: 0.1.3
|
||||||
Release: 15%{?dist}
|
%global so_version 3
|
||||||
Summary: Metalink library written in C
|
Release: 16%{?dist}
|
||||||
License: MIT
|
Summary: Metalink library written in C
|
||||||
URL: https://launchpad.net/libmetalink
|
|
||||||
Source0: https://launchpad.net/libmetalink/trunk/%{name}-%{version}/+download/%{name}-%{version}.tar.bz2
|
License: MIT
|
||||||
|
URL: https://github.com/metalink-dev/libmetalink
|
||||||
|
Source0: %{url}/archive/release-%{version}/libmetalink-release-%{version}.tar.gz
|
||||||
|
|
||||||
|
# NULL ptr deref in initial_state_start_fun
|
||||||
# https://bugs.launchpad.net/libmetalink/+bug/1888672
|
# https://bugs.launchpad.net/libmetalink/+bug/1888672
|
||||||
Patch0: libmetalink-0.1.3-ns_uri.patch
|
Patch0: https://bugs.launchpad.net/libmetalink/+bug/1888672/+attachment/5395227/+files/libmetalink-0.1.3-ns_uri.patch
|
||||||
|
# Fix few issues found by the Coverity static analysis tool
|
||||||
|
# https://bugs.launchpad.net/libmetalink/+bug/1784359
|
||||||
|
# https://github.com/metalink-dev/libmetalink/pull/2
|
||||||
|
Patch1: https://bugs.launchpad.net/libmetalink/+bug/1784359/+attachment/5169495/+files/0001-fix-covscan-issues.patch
|
||||||
|
|
||||||
|
BuildRequires: autoconf
|
||||||
|
BuildRequires: automake
|
||||||
|
BuildRequires: libtool
|
||||||
|
|
||||||
BuildRequires: gcc
|
BuildRequires: gcc
|
||||||
BuildRequires: expat-devel
|
BuildRequires: make
|
||||||
BuildRequires: CUnit-devel
|
|
||||||
BuildRequires: make
|
BuildRequires: pkgconfig(expat)
|
||||||
|
BuildRequires: pkgconfig(cunit)
|
||||||
|
# Required for AM_PATH_XML2 m4 macro so we can “autoreconf”; however, expat is
|
||||||
|
# used preferentially where available.
|
||||||
|
BuildRequires: libxml2-devel
|
||||||
|
|
||||||
%description
|
%description
|
||||||
libmetalink is a Metalink C library. It adds Metalink functionality such as
|
libmetalink is a Metalink C library. It adds Metalink functionality such as
|
||||||
parsing Metalink XML files to programs written in C.
|
parsing Metalink XML files to programs written in C.
|
||||||
|
|
||||||
%package devel
|
|
||||||
Summary: Files needed for developing with %{name}
|
|
||||||
Requires: %{name}%{?_isa} = %{version}-%{release}
|
|
||||||
|
|
||||||
%description devel
|
%package devel
|
||||||
|
Summary: Files needed for developing with libmetalink
|
||||||
|
|
||||||
|
Requires: libmetalink%{?_isa} = %{version}-%{release}
|
||||||
|
|
||||||
|
%description devel
|
||||||
Files needed for building applications with libmetalink.
|
Files needed for building applications with libmetalink.
|
||||||
|
|
||||||
|
|
||||||
%prep
|
%prep
|
||||||
%autosetup -p1
|
%autosetup -p1 -n libmetalink-release-%{version}
|
||||||
|
|
||||||
|
|
||||||
%build
|
%build
|
||||||
|
autoreconf --force --install --verbose
|
||||||
%configure --disable-static
|
%configure --disable-static
|
||||||
%make_build
|
%make_build
|
||||||
|
|
||||||
|
|
||||||
%check
|
%check
|
||||||
make check
|
%make_build check
|
||||||
|
|
||||||
|
|
||||||
%install
|
%install
|
||||||
rm -rf $RPM_BUILD_ROOT
|
|
||||||
%make_install
|
%make_install
|
||||||
find $RPM_BUILD_ROOT -name *.la -exec rm {} \;
|
find '%{buildroot}' -type f -name '*la' -print -delete
|
||||||
|
|
||||||
|
|
||||||
%ldconfig_scriptlets
|
%ldconfig_scriptlets
|
||||||
|
|
||||||
|
|
||||||
%files
|
%files
|
||||||
%{!?_licensedir:%global license %%doc}
|
|
||||||
%license COPYING
|
%license COPYING
|
||||||
%doc README
|
%doc README
|
||||||
%{_libdir}/libmetalink.so.*
|
%{_libdir}/libmetalink.so.%{so_version}
|
||||||
|
%{_libdir}/libmetalink.so.%{so_version}.*
|
||||||
|
|
||||||
|
|
||||||
%files devel
|
%files devel
|
||||||
%dir %{_includedir}/metalink/
|
%{_includedir}/metalink/
|
||||||
%{_includedir}/metalink/metalink_error.h
|
|
||||||
%{_includedir}/metalink/metalink.h
|
|
||||||
%{_includedir}/metalink/metalink_parser.h
|
|
||||||
%{_includedir}/metalink/metalink_types.h
|
|
||||||
%{_includedir}/metalink/metalinkver.h
|
|
||||||
%{_libdir}/libmetalink.so
|
%{_libdir}/libmetalink.so
|
||||||
%{_libdir}/pkgconfig/%{name}.pc
|
%{_libdir}/pkgconfig/libmetalink.pc
|
||||||
%{_mandir}/man3/*
|
%{_mandir}/man3/metalink*.3.*
|
||||||
|
|
||||||
|
|
||||||
%changelog
|
%changelog
|
||||||
|
* Wed Jan 12 2022 Benjamin A. Beasley <code@musicinmybrain.net> - 0.1.3-16
|
||||||
|
- Switch to GitHub release archive; as a result, we must now run autoreconf
|
||||||
|
- Patch additional allocation-related issues
|
||||||
|
- Switch BR’s to pkgconfig(…)
|
||||||
|
- Drop obsolete macros and workarounds
|
||||||
|
- General tidying
|
||||||
|
- Don’t glob over the .so version
|
||||||
|
|
||||||
* Thu Jul 22 2021 Fedora Release Engineering <releng@fedoraproject.org> - 0.1.3-15
|
* Thu Jul 22 2021 Fedora Release Engineering <releng@fedoraproject.org> - 0.1.3-15
|
||||||
- Rebuilt for https://fedoraproject.org/wiki/Fedora_35_Mass_Rebuild
|
- Rebuilt for https://fedoraproject.org/wiki/Fedora_35_Mass_Rebuild
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user