78fb1607deebfa0e259fc8012e45dfd6dda9e326
[xscreensaver] / xscreensaver.spec
1 %define name xscreensaver
2 %define version 4.21
3
4 Summary:        X screen saver and locker
5 Name:           %{name}
6 Version:        %{version}
7 Release:        1
8 Epoch:          1
9 License:        BSD
10 Group:          Amusements/Graphics
11 URL:            http://www.jwz.org/xscreensaver/
12 Source0:        http://www.jwz.org/xscreensaver/xscreensaver-%{version}.tar.gz
13 Vendor:         Jamie Zawinski <jwz@jwz.org>
14 Buildroot:      %{_tmppath}/%{name}-root
15
16 %package base
17 Summary: A minimal installation of xscreensaver.
18 Group: Amusements/Graphics
19 BuildPrereq: bc, pam-devel, xorg-x11-devel
20 BuildPrereq: gtk2-devel libglade2-devel
21 Requires: /etc/pam.d/system-auth, htmlview, desktop-backgrounds-basic
22 Provides: xscreensaver
23 Provides: xscreensaver-base
24 Obsoletes: xscreensaver
25
26 %package extras
27 Summary: An enhanced set of screensavers.
28 Group: Amusements/Graphics
29 Requires: xscreensaver-base
30
31 %package gl-extras
32 Summary: An enhanced set of screensavers that require OpenGL.
33 Group: Amusements/Graphics
34 Requires: xscreensaver-base
35 Obsoletes: xscreensaver-gl
36
37 %description
38 A modular screen saver and locker for the X Window System.
39 More than 190 display modes are included in this package.
40
41 %description base
42 A modular screen saver and locker for the X Window System.
43 This package contains the bare minimum needed to blank and
44 lock your screen.  The graphical display modes are the
45 "xscreensaver-extras" and "xscreensaver-gl-extras" packages.
46
47 %description extras
48 A modular screen saver and locker for the X Window System.
49 This package contains a variety of graphical screen savers for
50 your mind-numbing, ambition-eroding, time-wasting, hypnotized
51 viewing pleasure.
52
53 %description gl-extras
54 A modular screen saver and locker for the X Window System.
55 This package contains a variety of OpenGL-based (3D) screen
56 savers for your mind-numbing, ambition-eroding, time-wasting,
57 hypnotized viewing pleasure.
58
59 %prep
60 %setup -q
61
62 if [ -x %{_datadir}/libtool/config.guess ]; then
63   # use system-wide copy
64   cp -p %{_datadir}/libtool/config.{sub,guess} .
65 fi
66
67 %build
68 archdir=`./config.guess`
69 mkdir $archdir
70 cd $archdir
71
72 export CFLAGS="${CFLAGS:-${RPM_OPT_FLAGS}}"
73
74 CONFIG_OPTS="--prefix=/usr --with-pam --without-shadow --without-kerberos"
75
76 # Red Hat doesn't like this:
77 CONFIG_OPTS="$CONFIG_OPTS --with-setuid-hacks"
78
79 # This is flaky:
80 # CONFIG_OPTS="$CONFIG_OPTS --with-login-manager"
81
82 ln -s ../configure .
83 %configure $CONFIG_OPTS
84 rm -f configure
85
86 make
87
88 %install
89 archdir=`./config.guess`
90 cd $archdir
91
92 rm -rf ${RPM_BUILD_ROOT}
93
94 # We have to make sure these directories exist,
95 # or nothing will be installed into them.
96 #
97 mkdir -p $RPM_BUILD_ROOT%{_bindir}                      \
98          $RPM_BUILD_ROOT%{_datadir}/xscreensaver        \
99          $RPM_BUILD_ROOT%{_libexecdir}/xscreensaver     \
100          $RPM_BUILD_ROOT%{_mandir}/man1/xscreensaver    \
101          $RPM_BUILD_ROOT/etc/pam.d
102
103 make install_prefix=$RPM_BUILD_ROOT install
104
105 desktop-file-install --vendor gnome --delete-original                         \
106   --dir $RPM_BUILD_ROOT%{_datadir}/applications                               \
107   $RPM_BUILD_ROOT%{_datadir}/applications/*.desktop
108
109 # This function prints a list of things that get installed.
110 # It does this by parsing the output of a dummy run of "make install".
111 #
112 list_files() {
113   make -s install_prefix=${RPM_BUILD_ROOT} INSTALL=true "$@"    \
114    | sed -n -e 's@.* \(/[^ ]*\)$@\1@p'                          \
115    | sed    -e "s@^${RPM_BUILD_ROOT}@@"                         \
116             -e "s@/[a-z][a-z]*/\.\./@/@"                        \
117    | sed    -e 's@\(.*/man/.*\)@\1\*@'                          \
118    | sed    -e 's@\(.*/app-defaults/\)@%config \1@'             \
119             -e 's@\(.*/pam\.d/\)@%config(missingok) \1@'        \
120    | sort
121 }
122
123 # Generate three lists of files for the three packages.
124 #
125 dd=%{_builddir}/%{name}-%{version}
126 (  cd hacks     ; list_files install ) >  $dd/extras.files
127 (  cd hacks/glx ; list_files install ) >  $dd/gl-extras.files
128 (  cd driver    ; list_files install ) >  $dd/base.files
129 (  cd po        ; list_files install ) >> $dd/base.files
130
131 # jwz: I get "find-lang.sh: No translations found for xscreensaver" on FC3
132 #%find_lang %{name}
133 #cat %{name}.lang >> $dd/base.files
134
135 # Make sure all files are readable by all, and writable only by owner.
136 #
137 chmod -R a+r,u+w,og-w ${RPM_BUILD_ROOT}
138
139 %clean
140 rm -rf ${RPM_BUILD_ROOT}
141
142 %post base
143 # This part runs on the end user's system, when the RPM is installed.
144
145 pids=`/sbin/pidof xscreensaver`
146 if [ -n "$pids" ]; then
147   echo "sending SIGHUP to running xscreensaver ($pids)..." >&2
148   kill -HUP $pids
149 fi
150
151 %files -f base.files base
152 %defattr(-,root,root)
153
154 %files -f extras.files extras
155 %defattr(-,root,root)
156
157 %files -f gl-extras.files gl-extras
158 %defattr(-,root,root)