adaptations for CMake out-of-tree builds

See: https://fedoraproject.org/wiki/Changes/CMake_to_do_out-of-source_builds
This commit is contained in:
Fabio Valentini 2020-08-06 20:14:05 +02:00
parent 0a06e6fc93
commit c47995e62a
No known key found for this signature in database
GPG Key ID: 5AC5F572E5D410AF

View File

@ -136,21 +136,18 @@ find doc -type f -print0 | xargs -0 chmod a-x
%build
mkdir fedora
cd fedora
export CFLAGS="$RPM_OPT_FLAGS -Wno-error=format-security -fno-strict-aliasing"
export CXXFLAGS="$CFLAGS"
export FFLAGS="$CFLAGS"
%cmake CMAKE_VERBOSE=1 \
-DCMAKE_INSTALL_PREFIX:PATH=%{_prefix} \
-DBUILD_SHARED_LIBS:BOOL=ON \
..
make VERBOSE=1 %{?_smp_mflags}
%cmake \
-DCMAKE_INSTALL_PREFIX:PATH=%{_prefix} \
-DBUILD_SHARED_LIBS:BOOL=ON
%cmake_build
%install
cd fedora
make install DESTDIR=$RPM_BUILD_ROOT
%cmake_install
perl -pi -e 's#^require v5.8.1;##g' $RPM_BUILD_ROOT%{_bindir}/dirsplit
ln -s genisoimage $RPM_BUILD_ROOT%{_bindir}/mkisofs
ln -s genisoimage $RPM_BUILD_ROOT%{_bindir}/mkhybrid
@ -158,10 +155,6 @@ ln -s icedax $RPM_BUILD_ROOT%{_bindir}/cdda2wav
ln -s wodim $RPM_BUILD_ROOT%{_bindir}/cdrecord
ln -s wodim $RPM_BUILD_ROOT%{_bindir}/dvdrecord
#do not include empty fedora/* directories in debuginfo package
cd ..
rm -rf fedora
# missing man page. Do symlink like in debian
ln -sf wodim.1.gz $RPM_BUILD_ROOT/%{_mandir}/man1/netscsid.1.gz