File jsbeautify.spec of Package jsbeautify

#
# spec file for package jsbeautify
#
# Copyright (c) 2010 Bastian Friedrich
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
# upon. The license for this file, and modifications and additions to the
# file, is the same license as for the pristine package itself (unless the
# license for the pristine package is not an Open Source License, in which
# case the license is the MIT License). An "Open Source License" is a
# license that conforms to the Open Source Definition (Version 1.9)
# published by the Open Source Initiative.

# Please submit bugfixes or comments via http://bugs.opensuse.org/
#

# norootforbuild


Name:		jsbeautify
Requires:	rhino
Url:		http://jsbeautifier.org/
License:	Other uncritical OpenSource License
Group:		Productivity/File utilities
Version:	2010721git
Release:	1
Summary:	A JavaScript code beautifier/re-indenter
Source:		http://github.com/einars/js-beautify/tarball/master/einars-js-beautify-3c45cd9.tar.gz
#Patch:		jsbeautify-%{version}.diff
Patch1:		einars-js-beautify-3c45cd9-fix-relative-symlinks.diff
Patch2:		einars-js-beautify-3c45cd9-fix-argument-quoting.diff
BuildRoot:	%{_tmppath}/%{name}-%{version}-build
BuildArch:	noarch

%description
This little beautifier will reformat and reindent bookmarklets, ugly
javascript, unpack scripts packed by the popular Dean Edward's packer,
as well as deobfuscate scripts processed by javascriptobfuscator.com.

%prep
%setup -q -n einars-js-beautify-3c45cd9
%patch1 -p1
%patch2 -p1

%build
echo "No building required"
echo 'command! -range=% -nargs=0 BeautifyJavascript <line1>,<line2>!JSBEAUTY=<q-args> /usr/bin/beautify_js' > beautify_js.vim

%install
mkdir  -p %{buildroot}%{_datadir}/jsbeautify/
mkdir  -p %{buildroot}%{_bindir}
cp -a * %{buildroot}%{_datadir}/jsbeautify/
ln -s %{_datadir}/jsbeautify/bin/beautify_js %{buildroot}%{_bindir}/

%files
%defattr (644,root,root,755)
%dir %{_datadir}/jsbeautify
%{_datadir}/jsbeautify/*
%attr (755, root, root) %{_bindir}/beautify_js
%attr (755, root, root) %{_datadir}/jsbeautify/bin/beautify_js
%attr (755, root, root) %{_datadir}/jsbeautify/opera-userscript/make_opera_userscript.sh

%changelog
* Wed Jul 21 2010 bastian@bastian-friedrich.de
- Initial package