[js/f15] Make mozjs185 the canonical target for both libmozjs and libmozjs185. Based on work from Christopher

Colin Walters walters at fedoraproject.org
Wed Jun 22 22:59:44 UTC 2011


commit 37233c66b34b496a41055d809d0d855144139613
Author: Colin Walters <walters at verbum.org>
Date:   Wed Jun 22 18:54:19 2011 -0400

    Make mozjs185 the canonical target for both libmozjs and libmozjs185.
    Based on work from Christopher Aillon <caillon at redhat.com>
    Switch to using make install DESTDIR=, instead of hardcoding build rules.
    Add DESTDIR= patch from GNOME 3.2 jhbuild

 js.spec             |   54 ++++++++++++++++++++++++++++----------------------
 js185-destdir.patch |   16 +++++++++++++++
 2 files changed, 46 insertions(+), 24 deletions(-)
---
diff --git a/js.spec b/js.spec
index 82cd656..fa33157 100644
--- a/js.spec
+++ b/js.spec
@@ -3,7 +3,7 @@
 Summary:		JavaScript interpreter and libraries
 Name:		js
 Version:		1.8.5
-Release:		5%{?hgdate:.hg%{hgdate}}%{?dist}
+Release:		6%{?hgdate:.hg%{hgdate}}%{?dist}
 # The sources are triple licensed, but when we link against readline which is
 # GPL, the result can only be GPL.
 %if 0%{?_without_readline:1}
@@ -16,6 +16,7 @@ URL:			http://www.mozilla.org/js/
 Source0:		http://ftp.mozilla.org/pub/mozilla.org/js/js185-1.0.0.tar.gz
 Patch0:			js-1.8.5-64bit-big-endian.patch
 Patch1:			js-1.8.5-secondary-jit.patch
+Patch2:			js185-destdir.patch
 Provides:		libjs = %{version}-%{release}
 BuildRoot:	%{_tmppath}/%{name}-%{version}-%{release}-root
 Buildrequires:	nspr-devel, python, zip
@@ -35,6 +36,7 @@ Summary: Header files, libraries and development documentation for %{name}
 Group: Development/Libraries
 Requires: %{name} = %{epoch}:%{version}-%{release}
 Requires: pkgconfig
+Requires: ncurses-devel readline-devel
 Provides: libjs-devel = %{version}-%{release}
 
 %description devel
@@ -48,6 +50,7 @@ you will need to install %{name}-devel.
 %setup -q -n %{name}-%{version}
 %patch0 -p2 -b .64bit-big-endian
 %patch1 -p2 -b .secondary-jit
+%patch2 -p0 -b .destdir
 cd js
 
 # Rm parts with spurios licenses, binaries
@@ -57,7 +60,7 @@ rm -rf src/ctypes/libffi src/t src/tests/src/jstests.jar src/tracevis src/v8
 
 pushd src
 autoconf-2.13
-%configure --with-system-nspr
+%configure --with-system-nspr --enable-threadsafe
 popd
 
 # Create pkgconfig file
@@ -72,7 +75,7 @@ Description: JS library
 Requires: nspr
 Version: %{version}
 Libs: -L${libdir} -ljs
-Cflags: -DXP_UNIX=1 -DJS_THREADSAFE=1 -I${includedir}
+Cflags: -DXP_UNIX=1 -DJS_THREADSAFE=1 -I${includedir}/js
 EOF
 
 
@@ -90,26 +93,24 @@ export BUILD_OPT=1
 
 %install
 cd js
-%{__rm} -rf %{buildroot}
-%{__mkdir_p} %{buildroot}%{_bindir} \
-	%{buildroot}%{_libdir}/pkgconfig \
-	%{buildroot}%{_includedir}
+make -C src install DESTDIR=%{buildroot}
+# We don't want this
+rm -f %{buildroot}%{_bindir}/js-config
 %{__install} -m 0755 src/jscpucfg src/shell/js \
-	%{buildroot}%{_bindir}/
-%{__install} -m 0755 src/libmozjs185.so \
-	%{buildroot}%{_libdir}/
-%{__mv} %{buildroot}%{_libdir}/libmozjs185.so %{buildroot}%{_libdir}/libmozjs185.so.1
-# For backward capability
-%{__ln_s} -nf libmozjs185.so.1 %{buildroot}%{_libdir}/libmozjs.so.1
-%{__ln_s} -nf libmozjs185.so.1 %{buildroot}%{_libdir}/libmozjs185.so
-%{__ln_s} -nf libmozjs.so.1 %{buildroot}%{_libdir}/libmozjs.so
-%{__ln_s} -nf libmozjs185.so.1 %{buildroot}%{_libdir}/libjs.so.1
-%{__ln_s} -nf libjs.so.1 %{buildroot}%{_libdir}/libjs.so
-%{__install} -m 0644 src/js*.h src/js.msg src/*.tbl \
-	%{buildroot}%{_includedir}/
-%{__install} -m 0644 libjs.pc \
-	%{buildroot}%{_libdir}/pkgconfig/
+       %{buildroot}%{_bindir}/
+%{__rm} -rf %{buildroot}%{_libdir}/*.a
+%{__rm} -rf %{buildroot}%{_libdir}/*.la
+
+# For compatibility
+# XXX do we really need libjs?!?!?!
+pushd %{buildroot}%{_libdir}
+ln -s libmozjs185.so.1.0 libmozjs.so.1 
+ln -s libmozjs185.so.1.0 libjs.so.1 
+ln -s libmozjs185.so libmozjs.so
+ln -s libmozjs185.so libjs.so
+popd
 
+%{__install} -m 0644 libjs.pc %{buildroot}%{_libdir}/pkgconfig/
 
 %clean
 %{__rm} -rf %{buildroot}
@@ -131,11 +132,16 @@ cd js
 %{_bindir}/jscpucfg
 %{_libdir}/pkgconfig/*.pc
 %{_libdir}/*.so
-%{_includedir}/js*.h
-%{_includedir}/*.tbl
-%{_includedir}/js.msg
+%{_includedir}/js
 
 %changelog
+* Wed Jun 22 2011 Colin Walters <walters at verbum.org> - 1:1.8.5-6
+- Include mozjs185.pc, clean up build
+- Based on work from Christopher Aillon <caillon at redhat.com>
+- Switch to using make install DESTDIR=, instead of hardcoding build rules.
+- Add DESTDIR= patch from GNOME 3.2 jhbuild
+- Make mozjs185 the canonical target for both libmozjs and libmozjs185.
+
 * Fri May 27 2011 Dan Horák <dan[at]danny.cz> - 1.8.5-5
 - add secondary arch patches from xulrunner
 
diff --git a/js185-destdir.patch b/js185-destdir.patch
new file mode 100644
index 0000000..e28baed
--- /dev/null
+++ b/js185-destdir.patch
@@ -0,0 +1,16 @@
+# See discussion in https://bugzilla.mozilla.org/show_bug.cgi?id=628723
+# Patch created by Colin Walters <walters at verbum.org>
+
+--- js/src/Makefile.in.orig	2011-06-15 19:40:27.447770306 -0400
++++ js/src/Makefile.in	2011-06-15 19:40:57.013770299 -0400
+@@ -888,8 +888,8 @@
+ ifeq (,$(HOST_BIN_SUFFIX))
+ 	mv -f $(SHLIB_ANY_VER) $(SHLIB_EXACT_VER)
+ 	@[ ! -h $(SHLIB_ABI_VER) ] || rm -f $(SHLIB_ABI_VER)
+-	ln -s $(SHLIB_EXACT_VER) $(SHLIB_ABI_VER)
+-	ln -s $(SHLIB_ABI_VER) $(SHLIB_ANY_VER)
++	ln -s $(notdir $(SHLIB_EXACT_VER)) $(SHLIB_ABI_VER)
++	ln -s $(notdir $(SHLIB_ABI_VER)) $(SHLIB_ANY_VER)
+ endif
+ endif
+ ifneq (,$(IMPORT_LIBRARY))


More information about the scm-commits mailing list