-make prefix=$RPM_BUILD_ROOT/usr/X11R6 \
- AD_DIR=$RPM_BUILD_ROOT/usr/X11R6/lib/X11/app-defaults \
- HACKDIR=$RPM_BUILD_ROOT/usr/X11R6/lib/xscreensaver \
- PAM_DIR=$RPM_BUILD_ROOT/etc/pam.d \
- install-strip
+cd $archdir
+make install_prefix=$RPM_BUILD_ROOT \
+ AD_DIR=%{x11_prefix}/lib/X11/app-defaults \
+ GNOME_BINDIR=%{gnome_prefix}/bin \
+ install-strip
+
+# 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 -e "s@^$RPM_BUILD_ROOT@@" \
+ -e "s@/[a-z][a-z]*/\.\./@/@" |
+ sed -e 's@\(.*/man/.*\)@\1\*@' |
+ sort
+}
+
+# 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