1 %define name xscreensaver
5 %define x11_prefix /usr/X11R6
6 %define gnome_prefix /usr
7 %define kde_prefix /usr
9 %define gnome_datadir %{gnome_prefix}/share
10 %define gnome_ccdir %{gnome_datadir}/control-center/Desktop
11 %define gnome_paneldir %{gnome_datadir}/gnome/apps/Settings/Desktop
12 %define gnome_icondir %{gnome_datadir}/pixmaps
14 # By default, builds the basic, non-GL package.
15 # To build both the basic and GL-add-on packages:
16 # rpm --define "USE_GL yes" ...
17 # or uncomment the following line.
20 Summary: X screen saver and locker
25 Group: Amusements/Graphics
27 URL: http://www.jwz.org/xscreensaver
28 Vendor: Jamie Zawinski <jwz@jwz.org>
29 Source: %{name}-%{version}.tar.gz
30 Buildroot: %{_tmppath}/%{name}-%{version}-root
33 A modular screen saver and locker for the X Window System.
34 Highly customizable: allows the use of any program that
35 can draw on the root window as a display mode.
36 More than 120 display modes are included in this package.
37 %{?USE_GL:See also the xscreensaver-gl package, which}
38 %{?USE_GL:includes optional OpenGL display modes.}
40 %{?USE_GL:%package gl}
41 %{?USE_GL:Group: Amusements/Graphics}
42 %{?USE_GL:Requires: xscreensaver = %{version}}
43 %{?USE_GL:Summary: A set of GL screensavers}
44 %{?USE_GL:%description gl}
45 %{?USE_GL:The xscreensaver-gl package contains even more screensavers for your}
46 %{?USE_GL:mind-numbing, ambition-eroding, time-wasting, hypnotized viewing}
47 %{?USE_GL:pleasure. These screensavers require OpenGL or Mesa support.}
49 %{?USE_GL:Install the xscreensaver-gl package if you need more screensavers}
50 %{?USE_GL:for use with the X Window System and you have OpenGL or Mesa}
59 # Is this really needed? If so, why?
61 # RPMOPTS="$RPMOPTS --without-xshm-ext"
64 # On Solaris, build without PAM and with Shadow.
65 # On other systems, build with PAM and without Shadow.
68 RPMOPTS="$RPMOPTS --without-pam"
70 RPMOPTS="$RPMOPTS --with-pam --without-shadow"
73 %{?USE_GL:RPMOPTS="$RPMOPTS --with-gl"}
74 %{!?USE_GL:RPMOPTS="$RPMOPTS --without-gl"}
76 CFLAGS="$RPM_OPT_FLAGS" \
77 ./configure --prefix=%{x11_prefix} \
85 # Most xscreensaver executables go in the X bin directory (/usr/X11R6/bin/)
86 # but some of them (e.g., the control panel capplet) go in the GNOME bin
87 # directory instead (/usr/bin/).
89 mkdir -p $RPM_BUILD_ROOT%{gnome_prefix}/bin
90 mkdir -p $RPM_BUILD_ROOT%{gnome_ccdir}
91 mkdir -p $RPM_BUILD_ROOT%{gnome_paneldir}
93 # Likewise for KDE: the .kss file goes in the KDE bin directory (/usr/bin/).
95 export KDEDIR=%{kde_prefix}
96 mkdir -p $RPM_BUILD_ROOT$KDEDIR/bin
98 # This is a directory that "make install" won't make as needed
99 # (since Linux uses /etc/pam.d/* and Solaris uses /etc/pam.conf).
101 mkdir -p $RPM_BUILD_ROOT/etc/pam.d
103 make install_prefix=$RPM_BUILD_ROOT \
104 AD_DIR=%{x11_prefix}/lib/X11/app-defaults \
105 GNOME_BINDIR=%{gnome_prefix}/bin \
108 # Make a pair of lists, of the GL and non-GL executables.
109 # Do this by parsing the output of a dummy run of "make install"
110 # in the driver/, hacks/ and hacks/glx/ directories.
113 make -s install_prefix=$RPM_BUILD_ROOT INSTALL=true \
114 GNOME_BINDIR=%{gnome_prefix}/bin \
116 sed -n -e 's@.* /\([^ ]*\)$@/\1@p' |
117 sed -e "s@^$RPM_BUILD_ROOT@@" \
118 -e "s@/bin/\.\./@/@" |
119 sed -e 's@\(.*/man/.*\)@\1\*@' |
123 ( cd hacks ; list_files install ; \
124 cd ../driver; list_files install-program install-scripts ) \
125 > $RPM_BUILD_DIR/xscreensaver-%{version}/exes-non-gl
126 ( cd hacks/glx ; list_files install ) \
127 | grep -v man1/xscreensaver-gl-helper \
128 > $RPM_BUILD_DIR/xscreensaver-%{version}/exes-gl
131 # This line is redundant, except that it causes the "xscreensaver"
132 # executable to be installed unstripped (while all others are stripped.)
133 # You should install it this way so that jwz gets useful bug reports.
135 install -m 4755 driver/xscreensaver $RPM_BUILD_ROOT%{x11_prefix}/bin
137 # Even if we weren't compiled with PAM support, make sure to include
138 # the PAM module file in the RPM anyway, just in case.
141 make install_prefix=$RPM_BUILD_ROOT PAM_DIR=/etc/pam.d install-pam )
143 # Make sure all files are readable by all, and writable only by owner.
145 chmod -R a+r,u+w,og-w $RPM_BUILD_ROOT
148 if [ -d $RPM_BUILD_ROOT ]; then rm -r $RPM_BUILD_ROOT ; fi
149 if [ -d $RPM_BUILD_ROOT-gl ]; then rm -r $RPM_BUILD_ROOT-gl ; fi
151 %files -f exes-non-gl
152 %defattr(-,root,root)
154 # Files for the "xscreensaver" package:
156 %doc README README.debugging
157 %dir %{x11_prefix}/lib/xscreensaver
158 %config %{x11_prefix}/lib/X11/app-defaults/*
159 %{x11_prefix}/man/man1/xscreensaver*
162 %config(missingok) %{kde_prefix}/bin/*.kss
164 %config(missingok) %{gnome_prefix}/bin/*-capplet
165 %config(missingok) %{gnome_ccdir}/*.desktop
166 %config(missingok) %{gnome_paneldir}/*.desktop
167 %config(missingok) %{gnome_icondir}/*
169 # Files for the "xscreensaver-gl" package:
171 %{?USE_GL:%files -f exes-gl gl}