File jedit.spec of Package jedit

#
# spec file for package jedit (Version 4.2)
#
# Copyright (c) 2008 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/
#

# norootforbuild
# icecream 0


Name:           jedit
BuildRequires:  aelfred aelfred-javadoc ant asm-javadoc bsh2 bsh2-classgen bsh2-javadoc docbook-xsl-stylesheets gnu-regexp gnu-regexp-javadoc iso_ent java2-devel-packages libxslt openjade xml-commons-apis xorg-x11 xorg-x11-devel
BuildRequires:  fdupes
%define name		jedit
%define Name		jEdit
%define	major		4
%define minor		2
# Why, oh why, does RPM expand macros in comments?
#%%define pre		pre14
%define rel		3jpp
%define version		%{major}.%{minor}
%define relpre		0.%{pre}.%{rel}
%if %{?pre:1}%{!?pre:0}
%define release		%{relpre}
%else
%define release		%{rel}
%endif
%define Summary		Open Source programmer's text editor
%define section		free
Version:        4.2
Release:        282
Summary:        Programmer's Text Editor Written in Java
License:        GPL v2 or later
Group:          Productivity/Editors/Other
Source0:        http://download.sourceforge.net/jedit/jedit42source.tar.bz2
Source1:        %{name}-16.png
Source2:        %{name}-32.png
Source3:        %{name}-48.png
Source4:        TextTools-1.12-bin.tgz
Patch0:         %{name}-installer.patch
Patch1:         %{name}-man.patch
Patch2:         %{name}-crosslink.patch
Patch3:         %{name}-java14compat.patch
Patch4:         %{name}-%{version}-name-clash.patch
Url:            http://www.jedit.org/
Requires:       aelfred
Requires:       asm
Requires:       bsh2
Requires:       bsh2-classgen
Requires:       gnu-regexp
Requires:       jpackage-utils >= 1.5
BuildArch:      noarch
Obsoletes:      %{name}-rhmenu
Obsoletes:      antlr-jedit
Provides:       %{name}-rhmenu
Provides:       antlr-jedit
BuildRoot:      %{_tmppath}/%{name}-%{version}-build

%description
jEdit is a cross-platform programmer's text editor written in Java.

Some of jEdit's features include:

* Built-in macro language (BeanShell)

* Extensible plug-in architecture with more than 80 plug-ins
   available

* Plug-ins can be downloaded and installed from within jEdit using
   the plug-in manager feature

* Syntax highlighting for more than 80 languages

* Supports a large number of character encodings including UTF8 and
   Unicode

* Autoindenting of source code

* Folding (indent and marker based)

* Word wrap

* Unlimited undo and redo

* Highly configurable and customizable

* Every other feature, both basic and advanced, that you would expect
to find in a text editor



%package javadoc
License:        GPL v2 or later
PreReq:         coreutils
Summary:        Programmer's text editor written in Java (Documentation)
Group:          Productivity/Editors/Other

%description javadoc
Javadoc for jedit.



%prep
#%setup -q -n jEdit
%setup -q -D -b 4 -n jEdit
%patch0 -p1
%patch1 -p1
%patch2 -p1
%patch3
%patch4 -b .sav4
# remove all included external sources
%__rm -rf bsh
%__rm -rf com
%__rm -rf gnu
%__rm -rf org/objectweb
# remove all binary libs
#find . -name "*.jar" -exec rm -f {} \;

%build
export CLASSPATH=$(build-classpath aelfred asm bsh2/bsh-classgen bsh2/bsh-commands bsh2/bsh-core bsh2/bsh-reflect gnu.regexp)
#export CLASSPATH=$(build-classpath aelfred gnu.regexp)
# compress jedit.jar
%__perl -p -i -e 's|compress="false"|compress="true"|' build.xml
%__perl -p -i -e 's|app.version=.*|app.version=%{version}-%{release}|' installer/install.props
%ant
DOCBOOK_XSL=`rpm -ql docbook-xsl-stylesheets | %__grep /html/chunk.xsl \
| %__sed 's|/html/chunk.xsl||'`
if [ -z $DOCBOOK_XSL ]; then
  echo "Unable to find docbook xsl directory"
  exit 1
fi
if [ -z "$SGML_CATALOG_FILES" -a -e %{_sysconfdir}/sgml/catalog ] ; then
  export SGML_CATALOG_FILES=%{_sysconfdir}/sgml/catalog
fi
%ant -Ddocbook.xsl=$DOCBOOK_XSL docs-html dist
# Build LatestVersion.jar
(cd jars/LatestVersion && %ant)
# Build QuickNotepad.jar
(cd jars/QuickNotepad && %ant)
# Create installer filelists
sh installer/mk_filelist.sh
# FIXME: crosslink with gnu.regexp and bsh2 when they have non-versioned dirs
%ant -Djava.javadoc=%{_javadocdir}/java \
     -Daelfred.javadoc=%{_javadocdir}/aelfred \
     -Dasm.javadoc=%{_javadocdir}/asm \
     -Dbsh2.javadoc=%{_javadocdir}/bsh2 \
     -Dgnu.regexp.javadoc=%{_javadocdir}/bsh2 \
     javadoc

%install
JAVA_HOME=%{java_home} CLASSPATH=. \
%java installer.Install auto %{buildroot}%{_datadir}/%{name} \
unix-man=%{buildroot}%{_mandir}/man1
# XXX: Can this be made relative?
(cd %{buildroot}%{_datadir}/%{name}/doc && %__ln_s %{_javadocdir}/%{name} api)
# manual
#find doc/users-guide -type f ! -name "*.html" -exec rm -f {} \;
#(cd %{buildroot}%{_datadir}/%{name}/doc && %__ln_s %{_docdir}/%{name}-manual-%{version} users-guide)
# script
%__mkdir_p %{buildroot}%{_bindir}
%__cat > %{buildroot}%{_bindir}/%{name} << EOF
#!/bin/sh
#
# jedit script
# JPackage Project <http://www.jpackage.org/>
# Source functions library
. %{_datadir}/java-utils/java-functions
# Source system prefs
if [ -f %{_sysconfdir}/%{name}.conf ] ; then
  . %{_sysconfdir}/%{name}.conf
fi
# Source user prefs
if [ -f \$HOME/.%{name}rc ] ; then
  . \$HOME/.%{name}rc
fi
# Configuration
MAIN_CLASS="org.gjt.sp.jedit.jEdit"
BASE_FLAGS="-Dbsh.jedit=true -Djedit.home=%{_datadir}/%{name} -mx32m"
BASE_JARS="aelfred asm bsh2/bsh-classgen bsh2/bsh-commands bsh2/bsh-core bsh2/bsh-reflect bsh2/bsh-util gnu.regexp %{name}"
#BASE_JARS="aelfred gnu.regexp %{name}"
# Set parameters
set_jvm
set_classpath \$BASE_JARS
set_flags \$BASE_FLAGS
# Let's start
run "\$@"
EOF
# javadoc
%__mkdir_p %{buildroot}%{_javadocdir}/%{name}-%{version}
%__cp -a doc/api/* %{buildroot}%{_javadocdir}/%{name}-%{version}
%__ln_s %{name}-%{version} %{buildroot}%{_javadocdir}/%{name}
# icons
%__install -D -m 644 %{SOURCE3} %{buildroot}%{_datadir}/icons/hicolor/48x48/apps/%{name}.png
%__install -D -m 644 %{SOURCE2} %{buildroot}%{_datadir}/icons/hicolor/32x32/apps/%{name}.png
%__install -D -m 644 %{SOURCE1} %{buildroot}%{_datadir}/icons/hicolor/16x16/apps/%{name}.png
# jar
%__mkdir_p %{buildroot}%{_javadir}
%__cp -a %{name}.jar %{buildroot}%{_javadir}/%{name}-%{version}.jar
(cd %{buildroot}%{_javadir} && for jar in *-%{version}*; do \
%__ln_s ${jar} ${jar/-%{version}/}; done)
(cd %{buildroot}%{_datadir}/%{name} && \
%__ln_s %{_javadir}/%{name}.jar %{name}.jar)
# installing TextTools plugin
mv ../TextTools.jar $RPM_BUILD_ROOT/usr/share/jedit/jars/
%fdupes -s ${RPM_BUILD_ROOT}

%clean
rm -rf $RPM_BUILD_ROOT

%post javadoc
%__rm -f %{_javadocdir}/%{name}
%__ln_s %{name}-%{version} %{_javadocdir}/%{name}

%files
%defattr(0644,root,root,0755)
%attr(0755,root,root) %{_bindir}/%{name}
%{_javadir}/*
%exclude %{_datadir}/%{name}/doc/api
%{_datadir}/%{name}
%{_mandir}/man1/%{name}.1*
%{_datadir}/icons/hicolor/
#%files manual
#%defattr(0644,root,root,0755)
#%doc doc/users-guide/*

%files javadoc
%defattr(0644,root,root,0755)
%doc %{_javadocdir}/%{name}-%{version}
%ghost %doc %{_javadocdir}/%{name}
%{_datadir}/%{name}/doc/api

%changelog
* Thu Aug 07 2008 mvyskocil@suse.cz
- fixed a name clash under java6
- fix some rpmlint warnings:
  - bzipped source tarball
  - fix duplicates using fdupes
  - add a provides jedit-rhmenu  antlr-jedit
- quiet option to setup macro
* Tue Jan 29 2008 mmaher@suse.de
- added TextTools Plugin (#276446)
  The TextTools plugin provides a set of plugin actions for
  manipulating text in a buffer.
* Fri Mar 09 2007 sbrabec@suse.cz
- Removed obsolete hicolor icon symlink (#248676).
* Mon Sep 25 2006 skh@suse.de
- don't use icecream
- use source="1.4" and target="1.4" for build with java 1.5
* Wed Jan 25 2006 mls@suse.de
- converted neededforbuild to BuildRequires
* Thu Nov 03 2005 jsmeix@suse.de
- added Obsoletes for antlr-jedit because since jedit version 4.2
  /usr/share/jedit/modes/antlr.xml is included in jedit.
* Wed Oct 19 2005 jsmeix@suse.de
- Current version 4.2 from JPackage.org
* Tue Aug 09 2005 mls@suse.de
- removed compat from neededforbuild
* Tue Sep 14 2004 ro@suse.de
- removed apache-ant from neededforbuild
- added to neededforbuild: ant,xml-commons-apis,jpackage-utils
  update-alternatives,xerces-j2
* Mon Mar 08 2004 pmladek@suse.cz
- updated to version 4.1
* Sat Jan 10 2004 adrian@suse.de
- build as user
* Fri Sep 19 2003 pmladek@suse.cz
- renamed the link /usr/share/doc/packages/jedit/users-guide to
  fix the update from older distributions [#31307]
* Mon Jul 14 2003 pmladek@suse.cz
- fixed neededforbuild due to the renamed package jakarta-ant -> apache-ant
* Fri Jan 31 2003 pmladek@suse.cz
- updated BufferTabs plugin to version 0.7.8
- fixed jedit wrapper to require at least a JRE version 1.3,
  but to do not require exactly this version
* Mon Nov 11 2002 ro@suse.de
- changed neededforbuild <jade_dsl> to <openjade>
- changed neededforbuild <sp> to <opensp>
* Mon Aug 05 2002 pmladek@suse.cz
- updated to version 4.0.3 with many improvents and bug fixes
- updated InfoViewer plugin to version 1.1
- removed obsolete patch
- removed obsolete EditBus plugin (it is included in jedit now)
- fixed jedit launcher to select strict java version 1.3.x
- fixed neededforbuild
* Thu Feb 07 2002 pmladek@suse.cz
- updated plugins:
  * BufferTabs to version 0.7.6
  * InfoViewer to version 1.0
- removed the plugin QuickNotepad, it does not work
- only plugins with makefile.jmk are compiled from sources
* Fri Nov 30 2001 ro@suse.de
- changed neededforbuild <docbktls> to <docbook-toys>
* Tue Nov 20 2001 pmladek@suse.cz
- fixed silly messages on start
* Tue Oct 30 2001 pmladek@suse.cz
- package creadted, version 3.2.2
openSUSE Build Service is sponsored by