http://ftp.x.org/contrib/applications/xscreensaver-3.25.tar.gz
[xscreensaver] / xscreensaver.spec
1 %define name    xscreensaver
2 %define version 3.25
3 %define release 1
4 %define serial  1
5 %define prefix  /usr/X11R6
6
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" ...
10
11 Summary:        X screen saver and locker
12 Name:           %{name}
13 Version:        %{version}
14 Release:        %{release}
15 Serial:         %{serial}
16 Group:          Amusements/Graphics
17 Copyright:      BSD
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
22
23 %description
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.}
30
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.}
39 %{?USE_GL: }
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}
42 %{?USE_GL:installed.}
43
44 %prep
45 %setup -q
46
47 %build
48 RPMOPTS=""
49
50 # Is this really needed?  If so, why?
51 # %ifarch alpha
52 #  RPMOPTS="$RPMOPTS --without-xshm-ext"
53 # %endif
54
55 # On Solaris, build without PAM and with Shadow.
56 # On other systems, build with PAM and without Shadow.
57 #
58 %ifos solaris
59  RPMOPTS="$RPMOPTS --without-pam"
60 %else
61  RPMOPTS="$RPMOPTS --with-pam --without-shadow"
62 %endif
63
64 %{?USE_GL:RPMOPTS="$RPMOPTS --with-gl"}
65 %{!?USE_GL:RPMOPTS="$RPMOPTS --without-gl"}
66
67 CFLAGS="$RPM_OPT_FLAGS" \
68  ./configure --prefix=%{prefix} \
69              --enable-subdir=../lib/xscreensaver \
70              $RPMOPTS
71
72 make
73
74 %install
75
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).
78 #
79 mkdir -p $RPM_BUILD_ROOT/etc/pam.d
80
81 # This is another (since "make install" doesn't try to install
82 # the xscreensaver.kss file unless $KDEDIR is set.)
83 #
84 if [ -z "$KDEDIR" ]; then export KDEDIR=/usr; fi
85 mkdir -p $RPM_BUILD_ROOT$KDEDIR/bin
86
87 # And two more for Gnome (same reason...)
88 #
89 mkdir -p $RPM_BUILD_ROOT/usr/share/control-center/Desktop
90 mkdir -p $RPM_BUILD_ROOT/usr/share/gnome/apps/Settings/Desktop
91
92 make  install_prefix=$RPM_BUILD_ROOT \
93       AD_DIR=%{prefix}/lib/X11/app-defaults \
94       install-strip
95
96 # Make a pair of lists, of the GL and non-GL hacks.
97 # Do this by parsing the output of a dummy run of "make install"
98 # in the hacks/ and hacks/glx/ directories.
99 #
100 list_files() {
101   make -s install_prefix=$RPM_BUILD_ROOT INSTALL=true install   |
102     sed -n -e 's@.* /\([^ ]*\)$@/\1@p'                          |
103     sed    -e "s@^$RPM_BUILD_ROOT@@"                            \
104            -e "s@/bin/..@@"                                     |
105     sort
106 }
107
108 ( cd hacks ; list_files > $RPM_BUILD_DIR/xscreensaver-%{version}/hacks-non-gl )
109 ( cd hacks/glx ; list_files > $RPM_BUILD_DIR/xscreensaver-%{version}/hacks-gl )
110
111
112
113 # This line is redundant, except that it causes the "xscreensaver"
114 # executable to be installed unstripped (while all others are stripped.)
115 # You should install it this way so that jwz gets useful bug reports.
116 #
117 install -m 4755 driver/xscreensaver $RPM_BUILD_ROOT%{prefix}/bin
118
119 # Even if we weren't compiled with PAM support, make sure to include
120 # the PAM module file in the RPM anyway, just in case.
121 #
122 ( cd driver ;
123   make install_prefix=$RPM_BUILD_ROOT PAM_DIR=/etc/pam.d install-pam )
124
125 # Make sure all files are readable by all, and writable only by owner.
126 #
127 chmod -R a+r,u+w,og-w $RPM_BUILD_ROOT
128
129 %clean
130 if [ -d $RPM_BUILD_ROOT    ]; then rm -r $RPM_BUILD_ROOT    ; fi
131 if [ -d $RPM_BUILD_ROOT-gl ]; then rm -r $RPM_BUILD_ROOT-gl ; fi
132
133 %files -f hacks-non-gl
134 %defattr(-,root,root)
135
136 # Files for the "xscreensaver" package:
137 #
138 %doc                README README.debugging
139                     %{prefix}/bin/*
140 %dir                %{prefix}/lib/xscreensaver
141 %config             %{prefix}/lib/X11/app-defaults/*
142                     %{prefix}/man/man1/xscreensaver*
143                     /etc/pam.d/*
144 %config(missingok)  /usr/bin/*.kss
145 %config(missingok)  "/usr/share/control-center/Desktop/screensaver-properties.desktop"
146 %config(missingok)  "/usr/share/gnome/apps/Settings/Desktop/screensaver-properties.desktop"
147
148 # Files for the "xscreensaver-gl" package:
149 #
150 %{?USE_GL:%files -f hacks-gl gl}