From 442a36e3067e61b697043856c5f81425c006af72 Mon Sep 17 00:00:00 2001 From: Petr Písař Date: Jul 10 2018 11:37:00 +0000 Subject: Adapt to attr-2.4.48 --- diff --git a/shigofumi-0.8-Prefer-fgetxattr-from-sys-xattr.h.patch b/shigofumi-0.8-Prefer-fgetxattr-from-sys-xattr.h.patch new file mode 100644 index 0000000..7b9d914 --- /dev/null +++ b/shigofumi-0.8-Prefer-fgetxattr-from-sys-xattr.h.patch @@ -0,0 +1,88 @@ +From ac53807938f9a2e43401ab5b1b1c7f4dd80ac620 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Petr=20P=C3=ADsa=C5=99?= +Date: Fri, 6 Jul 2018 20:53:54 +0200 +Subject: [PATCH] Prefer fgetxattr() from +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +attr-2.4.48 removed and everybody should use glibc's + now. + +This patch changes configure to check for both of the headers and to +prefer . + +Signed-off-by: Petr Písař +--- + INSTALL | 5 +++-- + configure.ac | 16 ++++++++++++++-- + src/io.c | 4 ++++ + 3 files changed, 21 insertions(+), 4 deletions(-) + +diff --git a/INSTALL b/INSTALL +index 8528e74..80e9214 100644 +--- a/INSTALL ++++ b/INSTALL +@@ -29,8 +29,9 @@ Additional configure options: + + --disable-xattr + +- Switch off extended attributes support. (Shigofumi can stores and load +- MIME types there.) Support is autodetected by default. ++ Switch off extended attributes support. (Shigofumi can store and load ++ MIME types there.) Support is autodetected by default. You need glibc ++ >= 2.3 or attr library for this feature. + + --with-docbook-xsl-stylesheets=DIR + +diff --git a/configure.ac b/configure.ac +index a875838..aa42aeb 100644 +--- a/configure.ac ++++ b/configure.ac +@@ -117,12 +117,24 @@ AM_CONDITIONAL([BUILD_MANPO], [test "$HAVE_PO4A" = "yes"]) + + # Check for extended attributes + # XXX: AC_CHECK_HEADER() must be in top level scope +-AC_CHECK_HEADER([attr/xattr.h], [have_xattr=yes], [have_xattr=no]) ++AC_CHECK_HEADER([sys/xattr.h], ++ [AC_DEFINE([HAVE_SYS_XATTR], [1], [Define if sys/xattr.h is available]) ++ have_sys_xattr=yes], ++ [have_sys_xattr=no], ++ [#include ++ #include ] ++) ++AC_CHECK_HEADER([attr/xattr.h], ++ [have_attr_xattr=yes], ++ [have_attr_xattr=no], ++ [#include ++ #include ] ++) + AC_ARG_ENABLE(xattr, [AS_HELP_STRING([--disable-xattr], + [Disable extended attribute support])]) + AS_IF([test "$enable_xattr" = "no"], + AC_MSG_WARN([Extended attribute support disabled]), +- AS_IF([test "$have_xattr" = "yes"], ++ AS_IF([test "$have_sys_xattr" = "yes" -o "$have_attr_xattr" = "yes"], + AC_DEFINE([ENABLE_XATTR], [1], + [Define if you want support extended attributes]), + AS_IF([test "$enable_xattr" = "yes"], +diff --git a/src/io.c b/src/io.c +index 343f897..d2d7988 100644 +--- a/src/io.c ++++ b/src/io.c +@@ -20,8 +20,12 @@ + #include "shigofumi.h" + + #if ENABLE_XATTR ++#if HAVE_SYS_XATTR ++#include ++#else + #include + #endif ++#endif + + + /* Guess MIME type of @file by content. +-- +2.14.4 + diff --git a/shigofumi.spec b/shigofumi.spec index 0662d1c..4e4e5e0 100644 --- a/shigofumi.spec +++ b/shigofumi.spec @@ -1,6 +1,6 @@ Name: shigofumi Version: 0.8 -Release: 6%{?dist} +Release: 7%{?dist} Summary: Command line client for accessing the Czech Data Boxes # COPYING: GPLv3 text # README: GPLv3+ @@ -37,9 +37,13 @@ Summary: Command line client for accessing the Czech Data Boxes License: GPLv3+ and GPLv2+ URL: http://xpisar.wz.cz/%{name}/ Source0: %{url}dist/%{name}-%{version}.tar.xz +# Adapt to attr-2.4.48, in upstream after 0.8 +Patch0: shigofumi-0.8-Prefer-fgetxattr-from-sys-xattr.h.patch +BuildRequires: autoconf +BuildRequires: automake BuildRequires: file-devel +BuildRequires: gettext-devel BuildRequires: gcc -BuildRequires: libattr-devel BuildRequires: libxml2-devel BuildRequires: make BuildRequires: pkgconfig(libconfuse) @@ -52,6 +56,8 @@ Information System) client. %prep %setup -q +%patch0 -p1 +autoreconf -fi %build %configure \ @@ -78,6 +84,9 @@ make %{?_smp_mflags} install DESTDIR=$RPM_BUILD_ROOT %{_mandir}/*/man5/* %changelog +* Tue Jul 10 2018 Petr Pisar - 0.8-7 +- Adapt to attr-2.4.48 + * Fri Feb 09 2018 Fedora Release Engineering - 0.8-6 - Rebuilt for https://fedoraproject.org/wiki/Fedora_28_Mass_Rebuild