Move 'captivemodid' library to libcaptive.
[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 Obsoletes: gnome-vfs-httpcaptive
72 %if %{static}
73 BuildRequires: fuse-devel
74 BuildRequires: ntfsprogs-devel >= 1.8.0
75 BuildRequires: libgnomeui-devel
76 Obsoletes: @PACKAGE@
77 Obsoletes: @PACKAGE@-lufs
78 Obsoletes: @PACKAGE@-install
79 # FIXME: ?: ntfsprogs-gnomevfs < 1.1
80 %else
81 Conflicts: @PACKAGE@-static
82 %endif
83
84 %description
85 Existing binary Microsoft Windows file system drivers were exploited
86 for accessing drives with possibly proprietary file system data structures.
87 Open file system API is provided to access these file system drivers.
88 Microsoft Windows system components required by these drivers
89 were analyzed and successfuly emulated in the GNU/Linux operating system.
90
91 The implementation allows applications running under the GNU/Linux operating
92 system to access NTFS drives. File system driver compatibility with VFAT,
93 ISO9660 and EXT2 is also provided.
94 %if %{static}
95 This packaging is a standalone static version, no other packages are needed.
96
97 %else
98
99 %package fuse
100 Summary: FUSE module for Microsoft Windows platform filesystem access.
101 Group: System Environment/Base
102 Requires: captive = %{PACKAGE_VERSION}
103 BuildRequires: fuse-devel
104 Requires: fuse fuse-libs
105
106 %description fuse
107 FUSE is a userspace filesystem framework.
108
109 Package provides FUSE filesystem module to access Microsoft Windows platform
110 filesystems such as NTFS. Use filesystem type 'captive-ntfs' for NTFS disks.
111
112 %package install
113 Summary: Instant installer for Microsoft Windows platform filesystem access.
114 Group: System Environment/Base
115 Requires: captive-fuse = %{PACKAGE_VERSION}
116 # Versions before 1.8.0 were too buggy
117 BuildRequires: ntfsprogs-devel >= 1.8.0
118 # 'PreReq' needed for Mandrake-9.1 otherwise '%preun install' fails
119 # during 'rpm -e ntfsprogs captive-install':
120 PreReq: ntfsprogs >= 1.8.0
121 Requires: ntfsprogs >= 1.8.0
122 Requires: ntfsprogs-gnomevfs
123 Requires: gnome-vfs-httpcaptive
124 BuildRequires: gnome-vfs2-devel
125 Requires: gnome-vfs2
126 BuildRequires: libgnomeui-devel
127 Requires: libgnomeui
128 BuildRequires: readline-devel
129 Requires: readline
130 BuildRequires: libxml2-devel >= 2.4.29
131 Requires: libxml2 >= 2.4.29
132
133 %description install
134 Package provides easy enough unattended installation of Microsoft Windows
135 platform filesystem access. Installer finds available NTFS partitions and
136 tries to acquire needed Microsoft Windows filesystem driver files.
137
138 You may need to run 'captive-install-acquire' to answer several questions.
139 NTFS disks will become mount(8)able at directories: /mnt/captive-VOLUME_NAME
140
141 %endif
142
143 #% %package devel
144 #% Summary: Microsoft Windows platform filesystem access development support.
145 #% Group: Development/System
146 #% Requires: surprise = %{PACKAGE_VERSION}
147 #% 
148 #% %description devel
149 #% Development package containing libraries for static linking together with
150 #% header files needed for any linking.
151 #% 
152 #% Microsoft Windows platform filesystem access.
153 #% TODO
154
155 %prep
156 %setup -n @PACKAGE@-%{version}
157
158 %build
159 # Never disable debug for captive, see FAQ
160 #       "How to check valid input arguments? Invalid processing state assumptions?"
161 %if 0
162 # For AutoGen:
163 %configure
164 %endif
165 # 'define' of rpm(1) does not accept line-continuation backslashes ('\').
166 %if %{static}
167 %configure \
168                 --disable-shared --enable-static \
169                 --enable-standalone \
170                 --enable-standalone-fonts=%{_datadir}/@PACKAGE@/fonts \
171 %else
172 %configure \
173                 --enable-shared --disable-static \
174                 --disable-standalone \
175                 --disable-standalone-fonts \
176 %endif
177                 --disable-standalone-yum \
178                 --with-readline \
179                 --disable-bug-replay \
180                 --disable-lufs \
181                 --enable-fuse \
182                 --enable-install-pkg \
183                 --enable-sandbox-setuid=@PACKAGE@ \
184                 --enable-sandbox-setgid=@PACKAGE@ \
185                 --enable-sandbox-chroot=%{_var}/lib/@PACKAGE@ \
186                 --enable-man-pages \
187                 --enable-sbin-mountdir=/sbin \
188                 --enable-sbin-mount-fs=ntfs:fastfat:cdfs:ext2fsd \
189                 --with-initddir=%{_initrddir} \
190                 --disable-gtk-doc \
191                 --with-orbit-line=link
192
193 #               --enable-standalone-yum=%{_sysconfdir}/yum.repos.d
194
195 make
196 %if %{static}
197 ./build-static link
198 %endif
199
200 %install
201 make DESTDIR=$RPM_BUILD_ROOT install-strip
202
203 %clean
204 rm -rf $RPM_BUILD_ROOT
205
206 %pre
207
208 %if ! %{static}
209 %pre fuse
210 %endif
211 %if %{static}
212 /usr/sbin/groupadd -r fuse 2>/dev/null || \
213    /usr/sbin/groupadd fuse 2>/dev/null || \
214    true
215 %endif
216
217 %post
218 /sbin/ldconfig
219 /usr/sbin/groupadd -r captive 2>/dev/null || \
220    /usr/sbin/groupadd captive 2>/dev/null || \
221    true
222 /usr/sbin/useradd -r -c "Captive Sandbox" -s /sbin/nologin -g captive -d %{_var}/lib/@PACKAGE@ captive 2>/dev/null || \
223    /usr/sbin/useradd -c "Captive Sandbox" -s /sbin/nologin -g captive -d %{_var}/lib/@PACKAGE@ captive 2>/dev/null || \
224    true
225
226 %if ! %{static}
227 %post fuse
228 %endif
229 /usr/lib/lsb/install_initd @PACKAGE@ 2>/dev/null || \
230                 /sbin/chkconfig --add @PACKAGE@
231 touch %{_var}/lock/subsys/@PACKAGE@
232
233 %if ! %{static}
234 %post install
235 %endif
236 %{_sbindir}/captive-install-fstab --add
237 %{_sbindir}/captive-install-acquire --text --scan-disks-quick
238
239 %preun
240
241 %if ! %{static}
242 %preun fuse
243 %endif
244 # Only on real erase, not on upgrade:
245 if [ $1 = 0 ];then
246         /usr/lib/lsb/remove_initd @PACKAGE@ 2>/dev/null || \
247                         /sbin/chkconfig --del @PACKAGE@
248         %{_initrddir}/@PACKAGE@ stop
249         rm -f %{_var}/lock/subsys/@PACKAGE@
250 fi
251
252 %if ! %{static}
253 %preun install
254 %endif
255 # Only on real erase, not on upgrade:
256 if [ $1 = 0 ];then
257         %{_sbindir}/captive-install-fstab --remove
258 fi
259
260 %postun
261 /sbin/ldconfig
262 # Only on real erase, not on upgrade:
263 if [ $1 = 0 ];then
264         # Remove stale sandbox chroot directories owned by 'captive.captive':
265         rm -rf %{_var}/lib/@PACKAGE@/s-*
266         rm -rf %{_var}/lib/@PACKAGE@/tmp/*
267 fi
268
269 %files
270 %defattr(-,root,root)
271 %doc README NEWS AUTHORS THANKS TODO
272 %if ! %{static}
273 %{_libdir}/lib@PACKAGE@-@VERSION@.so
274 %{_libdir}/gnome-vfs-2.0/modules/lib@PACKAGE@-gnomevfs-@VERSION@.so
275 %{_libdir}/gnome-vfs-2.0/modules/lib@PACKAGE@-gnomevfs.so
276 %endif
277 %attr(644,root,root) %{_mandir}/man?/@PACKAGE@.*
278 %{_bindir}/@PACKAGE@-cmdline
279 %attr(644,root,root) %{_mandir}/man?/@PACKAGE@-cmdline.*
280 %attr(4755,root,root) %{_libexecdir}/@PACKAGE@-sandbox-server
281 %attr(644,root,root) %{_mandir}/man?/@PACKAGE@-sandbox-server.*
282 %config %{_sysconfdir}/w32-mod-id.captivemodid.xml
283 %config %{_sysconfdir}/gnome-vfs-2.0/modules/@PACKAGE@.conf
284 # %config %{_sysconfdir}/yum.repos.d/*
285 %{_datadir}/locale/*/LC_MESSAGES/@PACKAGE@.mo
286 %{_var}/lib/@PACKAGE@
287
288 %if ! %{static}
289 %files fuse
290 %endif
291 %defattr(-,root,root)
292 %{_initrddir}/@PACKAGE@
293 /sbin/mount.@PACKAGE@
294 /sbin/mount.@PACKAGE@-*
295 %attr(644,root,root) %{_mandir}/man?/mount.@PACKAGE@.*
296 %if %{static}
297 %attr(4754,root,fuse) %{_libexecdir}/@PACKAGE@-fusermount
298 %endif
299
300 %if ! %{static}
301 %files install
302 %endif
303 %defattr(-,root,root)
304 %{_sbindir}/captive-install-fstab
305 %attr(644,root,root) %{_mandir}/man?/captive-install-fstab.*
306 %{_sbindir}/captive-install-acquire
307 %attr(644,root,root) %{_mandir}/man?/captive-install-acquire.*
308 %if %{static}
309 %{_datadir}/@PACKAGE@
310 %endif
311
312 # %files devel
313 # %defattr(-,root,root)
314 # %doc ChangeLog
315 # /usr/include/@PACKAGE@
316 # /usr/share/aclocal/*
317 # %{_libdir}/gnome-vfs-2.0/modules/libcaptive-gnomevfs.la
318 # /usr/lib/*.a
319 # /usr/lib/*.la
320 # ###for --disable-shared/(--enable-static-link disable):
321 # /usr/lib/*[a-z].so