Репозиторий Sisyphus
Последнее обновление: 22 ноября 2017 | Пакетов: 17883 | Посещений: 10416553
en ru br
Репозитории ALT
S:2.7.7-alt12_51jpp8
5.1: 2.7.7-alt7_1jpp5
4.1: 2.7.7-alt4_1jpp1.7
4.0: 2.7.7-alt4_1jpp1.7
3.0: 2.7.4-alt1
www.altlinux.org/Changes

Другие репозитории
Upstream:2.7.5

Группа :: Разработка/Java
Пакет: antlr

 Главная   Изменения   Спек   Патчи   Sources   Загрузить   Gear   Bugs and FR  Repocop 

Group: Development/Java
# BEGIN SourceDeps(oneline):
BuildRequires(pre): rpm-build-python rpm-macros-fedora-compat
BuildRequires: rpm-build-java
# END SourceDeps(oneline)
BuildRequires: /proc
BuildRequires: jpackage-generic-compat
# 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_without doxygen
%bcond_without python

%global debug_package %{nil}
# since we have only a static library

Summary:       ANother Tool for Language Recognition
Name:          antlr
Version:       2.7.7
Release:       alt12_51jpp8
Epoch:         0
License:       Public Domain
URL:           http://www.antlr2.org/
Source0:       http://www.antlr2.org/download/antlr-%{version}.tar.gz
Source1:       %{name}-build.xml
Source2:       %{name}-script
Source3:       http://repo2.maven.org/maven2/antlr/antlr/%{version}/%{name}-%{version}.pom
Patch1:        %{name}-%{version}-newgcc.patch
# see BZ#848662
Patch2:        antlr-examples-license.patch

%ifarch %{mono_arches}
%if ! 0%{?rhel} >= 6
BuildRequires: mono-core mono-devel
BuildRequires: mono-winforms
%endif
%endif
BuildRequires: gcc-c++
BuildRequires: ant
BuildRequires: java-devel >= 1.7.0
BuildRequires: java-javadoc
BuildRequires: javapackages-local
%if %{with doxygen}
BuildRequires: doxygen graphviz libgraphviz
%endif
%if %{with python}
# Do not support Python3
BuildRequires: python-devel
BuildRequires: python-module-setuptools
%endif
Source44: import.info

%description
ANTLR, ANother Tool for Language Recognition, (formerly PCCTS) is a
language tool that provides a framework for constructing recognizers,
compilers, and translators from grammatical descriptions containing
C++ or Java actions [You can use PCCTS 1.xx to generate C-based
parsers].

%package     tool
Group: Development/Java
Summary:       ANother Tool for Language Recognition
Provides:      %{name} = %{version}-%{release}
BuildArch:     noarch

%description tool
ANTLR, ANother Tool for Language Recognition, (formerly PCCTS) is a
language tool that provides a framework for constructing recognizers,
compilers, and translators from grammatical descriptions containing
C++ or Java actions [You can use PCCTS 1.xx to generate C-based
parsers].

%package     manual
Group: Development/Java
Summary:       Manual for %{name}
BuildArch:     noarch

%description manual
Documentation for %{name}.

%package     javadoc
Group: Development/Java
Summary:       Javadoc for %{name}
BuildArch:     noarch

%description javadoc
Javadoc for %{name}.

%package     C++
Group: Development/Java
Summary:       C++ bindings for antlr2 generated parsers
Provides:      antlr-static = %{version}-%{release}

%description C++
This package provides a static C++ library for parsers generated by ANTLR2.

%if %{with doxygen}
%package     C++-doc
Group: Development/Java
Summary:       Documentation for C++ bindings for antlr2 generated parsers
BuildArch:     noarch

%description C++-doc
This package contains the documentation for the C++ bindings for parsers
generated by ANTLR2.
%endif

%if %{with python}
%package     -n python-module-antlr
Group: Development/Java
Summary:       Python 2 runtime support for ANTLR-generated parsers
%{?python_provide:%python_provide python2-%{name}}

# This can be removed in Fedora 30

Provides:      %{name}-python = %{version}-%{release}
Obsoletes:     %{name}-python < 2.7.7-48

BuildArch:     noarch

Obsoletes: python-module-antlr2 <= 0:2.7.7-alt11_13jpp6.1
Conflicts: python-module-antlr2 <= 0:2.7.7-alt11_13jpp6.1


%description -n python-module-antlr
Python runtime support for ANTLR-generated parsers
%endif

%prep
%setup -q
# remove all binary libs
find . -name "*.jar" -exec rm -f {} \;
cp -p %{SOURCE1} build.xml
%patch1
%patch2 -p1
# CRLF->LF
sed -i 's/\r//' LICENSE.txt

# set jar location

%mvn_file %{name}:%{name} %{name}

%build
ant -Dj2se.apidoc=%{_javadocdir}/java
# make expects to find it here
cp work/lib/antlr.jar .
export CLASSPATH=.
%configure --without-examples
make CXXFLAGS="${CXXFLAGS} -fPIC" DEBUG=1 verbose=1
# no longer needed
rm antlr.jar

# fix doc permissions and remove Makefiles

rm doc/{Makefile,Makefile.in}
chmod 0644 doc/*

%if %{with doxygen}
# generate doxygen docs for C++ bindings
pushd lib/cpp
 doxygen doxygen.cfg
 find gen_doc -type f -exec chmod 0644 {} \;
popd
%endif

%if %{with python}
# build python
cd lib/python
%python_build
cd ../../
%endif

%install
# jars, POM and depmap
%mvn_artifact %{SOURCE3} work/lib/%{name}.jar
%mvn_alias %{name}:%{name} %{name}:%{name}all
%mvn_install -J work/api

mkdir -p $RPM_BUILD_ROOT{%{_includedir}/%{name},%{_libdir},%{_bindir}}
# script
install -p -m 755 %{SOURCE2} $RPM_BUILD_ROOT%{_bindir}/antlr

# C++ lib and headers, antlr-config

install -p -m 644 lib/cpp/antlr/*.hpp $RPM_BUILD_ROOT%{_includedir}/%{name}
install -p -m 644 lib/cpp/src/libantlr.a $RPM_BUILD_ROOT%{_libdir}
install -p -m 755 scripts/antlr-config $RPM_BUILD_ROOT%{_bindir}

%if %{with python}
# python
cd lib/python
%python_install
cd ../..
%endif
chmod 755 $RPM_BUILD_ROOT%{_bindir}/*


%files tool -f .mfiles
%doc LICENSE.txt
%{_bindir}/antlr

# this is actually a development package for the C++ target

# as we ship only a static library, it doesn't make sense
# to have a separate -devel package for the headers
%files C++
%doc LICENSE.txt
%{_includedir}/%{name}
%{_libdir}/libantlr.a
%{_bindir}/antlr-config

%if %{with doxygen}
%files C++-doc
%doc LICENSE.txt
%doc lib/cpp/gen_doc/html/
%endif

%files manual
%doc LICENSE.txt
%doc doc/*

%files javadoc -f .mfiles-javadoc
%doc LICENSE.txt

%if %{with python}
%files -n python-module-antlr
%doc LICENSE.txt
%{python_sitelibdir_noarch}/antlr/*
%{python_sitelibdir_noarch}/antlr-*
%endif

%changelog

Полный changelog можно просмотреть здесь

 
дизайн и разработка: Vladimir Lettiev aka crux © 2004-2005, Andrew Avramenko aka liks © 2007-2008
текущий майнтейнер: Michael Shigorin