[packages] Use default templates instead of custom reimplementations where applicable
[packages.git] / libs / argtable / Makefile
1 #
2 # Copyright (C) 2007 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:=argtable
11 PKG_VERSION:=2.11
12 PKG_RELEASE:=1
13
14 PKG_SOURCE:=$(PKG_NAME)2-11.tar.gz
15 PKG_SOURCE_URL:=@SF/argtable
16 PKG_MD5SUM:=6be6bdb5395b2de8063698f83db61791
17
18 PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)2-11
19
20 include $(INCLUDE_DIR)/package.mk
21
22 define Package/argtable
23   SECTION:=libs
24   CATEGORY:=Libraries
25   TITLE:=A library for parsing GNU style command line options
26   URL:=http://argtable.sourceforge.net/
27 endef
28
29 define Package/argtable/description
30         Argtable is an ANSI C library for parsing GNU style command line options
31         with a minimum of fuss. It enables a program's command line syntax to be
32         defined in the source code as an array of argtable structs. The command
33         line is then parsed according to that specification and the resulting
34         values are returned in those same structs where they are accessible to
35         the main program. Both tagged (-v, --verbose, --foo=bar) and untagged
36         arguments are supported, as are multiple instances of each argument.
37 endef
38
39 TARGET_CFLAGS += $(FPIC)
40 CONFIGURE_ARGS += \
41         --enable-shared \
42         --enable-static \
43
44 MAKE_FLAGS += \
45         -C $(PKG_BUILD_DIR)/src \
46         DESTDIR="$(PKG_INSTALL_DIR)" \
47         all install \
48
49 define Build/InstallDev
50         $(INSTALL_DIR) $(1)/usr/include
51         $(CP) $(PKG_INSTALL_DIR)/usr/include/argtable2.h $(1)/usr/include/
52         $(INSTALL_DIR) $(1)/usr/lib
53         $(CP) $(PKG_INSTALL_DIR)/usr/lib/libargtable2.{a,so*} $(1)/usr/lib/
54 endef
55
56 define Package/argtable/install
57         $(INSTALL_DIR) $(1)/usr/lib
58         $(CP) $(PKG_INSTALL_DIR)/usr/lib/libargtable2.so.* $(1)/usr/lib/
59 endef
60
61 $(eval $(call BuildPackage,argtable))