Blame SPECS/lld.spec

f79958
#%%global rc_ver 3
f79958
%global baserelease 1
074ff8
%global lld_srcdir lld-%{version}%{?rc_ver:rc%{rc_ver}}.src
f79958
%global maj_ver 9
074ff8
f79958
# Don't include unittests in automatic generation of provides or requires.
f79958
%global __provides_exclude_from ^%{_libdir}/lld/.*$
f79958
%global __requires_exclude ^libgtest.*$
f79958
f79958
%bcond_with ld_alternative
0d6038
074ff8
Name:		lld
f79958
Version:	%{maj_ver}.0.1
f79958
Release:	%{baserelease}%{?rc_ver:.rc%{rc_ver}}%{?dist}
074ff8
Summary:	The LLVM Linker
074ff8
074ff8
License:	NCSA
074ff8
URL:		http://llvm.org
f79958
Source0:	http://%{?rc_ver:pre}releases.llvm.org/%{version}/%{?rc_ver:rc%{rc_ver}}/%{lld_srcdir}.tar.xz
f79958
Source1:	run-lit-tests
f79958
Source2:	lit.lld-test.cfg.py
074ff8
074ff8
Patch0:		0001-CMake-Check-for-gtest-headers-even-if-lit.py-is-not-.patch
074ff8
0d6038
BuildRequires:	gcc
0d6038
BuildRequires:	gcc-c++
0d6038
BuildRequires:	cmake
0d6038
BuildRequires:	llvm-devel = %{version}
0d6038
BuildRequires:	llvm-test = %{version}
0d6038
BuildRequires:	ncurses-devel
0d6038
BuildRequires:	zlib-devel
0d6038
BuildRequires:	chrpath
074ff8
074ff8
# For make check:
0d6038
BuildRequires:	python3-rpm-macros
0d6038
BuildRequires:	python3-lit
0d6038
BuildRequires:	llvm-googletest = %{version}
074ff8
f79958
%if %{with ld_alternative}
f79958
Requires(post): %{_sbindir}/alternatives
f79958
Requires(preun): %{_sbindir}/alternatives
f79958
%endif
f79958
f79958
Requires: lld-libs = %{version}-%{release}
f79958
074ff8
%description
074ff8
The LLVM project linker.
074ff8
074ff8
%package devel
074ff8
Summary:	Libraries and header files for LLD
f79958
Requires: lld-libs = %{version}-%{release}
074ff8
074ff8
%description devel
074ff8
This package contains library and header files needed to develop new native
074ff8
programs that use the LLD infrastructure.
074ff8
074ff8
%package libs
074ff8
Summary:	LLD shared libraries
074ff8
074ff8
%description libs
074ff8
Shared libraries for LLD.
074ff8
f79958
%package test
f79958
Summary: LLD regression tests
f79958
Requires:	%{name}%{?_isa} = %{version}-%{release}
f79958
Requires:	python3-lit
f79958
Requires:	llvm-test(major) = %{maj_ver}
f79958
Requires:	lld-libs = %{version}-%{release}
f79958
f79958
%description test
f79958
LLVM regression tests.
f79958
074ff8
%prep
074ff8
%autosetup -n %{name}-%{version}%{?rc_ver:rc%{rc_ver}}.src -p1
074ff8
074ff8
%build
074ff8
074ff8
mkdir %{_target_platform}
074ff8
cd %{_target_platform}
074ff8
074ff8
%cmake .. \
074ff8
	-DLLVM_LINK_LLVM_DYLIB:BOOL=ON \
074ff8
	-DLLVM_DYLIB_COMPONENTS="all" \
0d6038
	-DPYTHON_EXECUTABLE=%{__python3} \
074ff8
	-DLLVM_INCLUDE_TESTS=ON \
074ff8
	-DLLVM_MAIN_SRC_DIR=%{_datadir}/llvm/src \
074ff8
	-DLLVM_EXTERNAL_LIT=%{_bindir}/lit \
074ff8
	-DLLVM_LIT_ARGS="-sv \
0d6038
	--path %{_libdir}/llvm" \
074ff8
%if 0%{?__isa_bits} == 64
074ff8
	-DLLVM_LIBDIR_SUFFIX=64
074ff8
%else
074ff8
	-DLLVM_LIBDIR_SUFFIX=
074ff8
%endif
074ff8
074ff8
%make_build
074ff8
f79958
# Build the unittests so we can install them.
f79958
%make_build lld-test-depends
f79958
074ff8
%install
f79958
f79958
%global lit_cfg test/%{_arch}.site.cfg.py
f79958
%global lit_unit_cfg test/Unit/%{_arch}.site.cfg.py
f79958
%global lit_lld_test_cfg_install_path %{_datadir}/lld/lit.lld-test.cfg.py
f79958
f79958
# Generate lit config files.  Strip off the last line that initiates the
f79958
# test run, so we can customize the configuration.
f79958
head -n -1 %{_target_platform}/test/lit.site.cfg.py >> %{lit_cfg}
f79958
head -n -1 %{_target_platform}/test/Unit/lit.site.cfg.py >> %{lit_unit_cfg}
f79958
f79958
# Patch lit config files to load custom config:
f79958
for f in %{lit_cfg} %{lit_unit_cfg}; do
f79958
  echo "lit_config.load_config(config, '%{lit_lld_test_cfg_install_path}')" >> $f
f79958
done
f79958
f79958
# Install test files
f79958
install -d %{buildroot}%{_datadir}/lld/src
f79958
cp %{SOURCE2} %{buildroot}%{_datadir}/lld/
f79958
f79958
tar -czf %{buildroot}%{_datadir}/lld/src/test.tar.gz test/
f79958
install -d %{buildroot}%{_libexecdir}/tests/lld
f79958
cp %{SOURCE1} %{buildroot}%{_libexecdir}/tests/lld
f79958
f79958
# Install unit test binaries
f79958
install -d %{buildroot}%{_libdir}/lld/
f79958
cp -R %{_target_platform}/unittests %{buildroot}%{_libdir}/lld/
f79958
rm -rf `find %{buildroot}%{_libdir}/lld/ -iname '*make*'`
f79958
f79958
# Install gtest libraries
f79958
cp %{_target_platform}/%{_lib}/libgtest*so* %{buildroot}%{_libdir}/lld/
f79958
f79958
# Install libraries and binaries
074ff8
cd %{_target_platform}
074ff8
%make_install
074ff8
074ff8
# Remove rpath
074ff8
chrpath --delete %{buildroot}%{_bindir}/*
074ff8
chrpath --delete %{buildroot}%{_libdir}/*.so*
f79958
chrpath --delete `find %{buildroot}%{_libdir}/lld/ -type f`
f79958
f79958
%if %{with ld_alternative}
f79958
# Required when using update-alternatives:
f79958
# https://docs.fedoraproject.org/en-US/packaging-guidelines/Alternatives/
f79958
touch %{buildroot}%{_bindir}/ld
f79958
f79958
%post
f79958
%{_sbindir}/update-alternatives --install %{_bindir}/ld ld %{_bindir}/ld.lld 1
f79958
f79958
%postun
f79958
if [ $1 -eq 0 ] ; then
f79958
  %{_sbindir}/update-alternatives --remove ld %{_bindir}/ld.lld
f79958
fi
f79958
%endif
074ff8
074ff8
%check
0d6038
f79958
# armv7lhl tests disabled because of arm issue, see https://koji.fedoraproject.org/koji/taskinfo?taskID=33660162
f79958
%ifnarch %{arm}
074ff8
make -C %{_target_platform} %{?_smp_mflags} check-lld
0d6038
%endif
074ff8
0d6038
%ldconfig_scriptlets libs
074ff8
074ff8
%files
f79958
%if %{with ld_alternative}
f79958
%ghost %{_bindir}/ld
f79958
%endif
074ff8
%{_bindir}/lld*
074ff8
%{_bindir}/ld.lld
074ff8
%{_bindir}/ld64.lld
074ff8
%{_bindir}/wasm-ld
074ff8
074ff8
%files devel
074ff8
%{_includedir}/lld
074ff8
%{_libdir}/liblld*.so
074ff8
074ff8
%files libs
074ff8
%{_libdir}/liblld*.so.*
074ff8
f79958
%files test
f79958
%{_libexecdir}/tests/lld/
f79958
%{_libdir}/lld/
f79958
%{_datadir}/lld/src/test.tar.gz
f79958
%{_datadir}/lld/lit.lld-test.cfg.py
f79958
074ff8
%changelog
f79958
* Thu Dec 19 2019 Tom Stellard <tstellar@redhat.com> -9.0.1-1
f79958
- 9.0.1 Release
f79958
f79958
* Fri Dec 13 2019 Tom Stellard <tstellar@redhat.com> - 9.0.0-5
f79958
- Fix some rpmdiff errors
f79958
f79958
* Fri Dec 13 2019 Tom Stellard <tstellar@redhat.com> - 9.0.0-4
f79958
- Remove build artifacts installed with unittests
f79958
f79958
* Thu Dec 05 2019 Tom Stellard <tstellar@redhat.com> - 9.0.0-3
f79958
- Add lld-test package
f79958
f79958
* Thu Nov 14 2019 Tom Stellard <tstellar@redhat.com> - 9.0.0-2
f79958
- Add explicit lld-libs requires to fix rpmdiff errors
f79958
f79958
* Thu Sep 26 2019 Tom Stellard <tstellar@redhat.com> - 9.0.0-1
f79958
- 9.0.0 Release
f79958
0d6038
* Thu Aug 1 2019 sguelton@redhat.com - 8.0.1-1
0d6038
- 8.0.1 release
0d6038
0d6038
* Mon Jun 17 2019 sguelton@redhat.com - 8.0.1-0.2.rc2
0d6038
- Remove unnecessary threading patch
0d6038
0d6038
* Thu Jun 13 2019 sguelton@redhat.com - 8.0.1-0.1.rc2
0d6038
- 8.0.1rc2 Release
0d6038
0d6038
* Tue Apr 16 2019 sguelton@redhat.com - 8.0.0-1
0d6038
- 8.0.0 Release
0d6038
074ff8
* Mon Jan 14 2019 sguelton@redhat.com - 7.0.1-3
074ff8
- Fix lld + annobin integration & Setup basic CI tests
074ff8
074ff8
* Sat Dec 15 2018 Tom Stellard <tstellar@redhat.com> - 7.0.1-2
074ff8
- Bump required python3-lit version
074ff8
074ff8
* Fri Dec 14 2018 Tom Stellard <tstellar@redhat.com> - 7.0.1-1
074ff8
- 7.0.1-1 Release
074ff8
074ff8
* Mon Dec 10 2018 Tom Stellard <tstellar@redhat.com> - 7.0.1-0.2.rc3
074ff8
- 7.0.1-rc3 Release
074ff8
074ff8
* Tue Nov 27 2018 Tom Stellard <tstellar@redhat.com> - 7.0.0-1
074ff8
- 7.0.0 Release
074ff8
074ff8
* Mon Oct 01 2018 Tom Stellard <tstellar@redhat.com> - 6.0.1-2
074ff8
- Drop scl macros
074ff8
074ff8
* Wed Jun 27 2018 Tom Stellard <tstellar@redhat.com> - 6.0.1-1
074ff8
- 6.0.1 Release
074ff8
074ff8
* Fri May 11 2018 Tom Stellard <tstellar@redhat.com> - 6.0.1-0.1.rc1
074ff8
- 6.0.1-rc1 Release
074ff8
074ff8
* Thu Mar 08 2018 Tom Stellard <tstellar@redhat.com> - 6.0.0-1
074ff8
- 6.0.0 Release
074ff8
074ff8
* Tue Feb 13 2018 Tom Stellard <tstellar@redhat.com> - 6.0.0-0.3.rc2
074ff8
- 6.0.0-rc2 Release
074ff8
074ff8
* Thu Feb 08 2018 Fedora Release Engineering <releng@fedoraproject.org> - 6.0.0-0.2.rc1
074ff8
- Rebuilt for https://fedoraproject.org/wiki/Fedora_28_Mass_Rebuild
074ff8
074ff8
* Thu Jan 25 2018 Tom Stellard <tstellar@redhat.com> - 6.0.0-0.1.rc1
074ff8
- 6.0.0-rc1 Release
074ff8
074ff8
* Thu Dec 21 2017 Tom Stellard <tstellar@redhat.com> - 5.0.1-1
074ff8
- 5.0.1 Release
074ff8
074ff8
* Mon Sep 11 2017 Tom Stellard <tstellar@redhat.com> - 5.0.0-1
074ff8
- 5.0.0 Release
074ff8
074ff8
* Thu Aug 03 2017 Fedora Release Engineering <releng@fedoraproject.org> - 4.0.1-4
074ff8
- Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Binutils_Mass_Rebuild
074ff8
074ff8
* Wed Jul 26 2017 Fedora Release Engineering <releng@fedoraproject.org> - 4.0.1-3
074ff8
- Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Mass_Rebuild
074ff8
074ff8
* Thu Jul 06 2017 Tom Stellard <tstellar@redhat.com> - 4.0.1-2
074ff8
- Backport r307092
074ff8
074ff8
* Tue Jul 04 2017 Tom Stellard <tstellar@redhat.com> - 4.0.1-1
074ff8
- 4.0.1 Release
074ff8
074ff8
* Tue Jul 04 2017 Tom Stellard <tstellar@redhat.com> - 4.0.0-4
074ff8
- Fix build without llvm-static
074ff8
074ff8
* Wed May 31 2017 Tom Stellard <tstellar@redhat.com> - 4.0.0-3
074ff8
- Remove llvm-static dependency
074ff8
074ff8
* Mon May 15 2017 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 4.0.0-2
074ff8
- Rebuilt for https://fedoraproject.org/wiki/Fedora_26_27_Mass_Rebuild
074ff8
074ff8
* Tue Mar 14 2017 Tom Stellard <tstellar@redhat.com> - 4.0.0-1
074ff8
- lld 4.0.0 Final Release