treewide: add PKG_CPE_ID for better cvescanner coverage
[feed/packages.git] / lang / tcl / Makefile
1 #
2 # Copyright (C) 2006-2018 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:=tcl
11 TCL_MAJOR_VERSION:=8.6
12 PKG_VERSION:=${TCL_MAJOR_VERSION}.9
13 PKG_RELEASE:=1
14
15 PKG_SOURCE:=$(PKG_NAME)$(PKG_VERSION)-src.tar.gz
16 PKG_SOURCE_URL:=@SF/$(PKG_NAME)
17 PKG_HASH:=ad0cd2de2c87b9ba8086b43957a0de3eb2eb565c7159d5f53ccbba3feb915f4e
18 PKG_LICENSE:=TCL
19 PKG_LICENSE_FILES:=license.terms
20 PKG_MAINTAINER:=Joe Mistachkin <joe@mistachkin.com>
21 PKG_CPE_ID:=cpe:/a:tcl_tk:tcl_tk
22
23 PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)$(PKG_VERSION)
24 HOST_BUILD_DIR:=$(BUILD_DIR_HOST)/$(PKG_NAME)$(PKG_VERSION)
25
26 PKG_FIXUP:=autoreconf
27 PKG_INSTALL:=1
28
29 include $(INCLUDE_DIR)/host-build.mk
30 include $(INCLUDE_DIR)/package.mk
31
32 define Package/tcl
33 SUBMENU:=Tcl
34 SECTION:=lang
35 CATEGORY:=Languages
36 DEPENDS:=+libpthread +zlib
37 TITLE:=The Tcl language
38 URL:=https://www.tcl.tk/
39 endef
40
41 define Package/tcl/description
42 Tcl, or Tool Command Language, is a an elegant, versatile, feature-rich,
43 simple-to-learn yet very powerful industrial-strength open-source
44 programming language and development platform. It is renowned for its
45 stability and utility, and its emphasis on providing a cross-platform
46 programming API makes it an ideal choice for an enormous variety of
47 programming jobs.
48 endef
49
50 CONFIGURE_PATH := unix
51
52 CONFIGURE_VARS += \
53 tcl_cv_strtod_unbroken=ok
54
55 CONFIGURE_ARGS += \
56 --enable-threads
57
58 MAKE_PATH := unix
59
60 define Build/Prepare
61 $(call Build/Prepare/Default)
62 rm -rf $(PKG_BUILD_DIR)/pkgs/*
63 endef
64
65 define Build/InstallDev
66 $(INSTALL_DIR) $(1)/usr/include
67 $(CP) $(PKG_INSTALL_DIR)/usr/include/*.h $(1)/usr/include/
68
69 $(INSTALL_DIR) $(1)/usr/lib
70 $(CP) $(PKG_INSTALL_DIR)/usr/lib/libtcl*.{a,so*} $(1)/usr/lib/
71 $(CP) $(PKG_INSTALL_DIR)/usr/lib/tclConfig.sh $(1)/usr/lib/
72 $(CP) $(PKG_INSTALL_DIR)/usr/lib/tclooConfig.sh $(1)/usr/lib/
73
74 $(INSTALL_DIR) $(1)/usr/lib/pkgconfig
75 $(CP) $(PKG_INSTALL_DIR)/usr/lib/pkgconfig/tcl.pc \
76 $(1)/usr/lib/pkgconfig
77 endef
78
79 define Package/tcl/install
80 $(INSTALL_DIR) $(1)/usr/lib
81 $(CP) $(PKG_INSTALL_DIR)/usr/lib/*.so $(1)/usr/lib
82
83 $(INSTALL_DIR) $(1)/usr/bin
84 $(CP) $(PKG_INSTALL_DIR)/usr/bin/* $(1)/usr/bin
85
86 $(CP) -a $(PKG_INSTALL_DIR)/usr/lib/tcl8 $(1)/usr/lib/
87 $(CP) -a $(PKG_INSTALL_DIR)/usr/lib/tcl$(TCL_MAJOR_VERSION) $(1)/usr/lib/
88 $(LN) tclsh$(TCL_MAJOR_VERSION) $(1)/usr/bin/tclsh
89 endef
90
91 define Host/Configure
92 $(call Host/Configure/Default,$(1),$(2),$(CONFIGURE_PATH)/$(3))
93 endef
94
95 define Host/Compile
96 +$(HOST_MAKE_VARS) \
97 $(MAKE) $(HOST_JOBS) -C $(HOST_BUILD_DIR)/$(MAKE_PATH) \
98 $(HOST_MAKE_FLAGS) \
99 $(1)
100 endef
101
102 define Host/Install
103 $(call Host/Compile,install)
104 (cd $(HOST_BUILD_PREFIX)/bin; test -f tclsh || ln -s tclsh$(TCL_MAJOR_VERSION) tclsh)
105 endef
106
107 $(eval $(call HostBuild))
108 $(eval $(call BuildPackage,tcl))