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_1 %{gnome_datadir}/control-center/Desktop
11 %define gnome_ccdir_2 %{gnome_datadir}/control-center/capplets
12 %define gnome_paneldir %{gnome_datadir}/gnome/apps/Settings/Desktop
13 %define gnome_icondir %{gnome_datadir}/pixmaps
15 # By default, builds the basic, non-GL package.
16 # To build both the basic and GL-add-on packages:
17 # rpm --define "USE_GL yes" ...
18 # or uncomment the following line.
21 Summary: X screen saver and locker
26 Group: Amusements/Graphics
28 URL: http://www.jwz.org/xscreensaver
29 Vendor: Jamie Zawinski <jwz@jwz.org>
30 Source: %{name}-%{version}.tar.gz
31 Buildroot: %{_tmppath}/%{name}-%{version}-root
33 # This package really should be made to depend on
34 # control-center >= 1.4.0.2 -OR- control-center >= 1.5.12
35 # but there's no way to express that.
38 A modular screen saver and locker for the X Window System.
39 Highly customizable: allows the use of any program that
40 can draw on the root window as a display mode.
41 More than 140 display modes are included in this package.
42 %{?USE_GL:See also the xscreensaver-gl package, which}
43 %{?USE_GL:includes optional OpenGL display modes.}
45 %{?USE_GL:%package gl}
46 %{?USE_GL:Group: Amusements/Graphics}
47 %{?USE_GL:Requires: xscreensaver = %{version}}
48 %{?USE_GL:Summary: A set of GL screensavers}
49 %{?USE_GL:%description gl}
50 %{?USE_GL:The xscreensaver-gl package contains even more screensavers for your}
51 %{?USE_GL:mind-numbing, ambition-eroding, time-wasting, hypnotized viewing}
52 %{?USE_GL:pleasure. These screensavers require OpenGL or Mesa support.}
54 %{?USE_GL:Install the xscreensaver-gl package if you need more screensavers}
55 %{?USE_GL:for use with the X Window System and you have OpenGL or Mesa}
64 # Is this really needed? If so, why?
66 # RPMOPTS="$RPMOPTS --without-xshm-ext"
69 # On Solaris, build without PAM and with Shadow.
70 # On other systems, build with PAM and without Shadow.
73 RPMOPTS="$RPMOPTS --without-pam"
75 RPMOPTS="$RPMOPTS --with-pam --without-shadow"
78 %{?USE_GL:RPMOPTS="$RPMOPTS --with-gl"}
79 %{!?USE_GL:RPMOPTS="$RPMOPTS --without-gl"}
81 CFLAGS="$RPM_OPT_FLAGS" \
82 ./configure --prefix=%{x11_prefix} \
90 # Most xscreensaver executables go in the X bin directory (/usr/X11R6/bin/)
91 # but some of them (e.g., the control panel capplet) go in the GNOME bin
92 # directory instead (/usr/bin/).
94 mkdir -p $RPM_BUILD_ROOT%{gnome_prefix}/bin
95 mkdir -p $RPM_BUILD_ROOT%{gnome_ccdir_1}
96 mkdir -p $RPM_BUILD_ROOT%{gnome_ccdir_2}
97 mkdir -p $RPM_BUILD_ROOT%{gnome_paneldir}
99 # Likewise for KDE: the .kss file goes in the KDE bin directory (/usr/bin/).
101 export KDEDIR=%{kde_prefix}
102 mkdir -p $RPM_BUILD_ROOT$KDEDIR/bin
104 # This is a directory that "make install" won't make as needed
105 # (since Linux uses /etc/pam.d/* and Solaris uses /etc/pam.conf).
107 mkdir -p $RPM_BUILD_ROOT/etc/pam.d
109 make install_prefix=$RPM_BUILD_ROOT \
110 AD_DIR=%{x11_prefix}/lib/X11/app-defaults \
111 GNOME_BINDIR=%{gnome_prefix}/bin \
114 # Make a pair of lists, of the GL and non-GL executables.
115 # Do this by parsing the output of a dummy run of "make install"
116 # in the driver/, hacks/ and hacks/glx/ directories.
119 make -s install_prefix=$RPM_BUILD_ROOT INSTALL=true \
120 GNOME_BINDIR=%{gnome_prefix}/bin \
122 sed -n -e 's@.* /\([^ ]*\)$@/\1@p' |
123 sed -e "s@^$RPM_BUILD_ROOT@@" \
124 -e "s@/bin/\.\./@/@" |
125 sed -e 's@\(.*/man/.*\)@\1\*@' |
129 ( cd hacks ; list_files install ; \
130 cd ../driver; list_files install-program install-scripts ) \
131 > $RPM_BUILD_DIR/xscreensaver-%{version}/exes-non-gl
132 ( cd hacks/glx ; list_files install ) \
133 | grep -v man1/xscreensaver-gl-helper \
134 > $RPM_BUILD_DIR/xscreensaver-%{version}/exes-gl
137 # This line is redundant, except that it causes the "xscreensaver"
138 # executable to be installed unstripped (while all others are stripped.)
139 # You should install it this way so that jwz gets useful bug reports.
141 install -m 4755 driver/xscreensaver $RPM_BUILD_ROOT%{x11_prefix}/bin
143 # Even if we weren't compiled with PAM support, make sure to include
144 # the PAM module file in the RPM anyway, just in case.
147 make install_prefix=$RPM_BUILD_ROOT PAM_DIR=/etc/pam.d install-pam )
149 # Make sure all files are readable by all, and writable only by owner.
151 chmod -R a+r,u+w,og-w $RPM_BUILD_ROOT
154 # This part runs on the end user's system, when the RPM is installed.
156 pids=`pidof xscreensaver`
157 if [ -n "$pids" ]; then
158 echo "sending SIGHUP to running xscreensaver ($pids)..." >&2
163 if [ -d $RPM_BUILD_ROOT ]; then rm -r $RPM_BUILD_ROOT ; fi
164 if [ -d $RPM_BUILD_ROOT-gl ]; then rm -r $RPM_BUILD_ROOT-gl ; fi
166 %files -f exes-non-gl
167 %defattr(-,root,root)
169 # Files for the "xscreensaver" package:
171 %doc README README.debugging
172 %dir %{x11_prefix}/lib/xscreensaver
173 %config %{x11_prefix}/lib/X11/app-defaults/*
174 %{x11_prefix}/man/man1/xscreensaver*
177 %config(missingok) %{kde_prefix}/bin/*.kss
179 %config(missingok) %{gnome_prefix}/bin/*-capplet
180 %config(missingok) %{gnome_ccdir_1}/*.desktop
181 %config(missingok) %{gnome_ccdir_2}/*.desktop
182 %config(missingok) %{gnome_paneldir}/*.desktop
183 %config(missingok) %{gnome_icondir}/*
185 # Files for the "xscreensaver-gl" package:
187 %{?USE_GL:%files -f exes-gl gl}