File jrefactory.spec of Package jrefactory

#
# spec file for package jrefactory (Version 2.8.9)
#
# Copyright (c) 2009 SUSE LINUX Products GmbH, Nuernberg, Germany.
#
# 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/
#


%define	section	devel

Name:           jrefactory
Version:        2.8.9
Release:        1
Summary:        JRefactory and Pretty Print
License:        Apache Software License ..
Group:          Development/Libraries/Java
Source0:        %{name}-%{version}-full.zip
Patch0:         jrefactory-2.8.9-fixcrlf.patch
Patch1:         jrefactory-2.8.9-no-enums.patch
Url:            http://jrefactory.sourceforge.net/
BuildRequires:  ant
BuildRequires:  jpackage-utils >= 1.5
BuildRequires:  java-devel
BuildRequires:  unzip
BuildRequires:  dos2unix
BuildArch:      noarch
BuildRoot:      %{_tmppath}/%{name}-%{version}-build

%description
JRefactory provides a variety of refactoring and pretty printing tools

%prep
%setup -q -c %{name}-%{version}
mv settings/.Refactory settings/sample
%patch0 -p0 -b .fixcrlf
%patch1 -p1 -b .enums
find . -type 'f' -name '*txt' -or -name '*.settings' | xargs dos2unix 

%build
perl -p -i -e 's|^Class-Path:.*||' \
	src/meta-inf/refactory.mf
ant jar

%install
# jar
install -d -m 755 $RPM_BUILD_ROOT%{_javadir}
install -m 644 ant.build/lib/%{name}.jar $RPM_BUILD_ROOT%{_javadir}/%{name}-%{version}.jar
(cd $RPM_BUILD_ROOT%{_javadir} && for jar in *-%{version}.jar; do ln -sf ${jar} ${jar/-%{version}/}; done)

%clean
rm -rf $RPM_BUILD_ROOT

%files
%defattr(0664,root,root,0755)
%doc docs/{*.html,*.jpg,*.gif,*.txt} settings/sample
%{_javadir}/*

%changelog