Remove the atk*.def file.
[fedora-mingw.git] / libjpeg / mingw32-libjpeg.spec
1 %define __strip %{_mingw32_strip}
2 %define __objdump %{_mingw32_objdump}
3 %define _use_internal_dependency_generator 0
4 %define __find_requires %{_mingw32_findrequires}
5 %define __find_provides %{_mingw32_findprovides}
6
7 # Build the programs like cjpeg, etc.
8 # https://bugzilla.redhat.com/show_bug.cgi?id=467401c7
9 %define build_programs 0
10
11 Name:           mingw32-libjpeg
12 Version:        6b
13 Release:        8%{?dist}
14 Summary:        MinGW Windows Libjpeg library
15
16 License:        IJG
17 URL:            http://www.ijg.org/
18 Group:          Development/Libraries
19 BuildRoot:      %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
20 Source0:        ftp://ftp.uu.net/graphics/jpeg/jpegsrc.v%{version}.tar.gz
21 Source1:        configure.in
22
23 Patch1:         jpeg-c++.patch
24 Patch4:         libjpeg-cflags.patch
25 Patch5:         libjpeg-buf-oflo.patch
26 Patch6:         libjpeg-autoconf.patch
27
28 Patch100:       jpeg-mingw32.patch
29
30 BuildArch:      noarch
31
32 BuildRequires:  mingw32-filesystem >= 23
33 BuildRequires:  mingw32-dlfcn
34 BuildRequires:  mingw32-gcc
35 BuildRequires:  mingw32-binutils
36 BuildRequires:  mingw32-libpng
37 BuildRequires:  mingw32-zlib
38 BuildRequires:  autoconf, libtool
39
40
41 %description
42 MinGW Windows Libjpeg library.
43
44
45 %prep
46 %setup -q -n jpeg-6b
47
48 %patch1 -p1 -b .c++
49 %patch4 -p1 -b .cflags
50 %patch5 -p1 -b .oflo
51 %patch6 -p1
52
53 %patch100 -p1
54
55 # For long-obsolete reasons, libjpeg 6b doesn't ship with a configure.in.
56 # We need to re-autoconf though, in order to update libtool support,
57 # so supply configure.in.
58 cp %{SOURCE1} configure.in
59
60 # libjpeg 6b includes a horribly obsolete version of libtool.
61 # Blow it away and replace with build system's version.
62 rm -f config.guess config.sub ltmain.sh ltconfig aclocal.m4
63
64 cat /usr/share/aclocal/libtool.m4 > aclocal.m4
65 # If this is the new libtool 2.x, we need to append some additional
66 # files.  Rather than hard-coding a version of libtool, just test
67 # if the files exist and append them:
68 for f in \
69   /usr/share/aclocal/ltoptions.m4 \
70   /usr/share/aclocal/ltversion.m4 \
71   /usr/share/aclocal/ltsugar.m4 \
72   /usr/share/aclocal/lt~obsolete.m4; do
73   if [ -f $f ]; then cat $f >> aclocal.m4; fi
74 done
75
76 # Now we can run libtool.
77 libtoolize
78
79 # Automake can fail - we only need this to get config.sub and config.guess.
80 automake -a ||:
81
82 # Finally because we replaced configure.in:
83 autoconf
84
85
86 %build
87 %{_mingw32_configure} --enable-shared --disable-static
88 make %{?_smp_mflags}
89
90
91 %install
92 rm -rf $RPM_BUILD_ROOT
93
94 mkdir -p $RPM_BUILD_ROOT%{_mingw32_bindir}
95 mkdir -p $RPM_BUILD_ROOT%{_mingw32_includedir}
96 mkdir -p $RPM_BUILD_ROOT%{_mingw32_libdir}
97 mkdir -p $RPM_BUILD_ROOT%{_mingw32_mandir}/man1
98
99 %{_mingw32_makeinstall}
100
101 # Remove manual pages which duplicate Fedora native.
102 rm -rf $RPM_BUILD_ROOT%{_mingw32_mandir}
103
104 pushd $RPM_BUILD_ROOT%{_mingw32_bindir}
105 # Rename or remove win32 native binaries
106 for i in cjpeg djpeg jpegtran rdjpgcom wrjpgcom ; do
107 %if %build_programs
108    mv $i $i.exe
109 %else
110    rm $i
111 %endif
112 done
113 popd
114
115
116 %clean
117 rm -rf $RPM_BUILD_ROOT
118
119
120 %files
121 %defattr(-,root,root)
122 %doc README
123 %if %build_programs
124 %{_mingw32_bindir}/cjpeg.exe
125 %{_mingw32_bindir}/djpeg.exe
126 %{_mingw32_bindir}/jpegtran.exe
127 %{_mingw32_bindir}/rdjpgcom.exe
128 %{_mingw32_bindir}/wrjpgcom.exe
129 %endif
130 %{_mingw32_bindir}/libjpeg-62.dll
131 %{_mingw32_includedir}/jconfig.h
132 %{_mingw32_includedir}/jerror.h
133 %{_mingw32_includedir}/jmorecfg.h
134 %{_mingw32_includedir}/jpeglib.h
135 %{_mingw32_libdir}/libjpeg.dll.a
136 %{_mingw32_libdir}/libjpeg.la
137
138
139 %changelog
140 * Wed Jan 28 2009 Richard W.M. Jones <rjones@redhat.com> - 6b-8
141 - Exclude the binaries.
142 - Rename the binaries to *.exe (Levente Farkas).
143
144 * Fri Jan 23 2009 Richard W.M. Jones <rjones@redhat.com> - 6b-7
145 - Disable static libraries.
146 - Use _smp_mflags.
147 - Update for new libtool 2.
148 - +BR mingw32-dlfcn.
149 - Added documentation (README includes the license).
150
151 * Thu Nov 20 2008 Richard W.M. Jones <rjones@redhat.com> - 6b-6
152 - Don't set libdir in the make step.
153 - Fix path to mandir.
154
155 * Wed Sep 24 2008 Richard W.M. Jones <rjones@redhat.com> - 6b-5
156 - Rename mingw -> mingw32.
157
158 * Mon Sep 22 2008 Daniel P. Berrange <berrange@redhat.com> - 6b-4
159 - Switch to tar.bz2 source, and rename configure.in
160
161 * Sun Sep 21 2008 Daniel P. Berrange <berrange@redhat.com> - 6b-3
162 - Fix URL.
163 - Remove manpages which duplicate Fedora native.
164
165 * Wed Sep 10 2008 Daniel P. Berrange <berrange@redhat.com> - 6b-2
166 - Rename configure.in with a prefix.
167 - Remove static library.
168
169 * Tue Sep  9 2008 Daniel P. Berrange <berrange@redhat.com> - 6b-1
170 - Initial RPM release