563e925a79a95aa67167e90512683f1ef1133b69
[framework/connectivity/libgphoto2.git] / packaging / rpm / package.spec
1 ########################################################################
2 #
3 # $Id: package.spec.in 12088 2009-05-16 22:25:13Z marcusmeissner $
4 #
5 # RPM spec file for libgphoto2
6 #
7 # TODO list concerning packaging
8 # - review and coordinate RPM packaging for libgphoto2, gphoto2, gtkam
9 #
10 ########################################################################
11
12 %define debug_package %{nil}
13
14 ####################################
15 Summary: Software for accessing digital cameras
16 Name: libgphoto2
17 Version: 2.4.11
18 Release: 2
19 License: LGPL
20 Group: Applications/Multimedia
21 BuildRoot: %{_tmppath}/%{name}-%{version}-root
22 # sources only available from sf.net - but not wgettable.
23 # Source: http://www.gphoto.org/dist/libgphoto2-2.4.11.tar.gz
24 Source: http://prdownloads.sourceforge.net/gphoto/libgphoto2-2.4.11.tar.gz
25 Url: http://www.gphoto.org/
26 ExcludeArch: s390 s390x
27 Provides: libgphoto2
28 Provides: libgphoto2_port
29 Requires: libgphoto2_port
30 # absolute requirements
31 PreReq: hotplug >= 2001_04_24-13
32 PreReq: /sbin/ldconfig, grep, fileutils
33 BuildRequires: findutils perl
34
35 # the following requirements are optional
36 #BuildRequires: gtk-doc
37 BuildRequires: libusb-devel >= 0.1.8
38
39 ####################################
40 %description
41 The gPhoto2 project is a universal, free application and library
42 framework that lets you download images from several different
43 digital camera models, including the newer models with USB
44 connections. Note that
45 a) for some older camera models you must use the old "gphoto" package.
46 b) for USB mass storage models you must use the driver in the kernel
47
48 This libgphoto2 package contains only the library that digital 
49 camera applications can use.
50
51 Frontend like the command-line utility gphoto2 and other (GUI)
52 frontends are available seperately.
53
54 ####################################
55 %package devel
56 Summary: Headers and libraries to compile against the libgphoto2 library.
57 Requires: %{name} = %{version}
58 Provides: libgphoto2-devel
59 Provides: libgphoto2_port-devel
60 Group: Development/Libraries
61
62 ####################################
63 %description devel
64 The gPhoto2 project is a universal, free application and library
65 framework that lets you download images from several different
66 digital camera models, including the newer models with USB
67 connections. Note that
68 a) for some older camera models you must use the old "gphoto" package.
69 b) for USB mass storage models you must use the driver in the kernel
70
71 This libgphoto2-devel package contains the files needed to compile 
72 frontends like the command-line utility gphoto2 and other (GUI)
73 frontends, which are available seperately.
74
75
76 ########################################################################
77 # Building and installing the beast into %{buildroot}
78 ########################################################################
79
80 ####################################
81 %prep
82 rm -rf "${RPM_BUILD_DIR}/%{name}-%{version}"
83 %setup -q -n %{name}-%{version}
84
85 ####################################
86 %build
87 %define __libtoolize :
88 # FIXME: We should copy the disable- arguments here
89 ##FIXMEPERCENTconfigure --enable-docs --with-docs-dir=%{buildroot}%{_docdir}/%{name}
90 %configure --with-docs-dir=%{buildroot}%{_docdir}/%{name}
91 make
92
93 ####################################
94 %install
95 rm -rf "${RPM_BUILD_ROOT}"
96
97 # Convince gphoto2 to be packaged.
98 perl -p -i -e "s|^libdir.*|libdir='$RPM_BUILD_ROOT%{_libdir}'|g" \
99         libgphoto2_port/libgphoto2_port/libgphoto2_port.la
100
101 %makeinstall
102
103 # Fix up libtool libraries.
104 find $RPM_BUILD_ROOT -name '*.la' | \
105   xargs perl -p -i -e "s|$RPM_BUILD_ROOT||g"
106
107 #cp -a %{buildroot}%{_docdir}/%{name}-%{version}/html html
108 #cp -a %{buildroot}%{_docdir}/libgphoto2_port-0.5.1/html/api/gphoto2-port html/api
109 #find html -name '*.sgml' | xargs rm
110
111
112 %find_lang libgphoto2-2
113 # FIXME: Update this manually as long as libgphoto2_port has a
114 #        different build system.
115 %find_lang libgphoto2_port-0
116
117 # build file list
118 find %{buildroot} -type f -or -type l \
119         | sed 's!^%{buildroot}!!' | sort > %{name}-%{version}.all.files
120
121 # extract .so libs
122 egrep '\.so(\.[0-9]+)*$' \
123         < %{name}-%{version}.all.files > %{name}-%{version}.so.files
124 egrep -v '\.so(\.[0-9]+)*$' \
125         < %{name}-%{version}.all.files > %{name}-%{version}.no-so.files
126
127 # extract files for devel package
128 egrep '(-config|\.h|\.la|\.a|\.pc|\.3)$' \
129         < %{name}-%{version}.no-so.files > %{name}-%{version}.devel.files
130 egrep -v '(-config|\.h|\.la|\.a|\.pc|\.3)$' \
131         < %{name}-%{version}.no-so.files > %{name}-%{version}.no-devel.files
132
133 # extract doc files
134 egrep '^%{_docdir}' \
135         < %{name}-%{version}.no-devel.files > %{name}-%{version}.doc.files
136 egrep -v '^%{_docdir}' \
137         < %{name}-%{version}.no-devel.files > %{name}-%{version}.no-doc.files
138
139 # extract i18n files
140 egrep '^%{_datadir}/locale' \
141         < %{name}-%{version}.no-doc.files > %{name}-%{version}.i18n.files
142 egrep -v '^%{_datadir}/locale' \
143         < %{name}-%{version}.no-doc.files > %{name}-%{version}.no-i18n.files
144
145 # extract misc files for lib package
146 egrep '^(%{_libdir}|%{_datadir})/libgphoto2' \
147         < %{name}-%{version}.no-i18n.files > %{name}-%{version}.misc.files
148 egrep -v '^(%{_libdir}|%{_datadir})/libgphoto2' \
149         < %{name}-%{version}.no-i18n.files > %{name}-%{version}.rest.files \
150         || echo "non-zero exit code is not fatal here"
151
152 if [ -s %{name}-%{version}.rest.files ]
153 then
154         cat %{name}-%{version}.rest.files
155 fi
156
157 cat %{name}-%{version}.{so,doc,misc,i18n}.files \
158         > %{name}-%{version}.files
159
160 # HACK
161 touch debugfiles.list
162
163 exit 0
164
165 ####################################
166 %clean
167 # FIXME: Cleanup deactiveated for debugging
168 # rm -rf "${RPM_BUILD_ROOT}"
169
170 ########################################################################
171 # file list and installation for main package
172 ########################################################################
173
174 ####################################
175 %files -f %{name}-%{version}.files
176 %defattr(-,root,root)
177 # FIXME: correct %docxyz markup for doc files
178
179 ####################################
180 %post
181
182 # register libraries
183 /sbin/ldconfig
184
185 # add supported cameras to /etc/hotplug/usb.usermap
186 grep -v '^usbcam' /etc/hotplug/usb.usermap > /etc/hotplug/usb.usermap.tmp
187 %{_libdir}/libgphoto2/print-usb-usermap >> /etc/hotplug/usb.usermap.tmp
188 mv /etc/hotplug/usb.usermap.tmp /etc/hotplug/usb.usermap
189
190 ####################################
191 %postun
192
193 # unregister libraries
194 /sbin/ldconfig
195
196 if [ "$1" = 0 ]; then
197     # remove supported cameras from /etc/hotplug/usb.usermap
198     # if erasing the package not as part of a package update
199     grep -v '^usbcam' /etc/hotplug/usb.usermap > /etc/hotplug/usb.usermap.new
200     mv /etc/hotplug/usb.usermap.new /etc/hotplug/usb.usermap
201 fi
202
203
204 ########################################################################
205 # file list and installation for -devel subpackage
206 ########################################################################
207
208 ####################################
209 %files devel -f %{name}-%{version}.devel.files
210 %defattr(-,root,root)
211 #%doc html/api
212
213
214 ########################################################################
215 # ChangeLog
216 ########################################################################
217 %changelog
218 * Thu Jun 20 2002 Hans Ulrich Niedermann <gp@n-dimensional.de> 2.1.4head
219 - hack in correct find_lang arguments
220 - fix misc. nagging little things preventing "rpmbuild -ta" from working
221
222 * Thu Jun 20 2002 Hans Ulrich Niedermann <gp@n-dimensional.de> 2.1.0rc3-1
223 - only --enable-docs and copy API docs if GTK_DOC found
224 - use --with-doc-formats from local ./configure call
225
226 * Tue May 28 2002 Hans Ulrich Niedermann <gp@n-dimensional.de> 2.0.1dev8-1
227 - comment out requirements if not used (gtk-doc, transfig)
228 - provide libgphoto2_port - for future compatibility
229 - fixed handling of misc HTML docs (API docs and docbook-generated manual)
230 - install linux-hotplug scripts into a directory of that name
231 - added gphoto2_port(3) man page
232
233 * Sat May 18 2002 Hans Ulrich Niedermann <gp@n-dimensional.de> 2.0.1dev6-1
234 - added API HTML docs to the -devel package
235 - added man page gphoto2(3), require hotplug >= 2001_04_24-13
236
237 * Thu May  9 2002 Hans Ulrich Niedermann <gp@n-dimensional.de> 2.0.1dev4-1
238 - merged changes from current Redhat spec file into gphoto2 distribution
239   as they managed to get the beast to build
240 - re-added FAQ to package (Redhat left it out regrettably)
241 - only require hotplug 2001_04_24-11 instead of 2001_04_24-13
242
243 * Mon Apr 29 2002 Tim Waugh <twaugh@redhat.com> 2.0-6
244 - In fact, don't even build for mainframe.
245
246 * Mon Apr 29 2002 Florian La Roche <Florian.LaRoche@redhat.de> 2.0-5
247 - do not require hotplug for mainframe
248
249 * Mon Apr 15 2002 Nalin Dahyabhai <nalin@redhat.com> 2.0-4
250 - Set the owner of the device to the console lock holder, not the owner
251   of /dev/console, in the hotplug agent, fixing access for users who log
252   in at VTs and use startx (#62976).
253
254 * Fri Apr 12 2002 Tim Waugh <twaugh@redhat.com> 2.0-3
255 - Rebuild (fixed bug #63355).
256
257 * Sat Apr 06 2002 Hans Ulrich Niedermann <gp@n-dimensional.de>
258 - require libusb >= 0.0.5 and for building require transfig
259
260 * Wed Feb 27 2002 Tim Waugh <twaugh@redhat.com> 2.0-2
261 - Fix from CVS: close port unconditionally in gp_camera_exit().
262
263 * Mon Feb 25 2002 Tim Waugh <twaugh@redhat.com> 2.0-1
264 - 2.0 is released.
265 - Ship the .so symlinks in the devel package.
266
267 * Mon Feb 25 2002 Tim Waugh <twaugh@redhat.com> 2.0-0.rc4.1
268 - 2.0rc4.
269
270 * Fri Feb 22 2002 Tim Waugh <twaugh@redhat.com> 2.0-0.rc3.1
271 - 2.0rc3.  No longer need CVS patch.
272 - Build no longer requires xmlto.
273
274 * Thu Feb 21 2002 Tim Waugh <twaugh@redhat.com> 2.0-0.rc2.2
275 - Fix DC240 hangs (patch from CVS).
276 - Rebuild in new environment.
277
278 * Tue Feb 19 2002 Tim Waugh <twaugh@redhat.com> 2.0-0.rc2.1
279 - 2.0rc2 (bug #59993).  No longer need docs patch or man page.
280 - Really fix up libtool libraries (bug #60002).
281
282 * Fri Feb 15 2002 Tim Waugh <twaugh@redhat.com> 2.0-0.beta5.2
283 - PreReq /sbin/ldconfig, grep, and fileutils (bug #59941).
284
285 * Tue Feb 12 2002 Tim Waugh <twaugh@redhat.com> 2.0-0.beta5.1
286 - 2.0beta5.
287 - Fix Makefiles so that documentation can be built.
288 - Ship pkgconfig file.
289 - Add man page.
290
291 * Thu Feb  7 2002 Tim Waugh <twaugh@redhat.com> 2.0-0.beta4.1
292 - 2.0beta4.
293 - Build requires transfig, and at least version 0.1.5 of libusb.
294 - Clean up file lists.
295 - Build documentation.
296
297 * Fri Jan 25 2002 Tim Waugh <twaugh@redhat.com> 2.0-0.beta3.2
298 - Rebuild in new environment.
299 - Dump docbook-dtd30-sgml requirement; gtk-doc is sufficient.
300
301 * Sun Nov 18 2001 Tim Waugh <twaugh@redhat.com> 2.0-0.beta3.1
302 - Adapted for Red Hat Linux.
303
304 * Sat Oct 27 2001 Hans Ulrich Niedermann <gp@n-dimensional.de>
305 - fixed update behaviour for hotplug list (do not erase it when updating)
306
307 * Thu Oct 25 2001 Tim Waugh <twaugh@redhat.com>
308 - hotplug dependency is a prereq not a requires (the package scripts
309   need it)
310
311 * Sun Oct 14 2001 Hans Ulrich Niedermann <gp@n-dimensional.de>
312 - integrated spec file into source package
313
314 * Sun Oct 14 2001 Hans Ulrich Niedermann <gp@n-dimensional.de>
315 - 2.0beta3
316
317 * Tue Oct  2 2001 Tim Waugh <twaugh@redhat.com> 2.0beta2-0.1
318 - Adapted for Red Hat Linux.
319 - 2.0beta2.
320
321 * Mon Aug  6 2001 Till Kamppeter <till@mandrakesoft.com> 2.0-0.beta1.2mdk
322 - Corrected "Requires:"
323
324 * Mon Aug  6 2001 Till Kamppeter <till@mandrakesoft.com> 2.0-0.beta1.1mdk
325 - Initial release
326
327
328
329 ########################################################################
330 # Local Variables:
331 # mode: rpm-spec
332 # End: