Don't complain if installing with --excludedocs (#515927) Drop unnecessary

capabilities in gpm (#517659)
This commit is contained in:
Zdenek Prikryl 2009-08-20 08:39:53 +00:00
parent 9be4ef8160
commit d678e55c33
2 changed files with 63 additions and 5 deletions

View File

@ -0,0 +1,48 @@
diff -urp gpm-1.20.6.orig/configure.ac gpm-1.20.6/configure.ac
--- gpm-1.20.6.orig/configure.ac 2009-08-15 13:39:33.000000000 -0400
+++ gpm-1.20.6/configure.ac 2009-08-15 13:51:14.000000000 -0400
@@ -129,6 +129,9 @@ No|no|N|n) SHARED_LIBS=-lc ;;
LIBS=$SAVELIBS ;;
esac
+# look for capabilities library
+LIBCAP_NG_PATH
+
GPMXTERM=
AC_SUBST(GPMXTERM)
AC_SUBST(abi_lev)
diff -urp gpm-1.20.6.orig/src/daemon/main.c gpm-1.20.6/src/daemon/main.c
--- gpm-1.20.6.orig/src/daemon/main.c 2009-08-15 13:39:33.000000000 -0400
+++ gpm-1.20.6/src/daemon/main.c 2009-08-15 13:47:39.000000000 -0400
@@ -26,9 +26,18 @@
#include "headers/daemon.h"
#include "headers/gpmInt.h"
+#ifdef HAVE_LIBCAP_NG
+#include <cap-ng.h>
+#endif
int main(int argc, char **argv)
{
+#ifdef HAVE_LIBCAP_NG
+ capng_clear(CAPNG_SELECT_BOTH);
+ capng_updatev(CAPNG_ADD, CAPNG_EFFECTIVE|CAPNG_PERMITTED,
+ CAP_SYS_ADMIN, CAP_SYS_TTY_CONFIG, -1);
+ capng_apply(CAPNG_SELECT_BOTH);
+#endif
startup(argc,argv); /* setup configurations */
old_main(); /* LATER: exit(daemon()); */
return 0; /* if we didn't exit before, just give back success */
diff -urp gpm-1.20.6.orig/src/Makefile.in gpm-1.20.6/src/Makefile.in
--- gpm-1.20.6.orig/src/Makefile.in 2009-08-15 13:39:33.000000000 -0400
+++ gpm-1.20.6/src/Makefile.in 2009-08-15 13:49:45.000000000 -0400
@@ -82,7 +82,8 @@ prog/%: prog/%.o
all: gpm lib/libgpm.so.@abi_lev@ lib/libgpm.a $(PROG)
gpm: $(GOBJ)
- $(CC) @LDFLAGS@ $(LDFLAGS) -o $@ $(GOBJ) @LIBS@ $(LIBS) -lm
+ $(CC) @LDFLAGS@ $(LDFLAGS) -o $@ $(GOBJ) @LIBS@ $(LIBS) \
+ -lm $(CAPNG_LDADD)
# construct dependings of sourcefiles and link sourcefiles
$(DEPFILE) dep: prog/gpm-root.c

View File

@ -1,7 +1,7 @@
Summary: A mouse server for the Linux console Summary: A mouse server for the Linux console
Name: gpm Name: gpm
Version: 1.20.6 Version: 1.20.6
Release: 5%{?dist} Release: 6%{?dist}
License: GPLv2+ License: GPLv2+
Group: System Environment/Daemons Group: System Environment/Daemons
URL: http://unix.schottelius.org/gpm/ URL: http://unix.schottelius.org/gpm/
@ -14,6 +14,7 @@ Patch3: gpm-1.20.3-gcc4.3.patch
Patch4: gpm-1.20.5-close-fds.patch Patch4: gpm-1.20.5-close-fds.patch
Patch5: gpm-1.20.1-weak-wgetch.patch Patch5: gpm-1.20.1-weak-wgetch.patch
Patch6: gpm-1.20.6-libtool.patch Patch6: gpm-1.20.6-libtool.patch
Patch7: gpm-1.20.6-capability.patch
Requires(post): /sbin/chkconfig /sbin/install-info /sbin/ldconfig Requires(post): /sbin/chkconfig /sbin/install-info /sbin/ldconfig
Requires(preun): /sbin/chkconfig /sbin/install-info Requires(preun): /sbin/chkconfig /sbin/install-info
Requires(postun): /sbin/ldconfig Requires(postun): /sbin/ldconfig
@ -65,6 +66,7 @@ mouse support to text-based Linux applications.
%patch4 -p1 -b .close-fds %patch4 -p1 -b .close-fds
%patch5 -p1 -b .weak-wgetch %patch5 -p1 -b .weak-wgetch
%patch6 -p1 -b .libtool %patch6 -p1 -b .libtool
%patch7 -p1 -b .capability
iconv -f iso-8859-1 -t utf-8 -o TODO.utf8 TODO iconv -f iso-8859-1 -t utf-8 -o TODO.utf8 TODO
touch -c -r TODO TODO.utf8 touch -c -r TODO TODO.utf8
@ -107,21 +109,25 @@ rm -rf %{buildroot}
%ifnarch s390 s390x %ifnarch s390 s390x
/sbin/chkconfig --add gpm /sbin/chkconfig --add gpm
%endif %endif
/sbin/install-info %{_infodir}/gpm.info.gz %{_infodir}/dir if [ -e %{_infodir}/gpm.info.gz ]; then
/sbin/install-info %{_infodir}/gpm.info.gz %{_infodir}/dir || :
fi
/sbin/ldconfig /sbin/ldconfig
%preun %preun
%ifnarch s390 s390x %ifnarch s390 s390x
if [ "$1" = "0" ]; then if [ $1 = 0 ]; then
/sbin/service gpm stop >/dev/null 2>&1 /sbin/service gpm stop >/dev/null 2>&1
/sbin/chkconfig --del gpm /sbin/chkconfig --del gpm
fi fi
%endif %endif
/sbin/install-info %{_infodir}/gpm.info.gz --delete %{_infodir}/dir || : if [ $1 = 0 -a -e %{_infodir}/gpm.info.gz ]; then
/sbin/install-info %{_infodir}/gpm.info.gz --delete %{_infodir}/dir || :
fi
%postun %postun
%ifnarch s390 s390x %ifnarch s390 s390x
if [ "$1" -ge "1" ]; then if [ $1 -ge 1 ]; then
/sbin/service gpm condrestart >/dev/null 2>&1 /sbin/service gpm condrestart >/dev/null 2>&1
fi fi
%endif %endif
@ -154,6 +160,10 @@ fi
%{_libdir}/libgpm.a %{_libdir}/libgpm.a
%changelog %changelog
* Thu Aug 20 2009 Zdenek Prikryl <zprikryl@redhat.com> 1.20.6-6
- Don't complain if installing with --excludedocs (#515927)
- Drop unnecessary capabilities in gpm (#517659)
* Wed Aug 12 2009 Ville Skyttä <ville.skytta@iki.fi> - 1.20.6-5 * Wed Aug 12 2009 Ville Skyttä <ville.skytta@iki.fi> - 1.20.6-5
- Use lzma compressed upstream tarball. - Use lzma compressed upstream tarball.