f9fe70d21c67ecd1e54a5d41ad047194e56d8b1f
[openwrt/svn-archive/archive.git] / libs / libjpeg / Makefile
1 #
2 # Copyright (C) 2006 OpenWrt.org
3 #
4 # This is free software, licensed under the GNU General Public License v2.
5 # See /LICENSE for more information.
6 #
7 # $Id$
8
9 include $(TOPDIR)/rules.mk
10
11 PKG_NAME:=jpeg
12 PKG_VERSION:=6b
13 PKG_RELEASE:=1
14
15 PKG_SOURCE:=$(PKG_NAME)src.v$(PKG_VERSION).tar.gz
16 PKG_SOURCE_URL:=http://www.ijg.org/files/ \
17 ftp://ftp.uu.net/graphics/jpeg/
18 PKG_MD5SUM:=dbd5f3b47ed13132f04c685d608a7547
19 PKG_CAT:=zcat
20
21 PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(PKG_VERSION)
22 PKG_INSTALL_DIR:=$(PKG_BUILD_DIR)/ipkg-install
23
24 PKG_BUILDDEP:=libtool
25
26 include $(INCLUDE_DIR)/package.mk
27
28 define Package/jpeg/Default
29 TITLE:=The Independent JPEG Group's JPEG
30 URL:=http://www.ijg.org/
31 endef
32
33 define Package/libjpeg
34 $(call Package/jpeg/Default)
35 SECTION:=libs
36 CATEGORY:=Libraries
37 TITLE+= runtime library
38 endef
39
40 define Package/jpeg-tools
41 $(call Package/jpeg/Default)
42 SECTION:=utils
43 CATEGORY:=Utilities
44 DEPENDS:=+libjpeg
45 TITLE+= manipulation tools
46 endef
47
48 define Build/Prepare
49 $(call Build/Prepare/Default)
50 # replace the old upstream libtool stuff with our own
51 ln -sf $(STAGING_DIR)/usr/bin/libtool $(PKG_BUILD_DIR)/
52 ln -sf $(STAGING_DIR)/usr/share/libtool/config.guess $(PKG_BUILD_DIR)/
53 ln -sf /bin/true $(PKG_BUILD_DIR)/ltconfig
54 endef
55
56 define Build/Configure
57 $(call Build/Configure/Default, \
58 --enable-shared \
59 --enable-static \
60 )
61 endef
62
63 define Build/Compile
64 rm -rf $(PKG_INSTALL_DIR)
65 mkdir -p $(PKG_INSTALL_DIR)/usr/{include,lib,bin,man/man1}
66 $(MAKE) -C $(PKG_BUILD_DIR) \
67 prefix="$(PKG_INSTALL_DIR)/usr" \
68 exec_prefix="$(PKG_INSTALL_DIR)/usr" \
69 all install-headers install-lib install
70 endef
71
72 define Build/InstallDev
73 mkdir -p $(STAGING_DIR)/usr/include
74 $(CP) $(PKG_INSTALL_DIR)/usr/include/jpeglib.h $(STAGING_DIR)/usr/include/
75 $(CP) $(PKG_BUILD_DIR)/jpegint.h $(STAGING_DIR)/usr/include/
76 $(CP) $(PKG_INSTALL_DIR)/usr/include/j{config,error,morecfg}.h $(STAGING_DIR)/usr/include/
77 mkdir -p $(STAGING_DIR)/usr/lib
78 $(CP) $(PKG_INSTALL_DIR)/usr/lib/libjpeg.{a,so*} $(STAGING_DIR)/usr/lib/
79 endef
80
81 define Build/UninstallDev
82 rm -rf \
83 $(STAGING_DIR)/usr/include/jpeg{int,lib}.h \
84 $(STAGING_DIR)/usr/include/j{config,error,morecfg}.h \
85 $(STAGING_DIR)/usr/lib/libjpeg.{a,so*}
86 endef
87
88 define Package/libjpeg/install
89 install -d -m0755 $(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 -d -m0755 $(1)/usr/bin
95 $(CP) $(PKG_INSTALL_DIR)/usr/bin/*jpeg* $(1)/usr/bin/
96 endef
97
98 $(eval $(call BuildPackage,libjpeg))
99 $(eval $(call BuildPackage,jpeg-tools))