OpenPKG CVS Repository
http://cvs.openpkg.org/
____________________________________________________________________________
Server: cvs.openpkg.org Name: Ralf S. Engelschall
Root: /e/openpkg/cvs Email: [EMAIL PROTECTED]
Module: openpkg-src Date: 27-Jun-2004 14:01:12
Branch: HEAD Handle: -NONE-
Added files:
openpkg-src/js js.patch
Modified files:
openpkg-src/js js.spec
Log:
add optional Perl binding (allowing to execute JS code from within
Perl) and refactor substs into a separate patch file
Summary:
Revision Changes Path
1.1 +24 -0 openpkg-src/js/js.patch
1.3 +28 -4 openpkg-src/js/js.spec
____________________________________________________________________________
patch -p0 <<'@@ .'
Index: openpkg-src/js/js.patch
============================================================================
$ cvs diff -u -r0 -r1.1 js.patch
--- /dev/null 2004-06-27 14:01:11.000000000 +0200
+++ js.patch 2004-06-27 14:01:11.000000000 +0200
@@ -0,0 +1,24 @@
+Index: perlconnect/JS.xs
+--- perlconnect/JS.xs.orig 2002-03-19 05:28:56 +0100
++++ perlconnect/JS.xs 2004-06-27 13:53:22 +0200
+@@ -56,7 +56,7 @@
+
+ #include <jsapi.h>
+ #include "jsperlpvt.h"
+-#include <malloc.h>
++#include <stdlib.h>
+
+ /* __REMOVE__ */
+ /* #include <stdio.h> */
+Index: rules.mk
+--- rules.mk.orig 2003-11-15 01:11:04 +0100
++++ rules.mk 2004-06-27 13:54:04 +0200
+@@ -58,7 +58,7 @@
+ # TARGETS = $(LIBRARY) # $(PROGRAM) not supported for MSVC yet
+ TARGETS += $(SHARED_LIBRARY) $(PROGRAM) # it is now
+ else
+-TARGETS += $(LIBRARY) $(SHARED_LIBRARY) $(PROGRAM)
++TARGETS += $(LIBRARY) $(PROGRAM)
+ endif
+
+ all:
@@ .
patch -p0 <<'@@ .'
Index: openpkg-src/js/js.spec
============================================================================
$ cvs diff -u -r1.2 -r1.3 js.spec
--- openpkg-src/js/js.spec 27 Jun 2004 11:07:41 -0000 1.2
+++ openpkg-src/js/js.spec 27 Jun 2004 12:01:11 -0000 1.3
@@ -40,15 +40,23 @@
Version: %{V_major}%{V_minor}
Release: 20040627
+# package options
+%option with_perl no
+
# list of sources
Source0:
http://ftp.mozilla.org/pub/mozilla.org/js/js-%{V_major}-%{V_minor}.tar.gz
Source1: js.pc
+Patch0: js.patch
# build information
Prefix: %{l_prefix}
BuildRoot: %{l_buildroot}
BuildPreReq: OpenPKG, openpkg >= 20040130, gcc, make
PreReq: OpenPKG, openpkg >= 20040130
+%if "%{with_perl}" == "yes"
+BuildPreReq: perl, perl-openpkg
+PreReq: perl
+%endif
AutoReq: no
AutoReqProv: no
@@ -69,6 +77,7 @@
%prep
%setup -q -c
+ %patch -p0 -d js/src
%build
( cd js/src
@@ -77,9 +86,6 @@
case "%{l_platform -t}" in
*-freebsd* ) cp config/Linux_All.mk config/`uname -s``uname -r`.mk ;;
esac
- %{l_shtool} subst \
- -e 's;^\(TARGETS.*\)$(SHARED_LIBRARY)\(.*\)$;\1\2;' \
- rules.mk
# build components
%{l_make} %{l_mflags} \
@@ -88,6 +94,16 @@
XLDFLAGS="%{l_ldflags}" \
BUILD_OPT=1 \
JS_EDITLINE=1
+%if "%{with_perl}" == "yes"
+ objdir="`echo *.OBJ`"
+ %{l_shtool} subst \
+ -e "s:\\(\$inc.=.\"\\).*\\(\";\\):\\1-I../$objdir -I..\\2:g" \
+ -e "s:\\(\$libpath.=.\"\\).*\\(\";\\):\\1-L../$objdir\\2:g" \
+ perlconnect/Makefile.PL
+ %{l_prefix}/bin/perl-openpkg prepare
+ %{l_prefix}/bin/perl-openpkg -d perlconnect -A "-c" configure
+ %{l_prefix}/bin/perl-openpkg -d perlconnect build
+%endif
) || exit $?
%install
@@ -114,7 +130,15 @@
fdlibm/*.OBJ/libfdm.a $RPM_BUILD_ROOT%{l_prefix}/lib/libjsfdlibm.a
%{l_shtool} install -c -m 644 \
fdlibm/fdlibm.h $RPM_BUILD_ROOT%{l_prefix}/include/js/
+%if "%{with_perl}" == "yes"
+ %{l_prefix}/bin/perl-openpkg -d perlconnect install
+%endif
) || exit $?
+%if "%{with_perl}" == "yes"
+ %{l_prefix}/bin/perl-openpkg -F perl-openpkg-files fixate cleanup
+%else
+ >perl-openpkg-files
+%endif
# install pkgconfig(1) file
%{l_shtool} install -c -m 644 %{l_value -s -a} \
@@ -123,7 +147,7 @@
# determine installation files
%{l_rpmtool} files -v -ofiles -r$RPM_BUILD_ROOT \
- %{l_files_std} \
+ %{l_files_std} `cat perl-openpkg-files` \
'%not %dir %{l_prefix}/lib/pkgconfig'
%files -f files
@@ .
______________________________________________________________________
The OpenPKG Project www.openpkg.org
CVS Repository Commit List [EMAIL PROTECTED]