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