f0afc4314daca48e985025c9143f27a2cb5829ac
[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.2.1
13 PKG_RELEASE:=1
14
15 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2
16 PKG_SOURCE_URL:=@SF/gphoto
17 PKG_MD5SUM:=69827311733e39fafa9f77bb05e55b77
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
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 BIG_ENDIAN:=no
46 ifeq ($(CONFIG_BIG_ENDIAN),y)
47 BIG_ENDIAN:=yes
48 endif
49
50 define Build/Configure
51 $(call Build/Configure/Default, \
52 --enable-shared \
53 --enable-static \
54 --disable-rpath \
55 --with-gnu-ld \
56 --with-drivers=all \
57 --without-included-ltdl \
58 --without-libiconv-prefix \
59 --without-libintl-prefix \
60 , \
61 LIBEXIF_CFLAGS="$$$$CPPFLAGS" \
62 LIBEXIF_LIBS="$$$$LDFLAGS -lexif" \
63 LIBUSB_CFLAGS="$$$$CPPFLAGS" \
64 LIBUSB_LIBS="$$$$LDFLAGS -lusb" \
65 LIBS="-lltdl" \
66 ac_cv_c_gettext_without_libintl=yes \
67 ac_cv_c_bigendian=$(BIG_ENDIAN) \
68 )
69 endef
70
71 define Build/Compile
72 $(MAKE) -C $(PKG_BUILD_DIR) -j$(CONFIG_JLEVEL) \
73 DESTDIR="$(PKG_INSTALL_DIR)" \
74 LIBLTDL="" \
75 all install
76 endef
77
78 define Build/InstallDev
79 mkdir -p $(STAGING_DIR)/usr/bin
80 $(CP) $(PKG_INSTALL_DIR)/usr/bin/gphoto2{,-port}-config $(STAGING_DIR)/usr/bin/
81 mkdir -p $(STAGING_DIR)/usr/include
82 $(CP) $(PKG_INSTALL_DIR)/usr/include/gphoto2 $(STAGING_DIR)/usr/include/
83 mkdir -p $(STAGING_DIR)/usr/lib
84 $(CP) $(PKG_INSTALL_DIR)/usr/lib/libgphoto2{,_port}.{a,so*} $(STAGING_DIR)/usr/lib/
85 mkdir -p $(STAGING_DIR)/usr/lib/pkgconfig
86 $(CP) $(PKG_INSTALL_DIR)/usr/lib/pkgconfig/libgphoto2.pc $(STAGING_DIR)/usr/lib/pkgconfig/
87 $(SED) 's,-I$$$${prefix}/include/gphoto2,,g' $(STAGING_DIR)/usr/bin/gphoto2{,-port}-config
88 $(SED) 's,-I$$$${prefix}/include,,g' $(STAGING_DIR)/usr/bin/gphoto2{,-port}-config
89 $(SED) 's,-L$$$${exec_prefix}/lib,,g' $(STAGING_DIR)/usr/lib/pkgconfig/libgphoto2.pc
90 $(SED) 's,-I$$$${includedir}/gphoto2,,g' $(STAGING_DIR)/usr/lib/pkgconfig/libgphoto2.pc
91 $(SED) 's,-L$$$${libdir},,g' $(STAGING_DIR)/usr/lib/pkgconfig/libgphoto2.pc
92 endef
93
94 define Build/UninstallDev
95 rm -rf $(STAGING_DIR)/usr/bin/gphoto2-config \
96 $(STAGING_DIR)/usr/bin/gphoto2-port-config \
97 $(STAGING_DIR)/usr/include/gphoto2* \
98 $(STAGING_DIR)/usr/lib/libgphoto*.{a,so*}
99 endef
100
101 define Package/libgphoto2/install
102 install -m0755 -d $(1)/usr/lib
103 $(CP) $(PKG_INSTALL_DIR)/usr/lib/libgphoto2{,_port}.so.* $(1)/usr/lib/
104 endef
105
106 define Package/libgphoto2-drivers/install
107 install -d -m0755 $(1)/usr/lib/
108 $(CP) $(PKG_INSTALL_DIR)/usr/lib/libgphoto2{,_port} $(1)/usr/lib/
109 rm -rf $(1)/usr/lib/libgphoto2{,_port}/*/*.{,l}a
110 endef
111
112 $(eval $(call BuildPackage,libgphoto2))
113 $(eval $(call BuildPackage,libgphoto2-drivers))