packages: js-json2/js-json2.spec (NEW) - new

glen glen at pld-linux.org
Mon Apr 26 18:57:50 CEST 2010


Author: glen                         Date: Mon Apr 26 16:57:50 2010 GMT
Module: packages                      Tag: HEAD
---- Log message:
- new

---- Files affected:
packages/js-json2:
   js-json2.spec (NONE -> 1.1)  (NEW)

---- Diffs:

================================================================
Index: packages/js-json2/js-json2.spec
diff -u /dev/null packages/js-json2/js-json2.spec:1.1
--- /dev/null	Mon Apr 26 18:57:50 2010
+++ packages/js-json2/js-json2.spec	Mon Apr 26 18:57:45 2010
@@ -0,0 +1,102 @@
+# $Revision$, $Date$
+Summary:	JSON in JavaScript
+Name:		js-json2
+Version:	20100320
+Release:	1
+License:	Public Domain
+Group:		Applications/WWW
+Source0:	http://www.JSON.org/json2.js
+# Source0-md5:	f98062b915eba703f4edf1e0891c2c84
+URL:		http://www.json.org/js.html
+BuildRequires:	js
+BuildRequires:	jsmin
+Requires:	webapps
+Requires:	webserver(access)
+Requires:	webserver(alias)
+BuildArch:	noarch
+BuildRoot:	%{tmpdir}/%{name}-%{version}-root-%(id -u -n)
+
+%define		_webapps	/etc/webapps
+%define		_webapp		%{name}
+%define		_sysconfdir	%{_webapps}/%{_webapp}
+%define		_appdir		%{_datadir}/%{_webapp}
+
+%description
+json2.js to handle json parser and stringify in MSIE below version 8.
+
+%prep
+%setup -qcT
+sed -e 1d %{S:0} > $(basename %{S:0})
+
+version=$(sed -n 3p json2.js | xargs)
+if [ "$(echo "$version" | tr -d -)" != %{version} ]; then
+	: %%{version} mismatch
+	exit 1
+fi
+
+# apache1/apache2 conf
+cat > apache.conf <<'EOF'
+Alias /js/json2.js %{_appdir}/json2.js
+<Directory %{_appdir}>
+	Allow from all
+</Directory>
+EOF
+
+# lighttpd conf
+cat > lighttpd.conf <<'EOF'
+alias.url += (
+    "/js/json2.js" => "%{_appdir}/json2.js",
+)
+EOF
+
+%build
+jsmin < json2.js > json2-min.js "json2.js %{version}"
+js -C -f json2-min.js
+
+%install
+rm -rf $RPM_BUILD_ROOT
+install -d $RPM_BUILD_ROOT%{_appdir}
+cp -a json2-min.js $RPM_BUILD_ROOT%{_appdir}/json2.js
+
+install -d $RPM_BUILD_ROOT%{_sysconfdir}
+cp -a apache.conf $RPM_BUILD_ROOT%{_sysconfdir}/apache.conf
+cp -a apache.conf $RPM_BUILD_ROOT%{_sysconfdir}/httpd.conf
+cp -a lighttpd.conf $RPM_BUILD_ROOT%{_sysconfdir}/lighttpd.conf
+
+%clean
+rm -rf $RPM_BUILD_ROOT
+
+%triggerin -- apache1 < 1.3.37-3, apache1-base
+%webapp_register apache %{_webapp}
+
+%triggerun -- apache1 < 1.3.37-3, apache1-base
+%webapp_unregister apache %{_webapp}
+
+%triggerin -- apache < 2.2.0, apache-base
+%webapp_register httpd %{_webapp}
+
+%triggerun -- apache < 2.2.0, apache-base
+%webapp_unregister httpd %{_webapp}
+
+%triggerin -- lighttpd
+%webapp_register lighttpd %{_webapp}
+
+%triggerun -- lighttpd
+%webapp_unregister lighttpd %{_webapp}
+
+%files
+%defattr(644,root,root,755)
+%dir %attr(750,root,http) %{_sysconfdir}
+%attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/apache.conf
+%attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/httpd.conf
+%attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/lighttpd.conf
+%{_appdir}
+
+%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/04/26 16:57:45  glen
+- new
================================================================


More information about the pld-cvs-commit mailing list