[packages] make libintl and libiconv stub/full implementations switchable, use the...
[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 include $(INCLUDE_DIR)/nls.mk
24
25 define Package/libgphoto2/Default
26   SECTION:=libs
27   CATEGORY:=Libraries
28   URL:=http://www.gphoto.org/
29 endef
30
31 define Package/libgphoto2
32   $(call Package/libgphoto2/Default)
33   DEPENDS:=+libusb +libexif +libjpeg +libpthread +libltdl $(ICONV_DEPENDS)
34   TITLE:=The basic library of the gphoto2 program.
35   MENU:=1
36 endef
37
38 define Package/libgphoto2-drivers
39   $(call Package/libgphoto2/Default)
40   DEPENDS:=libgphoto2
41   TITLE:=Gphoto2 drivers for various cameras
42 endef
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$(ICONV_PREFIX)/include" \
55         LDFLAGS="$$$$LDFLAGS -L$(ICONV_PREFIX)/lib" \
56         LIBEXIF_CFLAGS="$$$$CPPFLAGS" \
57         LIBEXIF_LIBS="$$$$LDFLAGS -lexif" \
58         LIBUSB_CFLAGS="$$$$CPPFLAGS" \
59         LIBUSB_LIBS="$$$$LDFLAGS -lusb" \
60         LIBS="-lltdl" \
61
62 MAKE_FLAGS += \
63         LIBLTDL="" \
64
65 TARGET_CFLAGS += $(FPIC)
66
67 define Build/InstallDev
68         $(INSTALL_DIR) $(1)/usr/bin
69         $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/gphoto2{,-port}-config $(1)/usr/bin/
70         $(INSTALL_DIR) $(1)/usr/include
71         $(CP) $(PKG_INSTALL_DIR)/usr/include/gphoto2 $(1)/usr/include/
72         $(INSTALL_DIR) $(1)/usr/lib
73         $(CP) $(PKG_INSTALL_DIR)/usr/lib/libgphoto2{,_port}.{a,so*} $(1)/usr/lib/
74         $(INSTALL_DIR) $(1)/usr/lib/pkgconfig
75         $(CP) $(PKG_INSTALL_DIR)/usr/lib/pkgconfig/libgphoto2.pc $(1)/usr/lib/pkgconfig/
76         $(SED) 's,-I$$$${prefix}/include/gphoto2,,g' $(1)/usr/bin/gphoto2{,-port}-config
77         $(SED) 's,-I$$$${prefix}/include,,g' $(1)/usr/bin/gphoto2{,-port}-config
78         # remove annoying recursive symlink
79         rm -f $(1)/usr/include/gphoto2/gphoto2
80 endef
81
82 define Package/libgphoto2/install
83         $(INSTALL_DIR) $(1)/usr/lib
84         $(CP) $(PKG_INSTALL_DIR)/usr/lib/libgphoto2{,_port}.so.* $(1)/usr/lib/
85 endef
86
87 define Package/libgphoto2-drivers/install
88         $(INSTALL_DIR) $(1)/usr/lib/
89         $(CP) $(PKG_INSTALL_DIR)/usr/lib/libgphoto2{,_port} $(1)/usr/lib/
90         rm -rf $(1)/usr/lib/libgphoto2{,_port}/*/*.{,l}a
91 endef
92
93 $(eval $(call BuildPackage,libgphoto2))
94 $(eval $(call BuildPackage,libgphoto2-drivers))