# Default options: --with sound --with dlopen --with xscreensaver # # --without sound: disables all sound support. # --without dlopen: links with OpenAL and libvorbisfile at compile-time, # rather than deferring it to run-time. # --without xscreensaver: # produce stand-alone programs only. %{?_with_sound: %{?_without_sound:%{error:both '--with sound' and '--without sound' specified}}} %{?_with_dlopen:%{?_without_sound:%{error:both '--with dlopen' and '--without dlopen' specified}}} %{?_with_xscreensaver: %{?_without_xscreensaver:%{error:both '--with xscreensaver' and '--without xscreensaver' specified}}} %{?_without_sound: %define _configure_sound --disable-sound} %{!?_without_sound:%define _configure_sound --enable-sound%{!?_without_dlopen:=dlopen}} # Expand hackdir -- configure leaves this unexpanded so that # one could do "make install exec_prefix=..." %define _hackdir %(exec_prefix="%{_exec_prefix}"; echo "@hackdir@") # Sanity check: don't allow --with xscreensaver if xscreensaver wasn't # around when rsxs.spec was generated by configure, because we really don't # know where files are supposed to go... %if "@xscreensaver@" == "yes" && 0%{!?_without_xscreensaver:1} %define _defaultdir @defaultdir@ %define _configdir @configdir@ %define __xscreensaver_command /usr/bin/xscreensaver-command %define _configure_xscreensaver --with-xscreensaver --with-defaultdir=%{_defaultdir} --with-hackdir=%{_hackdir} --with-configdir=%{_configdir} %define _use_xscreensaver 1 %else %define _configure_xscreensaver --without-xscreensaver %endif %define _configure_opts %{_configure_sound} %{_configure_xscreensaver} --enable-image # %{dist} and %{fedora} are reliable, and they're used in mock. # But if we don't have %{fedora}, try to determine it programmatically... %if "0%{?fedora}" == "0" %define fedora %(awk '{print $4}' /etc/fedora-release 2>/dev/null || echo 0) %endif Name: @PACKAGE_TARNAME@ Version: @PACKAGE_VERSION@ Release: @RELEASE@%{?dist} License: GPL Source0: @PACKAGE_TARNAME@-@PACKAGE_VERSION@.tar.gz URL: http://rsxs.sourceforge.net/ BuildRoot: %{_tmppath}/%{name}-%{version}-root %if "%{fedora}" >= "5" BuildRequires: libSM-devel, libICE-devel, libXmu-devel, libXt-devel %else BuildRequires: XFree86-devel %endif BuildRequires: libGL-devel, libGLU-devel, libpng-devel %{!?_without_sound:BuildRequires: openal-devel, libvorbis-devel} Summary: @PACKAGE_NAME@ Group: Amusements/Graphics Requires: mktemp%{?_use_xscreensaver:, xscreensaver} Obsoletes: @PACKAGE_TARNAME@-nosound Provides: @PACKAGE_TARNAME@-nosound %description The @PACKAGE_NAME@ package is an X11/GLX port of the Really Slick Screensavers collection, by Terry Welsh (http://www.reallyslick.com). %prep %setup -q -n @PACKAGE_TARNAME@-@PACKAGE_VERSION@ %build %{configure} %{_configure_opts} %{__make} %install if test "$RPM_BUILD_ROOT" != "/"; then %{__rm} -rf $RPM_BUILD_ROOT fi %{makeinstall} \ %{?_defaultdir:defaultdir=$RPM_BUILD_ROOT%{_defaultdir}} \ hackdir=$RPM_BUILD_ROOT%{_hackdir} \ %{?_configdir:configdir=$RPM_BUILD_ROOT%{_configdir}} %clean if test "$RPM_BUILD_ROOT" != "/"; then %{__rm} -rf $RPM_BUILD_ROOT fi %if 0%{?_use_xscreensaver} %post echo "Installing screensavers into %{_defaultdir}/XScreenSaver" TMPFILE1=`mktemp %{_tmppath}/$$.XXXXXX` || exit 1; TMPFILE2=`mktemp %{_tmppath}/$$.XXXXXX` || exit 1; trap "%{__rm} -f $TMPFILE1 $TMPFILE2" 0 %{__cat} <<"EOF" > $TMPFILE1 @INSTALL_AWK@ EOF %{__awk} -f $TMPFILE1 < %{_defaultdir}/XScreenSaver > $TMPFILE2 %{__chmod} a+r $TMPFILE2 %{__mv} -f $TMPFILE2 %{_defaultdir}/XScreenSaver # Can't just use return code from xscreensaver-command due to # "xscreensaver window unexpectedly deleted" quirk if %{__xscreensaver_command} -version &> /dev/null; then echo "Restarting XScreenSaver" %{__xscreensaver_command} --restart &> /dev/null || : fi %preun if test $1 -eq 0; then echo "Removing screensavers from %{_defaultdir}/XScreenSaver" TMPFILE1=`mktemp %{_tmppath}/$$.XXXXXX` || exit 1; TMPFILE2=`mktemp %{_tmppath}/$$.XXXXXX` || exit 1; trap "%{__rm} -f $TMPFILE1 $TMPFILE2" 0 %{__cat} <<"EOF" > $TMPFILE1 @UNINSTALL_AWK@ EOF %{__awk} -f $TMPFILE1 < %{_defaultdir}/XScreenSaver > $TMPFILE2 %{__chmod} a+r $TMPFILE2 %{__mv} -f $TMPFILE2 %{_defaultdir}/XScreenSaver # Can't just use return code from xscreensaver-command due to # "xscreensaver window unexpectedly deleted" quirk if %{__xscreensaver_command} -version &> /dev/null; then echo "Restarting XScreenSaver" %{__xscreensaver_command} --restart &> /dev/null || : fi fi %verifyscript echo "Checking screensavers are in %{_defaultdir}/XScreenSaver" TMPFILE1=`mktemp %{_tmppath}/$$.XXXXXX` || exit 1; TMPFILE2=`mktemp %{_tmppath}/$$.XXXXXX` || exit 1; trap "%{__rm} -f $TMPFILE1 $TMPFILE2" 0 %{__cat} <<"EOF" > $TMPFILE1 @VERIFY_AWK@ EOF %{__awk} -f $TMPFILE1 < %{_defaultdir}/XScreenSaver > $TMPFILE2 if test $? -eq 0; then echo "All screensavers correctly installed" else echo "Some screensavers not correctly installed" echo "%{_defaultdir}/XScreenSaver does not have the following screensavers:" %{__cat} $TMPFILE2 fi %endif %files %defattr(-,root,root) %doc AUTHORS COPYING ChangeLog INSTALL README THANKS %if 0%{?_use_xscreensaver} %{_hackdir}/rs-* %{_configdir}/rs-* %endif %{_bindir}/rs-* %{_datadir}/@PACKAGE_TARNAME@ %changelog @CHANGELOG@