Browse Source

libjpeg: import from oldpackages, add myself as maintainer, add fix for CVE-2013-6629, change PKG_LICENSE to SPDX identifier

Signed-off-by: Jo-Philipp Wich <jow@openwrt.org>
Jo-Philipp Wich 10 years ago
parent
commit
6a87c8d6a2

+ 100
- 0
libs/libjpeg/Makefile View File

@@ -0,0 +1,100 @@
1
+#
2
+# Copyright (C) 2006-2014 OpenWrt.org
3
+#
4
+# This is free software, licensed under the GNU General Public License v2.
5
+# See /LICENSE for more information.
6
+#
7
+
8
+include $(TOPDIR)/rules.mk
9
+
10
+PKG_NAME:=jpeg
11
+PKG_VERSION:=6b
12
+PKG_RELEASE:=1
13
+
14
+PKG_SOURCE:=$(PKG_NAME)src.v$(PKG_VERSION).tar.gz
15
+PKG_SOURCE_URL:=@SF/libjpeg
16
+PKG_MD5SUM:=dbd5f3b47ed13132f04c685d608a7547
17
+
18
+PKG_LICENSE:=IJG
19
+PKG_LICENSE_FILES:=README
20
+
21
+PKG_BUILD_PARALLEL:=1
22
+PKG_BUILD_DEPENDS:=libltdl
23
+
24
+include $(INCLUDE_DIR)/host-build.mk
25
+include $(INCLUDE_DIR)/package.mk
26
+
27
+define Package/jpeg/Default
28
+  TITLE:=The Independent JPEG Group's JPEG
29
+  URL:=http://www.ijg.org/
30
+endef
31
+
32
+define Package/libjpeg
33
+  $(call Package/jpeg/Default)
34
+  SECTION:=libs
35
+  CATEGORY:=Libraries
36
+  TITLE+= runtime library
37
+endef
38
+
39
+define Package/jpeg-tools
40
+  $(call Package/jpeg/Default)
41
+  SECTION:=utils
42
+  CATEGORY:=Utilities
43
+  DEPENDS:=+libjpeg
44
+  TITLE+= manipulation tools
45
+endef
46
+
47
+TARGET_CFLAGS += $(FPIC)
48
+
49
+CONFIGURE_ARGS += \
50
+	--enable-shared \
51
+	--enable-static \
52
+
53
+HOST_CONFIGURE_ARGS += \
54
+	--enable-shared \
55
+	--enable-static \
56
+
57
+define Build/Prepare
58
+	$(call Build/Prepare/Default)
59
+	(cd $(PKG_BUILD_DIR); \
60
+		rm -f ltconfig ltmain.sh libtool; \
61
+		ln -s `which true` ltconfig; \
62
+		ln -s $(STAGING_DIR)/host/bin/libtool libtool; \
63
+	)
64
+endef
65
+
66
+define Build/Compile
67
+	$(INSTALL_DIR) $(PKG_INSTALL_DIR)/usr/{include,lib,bin,man/man1}
68
+	+$(MAKE) $(PKG_JOBS) -C $(PKG_BUILD_DIR) \
69
+		LIBTOOL="./libtool --tag=CC" \
70
+		prefix="$(PKG_INSTALL_DIR)/usr" \
71
+		exec_prefix="$(PKG_INSTALL_DIR)/usr" \
72
+		all
73
+	$(MAKE) -C $(PKG_BUILD_DIR) \
74
+		prefix="$(PKG_INSTALL_DIR)/usr" \
75
+		exec_prefix="$(PKG_INSTALL_DIR)/usr" \
76
+		install install-headers install-lib
77
+endef
78
+
79
+define Build/InstallDev
80
+	$(INSTALL_DIR) $(1)/usr/include
81
+	$(CP) $(PKG_INSTALL_DIR)/usr/include/jpeglib.h $(1)/usr/include/
82
+	$(CP) $(PKG_BUILD_DIR)/jpegint.h $(1)/usr/include/
83
+	$(CP) $(PKG_INSTALL_DIR)/usr/include/j{config,error,morecfg}.h $(1)/usr/include/
84
+	$(INSTALL_DIR) $(1)/usr/lib
85
+	$(CP) $(PKG_INSTALL_DIR)/usr/lib/libjpeg.{a,so*} $(1)/usr/lib/
86
+endef
87
+
88
+define Package/libjpeg/install
89
+	$(INSTALL_DIR) $(1)/usr/lib
90
+	$(CP) $(PKG_INSTALL_DIR)/usr/lib/libjpeg.so.* $(1)/usr/lib/
91
+endef
92
+
93
+define Package/jpeg-tools/install
94
+	$(INSTALL_DIR) $(1)/usr/bin
95
+	$(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/*jpeg* $(1)/usr/bin/
96
+endef
97
+
98
+$(eval $(call HostBuild))
99
+$(eval $(call BuildPackage,libjpeg))
100
+$(eval $(call BuildPackage,jpeg-tools))

+ 11
- 0
libs/libjpeg/patches/001-allow-ccache.patch View File

@@ -0,0 +1,11 @@
1
+--- a/makefile.cfg
2
++++ b/makefile.cfg
3
+@@ -168,7 +168,7 @@ libjpeg.a: @A2K_DEPS@ $(LIBOBJECTS)
4
+ 
5
+ # with libtool:
6
+ libjpeg.la: @A2K_DEPS@ $(LIBOBJECTS)
7
+-	$(LIBTOOL) --mode=link $(CC) -o libjpeg.la $(LIBOBJECTS) \
8
++	$(LIBTOOL) --mode=link "$(CC)" -o libjpeg.la $(LIBOBJECTS) \
9
+ 		-rpath $(libdir) -version-info $(JPEG_LIB_VERSION)
10
+ 
11
+ # sample programs:

+ 1896
- 0
libs/libjpeg/patches/200-crop.patch
File diff suppressed because it is too large
View File


+ 15
- 0
libs/libjpeg/patches/300-CVE-2013-6629.patch View File

@@ -0,0 +1,15 @@
1
+--- a/jdmarker.c
2
++++ b/jdmarker.c
3
+@@ -342,6 +342,12 @@ get_sos (j_decompress_ptr cinfo)
4
+     
5
+     TRACEMS3(cinfo, 1, JTRC_SOS_COMPONENT, cc,
6
+ 	     compptr->dc_tbl_no, compptr->ac_tbl_no);
7
++
8
++    /* This CSi (cc) should differ from the previous CSi */
9
++    for (ci = 0; ci < i; ci++) {
10
++      if (cinfo->cur_comp_info[ci] == compptr)
11
++        ERREXIT1(cinfo, JERR_BAD_COMPONENT_ID, cc);
12
++    }
13
+   }
14
+ 
15
+   /* Collect the additional scan parameters Ss, Se, Ah/Al. */