SUNWxscreensaver.spec
author davelam
Wed, 24 Feb 2010 04:10:23 +0000
branchgnome-2-28
changeset 18642 478b5460cc36
parent 18618 3e24f9c15637
permissions -rw-r--r--
add new proto file for b133

#
# spec file for packages SUNWxscreensaver, SUNWxscreensaver-hacks, SUNWxscreensaver-hacks-gl, SUNWxwsvr, SUNWrss-glx
#
# includes module(s): xscreensaver, rss-glx
#
# Copyright 2009 Sun Microsystems, Inc.
# This file and all modifications and additions to the pristine
# packages are under the same license as the packages themselves.
#
%define owner alanc
#
%include Solaris.inc
%include l10n.inc

%define OSR 12732:5.0.1

%define src_name xscreensaver
%define src_version 5.01
%define src_url http://dlc.sun.com/osol/x/downloads/mirrors
%define src_dir %{src_name}-%{src_version}

%{?sf_download:#}%define sf_download http://downloads.sourceforge.net
%define rss_name rss-glx
%define rss_version 0.9.0
%define rss_url %{sf_download}/rss-glx
%define rss_dir %{rss_name}_%{rss_version}

%define x11_dir /usr/X11
%define xss_libdir %{_libdir}/xscreensaver

Name:                    SUNWxscreensaver
Summary:                 XScreenSaver - Screen Saver/Locker for the X Window System
Version:                 %{src_version}
Vendor:                  Sun Microsystems, Inc.
SUNW_BaseDir:            %{_basedir}
SUNW_Copyright:          %{name}.copyright
License:                 MIT
BuildRoot:               %{_tmppath}/%{name}-%{src_version}-build
Source:                  %{src_url}/%{src_dir}.tar.bz2
Source1:                 %{rss_url}/%{rss_dir}.tar.bz2
Source2:		 xscreensaver-opensolaris-logo.png
%if %option_with_sun_branding
Source3:		 solaris-lockscreen-logos-1.0.tar.bz2
%endif
Source4:		 suntouch-manpages.pl
Source5:		 %{src_name}-po-sun-%{po_sun_version}.tar.bz2

# date:2008-12-15 owner:alanc type:bug bugster:6785377 state:upstream
Patch1: xscreensaver-01-datarootdir.diff
# date:2009-05-19 owner:alanc type:bug bugster:6842304 state:upstream
Patch2: xscreensaver-02-ldflags.diff
# date:2006-05-10 owner:alanc type:branding bugster:6526791
Patch3: xscreensaver-03-Sun.app-defaults.diff
# date:2006-05-10 owner:alanc type:branding,l10n
Patch4: xscreensaver-04-GNOME-desktop.diff
# date:2006-05-10 owner:alanc type:branding bugster:6770336
Patch5: xscreensaver-05-solaris-paths.diff
# date:2006-05-10 owner:alanc type:branding
Patch6: xscreensaver-06-dont-bug-jwz.diff
# date:2006-05-10 owner:alanc type:feature
# bugster:6735203,6673036,6484604,6673036,6670025,6611183,6478362,6417168
# bugster:6346056,6308859,6269444,6182506,6237901,5039878,6178584,5039876
# bugster:5077993,5077989,5079870,4931584,5039876,5059445,4782515,4783832
# bugster:6845751
Patch7: xscreensaver-07-gtk-lock.diff
# date:2006-05-10 owner:ma54148 type:feature bugster:4849641
Patch8: xscreensaver-08-allow-root.diff
# date:2006-05-10 owner:alanc type:feature bugster:5077981
Patch9: xscreensaver-09-passwdTimeout-pref.diff
# date:2006-05-10 owner:alanc type:feature bugster:5077966,6836372
Patch10: xscreensaver-10-xinput.diff
# date:2006-05-10 owner:alanc type:l10n bugster:6203951
Patch11: xscreensaver-11-i18n.diff
# date:2006-05-10 owner:alanc type:feature
Patch12: xscreensaver-12-debug-msgs.diff
# date:2006-05-10 owner:alanc type:feature
Patch13: xscreensaver-13-dpms.diff
# date:2006-05-10 owner:alanc type:bug bugster:4832530
Patch14: xscreensaver-14-gl-error-capture.diff
# date:2006-05-10 owner:samlau bugster:5077993,5083155,5059445,5039878,6176524
Patch15: xscreensaver-15-accessibility.diff
# date:2006-05-10 owner:johnfisc type:feature
# bugster:6673036,6451477,6698996
Patch16: xscreensaver-16-trusted.diff
# date:2006-06-07 owner:ma54148 type:feature
# bugster:5015296,6417168,6654320
Patch17: xscreensaver-17-pam_audit.diff
# date:2006-07-21 owner:ma54148 type:bug
# bugster:6450019,5015296,6417168
Patch18: xscreensaver-18-bug-6450019.diff
# date:2006-08-09 owner:alanc type:branding
%if %option_with_sun_branding
Patch19: xscreensaver-19-Sun-colors.diff
%else
Patch19: xscreensaver-19-OpenSolaris-colors.diff
%endif
# date:2006-08-09 owner:alanc type:branding
Patch20: xscreensaver-20-barcode-hack.diff
# date:2006-08-09 owner:alanc type:branding
Patch21: xscreensaver-21-glsnake.diff
# date:2006-09-13 owner:ma54148 type:feature bugster:6448236
Patch22: xscreensaver-22-allowRootByPassFlag.diff
# date:2006-10-24 owner:samlau type:bug bugster:6478841
Patch23: xscreensaver-23-bug-6478841.diff
# date:2006-11-20 owner:samlau type:feature bugster:6461887,6395649
Patch24: xscreensaver-24-bug-6461887.diff
# date:2006-11-22 owner:samlau bugster:6573182,6461887
Patch25: xscreensaver-25-bug1-6461887.diff
# date:2007-02-27 owner:samlau type:bug bugster:6520014
Patch26: xscreensaver-26-bug-6520014.diff
# date:2007-06-18 owner:ma54148 type:bug bugster:6541240
Patch27: xscreensaver-27-NULLRootPasswd.diff
# date:2007-09-25 owner:ma54148 type:bug bugster:6580862,6531358
Patch28: xscreensaver-28-RobustKBGrab.diff
# date:2007-11-21 owner:hs208856 type:bug bugster:6573182
Patch29: xscreensaver-29-bug-6573182.diff
# date:2008-01-03 owner:samlau type:bug bugster:6610282
Patch30: xscreensaver-30-bug-6610282.diff
# date:2008-02-08 owner:uejio type:bug bugster:6475285
Patch31: xscreensaver-31-bug-6475285.diff
# date:2008-02-11 owner:uejio type:bug bugster:6583181
Patch33: xscreensaver-33-bug-6583181.diff
# date:2008-02-27 owner:ma54148 type:bug bugster:6585644
Patch34: xscreensaver-34-notice_events.diff
# date:2008-03-05 owner:uejio type:bug bugster:6670659
Patch35: xscreensaver-35-bug-6670659.diff
# date:2008-06-03 owner:uejio type:bug bugster:6583247
Patch36: xscreensaver-36-bug-6583247.diff
# date:2008-07-17 owner:alanc type:bug bugster:6573061 state:upstream
Patch37: xscreensaver-37-hush-misc.diff
# date:2008-07-30 owner:uejio type:bug bugster:6698996
Patch38: xscreensaver-38-bug-6698996.diff
# date:2009-02-05 owner:alanc type:bug bugster:4802301
Patch39: xscreensaver-39-bug-4802301.diff
# date:2009-02-05 owner:alanc type:bug bugster:6764033 state:upstream
Patch40: xscreensaver-40-interference-hack.diff
# date:2008-12-15 owner:alanc type:bug bugster:6785377
Patch41: xscreensaver-41-intltool.diff
# date:2009-02-09 owner:bp230705 type:bug bugster:6769901
Patch42: xscreensaver-42-bug-6769901.diff
# date:2009-03-08 owner:samlau type:bug bugster:6736157
Patch43: xscreensaver-43-bug-6736157.diff
# date:2009-03-03 owner:johnfisc type:bug bugster:6757448
Patch44: xscreensaver-44-bug-6757448.diff
# date:2009-04-16 owner:bp230705 type:bug bugster:6825374
Patch45: xscreensaver-45-bug-6825374.diff
# date:2009-07-14 owner:au230626 type:bug bugster:6857559
Patch46: xscreensaver-46-bug-6857559.diff
# date:2009-07-31 owner:bp230705 type:bug bugster:6859039
Patch47: xscreensaver-47-bug-6859039.diff
# date:2009-09-10 owner:au230626 type:bug bugster:6839026
Patch48: xscreensaver-48-bug-6839026.diff 
# date:2009-09-29 owner:au230626 type:bug bugster:6845488
Patch49: xscreensaver-49-bug-6845488.diff
# date:2009-12-28 owner:ng228438 type:bug bugster:6865652
Patch50: xscreensaver-50-bug-6865652.diff
# date:2009-12-22 owner:alanc type:bug 
Patch51: xscreensaver-51-dpms-headers.diff
# date:2009-12-28 owner:ng228438 type:bug bugster:6832923
Patch52: xscreensaver-52-bug-6832923.diff

# date:2008-03-07 owner:alanc type:branding
Patch101: rss-glx-101-matrixview.diff
# date:2008-03-07 owner:alanc type:branding
Patch102: rss-glx-102-install-util.diff

%include default-depend.inc
Requires: SUNWcslr
Requires: SUNWglib2
Requires: SUNWgnome-a11y-libs
Requires: SUNWgnome-component
Requires: SUNWgnome-config
Requires: SUNWgtk2
Requires: SUNWlibatk
Requires: SUNWlibglade
Requires: SUNWlibmsr
Requires: SUNWlxmlr
Requires: SUNWpango
Requires: SUNWperl584core
Requires: SUNWxwplt
Requires: SUNWxorg-clientlibs
BuildRequires: SUNWarc
BuildRequires: SUNWbtool
BuildRequires: SUNWhea
BuildRequires: SUNWggrp
BuildRequires: SUNWglib2-devel
BuildRequires: SUNWgnome-a11y-libs-devel
BuildRequires: SUNWgnome-component-devel
BuildRequires: SUNWgnome-common-devel
BuildRequires: SUNWgnome-config-devel
BuildRequires: SUNWgtk2-devel
BuildRequires: SUNWlibatk-devel
BuildRequires: SUNWlibglade-devel
BuildRequires: SUNWlxml-devel
BuildRequires: SUNWpango-devel
BuildRequires: SUNWtoo
BuildRequires: SUNWxwinc

%if %option_with_sun_branding
%package -n SUNWxwsvr
Summary:                 XScreenSaver - /usr/openwin compatibility links
SUNW_BaseDir:            %{_basedir}
# Need to have the 10.0 first so our version number is higher than
# the 6.9.0 version number used when delivered from X gate
Version:                 10.0%{src_version}
%include default-depend.inc
Requires: %{name}

%description -n SUNWxwsvr
Backwards compatibility links for old paths under /usr/openwin for
XScreenSaver files.
%endif

%package hacks
Summary:                 XScreenSaver - display mode modules
SUNW_BaseDir:            %{_basedir}
SUNW_Copyright:          %{name}-hacks.copyright
# Need to have the 10.0 first so our version number is higher than
# the 6.9.0 version number used when delivered from X gate
Version:                 10.0%{src_version}
%include default-depend.inc
Requires: %{name}
Requires: SUNWcslr
Requires: SUNWglib2
Requires: SUNWgtk2
Requires: SUNWlibmsr
Requires: SUNWxwplt

%description hacks
Modules that provide different display modes (hacks) for XScreenSaver

%package hacks-gl
Summary:                 XScreenSaver - OpenGL display mode modules
SUNW_BaseDir:            %{_basedir}
SUNW_Copyright:          %{name}-hacks-gl.copyright
License:                 MIT, GPL v2
# Need to have the 10.0 first so our version number is higher than
# the 6.9.0 version number used when delivered from X gate
Version:                 10.0%{src_version}
%include default-depend.inc
Requires: %{name}
Requires: SUNWcslr
Requires: SUNWglib2
Requires: SUNWgtk2
Requires: SUNWlibmsr
Requires: SUNWxwplt
Requires: SUNWxorg-mesa
%define opengl_dir /usr/X11

%description hacks-gl
Modules that provide different OpenGL-based display modes (hacks) for the screen saver

%package -n SUNWrss-glx
Summary:                 XScreenSaver - Really Slick ScreenSaver OpenGL display modules
SUNW_BaseDir:            %{_basedir}
SUNW_Copyright:          SUNWrss-glx.copyright
License:                 GPL v2
Version:                 %{rss_version}
%include default-depend.inc
Requires: %{name}
Requires: SUNWbzip
Requires: SUNWcslr
Requires: SUNWimagick
Requires: SUNWlibC
Requires: SUNWlibmsr
Requires: SUNWxwplt
Requires: SUNWxorg-mesa

%description -n SUNWrss-glx
Modules that provide additional OpenGL-based display modes (hacks) for
XScreenSaver

%if %build_l10n
%package l10n
Summary:                 XScreenSaver - l10n content
SUNW_BaseDir:            %{_basedir}
%include default-depend.inc
Requires: %{name}
%endif

%prep
%setup -q -n %{src_dir}
%if %build_l10n
bzcat %SOURCE5 | tar xf -
cd po-sun; make; cd ..
%endif
%patch1 -p1
%patch2 -p1
%patch3 -p1
%patch4 -p1
%patch5 -p1
%patch6 -p1
%patch7 -p1
%patch8 -p1
%patch9 -p1
%patch10 -p1
%patch11 -p1
%patch12 -p1
%patch13 -p1
%patch14 -p1
%patch15 -p1
%patch16 -p1
%patch17 -p1
%patch18 -p1
%patch19 -p1
%patch20 -p1
%patch21 -p1
%patch22 -p1
%patch23 -p1
%patch24 -p1
%patch25 -p1
%patch26 -p1
%patch27 -p1
%patch28 -p1
%patch29 -p1
%patch30 -p1
%patch31 -p1
%patch33 -p1
%patch34 -p1
%patch35 -p1
%patch36 -p1
%patch37 -p1
%patch38 -p1
%patch39 -p1
%patch40 -p1
%patch41 -p1
%patch42 -p1
%patch43 -p1
%patch44 -p1
%patch45 -p1
%patch46 -p1
%patch47 -p1
%patch48 -p1
%patch49 -p1
%patch50 -p1
%patch51 -p1
%patch52 -p1

chmod a+x install-sh configure

cp %SOURCE2 driver/opensolaris-logo.png
%if %option_with_sun_branding
bzcat %SOURCE3 | tar xf -
mv solaris-lockscreen-logos/unlock-logo.png driver/unlock-logo.png
mv solaris-lockscreen-logos/trusted-logo.png driver/trusted-logo.png
%else
ln -s opensolaris-logo.png driver/unlock-logo.png
ln -s opensolaris-logo.png driver/trusted-logo.png
%endif

# Adjust man pages to Solaris standards:
#  - add paths to synopsis
#  - add attributes section to end with package info & stability
%define suntouch_manpages_cmd /usr/perl5/bin/perl %SOURCE4
%{suntouch_manpages_cmd} \
    -a '{Availability, %{name}}' \
    -a '{Interface Stability, Volatile}' \
    -p %{_prefix}/bin/ \
    driver/xscreensaver.man \
    driver/xscreensaver-command.man \
    driver/xscreensaver-demo.man
%{suntouch_manpages_cmd} \
    -a '{Availability, %{name}}' \
    -a '{Interface Stability, Private}' \
    -p %{xss_libdir}/bin/ \
    driver/xscreensaver-get*.man \
    driver/xscreensaver-text.man
%{suntouch_manpages_cmd} \
    -a '{Availability, %{name}-hacks}' \
    -a '{Interface Stability, Private}' \
    -p %{xss_libdir}/hacks/ \
    hacks/*.man
%{suntouch_manpages_cmd} \
    -a '{Availability, %{name}-hacks-gl}' \
    -a '{Interface Stability, Private}' \
    -p %{xss_libdir}/hacks/ \
    hacks/glx/*.man

%setup1 -q -n %{rss_name}_%{rss_version}

%patch101 -p1
%patch102 -p1

%{suntouch_manpages_cmd} \
    -a '{Availability, SUNWrss-glx}' \
    -a '{Interface Stability, Private}' \
    -p %{xss_libdir}/hacks/ \
    src/*.1


# Clear pictures we don't want in build
rm -f src/matrixview_textures/cpics
touch src/matrixview_textures/cpics

%build

CPUS=$(/usr/sbin/psrinfo | grep -c on-line)
if test "x${CPUS}" = "x" -o ${CPUS} = 0; then
     CPUS=1
fi
MAKEFLAGS=-j${CPUS}

# Mapfile flags copied from X - these are generically good for all libraries
# and applications and should probably move to Solaris.inc in the future.
# See the comments in each mapfile for a description of what it does.

# Mark the stack and as much of heap/data as possible non-executable,
# so that it's harder for attackers to exploit buffer overflows
# SPARC architecture requires PLT section in .data be executable, so
# we can only make .bss, not all of .data no-exec on SPARC
%define mapfile_noexbss		-Wl,-M,/usr/lib/ld/map.noexbss
%ifarch sparc
%define mapfile_noexdata	%{mapfile_noexbss}
%else
%define mapfile_noexdata	-Wl,-M,/usr/lib/ld/map.noexdata
%endif
%define mapfile_noexstack       -Wl,-M,/usr/lib/ld/map.noexstk
# Alignment directives for more efficient memory/page mappings
%define mapfile_pagealign       -Wl,-M,/usr/lib/ld/map.pagealign
%define mapfile_heapalign       -Wl,-M,/usr/lib/ld/map.bssalign

# Flags useful for libraries, shared objects, and programs
%define mapfiles_for_all	%{mapfile_pagealign} %{mapfile_noexdata}
# Flags only useful for programs, not libraries/shared objects
%define mapfiles_for_progs	%{mapfile_heapalign} %{mapfile_noexstack} %{mapfile_noexbss}

# XScreenSaver

PKG_CONFIG_DISABLE_UNINSTALLED=
unset PKG_CONFIG_DISABLE_UNINSTALLED

export PATH=/usr/perl5/bin:${PATH}
export PERL=/usr/perl5/bin/perl
export XGETTEXT=/usr/gnu/bin/xgettext
export GNOME_DATADIR='%{xss_libdir}/config'
export GLADE_DATADIR='%{xss_libdir}/config'

# Additional optimization flags, to make the hacks show off the hardware
# better and because for just a screensaver display we can get away with
# using optimizations that may change strict correctness of floating point ops.
%if %cc_is_gcc
%define extra_opt_flags -funsafe-math-optimizations
%else
%define extra_opt_flags -fsimple=2 -nofstore -xlibmil -xprefetch
%endif

export CFLAGS="-v %optflags %extra_opt_flags"
export CXXFLAGS="+w2 %cxx_optflags %extra_opt_flags"
export LDFLAGS="%_ldflags %mapfiles_for_all %mapfiles_for_progs"

cd %{_builddir}/%{src_dir}

# Several patches change configure.in & Makefile.in files, so autoreconf
autoreconf -v --install --force

./configure --enable-maintainer-mode \
 --with-gnome --enable-gtk-doc --with-gtk2=/usr --with-pixbuf=/usr \
 --enable-locking --with-pam=/usr --without-shadow --without-kerberos \
 --with-dpms --enable-dpms --disable-screengrab --enable-root-passwd \
 --with-gl=%{opengl_dir}  --without-motif --with-jpeg=/usr \
 --prefix=%{_prefix} \
 --datadir=%{_datadir} \
 --mandir=%{_mandir} \
 --localstatedir=%{_localstatedir} \
 --libexecdir=%{xss_libdir}/bin \
 --with-hackdir=%{xss_libdir}/hacks \
 --with-configdir=%{xss_libdir}/config/control-center-2.0 \
 --with-image-directory=%{_datadir}/pixmaps/backgrounds \
 --with-text-file=/etc/motd \
 --with-x-app-defaults=%{x11_dir}/lib/X11/app-defaults

# Update potfiles.in to pick up our added sources like lock-Gtk.c
cd po
make generate_potfiles_in POTFILES xscreensaver.pot

cd %{_builddir}/%{src_dir}
make ${MAKEFLAGS}



# RSS-GLX hacks
cd %{_builddir}/%{rss_dir}
./configure \
 --disable-sound \
 --prefix=%{xss_libdir} \
 --bindir='$(prefix)/hacks' \
 --localstatedir=%{_localstatedir} \
 --mandir=%{_mandir} \
 --with-configdir=%{xss_libdir}/config/control-center-2.0 \
 CPPFLAGS="-D_FILE_OFFSET_BITS=64"

make ${MAKEFLAGS}

%install

rm -rf ${RPM_BUILD_ROOT}

cd %{_builddir}/%{src_dir}
chmod a+x install-sh intltool-*
make -e install_prefix=${RPM_BUILD_ROOT} SHELL=/bin/bash install
cp -pf driver/*-logo.png ${RPM_BUILD_ROOT}%{xss_libdir}/config/
cp -pf utils/images/logo-180.gif ${RPM_BUILD_ROOT}%{xss_libdir}/config/

mv ${RPM_BUILD_ROOT}%{_bindir}/xscreensaver-get* \
   ${RPM_BUILD_ROOT}%{_bindir}/xscreensaver-text \
   ${RPM_BUILD_ROOT}%{xss_libdir}/bin

mv ${RPM_BUILD_ROOT}/usr/share/applications/gnome-screensaver-properties.desktop ${RPM_BUILD_ROOT}%{_datadir}/applications/screensaver-properties.desktop 

# Remove hacks we've chosen not to ship at all for various reasons
REMOVED_HACKS="extrusion flyingtoasters ljlatest sonar webcollage"
for h in ${REMOVED_HACKS} ; do
    rm -f ${RPM_BUILD_ROOT}%{xss_libdir}/hacks/${h} \
	  ${RPM_BUILD_ROOT}%{_mandir}/man6/${h}.6 \
	  ${RPM_BUILD_ROOT}%{xss_libdir}/config/control-center-2.0/${h}.xml
done
rm -f ${RPM_BUILD_ROOT}%{xss_libdir}/hacks/webcollage-helper

cd %{_builddir}/%{rss_dir}
make install DESTDIR=${RPM_BUILD_ROOT}
# Move rss-glx man pages to section 6 (games/amusements) to match xscreensaver
for m in */*.1 ; do
	mv ${RPM_BUILD_ROOT}%{_mandir}/man1/$(basename $m) \
	   ${RPM_BUILD_ROOT}%{_mandir}/man6/$(basename $m .1).6 ; \
done
# Don't need to ship static libraries in the package
rm ${RPM_BUILD_ROOT}%{xss_libdir}/lib/lib*.a \
   ${RPM_BUILD_ROOT}%{xss_libdir}/lib/lib*.la
rmdir ${RPM_BUILD_ROOT}%{xss_libdir}/lib

# Run script to add rss-glx hacks to XScreenSaver app-defaults, then delete it
${RPM_BUILD_ROOT}%{xss_libdir}/hacks/rss-glx_install.pl \
  ${RPM_BUILD_ROOT}%{x11_dir}/lib/X11/app-defaults/XScreenSaver
rm ${RPM_BUILD_ROOT}%{xss_libdir}/hacks/rss-glx_install.pl

cd ${RPM_BUILD_ROOT}
%if %option_with_sun_branding
# Make compatibility links for SUNWxwsvr
install -m 755 -d usr/openwin

install -m 755 -d usr/openwin/bin
ln -s ../../bin/xscreensaver \
	../../bin/xscreensaver-command \
	../../bin/xscreensaver-demo \
	usr/openwin/bin

install -m 755 -d usr/openwin/lib
ln -s ../../lib/xscreensaver usr/openwin/lib

install -m 755 -d usr/openwin/lib/app-defaults
ln -s ../../../X11/lib/X11/app-defaults/XScreenSaver \
	usr/openwin/lib/app-defaults
%endif

# Make compatibility links for SUNWxscreensaver
install -m 755 -d usr/X11

install -m 755 -d usr/X11/bin
ln -s ../../bin/xscreensaver \
	../../bin/xscreensaver-command \
	../../bin/xscreensaver-demo \
	usr/X11/bin

install -m 755 -d usr/X11/lib
ln -s ../../lib/xscreensaver usr/X11/lib

# This function prints a list of things that get installed.
# It does this by parsing the output of a dummy run of "make install".
# Borrowed/modified from Fedora Project RPM for xscreensaver at
# http://cvs.fedoraproject.org/viewvc/rpms/xscreensaver/devel/xscreensaver.spec
list_files() {
   echo '%%defattr(-,root,bin)'
   echo '%%dir %%attr(0755, root, bin) %%{xss_libdir}'
   echo '%%dir %%attr(0755, root, bin) %%{xss_libdir}/hacks'
   echo '%%dir %%attr(0755, root, bin) %%{xss_libdir}/config/control-center-2.0'
   echo '%%dir %%attr(0755, root, sys) %%{_datadir}'
   echo '%%dir %%attr(0755, root, bin) %%{_mandir}'
   echo '%%dir %%attr(0755, root, bin) %%{_mandir}/man6'
   REMOVED_LIST=$(echo ${REMOVED_HACKS} | tr ' ' '\n')
   make -s INSTALL=true SHELL=/bin/bash DESTDIR=${RPM_BUILD_ROOT} "$@" \
      | tr -d "'"						\
      | grep -v -w -e "${REMOVED_LIST}"				\
      | sed -n -e 's@.* \(/[^ ]*\)$@\1@p'			\
      | sed    -e "s@^${RPM_BUILD_ROOT}@@"			\
               -e "s@/[a-z][a-z]*/\.\./@/@"			\
	       -e 's@/man1/\(.*\)\.1$@/man6/\1.6@'		\
	       -e 's@\(.*/man/.*\)@%%doc \1@'			\
      | sort -u
}

# Make lists of which hacks go into which addon package

cd %{_builddir}/%{src_dir}
(cd hacks ; list_files install ) > hacks.files
(cd hacks/glx ; list_files install ) > hacks-gl.files

cd %{_builddir}/%{rss_dir}
(cd src ; list_files install-data-am install-exec-am ) > rss-glx.files

%if %build_l10n
%else
# REMOVE l10n FILES
rm -rf ${RPM_BUILD_ROOT}%{_datadir}/locale
%endif

%{?pkgbuild_postprocess: %pkgbuild_postprocess -v -s -c "%{version}:%{jds_version}:%{name}:$RPM_ARCH:%(date +%%Y-%%m-%%d):%{support_level}" $RPM_BUILD_ROOT}

%clean
rm -rf ${RPM_BUILD_ROOT}

%files
%defattr (-, root, bin)

%dir %attr(0755, root, bin) %{_bindir}
# xscreensaver must be setuid root in order to do PAM authentication
%attr (4555, root, bin) %{_bindir}/xscreensaver
%{_bindir}/xscreensaver-command
%{_bindir}/xscreensaver-demo

%dir %attr(0755, root, bin) %{_libdir}
%dir %attr(0755, root, bin) %{xss_libdir}
%dir %attr(0755, root, bin) %{xss_libdir}/bin
%{xss_libdir}/bin/xscreensaver-lock
%{xss_libdir}/bin/xscreensaver-getimage*
%{xss_libdir}/bin/xscreensaver-text

%dir %attr(0755, root, bin) %{xss_libdir}/config
%{xss_libdir}/config/xscreensaver-demo.glade2
%{xss_libdir}/config/*.png
%{xss_libdir}/config/*.gif

%dir %attr(0755, root, bin) %{xss_libdir}/config/control-center-2.0
%doc %{xss_libdir}/config/control-center-2.0/README

%dir %attr(0755, root, bin) %{_mandir}
%dir %attr(0755, root, bin) %{_mandir}/man1
%{_mandir}/man1/xscreensaver*.1

%dir %attr(0755, root, bin) /usr/X11/lib/X11
%dir %attr(0755, root, bin) /usr/X11/lib/X11/app-defaults
/usr/X11/lib/X11/app-defaults/XScreenSaver

%dir %attr(0755, root, sys) %{_datadir}
%dir %attr(0755, root, other) %{_datadir}/applications
%{_datadir}/applications/screensaver-properties.desktop

%dir %attr(0755, root, other) %{_datadir}/pixmaps
%{_datadir}/pixmaps/xscreensaver.xpm

# compatibility links for old /usr/X11 paths
%dir %attr(0755, root, bin) %{x11_dir}
%dir %attr(0755, root, bin) %{x11_dir}/bin
%{x11_dir}/bin/*
%dir %attr(0755, root, bin) %{x11_dir}/lib
%{x11_dir}/lib/xscreensaver

%files -f hacks.files hacks

%files -f hacks-gl.files hacks-gl

%files -f ../%{rss_dir}/rss-glx.files -n SUNWrss-glx

%if %option_with_sun_branding
%files -n SUNWxwsvr
%defattr (0755, root, bin)
/usr/openwin
%endif

%if %build_l10n
%files l10n
%defattr (-, root, bin)
%dir %attr (0755, root, sys) /usr/share
%attr (-, root, other) /usr/share/locale
%endif

%changelog
* Thu Feb 04 2010 - [email protected]
- Add po-sun translations for xscreensaver.
* Mon Jan 25 2010 - [email protected]
- Change OpenGL package name to SUNWxorg-mesa on sparc as it's already available
- Mark SUNWxwsvr as Nevada only package.
* Tue Dec 30 2009 - [email protected]
- 6865652: Add xscreensaver-50-bug-6865652.diff to disable restart, kill options in xscreensaver-demo in trusted solaris
- 6832923: Add xscreensaver-52-bug-6832923.diff to prevent xscreensaver from crashing in sunray.
* Tue Dec 22 2009 - [email protected]
- Add xscreensaver-51-dpms-headers.diff to build with snv_130 X headers
- Use /usr/lib/ld/map.noexbss now that it's shipped in snv_125 & later
  builds (CR 6843010)
* Mon Oct 19 2009 - [email protected]
- Change default DPMS settings to match Xorg 1.7 defaults (10 minutes)
- Merge xscreensaver-32-XScr.ad.lockTimeout.diff 
   into xscreensaver-03-Sun.app-defaults.diff
- Fix patch 9 & 22 to apply cleanly to the new patch 3 results
* Wed Sep 23 2009 - [email protected]
- Move files from /usr/X11 to /usr (PSARC 2009/482)
* Mon Aug 24 2009 - [email protected]
- 6875124 Broken link in package SUNWxwsvr
* Mon Aug 17 2009 - [email protected]
- Add more BuildRequires
* Thu Aug 13 2009 - [email protected]
- Add Vendor & License tags
* Fri Jul 31 2009 - [email protected]
- forward port xscreensaver-47-bug-6859039.diff from new X gate putback
* Thu Jul 30 2009 - [email protected]
- move Solaris branding logos to solaris-lockscreen-logos-1.0.tar.bz2
* Fri Jul 24 2009 - [email protected]
- rename patches from *.patch to *.diff
* Fri Jul 17 2009 - [email protected]
- initial version (moved from X gate)