diff --git a/.cvsignore b/.cvsignore index e69de29..4b7b6df 100644 --- a/.cvsignore +++ b/.cvsignore @@ -0,0 +1 @@ +jasper-1.900.1.zip diff --git a/import.log b/import.log new file mode 100644 index 0000000..339736b --- /dev/null +++ b/import.log @@ -0,0 +1 @@ +mingw32-jasper-1_900_1-8_fc11:EL-5:mingw32-jasper-1.900.1-8.fc11.src.rpm:1236973799 diff --git a/jasper-1.900.1-mingw32.patch b/jasper-1.900.1-mingw32.patch new file mode 100644 index 0000000..f388349 --- /dev/null +++ b/jasper-1.900.1-mingw32.patch @@ -0,0 +1,12 @@ +diff -rup jasper-1.900.1.orig/src/libjasper/Makefile.in jasper-1.900.1.new/src/libjasper/Makefile.in +--- jasper-1.900.1.orig/src/libjasper/Makefile.in 2007-01-19 16:54:45.000000000 -0500 ++++ jasper-1.900.1.new/src/libjasper/Makefile.in 2008-09-09 10:08:43.000000000 -0400 +@@ -290,7 +290,7 @@ libjasper_la_LIBADD = \ + + # -release $(LT_RELEASE) + libjasper_la_LDFLAGS = \ +- -version-info $(LT_CURRENT):$(LT_REVISION):$(LT_AGE) ++ -no-undefined -version-info $(LT_CURRENT):$(LT_REVISION):$(LT_AGE) + + all: all-recursive + diff --git a/jasper-1.900.1-sleep.patch b/jasper-1.900.1-sleep.patch new file mode 100644 index 0000000..b647e48 --- /dev/null +++ b/jasper-1.900.1-sleep.patch @@ -0,0 +1,18 @@ +diff -rup jasper-1.900.1/src/appl/tmrdemo.c jasper-1.900.1.new/src/appl/tmrdemo.c +--- jasper-1.900.1/src/appl/tmrdemo.c 2007-01-19 16:43:08.000000000 -0500 ++++ jasper-1.900.1.new/src/appl/tmrdemo.c 2008-09-09 09:14:21.000000000 -0400 +@@ -1,4 +1,5 @@ + #include ++#include + + int main(int argc, char **argv) + { +@@ -43,7 +44,7 @@ int main(int argc, char **argv) + printf("zero time %.3f us\n", t * 1e6); + + jas_tmr_start(&tmr); +- sleep(1); ++ Sleep(1); + jas_tmr_stop(&tmr); + t = jas_tmr_get(&tmr); + printf("time delay %.8f s\n", t); diff --git a/mingw32-jasper.spec b/mingw32-jasper.spec new file mode 100644 index 0000000..8896784 --- /dev/null +++ b/mingw32-jasper.spec @@ -0,0 +1,122 @@ +%define __strip %{_mingw32_strip} +%define __objdump %{_mingw32_objdump} +%define _use_internal_dependency_generator 0 +%define __find_requires %{_mingw32_findrequires} +%define __find_provides %{_mingw32_findprovides} + +Name: mingw32-jasper +Version: 1.900.1 +Release: 8%{?dist} +Summary: MinGW Windows Jasper library + +License: JasPer +Group: Development/Libraries + +URL: http://www.ece.uvic.ca/~mdadams/jasper/ +Source0: http://www.ece.uvic.ca/~mdadams/jasper/software/jasper-%{version}.zip + +# Patches from Fedora native package. +# OpenGL is disabled in this build, so we don't need this patch: +#Patch1: jasper-1.701.0-GL.patch +# Note patch2 appears in native package, but is not applied: +#Patch2: jasper-1.701.0-GL-ac.patch +Patch3: patch-libjasper-stepsizes-overflow.diff + +# MinGW-specific patches. +# This patch adds '-no-undefined' flag to libtool line: +Patch1000: jasper-1.900.1-mingw32.patch +# This patch is a bit of a hack, but it's just there to fix a demo program: +Patch1001: jasper-1.900.1-sleep.patch + +BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n) +BuildArch: noarch + +BuildRequires: mingw32-filesystem >= 23 +BuildRequires: mingw32-gcc +BuildRequires: mingw32-binutils +BuildRequires: mingw32-libjpeg +BuildRequires: mingw32-dlfcn + + +%description +MinGW Windows Jasper library. + + +%prep +%setup -q -n jasper-%{version} +%patch3 -p1 -b .CVE-2007-2721 + +%patch1000 -p1 -b .mingw32 +%patch1001 -p1 -b .sleep + + +%build +%{_mingw32_configure} \ + --disable-opengl --enable-libjpeg --disable-static --enable-shared +make %{?_smp_mflags} + + +%install +rm -rf $RPM_BUILD_ROOT + +make DESTDIR=$RPM_BUILD_ROOT install mandir=%{_mingw32_mandir} + +# Remove the manual pages - don't duplicate documentation which +# is in the native Fedora package. +rm $RPM_BUILD_ROOT%{_mingw32_mandir}/man1/* + + +%clean +rm -rf $RPM_BUILD_ROOT + + +%files +%defattr(-,root,root,-) +%doc COPYRIGHT LICENSE NEWS README +%{_mingw32_bindir}/i686-pc-mingw32-imgcmp.exe +%{_mingw32_bindir}/i686-pc-mingw32-imginfo.exe +%{_mingw32_bindir}/i686-pc-mingw32-jasper.exe +%{_mingw32_bindir}/i686-pc-mingw32-tmrdemo.exe +%{_mingw32_bindir}/libjasper-1.dll +%{_mingw32_libdir}/libjasper.dll.a +%{_mingw32_libdir}/libjasper.la +%{_mingw32_includedir}/jasper/ + + +%changelog +* Mon Mar 9 2009 Richard W.M. Jones - 1.900.1-8 +- Fix defattr line. +- Remove the enable-shared patch, and just use --enable-shared on + the configure line. +- Disable the GL patch since OpenGL is disabled. +- Document what the patches are for in the spec file. +- Only patch Makefile.in so we don't have to rerun autotools, and + remove autotools dependency. + +* Fri Feb 20 2009 Richard W.M. Jones - 1.900.1-7 +- Rebuild for mingw32-gcc 4.4 + +* Fri Jan 23 2009 Richard W.M. Jones - 1.900.1-6 +- Use _smp_mflags. +- Disable static libraries. +- Include documentation. +- Use the same patches as Fedora native package. +- Just run autoconf instead of autoreconf so we don't upgrade libtool. +- +BR mingw32-dlfcn. +- Don't need the manual pages. + +* Wed Sep 24 2008 Richard W.M. Jones - 1.900.1-5 +- Rename mingw -> mingw32. + +* Mon Sep 22 2008 Daniel P. Berrange - 1.900.1-4 +- Add overflow patch from rawhide + +* Thu Sep 11 2008 Daniel P. Berrange - 1.900.1-3 +- Run autoreconf after changing configure.ac script and add BRs for autotools + +* Wed Sep 10 2008 Richard W.M. Jones - 1.900.1-2 +- Enable DLLs. +- Remove static libraries. + +* Tue Sep 9 2008 Daniel P. Berrange - 1.900.1-1 +- Initial RPM release diff --git a/patch-libjasper-stepsizes-overflow.diff b/patch-libjasper-stepsizes-overflow.diff new file mode 100644 index 0000000..097559f --- /dev/null +++ b/patch-libjasper-stepsizes-overflow.diff @@ -0,0 +1,14 @@ +--- jasper-1.900.1.orig/src/libjasper/jpc/jpc_cs.c 2007-01-19 22:43:07.000000000 +0100 ++++ jasper-1.900.1/src/libjasper/jpc/jpc_cs.c 2007-04-06 01:29:02.000000000 +0200 +@@ -982,7 +982,10 @@ static int jpc_qcx_getcompparms(jpc_qcxc + compparms->numstepsizes = (len - n) / 2; + break; + } +- if (compparms->numstepsizes > 0) { ++ if (compparms->numstepsizes > 3 * JPC_MAXRLVLS + 1) { ++ jpc_qcx_destroycompparms(compparms); ++ return -1; ++ } else if (compparms->numstepsizes > 0) { + compparms->stepsizes = jas_malloc(compparms->numstepsizes * + sizeof(uint_fast16_t)); + assert(compparms->stepsizes); diff --git a/sources b/sources index e69de29..5b418e1 100644 --- a/sources +++ b/sources @@ -0,0 +1 @@ +a342b2b4495b3e1394e161eb5d85d754 jasper-1.900.1.zip