1 %define name xscreensaver
5 %define prefix /usr/X11R6
7 # By default, builds the basic, non-GL package.
8 # To build both the basic and GL-add-on packages:
9 # rpm --define "USE_GL yes" ...
11 Summary: X screen saver and locker
16 Group: Amusements/Graphics
18 URL: http://www.jwz.org/xscreensaver
19 Vendor: Jamie Zawinski <jwz@jwz.org>
20 Source: %{name}-%{version}.tar.gz
21 Buildroot: /var/tmp/%{name}-%{version}-root
24 A modular screen saver and locker for the X Window System.
25 Highly customizable: allows the use of any program that
26 can draw on the root window as a display mode.
27 More than 100 display modes are included in this package.
28 %{?USE_GL:See also the xscreensaver-gl package, which}
29 %{?USE_GL:includes optional OpenGL display modes.}
31 %{?USE_GL:%package gl}
32 %{?USE_GL:Group: Amusements/Graphics}
33 %{?USE_GL:Requires: xscreensaver = %{version}}
34 %{?USE_GL:Summary: A set of GL screensavers}
35 %{?USE_GL:%description gl}
36 %{?USE_GL:The xscreensaver-gl package contains even more screensavers for your}
37 %{?USE_GL:mind-numbing, ambition-eroding, time-wasting, hypnotized viewing}
38 %{?USE_GL:pleasure. These screensavers require OpenGL or Mesa support.}
40 %{?USE_GL:Install the xscreensaver-gl package if you need more screensavers}
41 %{?USE_GL:for use with the X Window System and you have OpenGL or Mesa}
50 # Is this really needed? If so, why?
52 # RPMOPTS="$RPMOPTS --without-xshm-ext"
55 # On Solaris, build without PAM and with Shadow.
56 # On other systems, build with PAM and without Shadow.
59 RPMOPTS="$RPMOPTS --without-pam"
61 RPMOPTS="$RPMOPTS --with-pam --without-shadow"
64 %{?USE_GL:RPMOPTS="$RPMOPTS --with-gl"}
65 %{!?USE_GL:RPMOPTS="$RPMOPTS --without-gl"}
67 CFLAGS="$RPM_OPT_FLAGS" \
68 ./configure --prefix=%{prefix} \
69 --enable-subdir=../lib/xscreensaver \
76 # This is a directory that "make install" won't make as needed
77 # (since Linux uses /etc/pam.d/* and Solaris uses /etc/pam.conf).
79 mkdir -p $RPM_BUILD_ROOT/etc/pam.d
81 # This is another (since "make install" doesn't try to install
82 # the xscreensaver.kss file unless $KDEDIR is set.)
84 if [ -z "$KDEDIR" ]; then export KDEDIR=/usr; fi
85 mkdir -p $RPM_BUILD_ROOT$KDEDIR/bin
87 # And two more for Gnome (same reason...)
89 mkdir -p $RPM_BUILD_ROOT/usr/share/control-center/Desktop
90 mkdir -p $RPM_BUILD_ROOT/usr/share/gnome/apps/Settings/Desktop
92 make install_prefix=$RPM_BUILD_ROOT \
93 AD_DIR=%{prefix}/lib/X11/app-defaults \
96 # Make a pair of lists, of the GL and non-GL executable.
97 # Do this by parsing the output of a dummy run of "make install"
98 # in the driver/, hacks/ and hacks/glx/ directories.
101 make -s install_prefix=$RPM_BUILD_ROOT INSTALL=true $1 |
102 sed -n -e 's@.* /\([^ ]*\)$@/\1@p' |
103 sed -e "s@^$RPM_BUILD_ROOT@@" \
104 -e "s@/bin/\.\./@/@" |
108 ( cd hacks ; list_files install ; cd ../driver; list_files install-program ) \
109 > $RPM_BUILD_DIR/xscreensaver-%{version}/exes-non-gl
110 ( cd hacks/glx ; list_files install ) \
111 > $RPM_BUILD_DIR/xscreensaver-%{version}/exes-gl
115 # This line is redundant, except that it causes the "xscreensaver"
116 # executable to be installed unstripped (while all others are stripped.)
117 # You should install it this way so that jwz gets useful bug reports.
119 install -m 4755 driver/xscreensaver $RPM_BUILD_ROOT%{prefix}/bin
121 # Even if we weren't compiled with PAM support, make sure to include
122 # the PAM module file in the RPM anyway, just in case.
125 make install_prefix=$RPM_BUILD_ROOT PAM_DIR=/etc/pam.d install-pam )
127 # Make sure all files are readable by all, and writable only by owner.
129 chmod -R a+r,u+w,og-w $RPM_BUILD_ROOT
132 if [ -d $RPM_BUILD_ROOT ]; then rm -r $RPM_BUILD_ROOT ; fi
133 if [ -d $RPM_BUILD_ROOT-gl ]; then rm -r $RPM_BUILD_ROOT-gl ; fi
135 %files -f exes-non-gl
136 %defattr(-,root,root)
138 # Files for the "xscreensaver" package:
140 %doc README README.debugging
141 %dir %{prefix}/lib/xscreensaver
142 %config %{prefix}/lib/X11/app-defaults/*
143 %{prefix}/man/man1/xscreensaver*
145 %config(missingok) /usr/bin/*.kss
146 %config(missingok) /usr/share/control-center/Desktop/screensaver-properties.desktop
147 %config(missingok) /usr/share/gnome/apps/Settings/Desktop/screensaver-properties.desktop
149 # Files for the "xscreensaver-gl" package:
151 %{?USE_GL:%files -f exes-gl gl}