http://packetstormsecurity.org/UNIX/admin/xscreensaver-4.14.tar.gz
[xscreensaver] / xscreensaver.spec
1 %define name            xscreensaver
2 %define version         4.14
3 %define release         1
4 %define serial          1
5 %define x11_prefix      /usr/X11R6
6 %define gnome_prefix    /usr
7 %define kde_prefix      /usr
8 %define gnome_datadir   %{gnome_prefix}/share
9
10 # By default, builds the basic, non-GL package.
11 # To build both the basic and GL-add-on packages:
12 #   rpm --define "USE_GL yes" ...
13 # or uncomment the following line.
14 # %define       USE_GL          yes
15
16 Summary:        X screen saver and locker
17 Summary(fr):    Economiseur d'écran et verrouillage de terminaux X
18 Name:           %{name}
19 Version:        %{version}
20 Release:        %{release}
21 Serial:         %{serial}
22 Group:          Amusements/Graphics
23 Copyright:      BSD
24 URL:            http://www.jwz.org/xscreensaver
25 Vendor:         Jamie Zawinski <jwz@jwz.org>
26 Source:         %{name}-%{version}.tar.gz
27 Buildroot:      %{_tmppath}/%{name}-%{version}-root
28
29 # This package really should be made to depend on
30 # control-center >= 1.4.0.2 -OR- control-center >= 1.5.12
31 # but there's no way to express that.
32
33 %description
34 A modular screen saver and locker for the X Window System.
35 Highly customizable: allows the use of any program that
36 can draw on the root window as a display mode.
37 More than 175 display modes are included in this package.
38 %{?USE_GL:See also the xscreensaver-gl package, which}
39 %{?USE_GL:includes optional OpenGL display modes.}
40
41 %description -l fr
42 Un économiseur d'écran et verrouillage modulaire pour X-Window.
43 Hautement configurable: permet l'utilisation de n'importe quel programme
44 qui peut dessiner dans la fenêtre root.
45 Plus de 175 modes d'affichage sont inclus dans ce paquet.
46 %{?USE_GL:Voir aussi le paquet xscreensaver-gl, qui inclut}
47 %{?USE_GL:des modules optionnels OpenGL.}
48
49 %{?USE_GL:%package gl}
50 %{?USE_GL:Group:        Amusements/Graphics}
51 %{?USE_GL:Requires:     xscreensaver = %{version}}
52 %{?USE_GL:Summary:      A set of GL screensavers}
53 %{?USE_GL:Summary(fr):  Un ensemble d'économiseurs d'écran OpenGL}
54 %{?USE_GL:%description gl}
55 %{?USE_GL:The xscreensaver-gl package contains even more screensavers for your}
56 %{?USE_GL:mind-numbing, ambition-eroding, time-wasting, hypnotized viewing}
57 %{?USE_GL:pleasure. These screensavers require OpenGL or Mesa support.}
58 %{?USE_GL: }
59 %{?USE_GL:Install the xscreensaver-gl package if you need more screensavers}
60 %{?USE_GL:for use with the X Window System and you have OpenGL or Mesa}
61 %{?USE_GL:installed.}
62 %{?USE_GL:%description -l fr gl}
63 %{?USE_GL:Le paquet xscreensaver-gl contient encore plus d'économiseurs}
64 %{?USE_GL:d'écran pour votre plaisir visuel.}
65 %{?USE_GL: }
66 %{?USE_GL:Ces économiseurs d'écran nécessitent OpenGL ou Mesa.}
67 %{?USE_GL:Installez le paquet xscreensaver-gl si vous désirez plus}
68 %{?USE_GL:d'économiseur d'écran et que vous avez OpenGL ou Mesa installé.}
69
70 %prep
71 %setup -q
72
73 %build
74 RPMOPTS=""
75
76 # On Solaris, build without PAM and with Shadow.
77 # On other systems, build with PAM and without Shadow.
78 #
79 %ifos solaris
80  RPMOPTS="$RPMOPTS --without-pam"
81 %else
82  RPMOPTS="$RPMOPTS --with-pam --without-shadow"
83 %endif
84
85 %{?USE_GL:RPMOPTS="$RPMOPTS --with-gl"}
86 %{!?USE_GL:RPMOPTS="$RPMOPTS --without-gl"}
87
88 archdir=`./config.guess`
89 mkdir $archdir
90 cd $archdir
91 CFLAGS="$RPM_OPT_FLAGS" \
92  ../configure --prefix=%{x11_prefix} \
93               --with-setuid-hacks \
94               $RPMOPTS
95 make
96
97 %install
98
99 archdir=`./config.guess`
100
101 # We have to make sure these directories exist,
102 # or nothing will be installed into them.
103 #
104 export KDEDIR=%{kde_prefix}
105 mkdir -p $RPM_BUILD_ROOT$KDEDIR/bin
106 mkdir -p $RPM_BUILD_ROOT%{gnome_datadir}
107 mkdir -p $RPM_BUILD_ROOT/etc/pam.d
108
109 cd $archdir
110 make  install_prefix=$RPM_BUILD_ROOT \
111       AD_DIR=%{x11_prefix}/lib/X11/app-defaults \
112       GNOME_BINDIR=%{gnome_prefix}/bin \
113       install-strip
114
115 # This function prints a list of things that get installed.
116 # It does this by parsing the output of a dummy run of "make install".
117 #
118 list_files() {
119   make -s install_prefix=$RPM_BUILD_ROOT INSTALL=true           \
120           GNOME_BINDIR=%{gnome_prefix}/bin                      \
121           "$@"                                                  |
122     sed -n -e 's@.* \(/[^ ]*\)$@\1@p'                           |
123     sed    -e "s@^$RPM_BUILD_ROOT@@"                            \
124            -e "s@/[a-z][a-z]*/\.\./@/@"                         |
125     sed    -e 's@\(.*/man/.*\)@\1\*@'                           |
126     sort
127 }
128
129 # Collect the names of the non-GL executables and scripts...
130 # (Including the names of all of the Gnome, KDE, and L10N-related files,
131 # whereever they might have gotten installed...)
132 # For the translation catalogs, prepend an appropriate %lang(..) tag.
133 #
134 (  cd    hacks ; list_files install ; \
135    cd ../driver; list_files install-program install-scripts \
136                             install-gnome install-kde ; \
137  ( cd ../po;     list_files install | grep '\.' \
138     | sed 's@^\(.*/\([^/]*\)/LC.*\)$@%lang(\2) \1@' ) \
139 ) > $RPM_BUILD_DIR/xscreensaver-%{version}/exes-non-gl
140
141
142 # Collect the names of the GL-only executables...
143 #
144 ( cd hacks/glx ; list_files install ) \
145    | grep -v man1/xscreensaver-gl-helper \
146    > $RPM_BUILD_DIR/xscreensaver-%{version}/exes-gl
147
148 # This line is redundant, except that it causes the "xscreensaver"
149 # executable to be installed unstripped (while all others are stripped.)
150 # You should install it this way so that jwz gets useful bug reports.
151 #
152 install -m 4755 driver/xscreensaver $RPM_BUILD_ROOT%{x11_prefix}/bin
153
154 # Even if we weren't compiled with PAM support, make sure to include
155 # the PAM module file in the RPM anyway, just in case.
156 #
157 ( cd driver ;
158   make install_prefix=$RPM_BUILD_ROOT PAM_DIR=/etc/pam.d install-pam )
159
160 # Make sure all files are readable by all, and writable only by owner.
161 #
162 chmod -R a+r,u+w,og-w $RPM_BUILD_ROOT
163
164 %post
165 # This part runs on the end user's system, when the RPM is installed.
166
167 pids=`pidof xscreensaver`
168 if [ -n "$pids" ]; then
169   echo "sending SIGHUP to running xscreensaver ($pids)..." >&2
170   kill -HUP $pids
171 fi
172
173 %clean
174 if [ -d $RPM_BUILD_ROOT    ]; then rm -r $RPM_BUILD_ROOT    ; fi
175 if [ -d $RPM_BUILD_ROOT-gl ]; then rm -r $RPM_BUILD_ROOT-gl ; fi
176
177 # Files for the "xscreensaver" package:
178 #
179 %files -f exes-non-gl
180 %defattr(-,root,root)
181
182 %doc    README README.debugging
183 %dir    %{x11_prefix}/lib/xscreensaver
184 %config %{x11_prefix}/lib/X11/app-defaults/*
185         %{x11_prefix}/man/man1/xscreensaver*
186 %config /etc/pam.d/*
187
188 # Files for the "xscreensaver-gl" package:
189 #
190 %{?USE_GL:%files -f exes-gl gl}
191 %{?USE_GL:%defattr(-,root,root)}