Add Pod::Simple and Pod::Escapes to fix build issue
[profile/ivi/llvm.git] / packaging / llvm.spec
1 Name:           llvm
2 Version:        2.9
3 Release:        4
4 Summary:        The Low Level Virtual Machine
5 Group:          Development/Languages
6 License:        NCSA
7 URL:            http://llvm.org/
8 Source0:        llvm-%{version}%{?prerel}.tgz
9
10 # Data files should be installed with timestamps preserved
11 Patch0:         llvm-2.6-timestamp.patch
12 # clang link failure if system GCC version is unknown
13 # http://llvm.org/bugs/show_bug.cgi?id=8897
14 Patch1:         clang-2.9-add_gcc_vers.patch
15 # Operator.h incompatibility with GCC 4.6 in C++0x mode
16 # http://llvm.org/bugs/show_bug.cgi?id=9869
17 Patch2:         llvm-2.9-PR9869_operator_destructor.patch
18
19 BuildRequires:  bison
20 BuildRequires:  chrpath
21 BuildRequires:  flex
22 BuildRequires:  gcc-c++ >= 3.4
23 BuildRequires:  groff
24 BuildRequires:  libffi-devel
25 BuildRequires:  libtool-ltdl-devel
26 BuildRequires:  perl(Pod::Escapes)
27 BuildRequires:  perl(Pod::Simple)
28 Requires:       libllvm = %{version}-%{release}
29 ExclusiveArch:  %ix86
30
31 %description
32 LLVM is a compiler infrastructure designed for compile-time,
33 link-time, runtime, and idle-time optimization of programs from
34 arbitrary programming languages.  The compiler infrastructure includes
35 mirror sets of programming tools as well as libraries with equivalent
36 functionality.
37
38
39 %package devel
40 Summary:        Libraries and header files for LLVM
41 Group:          Development/Languages
42 Requires:       %{name} = %{version}-%{release}
43 Requires:       libffi-devel
44 Requires:       libstdc++-devel >= 3.4
45 Provides:       llvm-static = %{version}-%{release}
46
47 Requires(posttrans): /usr/sbin/alternatives
48 Requires(postun):    /usr/sbin/alternatives
49
50 %description devel
51 This package contains library and header files needed to develop new
52 native programs that use the LLVM infrastructure.
53
54
55
56 %package -n libllvm
57 Summary:        LLVM shared libraries
58 Group:          System Environment/Libraries
59
60 %description -n libllvm
61 Shared libraries for the LLVM compiler infrastructure.
62
63
64
65
66 %prep
67 %setup -q -n llvm-%{version}
68
69 # llvm patches
70 %patch0 -p1 -b .timestamp
71 %patch2 -p1 -b .pr9869_operator_destructor
72
73 %build
74 %configure \
75   --prefix=%{_prefix} \
76   --libdir=%{_libdir}/%{name} \
77   --datadir=%{_libdir}/%{name} \
78   --disable-doxygen \
79   --disable-assertions \
80   --enable-debug-runtime \
81   --enable-jit \
82   --enable-libffi \
83   --enable-shared \
84   --with-c-include-dirs=%{_includedir}:$(find %{_prefix}/lib/gcc/*/* \
85       -maxdepth 0 -type d)/include \
86 %if %{__isa_bits} == 64
87   --with-cxx-include-32bit-dir=32 \
88 %endif
89   --with-cxx-include-root=$(find %{_includedir}/c++/* -maxdepth 0 -type d) \
90   --with-cxx-include-arch=%{_target_cpu}-%{_vendor}-%{_os} \
91
92 # FIXME file this
93 # configure does not properly specify libdir
94 sed -i 's|(PROJ_prefix)/lib|(PROJ_prefix)/%{_lib}/%{name}|g' Makefile.config
95
96 make %{_smp_mflags} REQUIRES_RTTI=1 \
97   OPTIMIZE_OPTION="%{optflags}"
98
99
100 %install
101 make install DESTDIR=%{buildroot} \
102      PROJ_docsdir=/moredocs
103
104 # Create ld.so.conf.d entry
105 mkdir -p %{buildroot}%{_sysconfdir}/ld.so.conf.d
106 cat >> %{buildroot}%{_sysconfdir}/ld.so.conf.d/llvm-%{_arch}.conf << EOF
107 %{_libdir}/llvm
108 EOF
109
110
111 #find %%{buildroot} -name .dir -print0 | xargs -0r rm -f
112 file %{buildroot}/%{_bindir}/* | awk -F: '$2~/ELF/{print $1}' | xargs -r chrpath -d
113 file %{buildroot}/%{_libdir}/llvm/*.so | awk -F: '$2~/ELF/{print $1}' | xargs -r chrpath -d
114
115 # Get rid of erroneously installed example files.
116 rm %{buildroot}%{_libdir}/%{name}/*LLVMHello.*
117
118 # FIXME file this bug
119 sed -i 's,ABS_RUN_DIR/lib",ABS_RUN_DIR/%{_lib}/%{name}",' \
120   %{buildroot}%{_bindir}/llvm-config
121
122 chmod -x %{buildroot}%{_libdir}/%{name}/*.a
123
124 find examples -name 'Makefile' | xargs -0r rm -f
125
126
127
128 rm -rf %buildroot/moredocs
129
130 %post -n libllvm -p /sbin/ldconfig
131
132
133 %postun -n libllvm -p /sbin/ldconfig
134
135
136
137 %files
138 /usr/bin/tblgen
139 %{_bindir}/bugpoint
140 %{_bindir}/llc
141 %{_bindir}/lli
142 %{_bindir}/llvm*
143 %{_bindir}/macho-dump
144 %{_bindir}/opt
145 %doc %{_mandir}/man1/*.1.*
146
147 %files devel
148 %{_bindir}/llvm-config
149 %{_includedir}/%{name}
150 %{_includedir}/%{name}-c
151 %{_libdir}/%{name}/*.a
152
153 %files -n libllvm
154 %config(noreplace) %{_sysconfdir}/ld.so.conf.d/llvm-%{_arch}.conf
155 %dir %{_libdir}/%{name}
156 %{_libdir}/%{name}/*.so
157