Group :: Desenvolvimento/Java
RPM: java_cup
Main Changelog Spec Patches Sources Download Gear Bugs e FR Repocop
Group: Development/Java
BuildRequires: /proc rpm-build-java
BuildRequires: jpackage-default
# fedora bcond_with macro
%define bcond_with() %{expand:%%{?_with_%{1}:%%global with_%{1} 1}}
%define bcond_without() %{expand:%%{!?_without_%{1}:%%global with_%{1} 1}}
# redefine altlinux specific with and without
%define with() %{expand:%%{?with_%{1}:1}%%{!?with_%{1}:0}}
%define without() %{expand:%%{?with_%{1}:0}%%{!?with_%{1}:1}}
# see https://bugzilla.altlinux.org/show_bug.cgi?id=10382
%define _localstatedir %{_var}
%bcond_with bootstrap
%global pkg_version 11b
Name: java_cup
Version: 0.11b
Release: alt4_21jpp11
Epoch: 2
Summary: LALR parser generator for Java
License: MIT
URL: http://www2.cs.tum.edu/projects/cup/
BuildArch: noarch
# svn export -r 65 https://www2.in.tum.de/repos/cup/develop/ java_cup-0.11b
# tar cjf java_cup-0.11b.tar.bz2 java_cup-0.11b/
Source0: java_cup-%{version}.tar.bz2
# Add OSGi manifests
Source2: %{name}-MANIFEST.MF
Source4: %{name}-runtime-MANIFEST.MF
Patch0: %{name}-build.patch
BuildRequires: javapackages-local
%if %{with bootstrap}
BuildRequires: javapackages-bootstrap
%else
BuildRequires: ant
BuildRequires: jflex
BuildRequires: java_cup
%endif
# Explicit javapackages-tools requires since scripts use
# /usr/share/java-utils/java-functions
Requires: javapackages-tools
Source44: import.info
Obsoletes: java-cup < 2:11b
Provides: java-cup = %{epoch}:%{version}-%release
%description
java_cup is a LALR Parser Generator for Java
%package javadoc
Group: Development/Java
Summary: Javadoc for java_cup
BuildArch: noarch
%description javadoc
Javadoc for java_cup
%package manual
Group: Development/Java
Summary: Documentation for java_cup
BuildArch: noarch
%description manual
Documentation for java_cup.
%prep
%setup -q
%patch0 -b .build
sed -i '/<javac/s/1.5/1.7/g' build.xml
# remove all binary files
find -name "*.class" -delete
%mvn_file ':{*}' at 1
# remove prebuilt JFlex
rm -rf java_cup-%{version}/bin/JFlex.jar
# remove prebuilt java_cup, if not bootstrapping
rm -rf java_cup-%{version}/bin/java-cup-11.jar
%build
export CLASSPATH=$(build-classpath java_cup java_cup-runtime jflex)
%ant -Dant.build.javac.source=1.8 -Dant.build.javac.target=1.8 -Dcupversion=20150326 -Dsvnversion=65
find -name parser.cup -delete
%ant -Dant.build.javac.source=1.8 -Dant.build.javac.target=1.8 javadoc
# inject OSGi manifests
jar ufm dist/java-cup-%{pkg_version}.jar %{SOURCE2}
jar ufm dist/java-cup-%{pkg_version}-runtime.jar %{SOURCE4}
%install
%mvn_artifact %{name}:%{name}:%{version} dist/java-cup-%{pkg_version}.jar
%mvn_artifact %{name}:%{name}-runtime:%{version} dist/java-cup-%{pkg_version}-runtime.jar
%mvn_install -J dist/javadoc
# wrapper script for direct execution
%jpackage_script java_cup.Main "" "" java_cup cup true
%files -f .mfiles
%{_bindir}/cup
%doc changelog.txt
%doc --no-dereference licence.txt
%files manual
%doc manual.html
%doc --no-dereference licence.txt
%files javadoc -f .mfiles-javadoc
%doc --no-dereference licence.txt
%changelog
…
Todas as alterações você pod ver aqui
BuildRequires: /proc rpm-build-java
BuildRequires: jpackage-default
# fedora bcond_with macro
%define bcond_with() %{expand:%%{?_with_%{1}:%%global with_%{1} 1}}
%define bcond_without() %{expand:%%{!?_without_%{1}:%%global with_%{1} 1}}
# redefine altlinux specific with and without
%define with() %{expand:%%{?with_%{1}:1}%%{!?with_%{1}:0}}
%define without() %{expand:%%{?with_%{1}:0}%%{!?with_%{1}:1}}
# see https://bugzilla.altlinux.org/show_bug.cgi?id=10382
%define _localstatedir %{_var}
%bcond_with bootstrap
%global pkg_version 11b
Name: java_cup
Version: 0.11b
Release: alt4_21jpp11
Epoch: 2
Summary: LALR parser generator for Java
License: MIT
URL: http://www2.cs.tum.edu/projects/cup/
BuildArch: noarch
# svn export -r 65 https://www2.in.tum.de/repos/cup/develop/ java_cup-0.11b
# tar cjf java_cup-0.11b.tar.bz2 java_cup-0.11b/
Source0: java_cup-%{version}.tar.bz2
# Add OSGi manifests
Source2: %{name}-MANIFEST.MF
Source4: %{name}-runtime-MANIFEST.MF
Patch0: %{name}-build.patch
BuildRequires: javapackages-local
%if %{with bootstrap}
BuildRequires: javapackages-bootstrap
%else
BuildRequires: ant
BuildRequires: jflex
BuildRequires: java_cup
%endif
# Explicit javapackages-tools requires since scripts use
# /usr/share/java-utils/java-functions
Requires: javapackages-tools
Source44: import.info
Obsoletes: java-cup < 2:11b
Provides: java-cup = %{epoch}:%{version}-%release
%description
java_cup is a LALR Parser Generator for Java
%package javadoc
Group: Development/Java
Summary: Javadoc for java_cup
BuildArch: noarch
%description javadoc
Javadoc for java_cup
%package manual
Group: Development/Java
Summary: Documentation for java_cup
BuildArch: noarch
%description manual
Documentation for java_cup.
%prep
%setup -q
%patch0 -b .build
sed -i '/<javac/s/1.5/1.7/g' build.xml
# remove all binary files
find -name "*.class" -delete
%mvn_file ':{*}' at 1
# remove prebuilt JFlex
rm -rf java_cup-%{version}/bin/JFlex.jar
# remove prebuilt java_cup, if not bootstrapping
rm -rf java_cup-%{version}/bin/java-cup-11.jar
%build
export CLASSPATH=$(build-classpath java_cup java_cup-runtime jflex)
%ant -Dant.build.javac.source=1.8 -Dant.build.javac.target=1.8 -Dcupversion=20150326 -Dsvnversion=65
find -name parser.cup -delete
%ant -Dant.build.javac.source=1.8 -Dant.build.javac.target=1.8 javadoc
# inject OSGi manifests
jar ufm dist/java-cup-%{pkg_version}.jar %{SOURCE2}
jar ufm dist/java-cup-%{pkg_version}-runtime.jar %{SOURCE4}
%install
%mvn_artifact %{name}:%{name}:%{version} dist/java-cup-%{pkg_version}.jar
%mvn_artifact %{name}:%{name}-runtime:%{version} dist/java-cup-%{pkg_version}-runtime.jar
%mvn_install -J dist/javadoc
# wrapper script for direct execution
%jpackage_script java_cup.Main "" "" java_cup cup true
%files -f .mfiles
%{_bindir}/cup
%doc changelog.txt
%doc --no-dereference licence.txt
%files manual
%doc manual.html
%doc --no-dereference licence.txt
%files javadoc -f .mfiles-javadoc
%doc --no-dereference licence.txt
%changelog
…
Todas as alterações você pod ver aqui