rename libjpeg to jpeg (match source name), cleanup
[openwrt/svn-archive/archive.git] / libs / jpeg / 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_BUILD_DEPENDS:=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 CONFIGURE_ARGS += \
49 --enable-shared \
50 --enable-static \
51
52 define Build/Prepare
53 $(call Build/Prepare/Default)
54 # replace the old upstream libtool stuff with our own
55 ln -sf $(STAGING_DIR)/usr/bin/libtool $(PKG_BUILD_DIR)/
56 ln -sf $(STAGING_DIR)/usr/share/libtool/config.guess $(PKG_BUILD_DIR)/
57 ln -sf /bin/true $(PKG_BUILD_DIR)/ltconfig
58 endef
59
60 define Build/Configure
61 $(call Build/Configure/Default,)
62 endef
63
64 define Build/Compile
65 rm -rf $(PKG_INSTALL_DIR)
66 mkdir -p $(PKG_INSTALL_DIR)/usr/{include,lib,bin,man/man1}
67 $(MAKE) -C $(PKG_BUILD_DIR) \
68 LIBTOOL="./libtool --tag=CC" \
69 prefix="$(PKG_INSTALL_DIR)/usr" \
70 exec_prefix="$(PKG_INSTALL_DIR)/usr" \
71 all install install-headers install-lib
72 endef
73
74 define Build/InstallDev
75 mkdir -p $(STAGING_DIR)/usr/include
76 $(CP) $(PKG_INSTALL_DIR)/usr/include/jpeglib.h $(STAGING_DIR)/usr/include/
77 $(CP) $(PKG_BUILD_DIR)/jpegint.h $(STAGING_DIR)/usr/include/
78 $(CP) $(PKG_INSTALL_DIR)/usr/include/j{config,error,morecfg}.h $(STAGING_DIR)/usr/include/
79 mkdir -p $(STAGING_DIR)/usr/lib
80 $(CP) $(PKG_INSTALL_DIR)/usr/lib/libjpeg.{a,so*} $(STAGING_DIR)/usr/lib/
81 endef
82
83 define Build/UninstallDev
84 rm -rf $(STAGING_DIR)/usr/include/jpeg{int,lib}.h \
85 $(STAGING_DIR)/usr/include/j{config,error,morecfg}.h \
86 $(STAGING_DIR)/usr/lib/libjpeg.{a,so*}
87 endef
88
89 define Package/libjpeg/install
90 $(INSTALL_DIR) $(1)/usr/lib
91 $(CP) $(PKG_INSTALL_DIR)/usr/lib/libjpeg.so.* $(1)/usr/lib/
92 endef
93
94 define Package/jpeg-tools/install
95 $(INSTALL_DIR) $(1)/usr/bin
96 $(CP) $(PKG_INSTALL_DIR)/usr/bin/*jpeg* $(1)/usr/bin/
97 endef
98
99 $(eval $(call BuildPackage,libjpeg))
100 $(eval $(call BuildPackage,jpeg-tools))