llvm/llvm.spec

390 lines
13 KiB
RPMSpec

%define gccver %(gcc -dumpversion)
Name: llvm
Version: 3.5.0
Release: 2mamba
Summary: The Low Level Virtual Machine
Group: Development/Languages
Vendor: openmamba
Distribution: openmamba
Packager: Davide Madrisan <davide.madrisan@gmail.com>
URL: http://llvm.org/
Source0: http://llvm.org/releases/%{version}/llvm-%{version}.src.tar.xz
Source1: http://llvm.org/releases/%{version}/cfe-%{version}.src.tar.xz
Patch0: %{name}-3.1-llvm-config.patch
Patch1: llvm-3.4-default-to-i586.patch
Patch2: llvm-3.5.0-openmamba-triplet.patch
Patch3: llvm-3.5.0-buildfix-CommandLine_h-getOption.patch
Patch4: llvm-3.5.0-x86_64-llvm-config.patch
Patch5: llvm-3.5.0-llvm-config.patch
License: NCSA
## AUTOBUILDREQ-BEGIN
BuildRequires: glibc-devel
BuildRequires: libedit-devel
BuildRequires: libgcc
BuildRequires: libncurses-devel
BuildRequires: libperl
BuildRequires: libstdc++6-devel
BuildRequires: libxml2-devel
BuildRequires: libz-devel
BuildRequires: perl-devel
## AUTOBUILDREQ-END
BuildRequires: gcc-c++
BuildRequires: glibc-devel
BuildRequires: ocaml
#Requires: gcc >= %{gccver}
#Requires: gcc-c++ >= %{gccver}
BuildRoot: %{_tmppath}/%{name}-%{version}-root
%description
The LLVM Project is a collection of modular and reusable compiler and toolchain technologies.
Despite its name, LLVM has little to do with traditional virtual machines, though it does provide helpful libraries that can be used to build them.
%package -n lib%{name}
Group: System/Libraries
Summary: Shared libraries for %{name}
%description -n lib%{name}
This package contains shared libraries for %{name}.
%package -n lib%{name}-devel
Summary: Libraries and header files for LLVM
Group: Development/Languages
Requires: lib%{name} = %{?epoch:%epoch:}%{version}-%{release}
Provides: llvm-devel
Obsoletes: llvm-devel
Requires: libstdc++6-devel
%description -n lib%{name}-devel
The LLVM Project is a collection of modular and reusable compiler and toolchain technologies.
Despite its name, LLVM has little to do with traditional virtual machines, though it does provide helpful libraries that can be used to build them.
This package contains library and header files needed to develop new native programs that use the LLVM infrastructure.
%package devel
Summary: Libraries and header files for LLVM
Group: Development/Languages
Requires: %{name} = %{?epoch:%epoch:}%{version}-%{release}
Requires: libstdc++6-devel
%description devel
The LLVM Project is a collection of modular and reusable compiler and toolchain technologies.
Despite its name, LLVM has little to do with traditional virtual machines, though it does provide helpful libraries that can be used to build them.
This package contains library and header files needed to develop new native programs that use the LLVM infrastructure.
%package -n clang
Summary: LLVM native C/C++/Objective-C compiler
Group: Development/Languages
Requires: gcc-c++
Provides: cfe
Provides: llvm-clang
Obsoletes: llvm-clang
%description -n clang
Cfe is an "LLVM native" C/C++/Objective-C compiler, which aims to deliver amazingly fast compiles, extremely useful error and warning messages and to provide a platform for building great source level tools.
The Cfe Static Analyzer is a tool automatically finds bugs in your code, and is a great example of the sort of tool that can be built using the Cfe frontend as a library to parse C/C++ code.
%package -n clang-devel
Summary: Libraries and header files for LLVM cfe
Group: Development/Languages
Requires: clang = %{?epoch:%epoch:}%{version}-%{release}
Provides: cfe-devel
Provides: llvm-clang-devel
Obsoletes: llvm-clang-devel
%description -n clang-devel
Cfe is an "LLVM native" C/C++/Objective-C compiler, which aims to deliver amazingly fast compiles, extremely useful error and warning messages and to provide a platform for building great source level tools.
The Cfe Static Analyzer is a tool automatically finds bugs in your code, and is a great example of the sort of tool that can be built using the Cfe frontend as a library to parse C/C++ code.
This package contains header files for the Cfe compiler.
%package ocaml
Summary: OCaml binding for LLVM
Group: Development/Libraries
Requires: %{name} = %{version}-%{release}
#Requires: ocaml-runtime
%description ocaml
OCaml binding for LLVM.
%package ocaml-devel
Summary: Development files for %{name}-ocaml
Group: Development/Libraries
Requires: %{name}-devel = %{?epoch:%epoch:}%{version}-%{release}
Requires: %{name}-ocaml = %{?epoch:%epoch:}%{version}-%{release}
Requires: ocaml
%description ocaml-devel
The %{name}-ocaml-devel package contains libraries and signature files for developing applications that use %{name}-ocaml.
%prep
%setup -q -a1 -n %{name}-%{version}.src
#-D -T
#:<< __EOF
#%patch0 -p1
#%patch1 -p1
mv cfe-%{version}.src tools/clang
%patch2 -p1
%patch3 -p1
%ifarch x86_64
%patch4 -p1
%else
%patch5 -p1
%endif
%build
#:<< ___EOF
%configure \
--with-arch=%{_target_cpu} \
--libdir=%{_libdir}/%{name} \
--datadir=%{_libdir}/%{name} \
--disable-assertions \
--disable-expensive-checks \
--disable-debug-runtime \
--enable-jit \
--enable-shared \
--enable-lffi \
--enable-targets=all \
--with-gcc-toolchain=%{_prefix} \
--with-c-include-dirs=%{_includedir}:%{_libdir}/gcc/%{_target_platform}/%{gccver}/include \
--with-cxx-include-root=%{_includedir}/c++/%{gccver} \
--with-cxx-include-arch=%{_target_platform} \
--with-extra-ld-options="-Wl,-R,%{_libdir}/gcc/%{_target_platform}/%{gccver}"
# --enable-doxygen
sed -i 's|(PROJ_prefix)/lib|(PROJ_prefix)/%{_lib}/%{name}|g' Makefile.config
___EOF
%make
%install
[ "%{buildroot}" != / ] && rm -rf "%{buildroot}"
%makeinstall
install -d %{buildroot}%{_sysconfdir}/ld.so.conf.d
cat >> %{buildroot}%{_sysconfdir}/ld.so.conf.d/llvm-%{_arch}.conf << EOF
%{_libdir}/llvm
EOF
# Static analyzer not installed by default:
# http://clang-analyzer.llvm.org/installation#OtherPlatforms
install -d %{buildroot}%{_libdir}/cfe-analyzer
# create launchers
for f in scan-{build,view}; do
ln -s %{_libdir}/cfe-analyzer/$f/$f %{buildroot}%{_bindir}/$f
done
( cd tools/clang/tools &&
cp -pr scan-{build,view} %{buildroot}%{_libdir}/cfe-analyzer/ )
mv %{buildroot}%{_prefix}/docs/llvm ./llvm-extradocs || true
rm -f ./llvm-extradocs/*.tar.gz
rm -f ./llvm-extradocs/ocamldoc/html/*.tar.gz
install -d cfe-extradocs
for f in LICENSE.TXT NOTES.txt README.txt; do
cp tools/clang/$f cfe-extradocs/
done
#rm -rf tools/clang/docs/{doxygen*,Makefile*,*.graffle,tools}
rm %{buildroot}%{_libdir}/%{name}/*LLVMHello.*
find examples -name 'Makefile' | xargs -0r rm -f
%clean
[ "%{buildroot}" != / ] && rm -rf "%{buildroot}"
%post
/sbin/ldconfig
:
%postun
/sbin/ldconfig
:
%files
%defattr(-,root,root)
%{_bindir}/bugpoint
%{_bindir}/llc
%{_bindir}/lli
%{_bindir}/lli-child-target
%{_bindir}/llvm*
%{_bindir}/macho-dump
#%{_bindir}/c-index-test
%{_libdir}/ocaml/META.llvm
%exclude %{_bindir}/llvm-config
%{_bindir}/opt
%{_bindir}/scan-build
%{_bindir}/scan-view
%{_libdir}/cfe-analyzer
#%{_mandir}/man1/*
#%exclude %{_mandir}/man1/cfe.1.*
#%exclude %{_mandir}/man1/llvmg??.1.*
%doc CREDITS.TXT LICENSE.TXT
#doc llvm-testlog.txt
%files -n libllvm
%defattr(-,root,root)
%{_sysconfdir}/ld.so.conf.d/llvm-%{_arch}.conf
%dir %{_libdir}/llvm
%{_libdir}/llvm/*.so
%files -n libllvm-devel
%defattr(-,root,root)
%{_bindir}/llvm-config
%{_includedir}/%{name}
%{_includedir}/%{name}-c
%{_libdir}/%{name}/*.a
%doc llvm-extradocs/html
%doc README.txt
%files -n clang
%defattr(-,root,root)
%{_bindir}/FileCheck
%{_bindir}/c-index-test
%{_bindir}/clang
%{_bindir}/clang++
%{_bindir}/clang-check
%{_bindir}/clang-format
%{_bindir}/clang-tblgen
%{_bindir}/count
%{_bindir}/not
%{_mandir}/man1/clang.1*
%doc tools/clang/LICENSE.TXT
%files -n clang-devel
%defattr(-,root,root)
%dir %{_includedir}/clang-c
%{_includedir}/clang-c/*.h
%{_includedir}/clang-c/module.modulemap
%dir %{_includedir}/clang/ARCMigrate
%{_includedir}/clang/ARCMigrate/*.h
%dir %{_includedir}/clang/AST
%{_includedir}/clang/AST/*.h
%{_includedir}/clang/AST/*.def
%{_includedir}/clang/AST/*.inc
%dir %{_includedir}/clang/Analysis
%dir %{_includedir}/clang/Analysis/Analyses
%{_includedir}/clang/Analysis/Analyses/ThreadSafetyOps.def
%dir %{_includedir}/clang/Analysis/DomainSpecific
%{_includedir}/clang/Analysis/DomainSpecific/*.h
%dir %{_includedir}/clang/Analysis/FlowSensitive
%{_includedir}/clang/Analysis/FlowSensitive/DataflowValues.h
%dir %{_includedir}/clang/Analysis/Support
%{_includedir}/clang/Analysis/Support/BumpVector.h
%dir %{_includedir}/clang/ASTMatchers/
%{_includedir}/clang/ASTMatchers/*.h
%dir %{_includedir}/clang/ASTMatchers/Dynamic
%{_includedir}/clang/ASTMatchers/Dynamic/*.h
%dir %{_includedir}/clang/Analysis/Analyses
%{_includedir}/clang/Analysis/Analyses/*.h
%{_includedir}/clang/Analysis/*.h
%dir %{_includedir}/clang/Basic
%{_includedir}/clang/Basic/*.h
%{_includedir}/clang/Basic/*.def
%{_includedir}/clang/Basic/*.inc
%dir %{_includedir}/clang/CodeGen
%{_includedir}/clang/CodeGen/*.h
%dir %{_includedir}/clang/Config
%{_includedir}/clang/Config/config.h
%dir %{_includedir}/clang/Driver
%{_includedir}/clang/Driver/*.h
%{_includedir}/clang/Driver/Options.inc
%{_includedir}/clang/Driver/Types.def
%dir %{_includedir}/clang/Edit
%{_includedir}/clang/Edit/*.h
%dir %{_includedir}/clang/Format
%{_includedir}/clang/Format/Format.h
%dir %{_includedir}/clang/Frontend
%{_includedir}/clang/Frontend/*.h
%{_includedir}/clang/Frontend/*.def
%dir %{_includedir}/clang/FrontendTool
%{_includedir}/clang/FrontendTool/Utils.h
%dir %{_includedir}/clang/Index
%{_includedir}/clang/Index/*.h
%dir %{_includedir}/clang/Lex
%{_includedir}/clang/Lex/*.h
%dir %{_includedir}/clang/Parse
%{_includedir}/clang/Parse/*.h
%{_includedir}/clang/Parse/AttrParserStringSwitches.inc
%dir %{_includedir}/clang/Rewrite
%dir %{_includedir}/clang/Rewrite/Core
%{_includedir}/clang/Rewrite/Core/*.h
%dir %{_includedir}/clang/Rewrite/Frontend
%{_includedir}/clang/Rewrite/Frontend/*.h
%dir %{_includedir}/clang/Sema
%{_includedir}/clang/Sema/*.h
%{_includedir}/clang/Sema/*.inc
%dir %{_includedir}/clang/Serialization
%{_includedir}/clang/Serialization/*.h
%{_includedir}/clang/Serialization/*.inc
%dir %{_includedir}/clang/StaticAnalyzer
%dir %{_includedir}/clang/StaticAnalyzer/Checkers
%{_includedir}/clang/StaticAnalyzer/Checkers/*.h
%dir %{_includedir}/clang/StaticAnalyzer/Core
%{_includedir}/clang/StaticAnalyzer/Core/*.h
%{_includedir}/clang/StaticAnalyzer/Core/Analyses.def
%dir %{_includedir}/clang/StaticAnalyzer/Core/BugReporter
%{_includedir}/clang/StaticAnalyzer/Core/BugReporter/*.h
%dir %{_includedir}/clang/StaticAnalyzer/Core/PathSensitive
%{_includedir}/clang/StaticAnalyzer/Core/PathSensitive/*.h
%dir %{_includedir}/clang/StaticAnalyzer/Frontend
%{_includedir}/clang/StaticAnalyzer/Frontend/*.h
%dir %{_includedir}/clang/Tooling
%{_includedir}/clang/Tooling/*
%dir %{_prefix}/lib/clang
%dir %{_prefix}/lib/clang/%{version}
%dir %{_prefix}/lib/clang/%{version}/include
%{_prefix}/lib/clang/%{version}/include/*.h
%{_prefix}/lib/clang/%{version}/include/module.modulemap
%dir %{_datadir}/llvm/cmake
%{_datadir}/llvm/cmake/*.cmake
%doc tools/clang/{NOTES.txt,README.txt}
%doc tools/clang/docs
%files ocaml
%defattr(-,root,root)
%{_libdir}/ocaml/*.cma
%{_libdir}/ocaml/*.cmi
%{_libdir}/ocaml/META.llvm_*
%{_libdir}/ocaml/dllllvm*.so
%files ocaml-devel
%defattr(-,root,root)
%{_libdir}/ocaml/*.a
%{_libdir}/ocaml/*.cmx*
%{_libdir}/ocaml/*.mli
#%doc llvm-extradocs/ocamldoc/html
%changelog
* Fri Sep 19 2014 Silvan Calarco <silvan.calarco@mambasoft.it> 3.5.0-2mamba
- patch llvm-config for x86_64 support and %{_libdir}/llvm
* Wed Sep 10 2014 Silvan Calarco <silvan.calarco@mambasoft.it> 3.5.0-1mamba
- update to 3.5.0
* Thu Jul 10 2014 Silvan Calarco <silvan.calarco@mambasoft.it> 3.4.2-1mamba
- update to 3.4.2
* Sun Feb 16 2014 Silvan Calarco <silvan.calarco@mambasoft.it> 3.4-2mamba
- fix configure settings and add --with-extra-ld-options to correctly link and
pass --with-arch=%{_target_cpu} to fix penmamba bug #000163
* Sun Jan 12 2014 Silvan Calarco <silvan.calarco@mambasoft.it> 3.4-1mamba
- update to 3.4
* Thu Jun 20 2013 Automatic Build System <autodist@mambasoft.it> 3.3-1mamba
- update to 3.3
* Sat Dec 22 2012 Automatic Build System <autodist@mambasoft.it> 3.2-1mamba
- automatic version update by autodist
* Fri Jul 20 2012 Silvan Calarco <silvan.calarco@mambasoft.it> 3.1-1mamba
- update to 3.1
* Thu Feb 23 2012 Ercole 'ercolinux' Carpanetto <ercole69@gmail.com> 3.0.-1mamba
- update to 3.0
* Sun Jul 10 2011 Silvan Calarco <silvan.calarco@mambasoft.it> 2.9-1mamba
- update to 2.9
* Sat Jan 01 2011 Davide Madrisan <davide.madrisan@gmail.com> 2.8-1mamba
- package created by autospec