nuke $Id$ in /packages as well
[packages.git] / libs / ossp-js / Makefile
1 #
2 # Copyright (C) 2008 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:=js
11 PKG_VERSION:=1.6.20070208
12 PKG_RELEASE:=2
13
14 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
15 PKG_SOURCE_URL:=ftp://ftp.ossp.org/pkg/lib/js/
16 PKG_MD5SUM:=07f6cad7e03fd74a949588c3d4b333de
17 PKG_FIXUP:=libtool
18
19 include $(INCLUDE_DIR)/package.mk
20
21 PKG_INSTALL=1
22
23 define Package/js/Default
24  TITLE:=Mozilla JavaScript Engine
25  URL:=http://www.ossp.org/pkg/lib/js/
26 endef
27
28 define Package/js
29 $(call Package/js/Default)
30  SECTION:=lang
31  CATEGORY:=Languages
32  SUBMENU:=JavaScript
33  TITLE+= (interpreter)
34  DEPENDS+= +libjs +libreadline +libncurses
35 endef
36
37 define Package/libjs
38 $(call Package/js/Default)
39  SECTION:=libs
40  CATEGORY:=Libraries
41  TITLE+= (library)
42 endef
43
44 TARGET_CFLAGS += $(FPIC)
45
46 CONFIGURE_ARGS += \
47         --enable-shared \
48         --enable-static \
49         --with-dso \
50         --with-editline \
51         --with-file \
52         --without-perl
53
54 define Build/Configure
55         (cd $(PKG_BUILD_DIR); rm -f config.cache; \
56                 ./configure \
57                         --prefix=/usr \
58                         --exec-prefix=/usr \
59                         --bindir=/usr/bin \
60                         --datadir=/usr/share \
61                         --includedir=/usr/include \
62                         --infodir=/usr/share/info \
63                         --libdir=/usr/lib \
64                         --libexecdir=/usr/lib \
65                         --localstatedir=/var \
66                         --mandir=/usr/share/man \
67                         --sbindir=/usr/sbin \
68                         --sysconfdir=/etc \
69                         $(DISABLE_NLS) \
70                         $(DISABLE_LARGEFILE) \
71                         --disable-shared \
72                         --enable-static \
73         );
74         $(MAKE) -C $(PKG_BUILD_DIR) src/jsautocfg.h
75         $(call Build/Configure/Default)
76 endef
77
78 define Build/InstallDev
79         $(INSTALL_DIR) $(2)/bin
80         $(INSTALL_BIN) \
81                 $(PKG_INSTALL_DIR)/usr/bin/js-config \
82                 $(2)/bin/
83         $(SED) \
84                 's,^\(prefix\|exec_prefix\)=.*,\1=$(STAGING_DIR)/usr,g' \
85                 $(2)/bin/js-config
86
87         $(INSTALL_DIR) $(1)/usr/include
88         $(CP) \
89                 $(PKG_INSTALL_DIR)/usr/include/js \
90                 $(1)/usr/include/
91
92         $(INSTALL_DIR) $(1)/usr/lib
93         $(CP) \
94                 $(PKG_INSTALL_DIR)/usr/lib/libjs.{la,so*} \
95                 $(1)/usr/lib/
96
97         $(INSTALL_DIR) $(1)/usr/lib/pkgconfig
98         $(INSTALL_DATA) \
99                 $(PKG_INSTALL_DIR)/usr/lib/pkgconfig/js.pc \
100                 $(1)/usr/lib/pkgconfig/
101 endef
102
103 define Package/js/install
104         $(INSTALL_DIR) $(1)/usr/bin
105         $(INSTALL_BIN) \
106                 $(PKG_INSTALL_DIR)/usr/bin/js \
107                 $(1)/usr/bin/
108 endef
109
110 define Package/libjs/install
111         $(INSTALL_DIR) $(1)/usr/lib
112         $(CP) \
113                 $(PKG_INSTALL_DIR)/usr/lib/libjs.so.* \
114                 $(1)/usr/lib/
115 endef
116
117 $(eval $(call BuildPackage,js))
118 $(eval $(call BuildPackage,libjs))