- updated shared patch, replaced one pseudo-libtool hack with another using real...
[packages/crossmingw32-libjpeg.git] / crossmingw32-libjpeg.spec
1 %define         realname        libjpeg
2 Summary:        Library for handling different jpeg files - Mingw32 cross version
3 Summary(pl.UTF-8):      Biblioteka do manipulacji plikami w formacie jpeg - wersja skrośna dla Mingw32
4 Name:           crossmingw32-%{realname}
5 Version:        6b
6 Release:        5
7 License:        distributable
8 Group:          Development/Libraries
9 Source0:        ftp://ftp.uu.net/graphics/jpeg/jpegsrc.v%{version}.tar.gz
10 # Source0-md5:  dbd5f3b47ed13132f04c685d608a7547
11 Patch0:         %{realname}-DESTDIR.patch
12 Patch1:         %{realname}-include.patch
13 Patch2:         %{realname}-c++.patch
14 Patch3:         %{name}-shared.patch
15 URL:            http://www.ijg.org/
16 BuildRequires:  autoconf >= 2.50
17 BuildRequires:  automake
18 BuildRequires:  crossmingw32-gcc
19 BuildRequires:  libtool
20 Requires:       crossmingw32-runtime
21 BuildRoot:      %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
22
23 %define         no_install_post_strip   1
24
25 %define         target                  i386-mingw32
26 %define         target_platform         i386-pc-mingw32
27
28 %define         _sysprefix              /usr
29 %define         _prefix                 %{_sysprefix}/%{target}
30 %define         _libdir                 %{_prefix}/lib
31 %define         _dlldir                 /usr/share/wine/windows/system
32 %define         __cc                    %{target}-gcc
33 %define         __cxx                   %{target}-g++
34
35 %ifnarch %{ix86}
36 # arch-specific flags (like alpha's -mieee) are not valid for i386 gcc
37 %define         optflags        -O2
38 %endif
39
40 %description
41 The libjpeg package contains a library of functions for manipulating
42 JPEG images.
43
44 This package contains the cross version for Win32.
45
46 %description -l pl.UTF-8
47 Ten pakiet zawiera bibliotekę funkcji do manipulacji plikami jpeg.
48
49 Ten pakiet zawiera wersję skrośną dla Win32.
50
51 %package static
52 Summary:        Static libjpeg library (cross mingw32 version)
53 Summary(pl.UTF-8):      Statyczna biblioteka libjpeg (wersja skrośna mingw32)
54 Group:          Development/Libraries
55 Requires:       %{name} = %{version}-%{release}
56
57 %description static
58 Static libjpeg library (cross mingw32 version).
59
60 %description static -l pl.UTF-8
61 Statyczna biblioteka libjpeg (wersja skrośna mingw32).
62
63 %package dll
64 Summary:        libjpeg - DLL library for Windows
65 Summary(pl.UTF-8):      libjpeg - biblioteka DLL dla Windows
66 Group:          Applications/Emulators
67 Requires:       wine
68
69 %description dll
70 libjpeg - DLL library for Windows.
71
72 %description dll -l pl.UTF-8
73 libjpeg - biblioteka DLL dla Windows.
74
75 %prep
76 %setup -q -n jpeg-%{version}
77 %patch0 -p1
78 %patch1 -p1
79 %patch2 -p1
80 %patch3 -p1
81
82 cp /usr/share/automake/config.* .
83
84 # hack: use recent libtool by configuring for mingw32 in separate dir
85 # (cannot regenerate main ac/lt because of missing configure.in)
86 mkdir lthack
87 cd lthack
88 cat >configure.ac <<EOF
89 AC_INIT(lthack, 0)
90 AC_CONFIG_AUX_DIR(..)
91 AC_PROG_LIBTOOL
92 EOF
93
94 %build
95 cd lthack
96 %{__libtoolize}
97 %{__aclocal}
98 %{__autoconf}
99 %configure \
100         --target=%{target} \
101         --host=%{target}
102 cd ..
103
104 %configure \
105         --target=%{target} \
106         --host=%{target} \
107         --enable-shared \
108         --enable-static
109
110 cp -f lthack/libtool .
111
112 %{__make}
113
114 %install
115 rm -rf $RPM_BUILD_ROOT
116 install -d $RPM_BUILD_ROOT{%{_includedir},%{_libdir},%{_dlldir}}
117
118 %{__make} install-headers install-lib \
119         libdir=%{_libdir} \
120         DESTDIR=$RPM_BUILD_ROOT
121
122 install -d $RPM_BUILD_ROOT%{_dlldir}
123 mv -f $RPM_BUILD_ROOT%{_prefix}/bin/*.dll $RPM_BUILD_ROOT%{_dlldir}
124
125 %if 0%{!?debug:1}
126 %{target}-strip --strip-unneeded -R.comment -R.note $RPM_BUILD_ROOT%{_dlldir}/*.dll
127 %{target}-strip -g -R.comment -R.note $RPM_BUILD_ROOT%{_libdir}/*.a
128 %endif
129
130 %clean
131 rm -rf $RPM_BUILD_ROOT
132
133 %files
134 %defattr(644,root,root,755)
135 %doc README change.log
136 %{_libdir}/libjpeg.dll.a
137 %{_libdir}/libjpeg.la
138 %{_includedir}/jconfig.h
139 %{_includedir}/jerror.h
140 %{_includedir}/jmorecfg.h
141 %{_includedir}/jpeglib.h
142
143 %files static
144 %defattr(644,root,root,755)
145 %{_libdir}/libjpeg.a
146
147 %files dll
148 %defattr(644,root,root,755)
149 %{_dlldir}/libjpeg-*.dll
This page took 0.04351 seconds and 3 git commands to generate.