From d678e55c33b94548210d6da17bd420c354e15269 Mon Sep 17 00:00:00 2001 From: Zdenek Prikryl Date: Thu, 20 Aug 2009 08:39:53 +0000 Subject: [PATCH] Don't complain if installing with --excludedocs (#515927) Drop unnecessary capabilities in gpm (#517659) --- gpm-1.20.6-capability.patch | 48 +++++++++++++++++++++++++++++++++++++ gpm.spec | 20 ++++++++++++---- 2 files changed, 63 insertions(+), 5 deletions(-) create mode 100644 gpm-1.20.6-capability.patch diff --git a/gpm-1.20.6-capability.patch b/gpm-1.20.6-capability.patch new file mode 100644 index 0000000..a121188 --- /dev/null +++ b/gpm-1.20.6-capability.patch @@ -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 ++#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 diff --git a/gpm.spec b/gpm.spec index d23f9c4..429b84c 100644 --- a/gpm.spec +++ b/gpm.spec @@ -1,7 +1,7 @@ Summary: A mouse server for the Linux console Name: gpm Version: 1.20.6 -Release: 5%{?dist} +Release: 6%{?dist} License: GPLv2+ Group: System Environment/Daemons 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 Patch5: gpm-1.20.1-weak-wgetch.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(preun): /sbin/chkconfig /sbin/install-info Requires(postun): /sbin/ldconfig @@ -65,6 +66,7 @@ mouse support to text-based Linux applications. %patch4 -p1 -b .close-fds %patch5 -p1 -b .weak-wgetch %patch6 -p1 -b .libtool +%patch7 -p1 -b .capability iconv -f iso-8859-1 -t utf-8 -o TODO.utf8 TODO touch -c -r TODO TODO.utf8 @@ -107,21 +109,25 @@ rm -rf %{buildroot} %ifnarch s390 s390x /sbin/chkconfig --add gpm %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 %preun %ifnarch s390 s390x -if [ "$1" = "0" ]; then +if [ $1 = 0 ]; then /sbin/service gpm stop >/dev/null 2>&1 /sbin/chkconfig --del gpm fi %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 %ifnarch s390 s390x -if [ "$1" -ge "1" ]; then +if [ $1 -ge 1 ]; then /sbin/service gpm condrestart >/dev/null 2>&1 fi %endif @@ -154,6 +160,10 @@ fi %{_libdir}/libgpm.a %changelog +* Thu Aug 20 2009 Zdenek Prikryl 1.20.6-6 +- Don't complain if installing with --excludedocs (#515927) +- Drop unnecessary capabilities in gpm (#517659) + * Wed Aug 12 2009 Ville Skyttä - 1.20.6-5 - Use lzma compressed upstream tarball.