[8.09] merge r17680
[openwrt/svn-archive/archive.git] / libs / libgphoto2 / Makefile
1 #
2 # Copyright (C) 2006-2008 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.4.1
13 PKG_RELEASE:=1
14
15 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2
16 PKG_SOURCE_URL:=@SF/gphoto
17 PKG_MD5SUM:=70c7d2c3e84997f29b4e988e56bd02aa
18
19 PKG_FIXUP = libtool
20
21 include $(INCLUDE_DIR)/package.mk
22
23 define Package/libgphoto2/Default
24 SECTION:=libs
25 CATEGORY:=Libraries
26 URL:=http://www.gphoto.org/
27 endef
28
29 define Package/libgphoto2
30 $(call Package/libgphoto2/Default)
31 DEPENDS:=+libusb +libexif +libjpeg +libpthread +libltdl +libiconv
32 TITLE:=The basic library of the gphoto2 program.
33 MENU:=1
34 endef
35
36 define Package/libgphoto2-drivers
37 $(call Package/libgphoto2/Default)
38 DEPENDS:=libgphoto2
39 TITLE:=Gphoto2 drivers for various cameras
40 endef
41
42 TARGET_CFLAGS += $(FPIC)
43
44 CONFIGURE_ARGS += \
45 --enable-shared \
46 --enable-static \
47 --disable-rpath \
48 --with-drivers=all \
49 --without-included-ltdl \
50 --without-libiconv-prefix \
51 --without-libintl-prefix \
52
53 CONFIGURE_VARS += \
54 CPPFLAGS="$$$$CPPFLAGS -I$(STAGING_DIR)/usr/lib/libiconv/include" \
55 LDFLAGS="$$$$LDFLAGS -L$(STAGING_DIR)/usr/lib/libiconv/lib" \
56 LIBEXIF_CFLAGS="$$$$CPPFLAGS" \
57 LIBEXIF_LIBS="$$$$LDFLAGS -lexif" \
58 LIBUSB_CFLAGS="$$$$CPPFLAGS" \
59 LIBUSB_LIBS="$$$$LDFLAGS -lusb" \
60 LIBS="-lltdl" \
61
62 define Build/Compile
63 $(MAKE) -C $(PKG_BUILD_DIR) \
64 DESTDIR="$(PKG_INSTALL_DIR)" \
65 LIBLTDL="" \
66 all install
67 endef
68
69 define Build/InstallDev
70 mkdir -p $(1)/usr/bin
71 $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/gphoto2{,-port}-config $(1)/usr/bin/
72 mkdir -p $(1)/usr/include
73 $(CP) $(PKG_INSTALL_DIR)/usr/include/gphoto2 $(1)/usr/include/
74 mkdir -p $(1)/usr/lib
75 $(CP) $(PKG_INSTALL_DIR)/usr/lib/libgphoto2{,_port}.{a,so*} $(1)/usr/lib/
76 mkdir -p $(1)/usr/lib/pkgconfig
77 $(CP) $(PKG_INSTALL_DIR)/usr/lib/pkgconfig/libgphoto2.pc $(1)/usr/lib/pkgconfig/
78 $(SED) 's,-I$$$${prefix}/include/gphoto2,,g' $(1)/usr/bin/gphoto2{,-port}-config
79 $(SED) 's,-I$$$${prefix}/include,,g' $(1)/usr/bin/gphoto2{,-port}-config
80 # remove annoying recursive symlink
81 rm -f $(1)/usr/include/gphoto2/gphoto2
82 endef
83
84 define Package/libgphoto2/install
85 $(INSTALL_DIR) $(1)/usr/lib
86 $(CP) $(PKG_INSTALL_DIR)/usr/lib/libgphoto2{,_port}.so.* $(1)/usr/lib/
87 endef
88
89 define Package/libgphoto2-drivers/install
90 $(INSTALL_DIR) $(1)/usr/lib/
91 $(CP) $(PKG_INSTALL_DIR)/usr/lib/libgphoto2{,_port} $(1)/usr/lib/
92 rm -rf $(1)/usr/lib/libgphoto2{,_port}/*/*.{,l}a
93 endef
94
95 $(eval $(call BuildPackage,libgphoto2))
96 $(eval $(call BuildPackage,libgphoto2-drivers))