Retain symlinks. $(INSTALL_*) copys the contens of a file, so if we want to keep
[packages.git] / libs / libusb / Makefile
1 #
2 # Copyright (C) 2006-2008 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:=libusb
12 PKG_VERSION:=0.1.12
13 PKG_RELEASE:=2
14
15 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
16 PKG_SOURCE_URL:=@SF/libusb
17 PKG_MD5SUM:=caf182cbc7565dac0fd72155919672e6
18 PKG_FIXUP:=libtool
19
20 include $(INCLUDE_DIR)/package.mk
21
22 PKG_INSTALL=1
23
24 define Package/libusb
25   SECTION:=libs
26   CATEGORY:=Libraries
27   TITLE:=A library for accessing Linux USB devices
28   URL:=http://libusb.sourceforge.net/
29 endef
30
31 define Build/Configure
32         $(call Build/Configure/Default, \
33                 --enable-shared \
34                 --enable-static \
35         )
36 endef
37
38 TARGET_CFLAGS += $(FPIC)
39
40 define Build/InstallDev
41         $(INSTALL_DIR) $(2)/bin
42         $(INSTALL_BIN) \
43                 $(PKG_INSTALL_DIR)/usr/bin/libusb-config \
44                 $(2)/bin/
45         $(SED) \
46                 's,^\(prefix\|exec_prefix\)=.*,\1=$(STAGING_DIR)/usr,g' \
47                 $(2)/bin/libusb-config
48
49         $(INSTALL_DIR) $(1)/usr/include
50         $(INSTALL_DATA) \
51                 $(PKG_INSTALL_DIR)/usr/include/usb.h \
52                 $(1)/usr/include/
53
54         $(INSTALL_DIR) $(1)/usr/lib
55         $(CP) \
56                 $(PKG_INSTALL_DIR)/usr/lib/libusb*.{la,so*,a} \
57                 $(1)/usr/lib/
58
59         $(INSTALL_DIR) $(1)/usr/lib/pkgconfig
60         $(INSTALL_DATA) \
61                 $(PKG_INSTALL_DIR)/usr/lib/pkgconfig/libusb.pc \
62                 $(1)/usr/lib/pkgconfig/
63 endef
64
65 define Package/libusb/install
66         $(INSTALL_DIR) $(1)/usr/lib
67         $(CP) \
68                 $(PKG_INSTALL_DIR)/usr/lib/libusb*.so* \
69                 $(1)/usr/lib/
70 endef
71
72 $(eval $(call BuildPackage,libusb))