packages: jsl/jsl.spec (NEW), jsl/smash.patch (NEW), jsl/tests.patch (NEW) ...

glen glen at pld-linux.org
Thu May 20 20:20:26 CEST 2010


Author: glen                         Date: Thu May 20 18:20:26 2010 GMT
Module: packages                      Tag: HEAD
---- Log message:
- based on fc spec

---- Files affected:
packages/jsl:
   jsl.spec (NONE -> 1.1)  (NEW), smash.patch (NONE -> 1.1)  (NEW), tests.patch (NONE -> 1.1)  (NEW)

---- Diffs:

================================================================
Index: packages/jsl/jsl.spec
diff -u /dev/null packages/jsl/jsl.spec:1.1
--- /dev/null	Thu May 20 20:20:26 2010
+++ packages/jsl/jsl.spec	Thu May 20 20:20:21 2010
@@ -0,0 +1,77 @@
+# $Revision$, $Date$
+# TODO
+# - see if can use our js package
+#
+# Conditional build:
+%bcond_without	tests	# do not perform "make test"
+
+Summary:	Check JavaScript code for common mistakes
+Name:		jsl
+Version:	0.3.0
+Release:	1
+License:	MPL v1.1
+Group:		Development/Tools
+URL:		http://www.javascriptlint.com/
+Source0:	http://www.javascriptlint.com/download/%{name}-%{version}-src.tar.gz
+# Source0-md5:	2b94ffa4fab07acabe0c5e73cd49bcdf
+Patch0:		smash.patch
+Patch1:		tests.patch
+%{?with_tests:BuildRequires:	perl-base}
+BuildRequires:	rpmbuild(macros) >= 1.553
+BuildRequires:	sed >= 4.0
+BuildRoot:	%{tmpdir}/%{name}-%{version}-root-%(id -u -n)
+
+%description
+With JavaScript Lint, you can check all your JavaScript source code
+for common mistakes without actually running the script or opening the
+web page.
+
+JavaScript Lint holds an advantage over competing lints because it is
+based on the JavaScript engine for the Firefox browser. This provides
+a robust framework that can not only check JavaScript syntax but also
+examine the coding techniques used in the script and warn against
+questionable practices.
+
+%prep
+%setup -q
+%patch0 -p1
+%patch1 -p1
+
+# Fix DOS-y EOL encoding and permissions
+find -type f | xargs %undos
+
+%build
+# Dependencies dealt with poorly: -j1
+%{__make} -C src -f Makefile.ref -j1 \
+	CC="%{__cc}" \
+	XCFLAGS="%{optflags}" \
+	OS_CFLAGS="-DXP_UNIX -DHAVE_VA_COPY -DVA_COPY=va_copy" \
+	SHARED_LIBRARY= \
+	OBJDIR=. \
+	JS_EDITLINE=1 \
+
+%if %{with tests}
+cd tests
+%{__perl} run_tests.pl ../src/jsl
+%endif
+
+%install
+rm -rf $RPM_BUILD_ROOT
+install -d $RPM_BUILD_ROOT%{_bindir}
+install -p src/jsl $RPM_BUILD_ROOT%{_bindir}
+
+%clean
+rm -rf $RPM_BUILD_ROOT
+
+%files
+%defattr(644,root,root,755)
+%attr(755,root,root) %{_bindir}/jsl
+
+%define date	%(echo `LC_ALL="C" date +"%a %b %d %Y"`)
+%changelog
+* %{date} PLD Team <feedback at pld-linux.org>
+All persons listed below can be reached at <cvs_login>@pld-linux.org
+
+$Log$
+Revision 1.1  2010/05/20 18:20:21  glen
+- based on fc spec

================================================================
Index: packages/jsl/smash.patch
diff -u /dev/null packages/jsl/smash.patch:1.1
--- /dev/null	Thu May 20 20:20:26 2010
+++ packages/jsl/smash.patch	Thu May 20 20:20:21 2010
@@ -0,0 +1,21 @@
+Fix stack smashing... triggered by the stack overflow test (doh!)
+
+Lubomir Rintel <lkundrak at v3.sk>
+
+diff -urp jsl-0.3.0/src/jsl.c jsl-0.3.0.smash/src/jsl.c
+--- jsl-0.3.0/src/jsl.c	2006-11-03 20:20:24.000000000 +0100
++++ jsl-0.3.0.smash/src/jsl.c	2009-04-14 23:03:37.528221874 +0200
+@@ -91,7 +91,12 @@
+ #define EXITCODE_FILE_ERROR 4
+ 
+ /* file constants */
+-#define MAXPATHLEN 1024
++#ifdef PATH_MAX
++#define MAXPATHLEN PATH_MAX
++#else
++#warning "MAXPATHLEN can overflow if PATH_MAX is too big"
++#define MAXPATHLEN 65536
++#endif
+ 
+ #ifdef WIN32
+ #define DEFAULT_DIRECTORY_SEPARATOR '\\'

================================================================
Index: packages/jsl/tests.patch
diff -u /dev/null packages/jsl/tests.patch:1.1
--- /dev/null	Thu May 20 20:20:26 2010
+++ packages/jsl/tests.patch	Thu May 20 20:20:21 2010
@@ -0,0 +1,12 @@
+Fail if tests fail.
+
+Lubomir Rintel <lkundrak at v3.sk>
+
+diff -up jsl-0.3.0/tests/run_tests.pl.tests jsl-0.3.0/tests/run_tests.pl
+--- jsl-0.3.0/tests/run_tests.pl.tests	2009-04-14 23:05:50.287206494 +0200
++++ jsl-0.3.0/tests/run_tests.pl	2009-04-14 23:06:13.605209095 +0200
+@@ -69,3 +69,4 @@ print "Searching $FindBin::Bin...\n";
+ find( sub{TestFile}, '.');
+ 
+ print "Passed $num_passed of $num_tests tests\n";
++die "FAIL" unless $num_passed == $num_tests;
================================================================


More information about the pld-cvs-commit mailing list