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

%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}
Patch0:         jrefactory-2.8.9-fixcrlf.patch
Patch1:         jrefactory-2.8.9-no-enums.patch
BuildRequires:  ant
BuildRequires:  jpackage-utils >= 1.5
BuildRequires:  java-devel
BuildRequires:  unzip
BuildRequires:  dos2unix
BuildArch:      noarch
BuildRoot:      %{_tmppath}/%{name}-%{version}-build

JRefactory provides a variety of refactoring and pretty printing tools

%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 

perl -p -i -e 's|^Class-Path:.*||' \
ant jar

# jar
install -d -m 755 $RPM_BUILD_ROOT%{_javadir}
install -m 644{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)


%doc docs/{*.html,*.jpg,*.gif,*.txt} settings/sample