1 | %define name xscreensaver |
---|
2 | %define version 3.29 |
---|
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 executable. |
---|
97 | # Do this by parsing the output of a dummy run of "make install" |
---|
98 | # in the driver/, hacks/ and hacks/glx/ directories. |
---|
99 | # |
---|
100 | list_files() { |
---|
101 | make -s install_prefix=$RPM_BUILD_ROOT INSTALL=true $1 | |
---|
102 | sed -n -e 's@.* /\([^ ]*\)$@/\1@p' | |
---|
103 | sed -e "s@^$RPM_BUILD_ROOT@@" \ |
---|
104 | -e "s@/bin/\.\./@/@" | |
---|
105 | sed -e 's@\(.*/man/.*\)@\1\*@' | |
---|
106 | sort |
---|
107 | } |
---|
108 | |
---|
109 | ( cd hacks ; list_files install ; cd ../driver; list_files install-program ) \ |
---|
110 | > $RPM_BUILD_DIR/xscreensaver-%{version}/exes-non-gl |
---|
111 | ( cd hacks/glx ; list_files install ) \ |
---|
112 | > $RPM_BUILD_DIR/xscreensaver-%{version}/exes-gl |
---|
113 | |
---|
114 | |
---|
115 | |
---|
116 | # This line is redundant, except that it causes the "xscreensaver" |
---|
117 | # executable to be installed unstripped (while all others are stripped.) |
---|
118 | # You should install it this way so that jwz gets useful bug reports. |
---|
119 | # |
---|
120 | install -m 4755 driver/xscreensaver $RPM_BUILD_ROOT%{prefix}/bin |
---|
121 | |
---|
122 | # Even if we weren't compiled with PAM support, make sure to include |
---|
123 | # the PAM module file in the RPM anyway, just in case. |
---|
124 | # |
---|
125 | ( cd driver ; |
---|
126 | make install_prefix=$RPM_BUILD_ROOT PAM_DIR=/etc/pam.d install-pam ) |
---|
127 | |
---|
128 | # Make sure all files are readable by all, and writable only by owner. |
---|
129 | # |
---|
130 | chmod -R a+r,u+w,og-w $RPM_BUILD_ROOT |
---|
131 | |
---|
132 | %clean |
---|
133 | if [ -d $RPM_BUILD_ROOT ]; then rm -r $RPM_BUILD_ROOT ; fi |
---|
134 | if [ -d $RPM_BUILD_ROOT-gl ]; then rm -r $RPM_BUILD_ROOT-gl ; fi |
---|
135 | |
---|
136 | %files -f exes-non-gl |
---|
137 | %defattr(-,root,root) |
---|
138 | |
---|
139 | # Files for the "xscreensaver" package: |
---|
140 | # |
---|
141 | %doc README README.debugging |
---|
142 | %dir %{prefix}/lib/xscreensaver |
---|
143 | %config %{prefix}/lib/X11/app-defaults/* |
---|
144 | %{prefix}/man/man1/xscreensaver* |
---|
145 | /etc/pam.d/* |
---|
146 | %config(missingok) /usr/bin/*.kss |
---|
147 | %config(missingok) /usr/share/control-center/Desktop/screensaver-properties.desktop |
---|
148 | %config(missingok) /usr/share/gnome/apps/Settings/Desktop/screensaver-properties.desktop |
---|
149 | %config(missingok) /usr/share/pixmaps/* |
---|
150 | |
---|
151 | # Files for the "xscreensaver-gl" package: |
---|
152 | # |
---|
153 | %{?USE_GL:%files -f exes-gl gl} |
---|