[packages] Use default templates instead of custom reimplementations where applicable
[packages.git] / libs / popt / Makefile
1 #
2 # Copyright (C) 2006-2009 OpenWrt.org
3 #
4 # This is free software, licensed under the GNU General Public License v2.
5 # See /LICENSE for more information.
6 #
7
8 include $(TOPDIR)/rules.mk
9
10 PKG_NAME:=popt
11 PKG_VERSION:=1.7
12 PKG_RELEASE:=4
13
14 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
15 PKG_SOURCE_URL:=http://downloads.openwrt.org/sources/
16 PKG_MD5SUM:=5988e7aeb0ae4dac8d83561265984cc9
17
18 PKG_INSTALL:=1
19
20 include $(INCLUDE_DIR)/package.mk
21
22 TARGET_CFLAGS += $(FPIC)
23
24 define Package/libpopt
25   SECTION:=libs
26   CATEGORY:=Libraries
27   TITLE:=A command line option parsing library
28   URL:=http://rpm5.org/files/popt/
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/InstallDev
39         $(INSTALL_DIR) $(1)/usr/include
40         $(CP) $(PKG_INSTALL_DIR)/usr/include/popt.h $(1)/usr/include/
41         $(INSTALL_DIR) $(1)/usr/lib
42         $(CP) $(PKG_INSTALL_DIR)/usr/lib/libpopt.{a,so*} $(1)/usr/lib/
43 endef
44
45 define Package/libpopt/install
46         $(INSTALL_DIR) $(1)/usr/lib
47         $(CP) $(PKG_INSTALL_DIR)/usr/lib/libpopt.so.* $(1)/usr/lib/
48 endef
49
50 $(eval $(call RequireCommand,xgettext, \
51         $(PKG_NAME) requires the GNU gettext development package installed on the local system to build. \
52 ))
53
54 $(eval $(call BuildPackage,libpopt))
55