replace lots of manual install commands with INSTALL_* variables
[openwrt/svn-archive/archive.git] / libs / popt / 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:=popt
12 PKG_VERSION:=1.7
13 PKG_RELEASE:=4
14
15 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
16 PKG_SOURCE_URL:=ftp://ftp.rpm.org/pub/rpm/dist/rpm-4.1.x/
17 PKG_MD5SUM:=5988e7aeb0ae4dac8d83561265984cc9
18 PKG_CAT:=zcat
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 define Package/libpopt
26 SECTION:=libs
27 CATEGORY:=Libraries
28 TITLE:=A command line option parsing library
29 URL:=ftp://ftp.rpm.org/pub/rpm/dist/rpm-4.1.x/
30 endef
31
32 define Build/Configure
33 $(call Build/Configure/Default, \
34 --enable-shared \
35 --enable-static \
36 )
37 endef
38
39 define Build/Compile
40 $(MAKE) -C $(PKG_BUILD_DIR) \
41 DESTDIR="$(PKG_INSTALL_DIR)" \
42 all install
43 endef
44
45 define Build/InstallDev
46 mkdir -p $(STAGING_DIR)/usr/include
47 $(CP) $(PKG_INSTALL_DIR)/usr/include/popt.h $(STAGING_DIR)/usr/include/
48 mkdir -p $(STAGING_DIR)/usr/lib
49 $(CP) $(PKG_INSTALL_DIR)/usr/lib/libpopt.{a,so*} $(STAGING_DIR)/usr/lib/
50 endef
51
52 define Build/UninstallDev
53 rm -rf \
54 $(STAGING_DIR)/usr/include/popt.h \
55 $(STAGING_DIR)/usr/lib/libpopt.{a,so*}
56 endef
57
58 define Package/libpopt/install
59 $(INSTALL_DIR) $(1)/usr/lib
60 $(CP) $(PKG_INSTALL_DIR)/usr/lib/libpopt.so.* $(1)/usr/lib/
61 endef
62
63 $(eval $(call BuildPackage,libpopt))
64
65 $(eval $(call RequireCommand,xgettext, \
66 popt requires GNU gettext to build. \
67 ))