Blame SPECS/lld.spec

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