bb6da205cda7c73500883bcc5d7c86ae23e64cd3
[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
19 PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(PKG_VERSION)
20 PKG_INSTALL_DIR:=$(PKG_BUILD_DIR)/ipkg-install
21
22 include $(INCLUDE_DIR)/package.mk
23
24 define Package/libpopt
25 SECTION:=libs
26 CATEGORY:=Libraries
27 TITLE:=A command line option parsing library
28 URL:=ftp://ftp.rpm.org/pub/rpm/dist/rpm-4.1.x/
29 endef
30
31 define Build/Configure
32 $(call Build/Configure/Default, \
33 --enable-shared \
34 --enable-static \
35 )
36 endef
37
38 define Build/Compile
39 $(MAKE) -C $(PKG_BUILD_DIR) \
40 DESTDIR="$(PKG_INSTALL_DIR)" \
41 all install
42 endef
43
44 define Build/InstallDev
45 mkdir -p $(1)/usr/include
46 $(CP) $(PKG_INSTALL_DIR)/usr/include/popt.h $(1)/usr/include/
47 mkdir -p $(1)/usr/lib
48 $(CP) $(PKG_INSTALL_DIR)/usr/lib/libpopt.{a,so*} $(1)/usr/lib/
49 endef
50
51 define Build/UninstallDev
52 rm -rf \
53 $(STAGING_DIR)/usr/include/popt.h \
54 $(STAGING_DIR)/usr/lib/libpopt.{a,so*}
55 endef
56
57 define Package/libpopt/install
58 $(INSTALL_DIR) $(1)/usr/lib
59 $(CP) $(PKG_INSTALL_DIR)/usr/lib/libpopt.so.* $(1)/usr/lib/
60 endef
61
62 $(eval $(call BuildPackage,libpopt))
63
64 $(eval $(call RequireCommand,xgettext, \
65 $(PKG_NAME) requires GNU gettext to build. \
66 ))