update libgphoto2 to v2.3.1 (closes: #1105), add dependency on libiconv
[openwrt/svn-archive/archive.git] / libs / libgphoto2 / 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:=libgphoto2
12 PKG_VERSION:=2.3.1
13 PKG_RELEASE:=1
14
15 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2
16 PKG_SOURCE_URL:=@SF/gphoto
17 PKG_MD5SUM:=37f85e34e5b6031ddf6cac8b8782ac4f
18 PKG_CAT:=bzcat
19
20 PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(PKG_VERSION)
21 PKG_INSTALL_DIR:=$(PKG_BUILD_DIR)/ipkg-install
22
23 include $(INCLUDE_DIR)/package.mk
24
25
26 define Package/libgphoto2/Default
27 SECTION:=libs
28 CATEGORY:=Libraries
29 URL:=http://www.gphoto.org/
30 endef
31
32 define Package/libgphoto2
33 $(call Package/libgphoto2/Default)
34 DEPENDS:=+libusb +libexif +libjpeg +libpthread +libltdl +libiconv
35 TITLE:=The basic library of the gphoto2 program.
36 MENU:=1
37 endef
38
39 define Package/libgphoto2-drivers
40 $(call Package/libgphoto2/Default)
41 DEPENDS:=libgphoto2
42 TITLE:=Gphoto2 drivers for various cameras
43 endef
44
45 define Build/Configure
46 $(call Build/Configure/Default, \
47 --enable-shared \
48 --enable-static \
49 --disable-rpath \
50 --with-drivers=all \
51 --without-included-ltdl \
52 --without-libiconv-prefix \
53 --without-libintl-prefix \
54 , \
55 CPPFLAGS="$$$$CPPFLAGS -I$(STAGING_DIR)/usr/lib/libiconv/include" \
56 LDFLAGS="$$$$LDFLAGS -L$(STAGING_DIR)/usr/lib/libiconv/lib" \
57 LIBEXIF_CFLAGS="$$$$CPPFLAGS" \
58 LIBEXIF_LIBS="$$$$LDFLAGS -lexif" \
59 LIBUSB_CFLAGS="$$$$CPPFLAGS" \
60 LIBUSB_LIBS="$$$$LDFLAGS -lusb" \
61 LIBS="-lltdl" \
62 )
63 endef
64
65 define Build/Compile
66 $(MAKE) -C $(PKG_BUILD_DIR) -j$(CONFIG_JLEVEL) \
67 DESTDIR="$(PKG_INSTALL_DIR)" \
68 LIBLTDL="" \
69 all install
70 endef
71
72 define Build/InstallDev
73 mkdir -p $(STAGING_DIR)/usr/bin
74 $(CP) $(PKG_INSTALL_DIR)/usr/bin/gphoto2{,-port}-config $(STAGING_DIR)/usr/bin/
75 mkdir -p $(STAGING_DIR)/usr/include
76 $(CP) $(PKG_INSTALL_DIR)/usr/include/gphoto2 $(STAGING_DIR)/usr/include/
77 mkdir -p $(STAGING_DIR)/usr/lib
78 $(CP) $(PKG_INSTALL_DIR)/usr/lib/libgphoto2{,_port}.{a,so*} $(STAGING_DIR)/usr/lib/
79 mkdir -p $(STAGING_DIR)/usr/lib/pkgconfig
80 $(CP) $(PKG_INSTALL_DIR)/usr/lib/pkgconfig/libgphoto2.pc $(STAGING_DIR)/usr/lib/pkgconfig/
81 $(SED) 's,-I$$$${prefix}/include/gphoto2,,g' $(STAGING_DIR)/usr/bin/gphoto2{,-port}-config
82 $(SED) 's,-I$$$${prefix}/include,,g' $(STAGING_DIR)/usr/bin/gphoto2{,-port}-config
83 $(SED) 's,-L$$$${exec_prefix}/lib,,g' $(STAGING_DIR)/usr/lib/pkgconfig/libgphoto2.pc
84 $(SED) 's,-I$$$${includedir}/gphoto2,,g' $(STAGING_DIR)/usr/lib/pkgconfig/libgphoto2.pc
85 $(SED) 's,-L$$$${libdir},,g' $(STAGING_DIR)/usr/lib/pkgconfig/libgphoto2.pc
86 endef
87
88 define Build/UninstallDev
89 rm -rf \
90 $(STAGING_DIR)/usr/bin/gphoto2-config \
91 $(STAGING_DIR)/usr/bin/gphoto2-port-config \
92 $(STAGING_DIR)/usr/include/gphoto2* \
93 $(STAGING_DIR)/usr/lib/libgphoto*.{a,so*}
94 endef
95
96 define Package/libgphoto2/install
97 $(INSTALL_DIR) $(1)/usr/lib
98 $(CP) $(PKG_INSTALL_DIR)/usr/lib/libgphoto2{,_port}.so.* $(1)/usr/lib/
99 endef
100
101 define Package/libgphoto2-drivers/install
102 $(INSTALL_DIR) $(1)/usr/lib/
103 $(CP) $(PKG_INSTALL_DIR)/usr/lib/libgphoto2{,_port} $(1)/usr/lib/
104 rm -rf $(1)/usr/lib/libgphoto2{,_port}/*/*.{,l}a
105 endef
106
107 $(eval $(call BuildPackage,libgphoto2))
108 $(eval $(call BuildPackage,libgphoto2-drivers))