Группа :: Разработка/Java
Пакет: lpg
Главная Изменения Спек Патчи Sources Загрузить Gear Bugs and FR Repocop
Group: Development/Java
# BEGIN SourceDeps(oneline):
BuildRequires: unzip
# END SourceDeps(oneline)
AutoReq: yes,noosgi
BuildRequires: rpm-build-java-osgi
BuildRequires: /proc rpm-build-java
BuildRequires: jpackage-1.8-compat
# see https://bugzilla.altlinux.org/show_bug.cgi?id=10382
%define _localstatedir %{_var}
%global _version 2.0.17
%global _compat_version 1.1.0
Name: lpg
Version: %{_version}
Release: alt1_29jpp8
Summary: LALR Parser Generator
# although the text of the licence isn't distributed with some of the source,
# the author has exlicitly stated that everything is covered under the EPL
# see: http://sourceforge.net/forum/forum.php?thread_id=3277926&forum_id=523519
License: EPL-1.0
URL: http://lpg.sourceforge.net/
Source0: http://downloads.sourceforge.net/lpg/lpg-java-runtime-src-%{version}.zip
Source1: http://downloads.sourceforge.net/lpg/lpg-generator-cpp-src-%{version}.zip
Source2: http://downloads.sourceforge.net/lpg/lpg-generator-templates-%{version}.zip
# source archive for the java compat lib
Source3: http://downloads.sourceforge.net/lpg/lpgdistribution-05-16-06.zip
# upstream does not provide a build script or manifest file for the java
# compat lib
Source4: %{name}-build.xml
Source5: %{name}-manifest.mf
# TODO: drop Source3, 4, 5 and obsolete the java-compat package when dependent
# projects are ported to LPG 2.x.x
# executable name in the bootstrap make target is wrong; sent upstream, see:
# https://sourceforge.net/tracker/?func=detail&aid=2794057&group_id=155963&atid=797881
Patch0: %{name}-bootstrap-target.patch
# change build script to build the base jar with osgi bundle info
Patch1: %{name}-osgi-jar.patch
# fix segfault caused by aggressive optimisation of null checks in gcc 4.9
Patch2: %{name}-segfault.patch
BuildRequires: gcc-c++
BuildRequires: ant
BuildRequires: ant-apache-regexp
BuildRequires: javapackages-local
Source44: import.info
%description
The LALR Parser Generator (LPG) is a tool for developing scanners and parsers
written in Java, C++ or C. Input is specified by BNF rules. LPG supports
backtracking (to resolve ambiguity), automatic AST generation and grammar
inheritance.
%package java
Group: Development/Java
Summary: Java runtime library for LPG
BuildArch: noarch
%description java
Java runtime library for parsers generated with the LALR Parser Generator
(LPG).
%package java-compat
Group: Development/Java
Version: %{_compat_version}
Summary: Compatibility Java runtime library for LPG 1.x
BuildArch: noarch
%description java-compat
Compatibility Java runtime library for parsers generated with the LALR Parser
Generator (LPG) 1.x.
%prep
%setup -q -T -c -n %{name}-%{version}
# because you can't use setup to unzip to subdirectories when your source
# archives do not create top level directories
unzip -qq %{SOURCE0} -d lpg-java-runtime
unzip -qq %{SOURCE1} -d lpg-generator-cpp
unzip -qq %{SOURCE2} -d lpg-generator-templates
chmod -Rf a+rX,u+w,g-w,o-w .
# setup java compat stuff
%setup -q -D -T -a 3 -n %{name}-%{version}
cp -p %{SOURCE4} lpgdistribution/build.xml
cp -p %{SOURCE5} lpgdistribution/MANIFEST.MF
# apply patches
%patch0 -p0 -b .orig
%patch1 -p0 -b .orig
%patch2 -p0 -b .orig
%build
# build java stuff
(cd lpg-java-runtime && ant -f exportPlugin.xml)
# build java compat stuff
(cd lpgdistribution && ant)
# build native stuff
pushd lpg-generator-cpp/src
# ARCH just tells us what tools to use, so this can be the same on all arches
# we build twice in order to bootstrap the grammar parser
make clean install ARCH=linux_x86 \
LOCAL_CFLAGS="%{optflags} -Wno-strict-overflow" LOCAL_CXXFLAGS="%{optflags} -Wno-strict-overflow"
make bootstrap ARCH=linux_x86
make clean install ARCH=linux_x86 \
LOCAL_CFLAGS="%{optflags} -Wno-strict-overflow" LOCAL_CXXFLAGS="%{optflags} -Wno-strict-overflow"
popd
%install
# Install native stuff
install -pD -T lpg-generator-cpp/bin/%{name}-linux_x86 \
%{buildroot}%{_bindir}/%{name}
# Install java stuff
%mvn_package "lpg.runtime:java" java
%mvn_package "net.sourceforge.lpg:lpgjavaruntime" java-compat
%mvn_artifact "lpg.runtime:java:%{_version}" lpg-java-runtime/lpgruntime.jar
%mvn_artifact "net.sourceforge.lpg:lpgjavaruntime:%{_compat_version}" lpgdistribution/lpgjavaruntime.jar
%mvn_file "lpg.runtime:" lpgruntime
%mvn_file "net.sourceforge.lpg:" lpgjavaruntime
%mvn_install
%files
%doc lpg-generator-templates/docs/*
%{_bindir}/%{name}
%files java -f .mfiles-java
%doc lpg-java-runtime/Eclipse*.htm
%files java-compat -f .mfiles-java-compat
%doc lpg-java-runtime/Eclipse*.htm
%changelog
…
Полный changelog можно просмотреть здесь
# BEGIN SourceDeps(oneline):
BuildRequires: unzip
# END SourceDeps(oneline)
AutoReq: yes,noosgi
BuildRequires: rpm-build-java-osgi
BuildRequires: /proc rpm-build-java
BuildRequires: jpackage-1.8-compat
# see https://bugzilla.altlinux.org/show_bug.cgi?id=10382
%define _localstatedir %{_var}
%global _version 2.0.17
%global _compat_version 1.1.0
Name: lpg
Version: %{_version}
Release: alt1_29jpp8
Summary: LALR Parser Generator
# although the text of the licence isn't distributed with some of the source,
# the author has exlicitly stated that everything is covered under the EPL
# see: http://sourceforge.net/forum/forum.php?thread_id=3277926&forum_id=523519
License: EPL-1.0
URL: http://lpg.sourceforge.net/
Source0: http://downloads.sourceforge.net/lpg/lpg-java-runtime-src-%{version}.zip
Source1: http://downloads.sourceforge.net/lpg/lpg-generator-cpp-src-%{version}.zip
Source2: http://downloads.sourceforge.net/lpg/lpg-generator-templates-%{version}.zip
# source archive for the java compat lib
Source3: http://downloads.sourceforge.net/lpg/lpgdistribution-05-16-06.zip
# upstream does not provide a build script or manifest file for the java
# compat lib
Source4: %{name}-build.xml
Source5: %{name}-manifest.mf
# TODO: drop Source3, 4, 5 and obsolete the java-compat package when dependent
# projects are ported to LPG 2.x.x
# executable name in the bootstrap make target is wrong; sent upstream, see:
# https://sourceforge.net/tracker/?func=detail&aid=2794057&group_id=155963&atid=797881
Patch0: %{name}-bootstrap-target.patch
# change build script to build the base jar with osgi bundle info
Patch1: %{name}-osgi-jar.patch
# fix segfault caused by aggressive optimisation of null checks in gcc 4.9
Patch2: %{name}-segfault.patch
BuildRequires: gcc-c++
BuildRequires: ant
BuildRequires: ant-apache-regexp
BuildRequires: javapackages-local
Source44: import.info
%description
The LALR Parser Generator (LPG) is a tool for developing scanners and parsers
written in Java, C++ or C. Input is specified by BNF rules. LPG supports
backtracking (to resolve ambiguity), automatic AST generation and grammar
inheritance.
%package java
Group: Development/Java
Summary: Java runtime library for LPG
BuildArch: noarch
%description java
Java runtime library for parsers generated with the LALR Parser Generator
(LPG).
%package java-compat
Group: Development/Java
Version: %{_compat_version}
Summary: Compatibility Java runtime library for LPG 1.x
BuildArch: noarch
%description java-compat
Compatibility Java runtime library for parsers generated with the LALR Parser
Generator (LPG) 1.x.
%prep
%setup -q -T -c -n %{name}-%{version}
# because you can't use setup to unzip to subdirectories when your source
# archives do not create top level directories
unzip -qq %{SOURCE0} -d lpg-java-runtime
unzip -qq %{SOURCE1} -d lpg-generator-cpp
unzip -qq %{SOURCE2} -d lpg-generator-templates
chmod -Rf a+rX,u+w,g-w,o-w .
# setup java compat stuff
%setup -q -D -T -a 3 -n %{name}-%{version}
cp -p %{SOURCE4} lpgdistribution/build.xml
cp -p %{SOURCE5} lpgdistribution/MANIFEST.MF
# apply patches
%patch0 -p0 -b .orig
%patch1 -p0 -b .orig
%patch2 -p0 -b .orig
%build
# build java stuff
(cd lpg-java-runtime && ant -f exportPlugin.xml)
# build java compat stuff
(cd lpgdistribution && ant)
# build native stuff
pushd lpg-generator-cpp/src
# ARCH just tells us what tools to use, so this can be the same on all arches
# we build twice in order to bootstrap the grammar parser
make clean install ARCH=linux_x86 \
LOCAL_CFLAGS="%{optflags} -Wno-strict-overflow" LOCAL_CXXFLAGS="%{optflags} -Wno-strict-overflow"
make bootstrap ARCH=linux_x86
make clean install ARCH=linux_x86 \
LOCAL_CFLAGS="%{optflags} -Wno-strict-overflow" LOCAL_CXXFLAGS="%{optflags} -Wno-strict-overflow"
popd
%install
# Install native stuff
install -pD -T lpg-generator-cpp/bin/%{name}-linux_x86 \
%{buildroot}%{_bindir}/%{name}
# Install java stuff
%mvn_package "lpg.runtime:java" java
%mvn_package "net.sourceforge.lpg:lpgjavaruntime" java-compat
%mvn_artifact "lpg.runtime:java:%{_version}" lpg-java-runtime/lpgruntime.jar
%mvn_artifact "net.sourceforge.lpg:lpgjavaruntime:%{_compat_version}" lpgdistribution/lpgjavaruntime.jar
%mvn_file "lpg.runtime:" lpgruntime
%mvn_file "net.sourceforge.lpg:" lpgjavaruntime
%mvn_install
%files
%doc lpg-generator-templates/docs/*
%{_bindir}/%{name}
%files java -f .mfiles-java
%doc lpg-java-runtime/Eclipse*.htm
%files java-compat -f .mfiles-java-compat
%doc lpg-java-runtime/Eclipse*.htm
%changelog
…
Полный changelog можно просмотреть здесь