ftp://ftp.linux.ncsu.edu/mirror/ftp.redhat.com/pub/redhat/linux/enterprise/4/en/os...
[xscreensaver] / xscreensaver.spec
index fd75dbe02199977a82aec41f5584694685644704..6660f7de064d80b844901e80c1dca68a6991268a 100644 (file)
@@ -1,15 +1,11 @@
 %define        name            xscreensaver
-%define        version         3.32
+%define        version         4.18
 %define        release         1
-%define        serial          1
+%define        epoch           1
 %define        x11_prefix      /usr/X11R6
 %define        gnome_prefix    /usr
 %define        kde_prefix      /usr
-
 %define gnome_datadir  %{gnome_prefix}/share
-%define gnome_ccdir    %{gnome_datadir}/control-center/Desktop
-%define gnome_paneldir %{gnome_datadir}/gnome/apps/Settings/Desktop
-%define gnome_icondir  %{gnome_datadir}/pixmaps
 
 # By default, builds the basic, non-GL package.
 # To build both the basic and GL-add-on packages:
 # %define      USE_GL          yes
 
 Summary:       X screen saver and locker
+Summary(fr):   Economiseur d'écran et verrouillage de terminaux X
 Name:          %{name}
 Version:       %{version}
 Release:       %{release}
-Serial:                %{serial}
+Epoch:         %{epoch}
 Group:         Amusements/Graphics
-Copyright:     BSD
-URL:           http://www.jwz.org/xscreensaver
+License:       BSD
+URL:           http://www.jwz.org/xscreensaver/
 Vendor:                Jamie Zawinski <jwz@jwz.org>
 Source:                %{name}-%{version}.tar.gz
 Buildroot:     %{_tmppath}/%{name}-%{version}-root
 
+# This package really should be made to depend on
+# control-center >= 1.4.0.2 -OR- control-center >= 1.5.12
+# but there's no way to express that.
+
 %description
 A modular screen saver and locker for the X Window System.
 Highly customizable: allows the use of any program that
 can draw on the root window as a display mode.
-More than 120 display modes are included in this package.
+More than 180 display modes are included in this package.
 %{?USE_GL:See also the xscreensaver-gl package, which}
 %{?USE_GL:includes optional OpenGL display modes.}
 
+%description -l fr
+Un économiseur d'écran et verrouillage modulaire pour X-Window.
+Hautement configurable: permet l'utilisation de n'importe quel programme
+qui peut dessiner dans la fenêtre root.
+Plus de 180 modes d'affichage sont inclus dans ce paquet.
+%{?USE_GL:Voir aussi le paquet xscreensaver-gl, qui inclut}
+%{?USE_GL:des modules optionnels OpenGL.}
+
 %{?USE_GL:%package gl}
 %{?USE_GL:Group:       Amusements/Graphics}
-%{?USE_GL:Requires:    xscreensaver = %{version}}
+%{?USE_GL:Requires:     xscreensaver = %{epoch}:%{version}-%{release}}
 %{?USE_GL:Summary:     A set of GL screensavers}
+%{?USE_GL:Summary(fr): Un ensemble d'économiseurs d'écran OpenGL}
 %{?USE_GL:%description gl}
 %{?USE_GL:The xscreensaver-gl package contains even more screensavers for your}
 %{?USE_GL:mind-numbing, ambition-eroding, time-wasting, hypnotized viewing}
@@ -49,6 +59,13 @@ More than 120 display modes are included in this package.
 %{?USE_GL:Install the xscreensaver-gl package if you need more screensavers}
 %{?USE_GL:for use with the X Window System and you have OpenGL or Mesa}
 %{?USE_GL:installed.}
+%{?USE_GL:%description -l fr gl}
+%{?USE_GL:Le paquet xscreensaver-gl contient encore plus d'économiseurs}
+%{?USE_GL:d'écran pour votre plaisir visuel.}
+%{?USE_GL: }
+%{?USE_GL:Ces économiseurs d'écran nécessitent OpenGL ou Mesa.}
+%{?USE_GL:Installez le paquet xscreensaver-gl si vous désirez plus}
+%{?USE_GL:d'économiseur d'écran et que vous avez OpenGL ou Mesa installé.}
 
 %prep
 %setup -q
@@ -56,11 +73,6 @@ More than 120 display modes are included in this package.
 %build
 RPMOPTS=""
 
-# Is this really needed?  If so, why?
-# %ifarch alpha
-#  RPMOPTS="$RPMOPTS --without-xshm-ext"
-# %endif
-
 # On Solaris, build without PAM and with Shadow.
 # On other systems, build with PAM and without Shadow.
 #
@@ -73,61 +85,66 @@ RPMOPTS=""
 %{?USE_GL:RPMOPTS="$RPMOPTS --with-gl"}
 %{!?USE_GL:RPMOPTS="$RPMOPTS --without-gl"}
 
+archdir=`./config.guess`
+mkdir $archdir
+cd $archdir
 CFLAGS="$RPM_OPT_FLAGS" \
- ./configure --prefix=%{x11_prefix} \
-             --enable-subdir=../lib/xscreensaver \
-             --without-setuid-hacks \
-             $RPMOPTS
-
+ ../configure --prefix=%{x11_prefix} \
+              --with-setuid-hacks \
+              $RPMOPTS
 make
 
 %install
 
-# Most xscreensaver executables go in the X bin directory (/usr/X11R6/bin/)
-# but some of them (e.g., the control panel capplet) go in the GNOME bin
-# directory instead (/usr/bin/).
-#
-mkdir -p $RPM_BUILD_ROOT%{gnome_prefix}/bin
-mkdir -p $RPM_BUILD_ROOT%{gnome_ccdir}
-mkdir -p $RPM_BUILD_ROOT%{gnome_paneldir}
+archdir=`./config.guess`
 
-# Likewise for KDE: the .kss file goes in the KDE bin directory (/usr/bin/).
+# We have to make sure these directories exist,
+# or nothing will be installed into them.
 #
 export KDEDIR=%{kde_prefix}
 mkdir -p $RPM_BUILD_ROOT$KDEDIR/bin
-
-# This is a directory that "make install" won't make as needed
-# (since Linux uses /etc/pam.d/* and Solaris uses /etc/pam.conf).
-#
+mkdir -p $RPM_BUILD_ROOT%{gnome_datadir}
 mkdir -p $RPM_BUILD_ROOT/etc/pam.d
 
+cd $archdir
 make  install_prefix=$RPM_BUILD_ROOT \
       AD_DIR=%{x11_prefix}/lib/X11/app-defaults \
       GNOME_BINDIR=%{gnome_prefix}/bin \
       install-strip
 
-# Make a pair of lists, of the GL and non-GL executables.
-# Do this by parsing the output of a dummy run of "make install"
-# in the driver/, hacks/ and hacks/glx/ directories.
+# This function prints a list of things that get installed.
+# It does this by parsing the output of a dummy run of "make install".
 #
 list_files() {
   make -s install_prefix=$RPM_BUILD_ROOT INSTALL=true           \
           GNOME_BINDIR=%{gnome_prefix}/bin                      \
           "$@"                                                  |
-    sed -n -e 's@.* /\([^ ]*\)$@/\1@p'                          |
+    sed -n -e 's@.* \(/[^ ]*\)$@\1@p'                           |
     sed    -e "s@^$RPM_BUILD_ROOT@@"                            \
-           -e "s@/bin/\.\./@/@"                                 |
+           -e "s@/[a-z][a-z]*/\.\./@/@"                         |
     sed    -e 's@\(.*/man/.*\)@\1\*@'                           |
     sort
 }
 
-( cd hacks ; list_files install ; \
-  cd ../driver; list_files install-program ) \
-   > $RPM_BUILD_DIR/xscreensaver-%{version}/exes-non-gl
+# Collect the names of the non-GL executables and scripts...
+# (Including the names of all of the Gnome, KDE, and L10N-related files,
+# whereever they might have gotten installed...)
+# For the translation catalogs, prepend an appropriate %lang(..) tag.
+#
+(  cd    hacks ; list_files install ; \
+   cd ../driver; list_files install-program install-scripts \
+                            install-gnome install-kde ; \
+ ( cd ../po;     list_files install | grep '\.' \
+    | sed 's@^\(.*/\([^/]*\)/LC.*\)$@%lang(\2) \1@' ) \
+) > $RPM_BUILD_DIR/xscreensaver-%{version}/exes-non-gl
+
+
+# Collect the names of the GL-only executables...
+#
 ( cd hacks/glx ; list_files install ) \
+   | grep -v man1/xscreensaver-gl-helper \
    > $RPM_BUILD_DIR/xscreensaver-%{version}/exes-gl
 
-
 # This line is redundant, except that it causes the "xscreensaver"
 # executable to be installed unstripped (while all others are stripped.)
 # You should install it this way so that jwz gets useful bug reports.
@@ -144,112 +161,31 @@ install -m 4755 driver/xscreensaver $RPM_BUILD_ROOT%{x11_prefix}/bin
 #
 chmod -R a+r,u+w,og-w $RPM_BUILD_ROOT
 
-
-# This is a tricky part...
-#
-# xscreensaver installs several files that are also installed by the
-# "control-center" RPM.  The versions from xscreensaver are better,
-# and so should override control-center.  But, the way RPM works,
-# if the xscreensaver RPM contained those files, the end user would
-# have to "--force" to make the xscreensaver RPM install.  That's
-# not something people are used to doing, so that's Bad.
-#
-# So instead, we rename the files so that they don't conflict with
-# the control center.  Then we have a "%post" script that creates
-# symbolic links to our files.
-
-CCDIR=$RPM_BUILD_ROOT%{gnome_ccdir}
-PADIR=$RPM_BUILD_ROOT%{gnome_paneldir}
-CADIR=$RPM_BUILD_ROOT%{gnome_prefix}/bin
-DESKF=screensaver-properties.desktop
-CAPLT=screensaver-properties-capplet
-
-if [ -f $CCDIR/$DESKF ]; then
-  mv $CCDIR/$DESKF $CCDIR/x$DESKF
-  mv $PADIR/$DESKF $PADIR/x$DESKF
-  mv $CADIR/$CAPLT $CADIR/x$CAPLT
-fi
-
 %post
 # This part runs on the end user's system, when the RPM is installed.
-# (See comment above, at end of "%install" section.)
-
-verbose=0
-
-overwrite_links() {
-  dir="$1"
-  oname="$2"
-  nname="$3"
-
-  # only do this if the file we're making a link *to* exists
-  # (i.e., was present in this rpm.)
-  #
-  if [ -f "$dir/$nname" ]; then
-
-    # backup or delete the old version, if any.
-    #
-    existed=0
-    if [ -f "$dir/$oname" ]; then
-      existed=1
-      if [ -f "$dir/$oname.rpmsave" ]; then
-        rm -f "$dir/$oname"
-        if [ $verbose -gt 1 ]; then
-          echo "$dir/$oname.rpmsave already exists"  >&2
-        fi
-      else
-        mv "$dir/$oname" "$dir/$oname.rpmsave"
-        if [ $verbose -gt 1 ]; then
-          echo "saved $dir/$oname as $oname.rpmsave" >&2
-        fi
-      fi
-    fi
-
-    # install a relative symlink to the new name.
-    #
-    ln -s "$nname" "$dir/$oname"
-    if [ $verbose -ge 1 ]; then
-      if [ $existed = 1 ] ; then
-        echo "replaced $dir/$oname" >&2
-      else
-        echo "created $dir/$oname"  >&2
-      fi
-    fi
-  fi
-}
-
-CCDIR=%{gnome_ccdir}
-PADIR=%{gnome_paneldir}
-CADIR=%{gnome_prefix}/bin
-DESKF=screensaver-properties.desktop
-CAPLT=screensaver-properties-capplet
-
-overwrite_links $CCDIR $DESKF x$DESKF
-overwrite_links $PADIR $DESKF x$DESKF
-overwrite_links $CADIR $CAPLT x$CAPLT
 
+pids=`pidof xscreensaver`
+if [ -n "$pids" ]; then
+  echo "sending SIGHUP to running xscreensaver ($pids)..." >&2
+  kill -HUP $pids
+fi
 
 %clean
 if [ -d $RPM_BUILD_ROOT    ]; then rm -r $RPM_BUILD_ROOT    ; fi
 if [ -d $RPM_BUILD_ROOT-gl ]; then rm -r $RPM_BUILD_ROOT-gl ; fi
 
-%files -f exes-non-gl
-%defattr(-,root,root)
-
 # Files for the "xscreensaver" package:
 #
-%doc                README README.debugging
-%dir                %{x11_prefix}/lib/xscreensaver
-%config             %{x11_prefix}/lib/X11/app-defaults/*
-                    %{x11_prefix}/man/man1/xscreensaver*
-                    /etc/pam.d/*
-
-%config(missingok)  %{kde_prefix}/bin/*.kss
+%files -f exes-non-gl
+%defattr(-,root,root)
 
-%config(missingok)  %{gnome_prefix}/bin/*-capplet
-%config(missingok)  %{gnome_ccdir}/*.desktop
-%config(missingok)  %{gnome_paneldir}/*.desktop
-%config(missingok)  %{gnome_icondir}/*
+%doc    README README.debugging
+%dir    %{x11_prefix}/lib/xscreensaver
+%config %{x11_prefix}/lib/X11/app-defaults/*
+        %{x11_prefix}/man/man1/xscreensaver*
+%config /etc/pam.d/*
 
 # Files for the "xscreensaver-gl" package:
 #
 %{?USE_GL:%files -f exes-gl gl}
+%{?USE_GL:%defattr(-,root,root)}