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