diff --git a/.cvsignore b/.cvsignore index e69de29..21f9844 100644 --- a/.cvsignore +++ b/.cvsignore @@ -0,0 +1 @@ +epic-0.6.22.tar.gz diff --git a/eclipse-epic.spec b/eclipse-epic.spec new file mode 100644 index 0000000..a65ed0c --- /dev/null +++ b/eclipse-epic.spec @@ -0,0 +1,173 @@ +%define eclipse_base %{_datadir}/eclipse +%define gcj_support 1 + +Name: eclipse-epic +Version: 0.6.22 +Release: 4%{?dist} +Summary: Perl Eclipse plugin +Group: Development/Tools +License: CPL +URL: http://e-p-i-c.sourceforge.net/ + +# source tarball and the script used to generate it from upstream's cvs +# script usage: +# $ sh get-epic.sh +Source0: epic-%{version}.tar.gz +Source1: get-epic.sh + +# patch for api changes in newer version of jdom that ships w/Fedora +Patch0: epic-jdom-api-changes.patch + +BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n) + +%if %{gcj_support} +BuildRequires: gcc-java +BuildRequires: java-gcj-compat-devel +Requires(post): java-gcj-compat +Requires(postun): java-gcj-compat +%else +BuildArch: noarch +%endif +BuildRequires: java-devel +BuildRequires: jpackage-utils +BuildRequires: eclipse-pde +BuildRequires: antlr +BuildRequires: jdom +BuildRequires: gnu-regexp +BuildRequires: brazil +Requires: java +Requires: jpackage-utils +Requires: eclipse-platform +Requires: antlr +Requires: jdom +Requires: gnu-regexp +Requires: brazil +Requires: perl +Requires: perl-PadWalker + +%description +EPIC is an open source Perl IDE based on the Eclipse platform. Features +supported are syntax highlighting, on-the-fly syntax check, content assist, +perldoc support, source formatter, templating support, a regular expression +view and a Perl debugger. + +%prep +%setup -q -n epic-%{version} + +# ditch bundled libs in favor of building against fedora packaged libs +rm org.epic.lib/lib/jdom.jar \ + org.epic.lib/lib/antlr-2.7.5.jar \ + org.epic.lib/lib/brazil_mini.jar \ + org.epic.lib/lib/gnu-regexp-1.1.4.jar +build-jar-repository -s -p org.epic.lib/lib jdom antlr gnu-regexp brazil + +grep -lR antlr-2.7.5 * | xargs sed --in-place "s/antlr-2.7.5/antlr/" +grep -lR gnu-regexp-1.1.4 * | xargs sed --in-place "s/gnu-regexp-1.1.4/gnu-regexp/" +grep -lR brazil_mini * | xargs sed --in-place "s/brazil_mini/brazil/" + +# put the source plugin together +for p in org.epic.perleditor \ + org.epic.regexp \ + org.epic.debug; do + mkdir org.epic.source/src/$p + pushd $p/src + zip -r -q ../../org.epic.source/src/$p/src.zip * + popd +done + +# make sure upstream hasn't sneaked in any jars we don't know about +JARS="" +for j in `find -name "*.jar"`; do + if [ ! -L $j ]; then + JARS="$JARS $j" + fi +done +if [ ! -z "$JARS" ]; then + echo "These jars should be deleted and symlinked to system jars: $JARS" + exit 1 +fi + +# apply patches +%patch0 -p0 + +%build +# parse grammar for grammar parser +pushd org.epic.perleditor/src/org/epic/core/parser/ +for g in `find . -name "*.g"`; do + antlr $g +done +popd + +# build the main feature +%{eclipse_base}/buildscripts/pdebuild -f org.epic.feature.main \ + -a "-DjavacTarget=1.4 -DjavacSource=1.4" + +%install +rm -rf %{buildroot} +install -d -m 755 %{buildroot}%{eclipse_base} +unzip -q -d %{buildroot}%{eclipse_base}/.. build/rpmBuild/org.epic.feature.main.zip + +# need to recreate the symlinks to libraries that were setup in "prep" +# because for some reason the ant copy task doesn't preserve them +pushd %{buildroot}%{eclipse_base}/plugins/org.epic.lib_*/lib +rm *.jar +build-jar-repository -s -p . jdom antlr gnu-regexp brazil +popd + +# make sure source packages are correctly verisoned +pushd %{buildroot}%{eclipse_base}/plugins +for p in org.epic.perleditor \ + org.epic.regexp \ + org.epic.debug; do + PVERSION=_`ls -1 | grep $p | sed -r 's/.*_(.*)\.jar$/\1/'` + mv org.epic.source_%{version}/src/$p org.epic.source_%{version}/src/$p$PVERSION +done +popd + +%if %{gcj_support} +%{_bindir}/aot-compile-rpm +%endif + +%clean +rm -rf %{buildroot} + +%if %{gcj_support} +%post -p %{_bindir}/rebuild-gcj-db +%postun -p %{_bindir}/rebuild-gcj-db +%endif + +%files +%defattr(-,root,root,-) +%doc %{eclipse_base}/features/org.epic.feature.main_%{version}/license.html +%{eclipse_base}/features/org.epic.feature.main_%{version}/feature.xml +%{eclipse_base}/features/org.epic.feature.main_%{version}/icons/epic_install.jpg +%{eclipse_base}/plugins/org.epic.debug_* +%{eclipse_base}/plugins/org.epic.doc_* +%{eclipse_base}/plugins/org.epic.lib_* +%{eclipse_base}/plugins/org.epic.perleditor_* +%{eclipse_base}/plugins/org.epic.regexp_* +%{eclipse_base}/plugins/org.epic.source_* +%if %{gcj_support} +%{_libdir}/gcj/%{name} +%endif + +%changelog +* Tue Apr 29 2008 Mat Booth 0.6.22-4 +- Added missing dependency. +- Build the source plugin properly to support the "import as projects with + source folders" feature of Eclipse. + +* Sat Apr 19 2008 Mat Booth 0.6.22-3 +- Use JPackage tools to create jar repositories. + +* Sun Apr 13 2008 Mat Booth 0.6.22-2 +- Updated package for new Eclipse plugin guidelines. + +* Sun Mar 30 2008 Mat Booth 0.6.22-1 +- Updated to version 0.6.22. + +* Wed Feb 20 2008 Mat Booth 0.6.20-1 +- Updated to version 0.6.20. + +* Wed Dec 24 2007 Mat Booth 0.6.17-1 +- Initial release. diff --git a/epic-jdom-api-changes.patch b/epic-jdom-api-changes.patch new file mode 100644 index 0000000..e418064 --- /dev/null +++ b/epic-jdom-api-changes.patch @@ -0,0 +1,25 @@ +Index: org.epic.perleditor/src/org/epic/core/util/XMLUtilities.java +=================================================================== +RCS file: /cvsroot/e-p-i-c/org.epic.perleditor/src/org/epic/core/util/XMLUtilities.java,v +retrieving revision 1.6 +diff -u -r1.6 XMLUtilities.java +--- org.epic.perleditor/src/org/epic/core/util/XMLUtilities.java 23 Dec 2005 23:18:15 -0000 1.6 ++++ org.epic.perleditor/src/org/epic/core/util/XMLUtilities.java 17 Dec 2007 23:05:13 -0000 +@@ -122,12 +122,12 @@ + } + + private void writeOutput(Document doc, OutputStream out) throws IOException { +- XMLOutputter xmlout = new XMLOutputter(); ++ Format xmlFormat = Format.getPrettyFormat(); ++ xmlFormat.setLineSeparator(System.getProperty("line.separator")); ++ //xmlFormat.setTextMode(Format.TextMode.NORMALIZE); ++ xmlFormat.setEncoding(CHARSET); + +- xmlout.setIndent(true); +- xmlout.setNewlines(true); +- //xmlout.setTextNormalize(true); +- xmlout.setEncoding(CHARSET); ++ XMLOutputter xmlout = new XMLOutputter(xmlFormat); + xmlout.output(doc, out); + } + diff --git a/get-epic.sh b/get-epic.sh new file mode 100644 index 0000000..d677011 --- /dev/null +++ b/get-epic.sh @@ -0,0 +1,38 @@ +#!/bin/sh +NAME="epic" +VERSION=0.6.22 +TAG="testing_0_6_22" + +echo "Exporting from CVS..." +mkdir $NAME-$VERSION +pushd $NAME-$VERSION >/dev/null +for m in \ + org.epic.feature.main \ + org.epic.debug \ + org.epic.doc \ + org.epic.lib \ + org.epic.perleditor \ + org.epic.regexp \ + org.epic.source; do + cvs -z3 -d:pserver:anonymous@e-p-i-c.cvs.sourceforge.net:/cvsroot/e-p-i-c export -r $TAG $m + if [ $? -eq 1 ]; then + sleep 10 + cvs -z3 -d:pserver:anonymous@e-p-i-c.cvs.sourceforge.net:/cvsroot/e-p-i-c export -r $TAG $m + if [ $? -eq 1 ]; then + echo "ERROR: There was a problem checking out module: $m" + exit 1 + fi + fi +done +popd >/dev/null + +# jettison cvs gumph and empty files +find $NAME-$VERSION -name .cvs* | xargs rm +rm $NAME-$VERSION/org.epic.source/src/.dummy.txt + +# fix stray executable permissions +find $NAME-$VERSION -name *.gif | xargs chmod -x +find $NAME-$VERSION -name *.java | xargs chmod -x + +echo "Creating tarball '$NAME-$VERSION.tar.gz'..." +tar -czf $NAME-$VERSION.tar.gz $NAME-$VERSION diff --git a/sources b/sources index e69de29..26f5635 100644 --- a/sources +++ b/sources @@ -0,0 +1 @@ +09b6c4697308b23c6c98028e196ff838 epic-0.6.22.tar.gz