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