Fixed "Obsoletes" for: gnome-vfs-httpcaptive
[captive.git] / captive.spec.in
1 # $Id$
2 # rpm package description file for building
3 # Copyright (C) 2002-2005 Jan Kratochvil <project-captive@jankratochvil.net>
4
5 # This program is free software; you can redistribute it and/or modify
6 # it under the terms of the GNU General Public License as published by
7 # the Free Software Foundation; exactly version 2 of June 1991 is required
8
9 # This program is distributed in the hope that it will be useful,
10 # but WITHOUT ANY WARRANTY; without even the implied warranty of
11 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
12 # GNU General Public License for more details.
13
14 # You should have received a copy of the GNU General Public License
15 # along with this program; if not, write to the Free Software
16 # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
17
18
19 # Build fully statically.
20 # /usr/local/devel-static is required to contain static libraries.
21 %define static 1
22
23
24 # Temporary cludge before full 'devel' package gets deployed
25 %define _unpackaged_files_terminate_build 0
26
27 Summary: Microsoft Windows platform filesystem access.
28 %if %{static}
29 Name: @PACKAGE@-static
30 %else
31 Name: @PACKAGE@
32 %endif
33 %define release 0
34 Version: @VERSION@
35 Release: %{release}
36 Group: System Environment/Base
37 Packager: Jan Kratochvil <project-captive@jankratochvil.net>
38 Source: http://www.jankratochvil.net/project/captive/dist/@PACKAGE@-@VERSION@.tar.gz
39 License: GPL
40 BuildRoot: /var/tmp/@PACKAGE@-@VERSION@-%{release}-root
41 BuildRequires: ORBit2-devel
42 # Due to --with-orbit-line=link
43 %if ! %{static}
44 Requires: ORBit2 >= 2.7.0
45 %endif
46 BuildRequires: openssl-devel
47 %if ! %{static}
48 Requires: openssl
49 %endif
50 BuildRequires: gnome-vfs2-devel
51 %if ! %{static}
52 Requires: gnome-vfs2
53 %endif
54 BuildRequires: libxml2-devel
55 %if ! %{static}
56 Requires: libxml2
57 %endif
58 BuildRequires: popt
59 %if ! %{static}
60 Requires: popt
61 %endif
62 BuildRequires: glib2-devel
63 %if ! %{static}
64 Requires: glib2
65 %endif
66 BuildRequires: readline-devel
67 %if ! %{static}
68 Requires: readline
69 %endif
70 BuildRequires: gcc >= 3.0
71 %if %{static}
72 BuildRequires: fuse-devel
73 BuildRequires: ntfsprogs-devel >= 1.8.0
74 BuildRequires: libgnomeui-devel
75 Obsoletes: @PACKAGE@
76 Obsoletes: @PACKAGE@-lufs
77 Obsoletes: @PACKAGE@-install
78 # FIXME: ?: ntfsprogs-gnomevfs < 1.1
79 %else
80 Conflicts: @PACKAGE@-static
81 %endif
82
83 %description
84 Existing binary Microsoft Windows file system drivers were exploited
85 for accessing drives with possibly proprietary file system data structures.
86 Open file system API is provided to access these file system drivers.
87 Microsoft Windows system components required by these drivers
88 were analyzed and successfuly emulated in the GNU/Linux operating system.
89
90 The implementation allows applications running under the GNU/Linux operating
91 system to access NTFS drives. File system driver compatibility with VFAT,
92 ISO9660 and EXT2 is also provided.
93 %if %{static}
94 This packaging is a standalone static version, no other packages are needed.
95
96 %else
97
98 %package fuse
99 Summary: FUSE module for Microsoft Windows platform filesystem access.
100 Group: System Environment/Base
101 Requires: captive = %{PACKAGE_VERSION}
102 BuildRequires: fuse-devel
103 Requires: fuse fuse-libs
104
105 %description fuse
106 FUSE is a userspace filesystem framework.
107
108 Package provides FUSE filesystem module to access Microsoft Windows platform
109 filesystems such as NTFS. Use filesystem type 'captive-ntfs' for NTFS disks.
110
111 %package install
112 Summary: Instant installer for Microsoft Windows platform filesystem access.
113 Group: System Environment/Base
114 Requires: captive-fuse = %{PACKAGE_VERSION}
115 # Versions before 1.8.0 were too buggy
116 BuildRequires: ntfsprogs-devel >= 1.8.0
117 # 'PreReq' needed for Mandrake-9.1 otherwise '%preun install' fails
118 # during 'rpm -e ntfsprogs captive-install':
119 PreReq: ntfsprogs >= 1.8.0
120 Requires: ntfsprogs >= 1.8.0
121 Requires: ntfsprogs-gnomevfs
122 Obsoletes: gnome-vfs-httpcaptive
123 BuildRequires: gnome-vfs2-devel
124 Requires: gnome-vfs2
125 BuildRequires: libgnomeui-devel
126 Requires: libgnomeui
127 BuildRequires: readline-devel
128 Requires: readline
129 BuildRequires: libxml2-devel >= 2.4.29
130 Requires: libxml2 >= 2.4.29
131
132 %description install
133 Package provides easy enough unattended installation of Microsoft Windows
134 platform filesystem access. Installer finds available NTFS partitions and
135 tries to acquire needed Microsoft Windows filesystem driver files.
136
137 You may need to run 'captive-install-acquire' to answer several questions.
138 NTFS disks will become mount(8)able at directories: /mnt/captive-VOLUME_NAME
139
140 %endif
141
142 #% %package devel
143 #% Summary: Microsoft Windows platform filesystem access development support.
144 #% Group: Development/System
145 #% Requires: surprise = %{PACKAGE_VERSION}
146 #% 
147 #% %description devel
148 #% Development package containing libraries for static linking together with
149 #% header files needed for any linking.
150 #% 
151 #% Microsoft Windows platform filesystem access.
152 #% TODO
153
154 %prep
155 %setup -n @PACKAGE@-%{version}
156
157 %build
158 # Never disable debug for captive, see FAQ
159 #       "How to check valid input arguments? Invalid processing state assumptions?"
160 %if 0
161 # For AutoGen:
162 %configure
163 %endif
164 # 'define' of rpm(1) does not accept line-continuation backslashes ('\').
165 %if %{static}
166 %configure \
167                 --disable-shared --enable-static \
168                 --enable-standalone \
169                 --enable-standalone-fonts=%{_datadir}/@PACKAGE@/fonts \
170 %else
171 %configure \
172                 --enable-shared --disable-static \
173                 --disable-standalone \
174                 --disable-standalone-fonts \
175 %endif
176                 --disable-standalone-yum \
177                 --with-readline \
178                 --disable-bug-replay \
179                 --disable-lufs \
180                 --enable-fuse \
181                 --enable-install-pkg \
182                 --enable-sandbox-setuid=@PACKAGE@ \
183                 --enable-sandbox-setgid=@PACKAGE@ \
184                 --enable-sandbox-chroot=%{_var}/lib/@PACKAGE@ \
185                 --enable-man-pages \
186                 --enable-sbin-mountdir=/sbin \
187                 --enable-sbin-mount-fs=ntfs:fastfat:cdfs:ext2fsd \
188                 --with-initddir=%{_initrddir} \
189                 --disable-gtk-doc \
190                 --with-orbit-line=link
191
192 #               --enable-standalone-yum=%{_sysconfdir}/yum.repos.d
193
194 make
195 %if %{static}
196 ./build-static link
197 %endif
198
199 %install
200 make DESTDIR=$RPM_BUILD_ROOT install-strip
201
202 %clean
203 rm -rf $RPM_BUILD_ROOT
204
205 %pre
206
207 %if ! %{static}
208 %pre fuse
209 %endif
210 %if %{static}
211 /usr/sbin/groupadd -r fuse 2>/dev/null || \
212    /usr/sbin/groupadd fuse 2>/dev/null || \
213    true
214 %endif
215
216 %post
217 /sbin/ldconfig
218 /usr/sbin/groupadd -r captive 2>/dev/null || \
219    /usr/sbin/groupadd captive 2>/dev/null || \
220    true
221 /usr/sbin/useradd -r -c "Captive Sandbox" -s /sbin/nologin -g captive -d %{_var}/lib/@PACKAGE@ captive 2>/dev/null || \
222    /usr/sbin/useradd -c "Captive Sandbox" -s /sbin/nologin -g captive -d %{_var}/lib/@PACKAGE@ captive 2>/dev/null || \
223    true
224
225 %if ! %{static}
226 %post fuse
227 %endif
228 /usr/lib/lsb/install_initd @PACKAGE@ 2>/dev/null || \
229                 /sbin/chkconfig --add @PACKAGE@
230 touch %{_var}/lock/subsys/@PACKAGE@
231
232 %if ! %{static}
233 %post install
234 %endif
235 %{_sbindir}/captive-install-fstab --add
236 %{_sbindir}/captive-install-acquire --text --scan-disks-quick
237
238 %preun
239
240 %if ! %{static}
241 %preun fuse
242 %endif
243 # Only on real erase, not on upgrade:
244 if [ $1 = 0 ];then
245         /usr/lib/lsb/remove_initd @PACKAGE@ 2>/dev/null || \
246                         /sbin/chkconfig --del @PACKAGE@
247         %{_initrddir}/@PACKAGE@ stop
248         rm -f %{_var}/lock/subsys/@PACKAGE@
249 fi
250
251 %if ! %{static}
252 %preun install
253 %endif
254 # Only on real erase, not on upgrade:
255 if [ $1 = 0 ];then
256         %{_sbindir}/captive-install-fstab --remove
257 fi
258
259 %postun
260 /sbin/ldconfig
261 # Only on real erase, not on upgrade:
262 if [ $1 = 0 ];then
263         # Remove stale sandbox chroot directories owned by 'captive.captive':
264         rm -rf %{_var}/lib/@PACKAGE@/s-*
265         rm -rf %{_var}/lib/@PACKAGE@/tmp/*
266 fi
267
268 %files
269 %defattr(-,root,root)
270 %doc README NEWS AUTHORS THANKS TODO
271 %if ! %{static}
272 %{_libdir}/lib@PACKAGE@-@VERSION@.so
273 %{_libdir}/gnome-vfs-2.0/modules/lib@PACKAGE@-gnomevfs-@VERSION@.so
274 %{_libdir}/gnome-vfs-2.0/modules/lib@PACKAGE@-gnomevfs.so
275 %endif
276 %attr(644,root,root) %{_mandir}/man?/@PACKAGE@.*
277 %{_bindir}/@PACKAGE@-cmdline
278 %attr(644,root,root) %{_mandir}/man?/@PACKAGE@-cmdline.*
279 %attr(4755,root,root) %{_libexecdir}/@PACKAGE@-sandbox-server
280 %attr(644,root,root) %{_mandir}/man?/@PACKAGE@-sandbox-server.*
281 %config %{_sysconfdir}/w32-mod-id.captivemodid.xml
282 %if ! %{static}
283 %config %{_sysconfdir}/gnome-vfs-2.0/modules/@PACKAGE@.conf
284 %endif
285 # %config %{_sysconfdir}/yum.repos.d/*
286 %{_datadir}/locale/*/LC_MESSAGES/@PACKAGE@.mo
287 %{_var}/lib/@PACKAGE@
288
289 %if ! %{static}
290 %files fuse
291 %endif
292 %defattr(-,root,root)
293 %{_initrddir}/@PACKAGE@
294 /sbin/mount.@PACKAGE@
295 /sbin/mount.@PACKAGE@-*
296 %attr(644,root,root) %{_mandir}/man?/mount.@PACKAGE@.*
297 %if %{static}
298 %attr(4754,root,fuse) %{_libexecdir}/@PACKAGE@-fusermount
299 %endif
300
301 %if ! %{static}
302 %files install
303 %endif
304 %defattr(-,root,root)
305 %{_sbindir}/captive-install-fstab
306 %attr(644,root,root) %{_mandir}/man?/captive-install-fstab.*
307 %{_sbindir}/captive-install-acquire
308 %attr(644,root,root) %{_mandir}/man?/captive-install-acquire.*
309 %if %{static}
310 %{_datadir}/@PACKAGE@
311 %endif
312
313 # %files devel
314 # %defattr(-,root,root)
315 # %doc ChangeLog
316 # /usr/include/@PACKAGE@
317 # /usr/share/aclocal/*
318 # %{_libdir}/gnome-vfs-2.0/modules/libcaptive-gnomevfs.la
319 # /usr/lib/*.a
320 # /usr/lib/*.la
321 # ###for --disable-shared/(--enable-static-link disable):
322 # /usr/lib/*[a-z].so