remove intrusive patch, proper fix is [5820], Makefile cleanup
[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-drivers=all \
51 --without-included-ltdl \
52 --without-libiconv-prefix \
53 --without-libintl-prefix \
54 , \
55 LIBEXIF_CFLAGS="$$$$CPPFLAGS" \
56 LIBEXIF_LIBS="$$$$LDFLAGS -lexif" \
57 LIBUSB_CFLAGS="$$$$CPPFLAGS" \
58 LIBUSB_LIBS="$$$$LDFLAGS -lusb" \
59 LIBS="-lltdl" \
60 )
61 endef
62
63 define Build/Compile
64 $(MAKE) -C $(PKG_BUILD_DIR) -j$(CONFIG_JLEVEL) \
65 DESTDIR="$(PKG_INSTALL_DIR)" \
66 LIBLTDL="" \
67 all install
68 endef
69
70 define Build/InstallDev
71 mkdir -p $(STAGING_DIR)/usr/bin
72 $(CP) $(PKG_INSTALL_DIR)/usr/bin/gphoto2{,-port}-config $(STAGING_DIR)/usr/bin/
73 mkdir -p $(STAGING_DIR)/usr/include
74 $(CP) $(PKG_INSTALL_DIR)/usr/include/gphoto2 $(STAGING_DIR)/usr/include/
75 mkdir -p $(STAGING_DIR)/usr/lib
76 $(CP) $(PKG_INSTALL_DIR)/usr/lib/libgphoto2{,_port}.{a,so*} $(STAGING_DIR)/usr/lib/
77 mkdir -p $(STAGING_DIR)/usr/lib/pkgconfig
78 $(CP) $(PKG_INSTALL_DIR)/usr/lib/pkgconfig/libgphoto2.pc $(STAGING_DIR)/usr/lib/pkgconfig/
79 $(SED) 's,-I$$$${prefix}/include/gphoto2,,g' $(STAGING_DIR)/usr/bin/gphoto2{,-port}-config
80 $(SED) 's,-I$$$${prefix}/include,,g' $(STAGING_DIR)/usr/bin/gphoto2{,-port}-config
81 $(SED) 's,-L$$$${exec_prefix}/lib,,g' $(STAGING_DIR)/usr/lib/pkgconfig/libgphoto2.pc
82 $(SED) 's,-I$$$${includedir}/gphoto2,,g' $(STAGING_DIR)/usr/lib/pkgconfig/libgphoto2.pc
83 $(SED) 's,-L$$$${libdir},,g' $(STAGING_DIR)/usr/lib/pkgconfig/libgphoto2.pc
84 endef
85
86 define Build/UninstallDev
87 rm -rf \
88 $(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_DIR) $(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_DIR) $(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))