summaryrefslogtreecommitdiff
path: root/packaging/rpm/package.spec.in
blob: 65767fd9815acb7ea15de750d8c5fe50ad20162c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
########################################################################
#
# $Id$
#
# RPM spec file for @PACKAGE@
#
# TODO list concerning packaging
# - review and coordinate RPM packaging for libgphoto2, gphoto2, gtkam
#
########################################################################

%define debug_package %{nil}

####################################
Summary: Software for accessing digital cameras
Name: @PACKAGE@
Version: @VERSION@
Release: 2
License: LGPL
Group: Applications/Multimedia
BuildRoot: %{_tmppath}/%{name}-%{version}-root
# sources only available from sf.net - but not wgettable.
# Source: http://www.gphoto.org/dist/@PACKAGE@-@VERSION@.tar.gz
Source: http://prdownloads.sourceforge.net/gphoto/@PACKAGE@-@VERSION@.tar.gz
Url: @URL_GPHOTO_HOME@
ExcludeArch: s390 s390x
Provides: libgphoto2
Provides: libgphoto2_port
Requires: libgphoto2_port
# absolute requirements
PreReq: hotplug >= 2001_04_24-13
PreReq: /sbin/ldconfig, grep, fileutils
BuildRequires: findutils perl

# the following requirements are optional
@ENABLE_GTK_DOC_TRUE@BuildRequires: gtk-doc
Requires: libusb >= 0.1.8
BuildRequires: libusb-devel >= 0.1.8

####################################
%description
The gPhoto2 project is a universal, free application and library
framework that lets you download images from several different
digital camera models, including the newer models with USB
connections. Note that
a) for some older camera models you must use the old "gphoto" package.
b) for USB mass storage models you must use the driver in the kernel

This libgphoto2 package contains only the library that digital 
camera applications can use.

Frontend like the command-line utility gphoto2 and other (GUI)
frontends are available seperately.

####################################
%package devel
Summary: Headers and libraries to compile against the libgphoto2 library.
Requires: %{name} = %{version}
Provides: libgphoto2-devel
Provides: libgphoto2_port-devel
Group: Development/Libraries

####################################
%description devel
The gPhoto2 project is a universal, free application and library
framework that lets you download images from several different
digital camera models, including the newer models with USB
connections. Note that
a) for some older camera models you must use the old "gphoto" package.
b) for USB mass storage models you must use the driver in the kernel

This libgphoto2-devel package contains the files needed to compile 
frontends like the command-line utility gphoto2 and other (GUI)
frontends, which are available seperately.


########################################################################
# Building and installing the beast into %{buildroot}
########################################################################

####################################
%prep
rm -rf "${RPM_BUILD_DIR}/%{name}-%{version}"
%setup -q -n %{name}-%{version}

####################################
%build
%define __libtoolize :
# FIXME: We should copy the disable- arguments here
#@ENABLE_GTK_DOC_TRUE@FIXMEPERCENTconfigure --enable-docs --with-docs-dir=%{buildroot}%{_docdir}/%{name}
%configure --with-docs-dir=%{buildroot}%{_docdir}/%{name}
make

####################################
%install
rm -rf "${RPM_BUILD_ROOT}"

# Convince gphoto2 to be packaged.
perl -p -i -e "s|^libdir.*|libdir='$RPM_BUILD_ROOT%{_libdir}'|g" \
	libgphoto2_port/libgphoto2_port/libgphoto2_port.la

%makeinstall

# Fix up libtool libraries.
find $RPM_BUILD_ROOT -name '*.la' | \
  xargs perl -p -i -e "s|$RPM_BUILD_ROOT||g"

@ENABLE_GTK_DOC_TRUE@cp -a %{buildroot}%{_docdir}/%{name}-%{version}/html html
@ENABLE_GTK_DOC_TRUE@cp -a %{buildroot}%{_docdir}/libgphoto2_port-0.5.1/html/api/gphoto2-port html/api
@ENABLE_GTK_DOC_TRUE@find html -name '*.sgml' | xargs rm


%find_lang @GETTEXT_PACKAGE@
# FIXME: Update this manually as long as libgphoto2_port has a
#        different build system.
%find_lang libgphoto2_port-0

# build file list
find %{buildroot} -type f -or -type l \
        | sed 's!^%{buildroot}!!' | sort > %{name}-%{version}.all.files

# extract .so libs
egrep '\.so(\.[0-9]+)*$' \
	< %{name}-%{version}.all.files > %{name}-%{version}.so.files
egrep -v '\.so(\.[0-9]+)*$' \
	< %{name}-%{version}.all.files > %{name}-%{version}.no-so.files

# extract files for devel package
egrep '(-config|\.h|\.la|\.a|\.pc|\.3)$' \
	< %{name}-%{version}.no-so.files > %{name}-%{version}.devel.files
egrep -v '(-config|\.h|\.la|\.a|\.pc|\.3)$' \
	< %{name}-%{version}.no-so.files > %{name}-%{version}.no-devel.files

# extract doc files
egrep '^%{_docdir}' \
	< %{name}-%{version}.no-devel.files > %{name}-%{version}.doc.files
egrep -v '^%{_docdir}' \
	< %{name}-%{version}.no-devel.files > %{name}-%{version}.no-doc.files

# extract i18n files
egrep '^%{_datadir}/locale' \
	< %{name}-%{version}.no-doc.files > %{name}-%{version}.i18n.files
egrep -v '^%{_datadir}/locale' \
	< %{name}-%{version}.no-doc.files > %{name}-%{version}.no-i18n.files

# extract misc files for lib package
egrep '^(%{_libdir}|%{_datadir})/libgphoto2' \
	< %{name}-%{version}.no-i18n.files > %{name}-%{version}.misc.files
egrep -v '^(%{_libdir}|%{_datadir})/libgphoto2' \
	< %{name}-%{version}.no-i18n.files > %{name}-%{version}.rest.files \
	|| echo "non-zero exit code is not fatal here"

if [ -s %{name}-%{version}.rest.files ]
then
	cat %{name}-%{version}.rest.files
fi

cat %{name}-%{version}.{so,doc,misc,i18n}.files \
	> %{name}-%{version}.files

# HACK
touch debugfiles.list

exit 0

####################################
%clean
# FIXME: Cleanup deactiveated for debugging
# rm -rf "${RPM_BUILD_ROOT}"

########################################################################
# file list and installation for main package
########################################################################

####################################
%files -f %{name}-%{version}.files
%defattr(-,root,root)
# FIXME: correct %docxyz markup for doc files

####################################
%post

# register libraries
/sbin/ldconfig

# add supported cameras to /etc/hotplug/usb.usermap
grep -v '^usbcam' /etc/hotplug/usb.usermap > /etc/hotplug/usb.usermap.tmp
%{_libdir}/@PACKAGE@/print-usb-usermap >> /etc/hotplug/usb.usermap.tmp
mv /etc/hotplug/usb.usermap.tmp /etc/hotplug/usb.usermap

####################################
%postun

# unregister libraries
/sbin/ldconfig

if [ "$1" = 0 ]; then
    # remove supported cameras from /etc/hotplug/usb.usermap
    # if erasing the package not as part of a package update
    grep -v '^usbcam' /etc/hotplug/usb.usermap > /etc/hotplug/usb.usermap.new
    mv /etc/hotplug/usb.usermap.new /etc/hotplug/usb.usermap
fi


########################################################################
# file list and installation for -devel subpackage
########################################################################

####################################
%files devel -f %{name}-%{version}.devel.files
%defattr(-,root,root)
@ENABLE_GTK_DOC_TRUE@%doc html/api


########################################################################
# ChangeLog
########################################################################
%changelog
* Thu Jun 20 2002 Hans Ulrich Niedermann <gp@n-dimensional.de> 2.1.4head
- hack in correct find_lang arguments
- fix misc. nagging little things preventing "rpmbuild -ta" from working

* Thu Jun 20 2002 Hans Ulrich Niedermann <gp@n-dimensional.de> 2.1.0rc3-1
- only --enable-docs and copy API docs if GTK_DOC found
- use --with-doc-formats from local ./configure call

* Tue May 28 2002 Hans Ulrich Niedermann <gp@n-dimensional.de> 2.0.1dev8-1
- comment out requirements if not used (gtk-doc, transfig)
- provide libgphoto2_port - for future compatibility
- fixed handling of misc HTML docs (API docs and docbook-generated manual)
- install linux-hotplug scripts into a directory of that name
- added gphoto2_port(3) man page

* Sat May 18 2002 Hans Ulrich Niedermann <gp@n-dimensional.de> 2.0.1dev6-1
- added API HTML docs to the -devel package
- added man page gphoto2(3), require hotplug >= 2001_04_24-13

* Thu May  9 2002 Hans Ulrich Niedermann <gp@n-dimensional.de> 2.0.1dev4-1
- merged changes from current Redhat spec file into gphoto2 distribution
  as they managed to get the beast to build
- re-added FAQ to package (Redhat left it out regrettably)
- only require hotplug 2001_04_24-11 instead of 2001_04_24-13

* Mon Apr 29 2002 Tim Waugh <twaugh@redhat.com> 2.0-6
- In fact, don't even build for mainframe.

* Mon Apr 29 2002 Florian La Roche <Florian.LaRoche@redhat.de> 2.0-5
- do not require hotplug for mainframe

* Mon Apr 15 2002 Nalin Dahyabhai <nalin@redhat.com> 2.0-4
- Set the owner of the device to the console lock holder, not the owner
  of /dev/console, in the hotplug agent, fixing access for users who log
  in at VTs and use startx (#62976).

* Fri Apr 12 2002 Tim Waugh <twaugh@redhat.com> 2.0-3
- Rebuild (fixed bug #63355).

* Sat Apr 06 2002 Hans Ulrich Niedermann <gp@n-dimensional.de>
- require libusb >= 0.0.5 and for building require transfig

* Wed Feb 27 2002 Tim Waugh <twaugh@redhat.com> 2.0-2
- Fix from CVS: close port unconditionally in gp_camera_exit().

* Mon Feb 25 2002 Tim Waugh <twaugh@redhat.com> 2.0-1
- 2.0 is released.
- Ship the .so symlinks in the devel package.

* Mon Feb 25 2002 Tim Waugh <twaugh@redhat.com> 2.0-0.rc4.1
- 2.0rc4.

* Fri Feb 22 2002 Tim Waugh <twaugh@redhat.com> 2.0-0.rc3.1
- 2.0rc3.  No longer need CVS patch.
- Build no longer requires xmlto.

* Thu Feb 21 2002 Tim Waugh <twaugh@redhat.com> 2.0-0.rc2.2
- Fix DC240 hangs (patch from CVS).
- Rebuild in new environment.

* Tue Feb 19 2002 Tim Waugh <twaugh@redhat.com> 2.0-0.rc2.1
- 2.0rc2 (bug #59993).  No longer need docs patch or man page.
- Really fix up libtool libraries (bug #60002).

* Fri Feb 15 2002 Tim Waugh <twaugh@redhat.com> 2.0-0.beta5.2
- PreReq /sbin/ldconfig, grep, and fileutils (bug #59941).

* Tue Feb 12 2002 Tim Waugh <twaugh@redhat.com> 2.0-0.beta5.1
- 2.0beta5.
- Fix Makefiles so that documentation can be built.
- Ship pkgconfig file.
- Add man page.

* Thu Feb  7 2002 Tim Waugh <twaugh@redhat.com> 2.0-0.beta4.1
- 2.0beta4.
- Build requires transfig, and at least version 0.1.5 of libusb.
- Clean up file lists.
- Build documentation.

* Fri Jan 25 2002 Tim Waugh <twaugh@redhat.com> 2.0-0.beta3.2
- Rebuild in new environment.
- Dump docbook-dtd30-sgml requirement; gtk-doc is sufficient.

* Sun Nov 18 2001 Tim Waugh <twaugh@redhat.com> 2.0-0.beta3.1
- Adapted for Red Hat Linux.

* Sat Oct 27 2001 Hans Ulrich Niedermann <gp@n-dimensional.de>
- fixed update behaviour for hotplug list (do not erase it when updating)

* Thu Oct 25 2001 Tim Waugh <twaugh@redhat.com>
- hotplug dependency is a prereq not a requires (the package scripts
  need it)

* Sun Oct 14 2001 Hans Ulrich Niedermann <gp@n-dimensional.de>
- integrated spec file into source package

* Sun Oct 14 2001 Hans Ulrich Niedermann <gp@n-dimensional.de>
- 2.0beta3

* Tue Oct  2 2001 Tim Waugh <twaugh@redhat.com> 2.0beta2-0.1
- Adapted for Red Hat Linux.
- 2.0beta2.

* Mon Aug  6 2001 Till Kamppeter <till@mandrakesoft.com> 2.0-0.beta1.2mdk
- Corrected "Requires:"

* Mon Aug  6 2001 Till Kamppeter <till@mandrakesoft.com> 2.0-0.beta1.1mdk
- Initial release



########################################################################
# Local Variables:
# mode: rpm-spec
# End: