updated patch for lower capabilities

This commit is contained in:
Michal Hlavinka 2009-08-26 15:41:26 +00:00
parent 1a8b53a669
commit 6b054695f2
2 changed files with 46 additions and 8 deletions

View File

@ -1,18 +1,50 @@
diff -urp smartmontools-5.38.orig/configure.in smartmontools-5.38/configure.in diff -urp smartmontools-5.38.orig/configure.in smartmontools-5.38/configure.in
--- smartmontools-5.38.orig/configure.in 2009-08-16 07:42:57.000000000 -0400 --- smartmontools-5.38.orig/configure.in 2009-08-16 07:42:57.000000000 -0400
+++ smartmontools-5.38/configure.in 2009-08-16 08:07:53.000000000 -0400 +++ smartmontools-5.38/configure.in 2009-08-21 12:07:15.000000000 -0400
@@ -143,6 +143,8 @@ if test "$with_selinux" = "yes"; then @@ -143,6 +143,40 @@ if test "$with_selinux" = "yes"; then
AC_DEFINE(WITH_SELINUX, [1], [Define to 1 if SELinux support is enabled]) AC_DEFINE(WITH_SELINUX, [1], [Define to 1 if SELinux support is enabled])
fi fi
+LIBCAP_NG_PATH + AC_ARG_WITH(libcap-ng,
+ [ --with-libcap-ng=[auto/yes/no] Add Libcap-ng support [default=auto]],,
+ with_libcap_ng=auto)
+
+# Check for Libcap-ng API
+#
+# libcap-ng detection
+
+if test x$with_libcap_ng = xno ; then
+ have_libcap_ng=no;
+else
+ # Start by checking for header file
+ AC_CHECK_HEADER(cap-ng.h, capng_headers=yes, capng_headers=no)
+
+ # See if we have libcap-ng library
+ AC_CHECK_LIB(cap-ng, capng_clear, CAPNG_LDADD=-lcap-ng,)
+
+ # Check results are usable
+ if test x$with_libcap_ng = xyes -a x$CAPNG_LDADD = x ; then
+ AC_MSG_ERROR(libcap-ng support was requested and the library was not found)
+ fi
+ if test x$CAPNG_LDADD != x -a $capng_headers = no ; then
+ AC_MSG_ERROR(libcap-ng libraries found but headers are missing)
+ fi
+fi
+AC_SUBST(CAPNG_LDADD)
+AC_MSG_CHECKING(whether to use libcap-ng)
+if test x$CAPNG_LDADD != x ; then
+ AC_DEFINE(HAVE_LIBCAP_NG,1,[libcap-ng support])
+ AC_MSG_RESULT(yes)
+else
+ AC_MSG_RESULT(no)
+fi
+ +
if test "$prefix" = "NONE"; then if test "$prefix" = "NONE"; then
dnl no prefix and no mandir, so use ${prefix}/share/man as default dnl no prefix and no mandir, so use ${prefix}/share/man as default
if test "$mandir" = '${prefix}/man'; then if test "$mandir" = '${prefix}/man'; then
diff -urp smartmontools-5.38.orig/Makefile.am smartmontools-5.38/Makefile.am diff -urp smartmontools-5.38.orig/Makefile.am smartmontools-5.38/Makefile.am
--- smartmontools-5.38.orig/Makefile.am 2009-08-16 07:42:57.000000000 -0400 --- smartmontools-5.38.orig/Makefile.am 2009-08-16 07:42:57.000000000 -0400
+++ smartmontools-5.38/Makefile.am 2009-08-16 08:07:53.000000000 -0400 +++ smartmontools-5.38/Makefile.am 2009-08-21 11:28:22.000000000 -0400
@@ -35,7 +35,7 @@ smartd_SOURCES = smartd.cpp \ @@ -35,7 +35,7 @@ smartd_SOURCES = smartd.cpp \
utility.cpp \ utility.cpp \
utility.h utility.h
@ -24,7 +56,7 @@ diff -urp smartmontools-5.38.orig/Makefile.am smartmontools-5.38/Makefile.am
EXTRA_smartd_SOURCES = os_darwin.cpp \ EXTRA_smartd_SOURCES = os_darwin.cpp \
diff -urp smartmontools-5.38.orig/smartd.cpp smartmontools-5.38/smartd.cpp diff -urp smartmontools-5.38.orig/smartd.cpp smartmontools-5.38/smartd.cpp
--- smartmontools-5.38.orig/smartd.cpp 2009-08-16 07:42:57.000000000 -0400 --- smartmontools-5.38.orig/smartd.cpp 2009-08-16 07:42:57.000000000 -0400
+++ smartmontools-5.38/smartd.cpp 2009-08-16 08:08:27.000000000 -0400 +++ smartmontools-5.38/smartd.cpp 2009-08-21 11:28:22.000000000 -0400
@@ -74,6 +74,10 @@ extern "C" int __stdcall FreeConsole(voi @@ -74,6 +74,10 @@ extern "C" int __stdcall FreeConsole(voi
#include <io.h> // setmode() #include <io.h> // setmode()
#endif // __CYGWIN__ #endif // __CYGWIN__

View File

@ -1,7 +1,7 @@
Summary: Tools for monitoring SMART capable hard disks Summary: Tools for monitoring SMART capable hard disks
Name: smartmontools Name: smartmontools
Version: 5.38 Version: 5.38
Release: 14%{?dist} Release: 15%{?dist}
Epoch: 1 Epoch: 1
Group: System Environment/Base Group: System Environment/Base
License: GPLv2+ License: GPLv2+
@ -18,7 +18,7 @@ Patch6: smartmontools-5.38-lowcap.patch
BuildRoot: %(mktemp -ud %{_tmppath}/%{name}-%{version}-%{release}-XXXXXX) BuildRoot: %(mktemp -ud %{_tmppath}/%{name}-%{version}-%{release}-XXXXXX)
Requires: fileutils mailx chkconfig initscripts Requires: fileutils mailx chkconfig initscripts
BuildRequires: readline-devel ncurses-devel /usr/bin/aclocal util-linux groff gettext BuildRequires: readline-devel ncurses-devel /usr/bin/aclocal util-linux groff gettext
BuildRequires: libselinux-devel BuildRequires: libselinux-devel libcap-ng-devel
%description %description
The smartmontools package contains two utility programs (smartctl The smartmontools package contains two utility programs (smartctl
@ -38,7 +38,9 @@ failure.
%patch6 -p1 -b .lowcap %patch6 -p1 -b .lowcap
%build %build
%configure --with-selinux ln -s CHANGELOG ChangeLog
autoreconf -i
%configure --with-selinux --with-libcap-ng=yes
%ifarch sparc64 %ifarch sparc64
make CXXFLAGS="$RPM_OPT_FLAGS -fPIE" LDFLAGS="-pie -Wl,-z,relro,-z,now" make CXXFLAGS="$RPM_OPT_FLAGS -fPIE" LDFLAGS="-pie -Wl,-z,relro,-z,now"
%else %else
@ -77,6 +79,10 @@ fi
%config(noreplace) %{_sysconfdir}/sysconfig/smartmontools %config(noreplace) %{_sysconfdir}/sysconfig/smartmontools
%changelog %changelog
* Wed Aug 26 2009 Michal Hlavinka <mhlavink@redhat.com> - 1:5.38-15
- updated patch for lower capabilities (#517728)
- added buildrequires libcap-ng-devel
* Fri Aug 21 2009 Michal Hlavinka <mhlavink@redhat.com> - 1:5.38-14 * Fri Aug 21 2009 Michal Hlavinka <mhlavink@redhat.com> - 1:5.38-14
- drop all unnecessary capabilities (#517728) - drop all unnecessary capabilities (#517728)