mirror of
https://github.com/clearlinux/clr-rpm-config.git
synced 2026-08-31 02:46:48 +00:00
720 lines
28 KiB
Plaintext
720 lines
28 KiB
Plaintext
|
|
|
|
#==============================================================================
|
|
# ---- per-platform macros.
|
|
#
|
|
%_vendor clr
|
|
%_os linux
|
|
%_target_platform %{_target_cpu}-%{_vendor}-%{_target_os}%{?_gnu}
|
|
|
|
|
|
#==============================================================================
|
|
# ---- configure macros. note that most of these are inherited
|
|
# from the defaults.
|
|
#
|
|
%_prefix /usr
|
|
%_sysconfdir /etc
|
|
%_localstatedir /var
|
|
%_infodir %{_datadir}/info
|
|
%_mandir %{_datadir}/man
|
|
%_initrddir %{_sysconfdir}/rc.d/init.d
|
|
%_defaultdocdir %{_usr}/share/doc
|
|
%_docdir_fmt %%{NAME}
|
|
%_libdir /usr/lib64
|
|
%_lib lib64
|
|
%_fmoddir %{_libdir}/gfortran/modules
|
|
%_enable_debug_packages 1
|
|
|
|
# creates the build-id only for debug elf objects
|
|
%_build_id_links alldebug
|
|
|
|
# Default fuzz level for %patch in spec file.
|
|
%_default_patch_fuzz 2
|
|
|
|
# Default patch flags
|
|
#
|
|
# Upstream's default (as of rpm 4.17) is `--no-backup-if-mismatch -f`, but
|
|
# because `-f` suppresses the reverse patch diagnostic reporting that we might
|
|
# want for a future autospec feature [0], omit that flag.
|
|
# [0]: https://github.com/clearlinux/autospec/issues/454
|
|
%_default_patch_flags --no-backup-if-mismatch
|
|
|
|
# avoid aborting with packages without debugfiles.list
|
|
%_empty_manifest_terminate_build 0
|
|
|
|
#==============================================================================
|
|
# ---- configure and makeinstall.
|
|
#
|
|
%configure \
|
|
CFLAGS="${CFLAGS:-%optflags} -fPIC" ; export CFLAGS ; \
|
|
LDFLAGS="$LDFLAGS -Wl,--build-id=sha1" ; export LDFLAGS ; \
|
|
./configure --build=%{_build} --host=%{_host} \\\
|
|
--target=%{_target_platform} \\\
|
|
--program-prefix=%{?_program_prefix} \\\
|
|
--prefix=%{_prefix} \\\
|
|
--exec-prefix=%{_exec_prefix} \\\
|
|
--bindir=%{_bindir} \\\
|
|
--sbindir=%{_bindir} \\\
|
|
--sysconfdir=%{_sysconfdir} \\\
|
|
--datadir=%{_datadir} \\\
|
|
--includedir=%{_includedir} \\\
|
|
--libdir=%{_libdir} \\\
|
|
--libexecdir=%{_libexecdir} \\\
|
|
--localstatedir=%{_localstatedir} \\\
|
|
--sharedstatedir=%{_sharedstatedir} \\\
|
|
--mandir=%{_mandir} \\\
|
|
--infodir=%{_infodir}
|
|
|
|
|
|
%reconfigure \
|
|
CFLAGS="${CFLAGS:-%optflags} -fPIC" ; export CFLAGS ; \
|
|
autoreconf -v --install --force || exit 1 \
|
|
./configure --build=%{_build} --host=%{_host} \\\
|
|
--target=%{_target_platform} \\\
|
|
--program-prefix=%{?_program_prefix} \\\
|
|
--prefix=%{_prefix} \\\
|
|
--exec-prefix=%{_exec_prefix} \\\
|
|
--bindir=%{_bindir} \\\
|
|
--sbindir=%{_bindir} \\\
|
|
--sysconfdir=%{_sysconfdir} \\\
|
|
--datadir=%{_datadir} \\\
|
|
--includedir=%{_includedir} \\\
|
|
--libdir=%{_libdir} \\\
|
|
--libexecdir=%{_libexecdir} \\\
|
|
--localstatedir=%{_localstatedir} \\\
|
|
--sharedstatedir=%{_sharedstatedir} \\\
|
|
--mandir=%{_mandir} \\\
|
|
--infodir=%{_infodir}
|
|
|
|
%autogen \
|
|
CFLAGS="${CFLAGS:-%optflags} -fPIC" ; export CFLAGS ; \
|
|
NOCONFIGURE="noconfigure"; export NOCONFIGURE ; \
|
|
sh ./autogen.sh --build=%{_build} --host=%{_host} \\\
|
|
--target=%{_target_platform} \\\
|
|
--program-prefix=%{?_program_prefix} \\\
|
|
--prefix=%{_prefix} \\\
|
|
--exec-prefix=%{_exec_prefix} \\\
|
|
--bindir=%{_bindir} \\\
|
|
--sbindir=%{_bindir} \\\
|
|
--sysconfdir=%{_sysconfdir} \\\
|
|
--datadir=%{_datadir} \\\
|
|
--includedir=%{_includedir} \\\
|
|
--libdir=%{_libdir} \\\
|
|
--libexecdir=%{_libexecdir} \\\
|
|
--localstatedir=%{_localstatedir} \\\
|
|
--sharedstatedir=%{_sharedstatedir} \\\
|
|
--mandir=%{_mandir} \\\
|
|
--infodir=%{_infodir} || : \
|
|
./configure --build=%{_build} --host=%{_host} \\\
|
|
--target=%{_target_platform} \\\
|
|
--program-prefix=%{?_program_prefix} \\\
|
|
--prefix=%{_prefix} \\\
|
|
--exec-prefix=%{_exec_prefix} \\\
|
|
--bindir=%{_bindir} \\\
|
|
--sbindir=%{_bindir} \\\
|
|
--sysconfdir=%{_sysconfdir} \\\
|
|
--datadir=%{_datadir} \\\
|
|
--includedir=%{_includedir} \\\
|
|
--libdir=%{_libdir} \\\
|
|
--libexecdir=%{_libexecdir} \\\
|
|
--localstatedir=%{_localstatedir} \\\
|
|
--sharedstatedir=%{_sharedstatedir} \\\
|
|
--mandir=%{_mandir} \\\
|
|
--infodir=%{_infodir}
|
|
|
|
|
|
%waf \
|
|
CFLAGS="${CFLAGS:-%optflags}" ; export CFLAGS ; \
|
|
FFLAGS="${FFLAGS:-%optflags -I%_fmoddir}" ; export FFLAGS ; \
|
|
./waf configure \\\
|
|
--prefix=%{_prefix} \\\
|
|
--exec-prefix=%{_exec_prefix} \\\
|
|
--bindir=%{_bindir} \\\
|
|
--sbindir=%{_bindir} \\\
|
|
--sysconfdir=%{_sysconfdir} \\\
|
|
--datadir=%{_datadir} \\\
|
|
--includedir=%{_includedir} \\\
|
|
--libdir=%{_libdir} \\\
|
|
--libexecdir=%{_libexecdir} \\\
|
|
--localstatedir=%{_localstatedir} \\\
|
|
--sharedstatedir=%{_sharedstatedir} \\\
|
|
--mandir=%{_mandir} \\\
|
|
--infodir=%{_infodir}
|
|
|
|
%cmake \
|
|
cmake -G "Unix Makefiles" \\\
|
|
-DBUILD_SHARED_LIBS:BOOL=ON \\\
|
|
-DCMAKE_INSTALL_PREFIX=%{_prefix} \\\
|
|
-DCMAKE_INSTALL_SBINDIR=%{_sbindir} \\\
|
|
-DCMAKE_INSTALL_LIBDIR=%{_libdir} -DLIB_INSTALL_DIR=%{_libdir} -DLIB_SUFFIX=64 \\\
|
|
-DCMAKE_AR=/usr/bin/gcc-ar \\\
|
|
-DCMAKE_BUILD_TYPE=RelWithDebInfo \\\
|
|
-DCMAKE_RANLIB=/usr/bin/gcc-ranlib \\\
|
|
-DCMAKE_CTEST_ARGUMENTS="--output-on-failure"
|
|
|
|
%qmake \
|
|
qmake QMAKE_CFLAGS="$CFLAGS" \\\
|
|
QMAKE_CXXFLAGS="$CXXFLAGS" \\\
|
|
QMAKE_LFLAGS="$LDFLAGS" \\\
|
|
QMAKE_CFLAGS_RELEASE= \\\
|
|
QMAKE_LIBDIR="/usr/lib64" \\\
|
|
QMAKE_CXXFLAGS_RELEASE=
|
|
|
|
%makeinstall \
|
|
%{__make} \\\
|
|
prefix=%{?buildroot:%{buildroot}}%{_prefix} \\\
|
|
exec_prefix=%{?buildroot:%{buildroot}}%{_exec_prefix} \\\
|
|
bindir=%{?buildroot:%{buildroot}}%{_bindir} \\\
|
|
sbindir=%{?buildroot:%{buildroot}}%{_bindir} \\\
|
|
sysconfdir=%{?buildroot:%{buildroot}}%{_sysconfdir} \\\
|
|
datadir=%{?buildroot:%{buildroot}}%{_datadir} \\\
|
|
includedir=%{?buildroot:%{buildroot}}%{_includedir} \\\
|
|
libdir=%{?buildroot:%{buildroot}}%{_libdir} \\\
|
|
libexecdir=%{?buildroot:%{buildroot}}%{_libexecdir} \\\
|
|
localstatedir=%{?buildroot:%{buildroot}}%{_localstatedir} \\\
|
|
sharedstatedir=%{?buildroot:%{buildroot}}%{_sharedstatedir} \\\
|
|
mandir=%{?buildroot:%{buildroot}}%{_mandir} \\\
|
|
infodir=%{?buildroot:%{buildroot}}%{_infodir} \\\
|
|
install
|
|
|
|
%make_install_command() \
|
|
%{__make} \\\
|
|
DESTDIR=%{?buildroot:%{buildroot}} \\\
|
|
INSTALLROOT=%{?buildroot:%{buildroot}} \\\
|
|
install_prefix=%{?buildroot:%{buildroot}} \\\
|
|
BUILDROOT=%{?buildroot:%{buildroot}} \\\
|
|
BUILD_ROOT=%{?buildroot:%{buildroot}} \\\
|
|
INSTALL_ROOT=%{?buildroot:%{buildroot}} \\\
|
|
install %*
|
|
|
|
%make_install_command_v3() \
|
|
%{__make} \\\
|
|
DESTDIR=%{?buildroot:%{buildroot}-v3} \\\
|
|
INSTALLROOT=%{?buildroot:%{buildroot}-v3} \\\
|
|
install_prefix=%{?buildroot:%{buildroot}-v3} \\\
|
|
BUILDROOT=%{?buildroot:%{buildroot}-v3} \\\
|
|
BUILD_ROOT=%{?buildroot:%{buildroot}-v3} \\\
|
|
INSTALL_ROOT=%{?buildroot:%{buildroot}-v3} \\\
|
|
install %*
|
|
|
|
%make_install_command_v4() \
|
|
%{__make} \\\
|
|
DESTDIR=%{?buildroot:%{buildroot}-v4} \\\
|
|
INSTALLROOT=%{?buildroot:%{buildroot}-v4} \\\
|
|
install_prefix=%{?buildroot:%{buildroot}-v4} \\\
|
|
BUILDROOT=%{?buildroot:%{buildroot}-v4} \\\
|
|
BUILD_ROOT=%{?buildroot:%{buildroot}-v4} \\\
|
|
INSTALL_ROOT=%{?buildroot:%{buildroot}-v4} \\\
|
|
install %*
|
|
|
|
%make_install_common() \
|
|
rm -f %{?buildroot:%{buildroot}}/usr/share/info/dir \
|
|
rm -rf %{?buildroot:%{buildroot}}/usr/lib64/haswell/pkgconfig \
|
|
rm -rf %{?buildroot:%{buildroot}}/usr/lib64/haswell/avx512_1/pkgconfig \
|
|
rm -rf %{?buildroot:%{buildroot}}/usr/local \
|
|
rm -f %{?buildroot:%{buildroot}}/usr/lib/perl5/*/*/perllocal.pod \
|
|
[ -d %{?buildroot:%{buildroot}}/etc/dbus-1 ] && mkdir -p %{?buildroot:%{buildroot}}/usr/share/dbus-1 || : \
|
|
[ -d %{?buildroot:%{buildroot}}/etc/dbus-1 ] && mv %{?buildroot:%{buildroot}}/etc/dbus-1/* %{?buildroot:%{buildroot}}/usr/share/dbus-1/ || : \
|
|
[ -d %{?buildroot:%{buildroot}}/sbin ] && mkdir %{?buildroot:%{buildroot}}/usr/bin/ || : \
|
|
[ -d %{?buildroot:%{buildroot}}/bin ] && mkdir %{?buildroot:%{buildroot}}/usr/bin/ || : \
|
|
[ -d %{?buildroot:%{buildroot}}/usr/sbin ] && mkdir %{?buildroot:%{buildroot}}/usr/bin/ || : \
|
|
[ -d %{?buildroot:%{buildroot}}/usr/sbin ] && mv %{?buildroot:%{buildroot}}/usr/sbin/* %{?buildroot:%{buildroot}}/usr/bin/ || : \
|
|
[ -d %{?buildroot:%{buildroot}}/bin ] && mv %{?buildroot:%{buildroot}}/bin/* %{?buildroot:%{buildroot}}/usr/bin/ || : \
|
|
[ -d %{?buildroot:%{buildroot}}/sbin ] && mv %{?buildroot:%{buildroot}}/sbin/* %{?buildroot:%{buildroot}}/usr/bin/ || : \
|
|
[ -d %{?buildroot:%{buildroot}}/usr/share/pkgconfig ] && mkdir -p %{?buildroot:%{buildroot}}/usr/lib64/pkgconfig || : \
|
|
[ -d %{?buildroot:%{buildroot}}/usr/lib/pkgconfig ] && mkdir -p %{?buildroot:%{buildroot}}/usr/lib64/pkgconfig || : \
|
|
[ -d %{?buildroot:%{buildroot}}/usr/share/pkgconfig ] && mv %{?buildroot:%{buildroot}}/usr/share/pkgconfig/* %{?buildroot:%{buildroot}}/usr/lib64/pkgconfig && rmdir %{?buildroot:%{buildroot}}/usr/share/pkgconfig || : \
|
|
[ -d %{?buildroot:%{buildroot}}/usr/lib/pkgconfig ] && mv %{?buildroot:%{buildroot}}/usr/lib/pkgconfig/* %{?buildroot:%{buildroot}}/usr/lib64/pkgconfig && rmdir %{?buildroot:%{buildroot}}/usr/lib/pkgconfig || : \
|
|
[ -d %{?buildroot:%{buildroot}}/usr/share/doc/%{name}-%{version} ] && mv %{?buildroot:%{buildroot}}/usr/share/doc/%{name}-%{version} %{?buildroot:%{buildroot}}/usr/share/doc/%{name} || : \
|
|
[ -d %{?buildroot:%{buildroot}}/usr/sbin ] && rmdir %{?buildroot:%{buildroot}}/usr/sbin || : \
|
|
[ -d %{?buildroot:%{buildroot}}/sbin ] && rmdir %{?buildroot:%{buildroot}}/sbin || : \
|
|
[ -d %{?buildroot:%{buildroot}}/bin ] && rmdir %{?buildroot:%{buildroot}}/bin || : \
|
|
chmod a+x %{?buildroot:%{buildroot}}{/usr,}/lib{,32,64}/*.so* || : \
|
|
%{!?keepstatic:find %{?buildroot:%{buildroot}} -regex ".*\\.a$" | xargs rm -f --}
|
|
|
|
%make_install() \
|
|
%{make_install_command} %* \
|
|
%{make_install_common}
|
|
|
|
%make_install_avx2() \
|
|
%{make_install_command} %* \
|
|
%{make_install_common} \
|
|
/usr/bin/clr-avx2-move.pl haswell .avx2 %{?buildroot:%{buildroot}}/
|
|
|
|
%make_install_avx512() \
|
|
%{make_install_command} %* \
|
|
%{make_install_common} \
|
|
/usr/bin/clr-avx2-move.pl haswell/avx512_1 .avx512 %{?buildroot:%{buildroot}}/
|
|
|
|
%make_install_v3() \
|
|
%{make_install_command_v3} %* \
|
|
%{make_install_common}
|
|
|
|
%make_install_v4() \
|
|
%{make_install_command_v4} %* \
|
|
%{make_install_common}
|
|
|
|
%make_install_openmpi() \
|
|
%{make_install_command} %* \
|
|
rm -f %{?buildroot:%{buildroot}}$MPI_ROOT/share/info/dir \
|
|
rm -f %{?buildroot:%{buildroot}}$MPI_LIB/perl5/*/*/perllocal.pod \
|
|
%{!?keepstatic:find %{?buildroot:%{buildroot}}$MPI_ROOT -regex ".*\\.a$" | xargs rm -f --} \
|
|
chmod a+x %{?buildroot:%{buildroot}}$MPI_BIN/* || : \
|
|
chmod a+x %{?buildroot:%{buildroot}}$MPI_LIB/* || :
|
|
|
|
%make_install32() \
|
|
%{__make} \\\
|
|
DESTDIR=%{?buildroot:%{buildroot}} \\\
|
|
INSTALLROOT=%{?buildroot:%{buildroot}} \\\
|
|
install_prefix=%{?buildroot:%{buildroot}} \\\
|
|
BUILDROOT=%{?buildroot:%{buildroot}} \\\
|
|
BUILD_ROOT=%{?buildroot:%{buildroot}} \\\
|
|
INSTALL_ROOT=%{?buildroot:%{buildroot}} \\\
|
|
install %* \
|
|
rm -f %{?buildroot:%{buildroot}}/usr/share/info/dir \
|
|
rm -f %{?buildroot:%{buildroot}}/usr/lib/perl5/*/*/perllocal.pod \
|
|
[ -d %{?buildroot:%{buildroot}}/sbin ] && mkdir %{?buildroot:%{buildroot}}/usr/bin/ || : \
|
|
[ -d %{?buildroot:%{buildroot}}/bin ] && mkdir %{?buildroot:%{buildroot}}/usr/bin/ || : \
|
|
[ -d %{?buildroot:%{buildroot}}/usr/sbin ] && mkdir %{?buildroot:%{buildroot}}/usr/bin/ || : \
|
|
[ -d %{?buildroot:%{buildroot}}/usr/sbin ] && mv %{?buildroot:%{buildroot}}/usr/sbin/* %{?buildroot:%{buildroot}}/usr/bin/ || : \
|
|
[ -d %{?buildroot:%{buildroot}}/bin ] && mv %{?buildroot:%{buildroot}}/bin/* %{?buildroot:%{buildroot}}/usr/bin/ || : \
|
|
[ -d %{?buildroot:%{buildroot}}/sbin ] && mv %{?buildroot:%{buildroot}}/sbin/* %{?buildroot:%{buildroot}}/usr/bin/ || : \
|
|
[ -d %{?buildroot:%{buildroot}}/usr/share/pkgconfig ] && mkdir -p %{?buildroot:%{buildroot}}/usr/lib32/pkgconfig || : \
|
|
[ -d %{?buildroot:%{buildroot}}/usr/lib/pkgconfig ] && mkdir -p %{?buildroot:%{buildroot}}/usr/lib32/pkgconfig || : \
|
|
[ -d %{?buildroot:%{buildroot}}/usr/share/pkgconfig ] && mv %{?buildroot:%{buildroot}}/usr/share/pkgconfig/* %{?buildroot:%{buildroot}}/usr/lib32/pkgconfig && rmdir %{?buildroot:%{buildroot}}/usr/share/pkgconfig || : \
|
|
[ -d %{?buildroot:%{buildroot}}/usr/lib/pkgconfig ] && mv %{?buildroot:%{buildroot}}/usr/lib/pkgconfig/* %{?buildroot:%{buildroot}}/usr/lib32/pkgconfig && rmdir %{?buildroot:%{buildroot}}/usr/lib/pkgconfig || : \
|
|
[ -d %{?buildroot:%{buildroot}}/usr/share/doc/%{name}-%{version} ] && mv %{?buildroot:%{buildroot}}/usr/share/doc/%{name}-%{version} %{?buildroot:%{buildroot}}/usr/share/doc/%{name} || : \
|
|
[ -d %{?buildroot:%{buildroot}}/usr/sbin ] && rmdir %{?buildroot:%{buildroot}}/usr/sbin || : \
|
|
[ -d %{?buildroot:%{buildroot}}/sbin ] && rmdir %{?buildroot:%{buildroot}}/sbin || : \
|
|
[ -d %{?buildroot:%{buildroot}}/bin ] && rmdir %{?buildroot:%{buildroot}}/bin || : \
|
|
chmod a+x %{?buildroot:%{buildroot}}/usr/lib32/* || : \
|
|
chmod a+x %{?buildroot:%{buildroot}}/lib/* || : \
|
|
%{!?keepstatic:find %{?buildroot:%{buildroot}} -regex ".*\\.a$" | xargs rm -f --}
|
|
|
|
%ninja_install_command() \
|
|
DESTDIR=%{?buildroot:%{buildroot}} \\\
|
|
INSTALLROOT=%{?buildroot:%{buildroot}} \\\
|
|
install_prefix=%{?buildroot:%{buildroot}} \\\
|
|
BUILDROOT=%{?buildroot:%{buildroot}} \\\
|
|
BUILD_ROOT=%{?buildroot:%{buildroot}} \\\
|
|
INSTALL_ROOT=%{?buildroot:%{buildroot}} \\\
|
|
ninja \\\
|
|
install %*
|
|
|
|
%ninja_install() \
|
|
%{ninja_install_command} %* \
|
|
%{make_install_common}
|
|
|
|
%ninja_install32() \
|
|
DESTDIR=%{?buildroot:%{buildroot}} \\\
|
|
INSTALLROOT=%{?buildroot:%{buildroot}} \\\
|
|
install_prefix=%{?buildroot:%{buildroot}} \\\
|
|
BUILDROOT=%{?buildroot:%{buildroot}} \\\
|
|
BUILD_ROOT=%{?buildroot:%{buildroot}} \\\
|
|
INSTALL_ROOT=%{?buildroot:%{buildroot}} \\\
|
|
ninja \\\
|
|
install %* \
|
|
rm -f %{?buildroot:%{buildroot}}/usr/share/info/dir \
|
|
rm -f %{?buildroot:%{buildroot}}/usr/lib/perl5/*/*/perllocal.pod \
|
|
[ -d %{?buildroot:%{buildroot}}/sbin ] && mkdir %{?buildroot:%{buildroot}}/usr/bin/ || : \
|
|
[ -d %{?buildroot:%{buildroot}}/bin ] && mkdir %{?buildroot:%{buildroot}}/usr/bin/ || : \
|
|
[ -d %{?buildroot:%{buildroot}}/usr/sbin ] && mkdir %{?buildroot:%{buildroot}}/usr/bin/ || : \
|
|
[ -d %{?buildroot:%{buildroot}}/usr/sbin ] && mv %{?buildroot:%{buildroot}}/usr/sbin/* %{?buildroot:%{buildroot}}/usr/bin/ || : \
|
|
[ -d %{?buildroot:%{buildroot}}/bin ] && mv %{?buildroot:%{buildroot}}/bin/* %{?buildroot:%{buildroot}}/usr/bin/ || : \
|
|
[ -d %{?buildroot:%{buildroot}}/sbin ] && mv %{?buildroot:%{buildroot}}/sbin/* %{?buildroot:%{buildroot}}/usr/bin/ || : \
|
|
[ -d %{?buildroot:%{buildroot}}/usr/share/pkgconfig ] && mkdir -p %{?buildroot:%{buildroot}}/usr/lib32/pkgconfig || : \
|
|
[ -d %{?buildroot:%{buildroot}}/usr/lib/pkgconfig ] && mkdir -p %{?buildroot:%{buildroot}}/usr/lib32/pkgconfig || : \
|
|
[ -d %{?buildroot:%{buildroot}}/usr/share/pkgconfig ] && mv %{?buildroot:%{buildroot}}/usr/share/pkgconfig/* %{?buildroot:%{buildroot}}/usr/lib32/pkgconfig && rmdir %{?buildroot:%{buildroot}}/usr/share/pkgconfig || : \
|
|
[ -d %{?buildroot:%{buildroot}}/usr/lib/pkgconfig ] && mv %{?buildroot:%{buildroot}}/usr/lib/pkgconfig/* %{?buildroot:%{buildroot}}/usr/lib32/pkgconfig && rmdir %{?buildroot:%{buildroot}}/usr/lib/pkgconfig || : \
|
|
[ -d %{?buildroot:%{buildroot}}/usr/share/doc/%{name}-%{version} ] && mv %{?buildroot:%{buildroot}}/usr/share/doc/%{name}-%{version} %{?buildroot:%{buildroot}}/usr/share/doc/%{name} || : \
|
|
[ -d %{?buildroot:%{buildroot}}/usr/sbin ] && rmdir %{?buildroot:%{buildroot}}/usr/sbin || : \
|
|
[ -d %{?buildroot:%{buildroot}}/sbin ] && rmdir %{?buildroot:%{buildroot}}/sbin || : \
|
|
[ -d %{?buildroot:%{buildroot}}/bin ] && rmdir %{?buildroot:%{buildroot}}/bin || : \
|
|
chmod a+x %{?buildroot:%{buildroot}}/usr/lib32/* || : \
|
|
chmod a+x %{?buildroot:%{buildroot}}/lib/* || : \
|
|
%{!?keepstatic:find %{?buildroot:%{buildroot}} -regex ".*\\.a$" | xargs rm -f --}
|
|
|
|
%install_info(:-:) \
|
|
ALL_ARGS=(%{**}) \
|
|
NUM_ARGS=${#ALL_ARGS[@]} \
|
|
if test -x sbin/install-info ; then \
|
|
if test -e "${ALL_ARGS[$((NUM_ARGS-1))]}" ; then \
|
|
sbin/install-info "${ALL_ARGS[@]}" \
|
|
fi \
|
|
fi ;
|
|
|
|
%install_info_delete(:-:) \
|
|
ALL_ARGS=(%{**}) \
|
|
NUM_ARGS=${#ALL_ARGS[@]} \
|
|
if test -x sbin/install-info ; then \
|
|
if ! test -e "${ALL_ARGS[$((NUM_ARGS-1))]}" ; then \
|
|
sbin/install-info --quiet --delete "${ALL_ARGS[@]}" \
|
|
fi ; \
|
|
fi ;
|
|
|
|
#==============================================================================
|
|
# ---- Build policy macros.
|
|
#
|
|
#---------------------------------------------------------------------
|
|
# Expanded at end of %install scriptlet.
|
|
#
|
|
|
|
%__arch_install_post %{_rpmconfigdir}/check-buildroot
|
|
|
|
# Standard brp-macro naming:
|
|
# convert all '-' in basename to '_', add two leading underscores.
|
|
|
|
# brp macros from the 'rpm' project follow
|
|
%__brp_compress %{_rpmconfigdir}/brp-compress %{?_prefix}
|
|
#__brp_strip %{_rpmconfigdir}/brp-strip %{__strip}
|
|
%__brp_strip %{!?__debug_package:%{_rpmconfigdir}/clr/brp-strip %{__strip}}
|
|
#__brp_strip_comment_note %{_rpmconfigdir}/brp-strip-comment-note %{__strip} %{__objdump}
|
|
%__brp_strip_comment_note %{_rpmconfigdir}/clr/brp-strip-comment-note %{__strip} %{__objdump}
|
|
#__brp_strip_static_archive %{_rpmconfigdir}/brp-strip-static-archive %{__strip}
|
|
%__brp_strip_static_archive %{_rpmconfigdir}/clr/brp-strip-static-archive %{__strip}
|
|
%__brp_elfperms %{_rpmconfigdir}/brp-elfperms
|
|
%__brp_remove_la_files %{_rpmconfigdir}/brp-remove-la-files
|
|
|
|
# brp macros from the 'python-rpm-packaging' project follow
|
|
#__brp_python_bytecompile %{_rpmconfigdir}/brp-python-bytecompile
|
|
%__brp_python_bytecompile %{_rpmconfigdir}/clr/brp-python-bytecompile
|
|
|
|
# brp macros specific to Clear Linux OS follow
|
|
%__brp_strip_static_lto %{_rpmconfigdir}/clr/brp-strip-static-lto
|
|
%__brp_remove_python_pyo %{_rpmconfigdir}/clr/brp-remove-python-pyo
|
|
%__brp_set_epoch_timestamp %{_rpmconfigdir}/clr/brp-set-epoch-timestamp
|
|
%__brp_java_repack_jars %{!?__jar_repack:%{_rpmconfigdir}/clr/brp-java-repack-jars}
|
|
|
|
%__os_install_post \
|
|
%{?__brp_strip} \
|
|
%{?__brp_strip_static_archive} \
|
|
%{?__brp_strip_static_lto} \
|
|
%{?__brp_strip_comment_note} \
|
|
%{?__brp_python_bytecompile} \
|
|
%{?__brp_remove_python_pyo} \
|
|
%{?__brp_remove_la_files} \
|
|
%{?__brp_set_epoch_timestamp} \
|
|
%{?__brp_java_repack_jars} \
|
|
%{nil}
|
|
|
|
# %{_rpmconfigdir}/clr/brp-implant-ident-static
|
|
|
|
%__spec_install_post\
|
|
%{!?keepinfodir:rm -f %{?buildroot:%{buildroot}}/usr/share/info/dir} \
|
|
test -z "`find %{?buildroot:%{buildroot}} -path 'etc/*' ! -type d`" \
|
|
rm -rf %{?buildroot:%{buildroot}}/etc/* \
|
|
rm -rf %{?buildroot:%{buildroot}}/usr/share/factory/* \
|
|
chmod a+x %{?buildroot:%{buildroot}}{/usr,}/bin/* || : \
|
|
find %{?buildroot:%{buildroot}} -name "__pycache__" | xargs rm -rf -- \
|
|
if [ -d %{?buildroot:%{buildroot}}/usr/share/mime ] && ! [ -L %{?buildroot:%{buildroot}}/usr/share/mime ]; then \
|
|
mv %{?buildroot:%{buildroot}}/usr/share/mime/packages %{?buildroot:%{buildroot}}/usr/share/mime-packages \
|
|
rm -rf %{?buildroot:%{buildroot}}/usr/share/mime \
|
|
fi\
|
|
RPM_XARGS_PFLAG=-P%{_smp_build_ncpus} \
|
|
%{?__debug_package:%{__debug_install_post}}\
|
|
[ -d %{?buildroot:%{buildroot}}/usr/lib/debug ] && mkdir -p %{?buildroot:%{buildroot}}/usr/share || : \
|
|
[ -d %{?buildroot:%{buildroot}}/usr/lib/debug ] && mv %{?buildroot:%{buildroot}}/usr/lib/debug %{?buildroot:%{buildroot}}/usr/share || : \
|
|
[ -d %{?buildroot:%{buildroot}}/usr/src/debug ] && mv %{?buildroot:%{buildroot}}/usr/src/debug %{?buildroot:%{buildroot}}/usr/share/debug/src || : \
|
|
[ -d %{?buildroot:%{buildroot}}/usr/lib/debug.force ] && mv %{?buildroot:%{buildroot}}/usr/lib/debug.force %{?buildroot:%{buildroot}}/usr/lib/debug || : \
|
|
[ -d %{?buildroot:%{buildroot}}/usr/src/debug.force ] && mv %{?buildroot:%{buildroot}}/usr/src/debug.force %{?buildroot:%{buildroot}}/usr/src/debug || : \
|
|
%{__arch_install_post}\
|
|
%{__os_install_post}\
|
|
%{nil}
|
|
|
|
|
|
# Template for debug information sub-package.
|
|
%_debuginfo_template \
|
|
%package debuginfo\
|
|
Summary: Debug information for package %{name}\
|
|
Group: Development/Debug\
|
|
AutoReq: 0\
|
|
AutoProv: 1\
|
|
%description debuginfo\
|
|
This package provides debug information for package %{name}.\
|
|
Debug information is useful when developing applications that use this\
|
|
package or when debugging this package.\
|
|
%files debuginfo -f debugfiles.list\
|
|
%{nil}
|
|
|
|
%_debugsource_template \
|
|
%package debugsource\
|
|
Summary: Debug sources for package %{name}\
|
|
Group: Development/Debug\
|
|
AutoReqProv: 0\
|
|
%description debugsource\
|
|
This package provides debug sources for package %{name}.\
|
|
Debug sources are useful when developing applications that use this\
|
|
package or when debugging this package.\
|
|
%files debugsource -f debugsourcefiles.list\
|
|
%{nil}
|
|
|
|
%debug_package \
|
|
%ifnarch noarch\
|
|
%global __debug_package 1\
|
|
%_debuginfo_template\
|
|
%{?_debugsource_packages:%_debugsource_template}\
|
|
%endif\
|
|
%{nil}
|
|
|
|
# Bad hack to set $LANG to a UTF-8 capable locale during all RPM builds
|
|
%prep \
|
|
%%prep\
|
|
LANG=en_US.UTF-8\
|
|
export LANG\
|
|
unset DISPLAY\
|
|
%{nil}
|
|
|
|
%build %%build\
|
|
LANG=en_US.UTF-8\
|
|
export LANG\
|
|
unset DISPLAY\
|
|
unset PYTHONOPTIMIZE \
|
|
CFLAGS="%optflags" ; export CFLAGS ; \
|
|
http_proxy="http://127.0.0.1:9/"; export http_proxy ; \
|
|
https_proxy="http://127.0.0.1:9/"; export https_proxy ; \
|
|
ftp_proxy="http://127.0.0.1:9/"; export ftp_proxy ; \
|
|
no_proxy="localhost,127.0.0.1,0.0.0.0"; export no_proxy ; \
|
|
CXXFLAGS="%optflags" ; export CXXFLAGS ; \
|
|
FFLAGS="${FFLAGS:-%optflags -I%_fmoddir}" ; export FFLAGS ; \
|
|
LD_AS_NEEDED=1; export LD_AS_NEEDED ; \
|
|
PKG_CONFIG_LIBDIR="/usr/lib64/pkgconfig:/usr/share/pkgconfig"; export PKG_CONFIG_LIBDIR ; \
|
|
PATH="/usr/lib64/ccache/bin:/usr/local/bin:/usr/bin"; export PATH ; \
|
|
%{nil}
|
|
|
|
%install %{?_enable_debug_packages:%{?buildsubdir:%{debug_package}}}\
|
|
%%install\
|
|
LANG=en_US.UTF-8\
|
|
export LANG\
|
|
unset DISPLAY\
|
|
unset PYTHONOPTIMIZE \
|
|
rm -rf %{?buildroot:%{buildroot}} \
|
|
mkdir -p %{?buildroot:%{buildroot}} \
|
|
%{nil}
|
|
|
|
%check %%check\
|
|
LANG=en_US.UTF-8\
|
|
export LANG\
|
|
unset DISPLAY\
|
|
unset PYTHONOPTIMIZE \
|
|
%{nil}
|
|
|
|
%clean %%clean\
|
|
rm -rf %{?buildroot:%{buildroot}} \
|
|
%{nil}
|
|
|
|
%find_lang %{_rpmconfigdir}/find-lang.sh %{buildroot}
|
|
|
|
#
|
|
# use internal dep generator?
|
|
%_use_internal_dependency_generator 1
|
|
|
|
#
|
|
# Should missing %doc files terminate a build?
|
|
%_missing_doc_files_terminate_build 1
|
|
#
|
|
# Should missing buildids terminate a build?
|
|
%_missing_build_ids_terminate_build 0
|
|
|
|
#
|
|
# Should unpackaged files in a build root terminate a build?
|
|
%_unpackaged_files_terminate_build 1
|
|
|
|
#
|
|
# Path to scripts to autogenerate package dependencies,
|
|
#
|
|
%__set_helper_env %{lua:
|
|
posix.setenv("RPMBUILD_SPECFILE",rpm.expand("%?_specfile"));
|
|
posix.setenv("RPMBUILD_SOURCEDIR",rpm.expand("%?_sourcedir"));
|
|
}
|
|
# Note: Used iff _use_internal_dependency_generator is zero.
|
|
#%__find_provides %{_rpmconfigdir}/rpmdeps --provides
|
|
#%__find_requires %{_rpmconfigdir}/rpmdeps --requires
|
|
#%__find_provides %{__set_helper_env}%{_rpmconfigdir}/clr/find-provides %name
|
|
#%__find_requires %{__set_helper_env}%{_rpmconfigdir}/clr/find-requires %name
|
|
|
|
%__find_provides %{_rpmconfigdir}/clr/find-provides
|
|
%__find_requires %{_rpmconfigdir}/clr/find-requires
|
|
|
|
%__global_cflags -O2 -g -feliminate-unused-debug-types -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=64 -Wformat -Wformat-security -Wl,-z,now,-z,relro,-z,max-page-size=0x4000,-z,separate-code -Wno-error -ftree-vectorize -ftree-slp-vectorize -Wl,--enable-new-dtags -Wl,--build-id=sha1 -ftrivial-auto-var-init=zero -mrelax-cmpxchg-loop
|
|
|
|
|
|
|
|
# Disable lookups
|
|
%_hkp_keyserver %{nil}
|
|
|
|
#
|
|
# RPM macros for Java applications.
|
|
#
|
|
# JPackage Project <http://www.jpackage.org/>
|
|
# David Walluck <david@jpackage.org>
|
|
# Ville Skyttä <scop at jpackage.org>
|
|
# Nicolas Mailhot <Nicolas.Mailhot@laPoste.net>
|
|
#
|
|
|
|
#==============================================================================
|
|
# ---- default Java directories
|
|
|
|
#
|
|
# Root directory where all Java VMs/SDK/JREs are installed.
|
|
#
|
|
# already in /usr/lib/macros on SUSE:
|
|
%_jvmdir %{_prefix}/lib/jvm
|
|
|
|
#
|
|
# Root directory where all Java VMs/SDK/JREs expose their jars
|
|
#
|
|
# already in /usr/lib/macros on SUSE:
|
|
%_jvmjardir %{_prefix}/lib/jvm-exports
|
|
|
|
#
|
|
# Root directory for all Java VM/SDK/JRE's private things.
|
|
#
|
|
# already in /usr/lib/macros on SUSE:
|
|
%_jvmprivdir %{_prefix}/lib/jvm-private
|
|
|
|
#
|
|
# Root directory for all architecture dependent parts of Java VM/SDK/JRE's
|
|
#
|
|
%_jvmlibdir %{_prefix}/lib/jvm
|
|
|
|
#
|
|
# Root directory for all architecture independent parts of Java VM/SDK/JRE's
|
|
#
|
|
%_jvmdatadir %{_datadir}/jvm
|
|
|
|
#
|
|
# Root directory for all configurations parts of Java VM/SDK/JRE's
|
|
#
|
|
%_jvmsysconfdir %{_sysconfdir}/jvm
|
|
|
|
#
|
|
# Root directory for all common architecture dependent parts of Java VM/SDK/JRE's
|
|
#
|
|
%_jvmcommonlibdir %{_prefix}/lib/jvm-commmon
|
|
|
|
#
|
|
# Root directory for all common architecture independent parts of Java VM/SDK/JRE's
|
|
#
|
|
%_jvmcommondatadir %{_datadir}/jvm-commmon
|
|
|
|
#
|
|
# Root directory for all common configurations parts of Java VM/SDK/JRE's
|
|
#
|
|
%_jvmcommonsysconfdir %{_sysconfdir}/jvm-commmon
|
|
|
|
#
|
|
# Directory where arch and version independent jars are installed.
|
|
# This has already been integrated in RH macros following our request.
|
|
#
|
|
# By extension:
|
|
# %{_javadir}-ext:
|
|
# - version dependent jars
|
|
# %{_javadir}-x.y.z:
|
|
# - jars for Java standard x.y.z (usually symlinks to %{_javadir}-ext)
|
|
# %{_javadir}-utils:
|
|
# - Java-related scripts
|
|
#
|
|
# To simplify things only %{_javadir} is defined.
|
|
#
|
|
# already in /usr/lib/macros on SUSE:
|
|
# %_javadir %{_datadir}/java
|
|
|
|
#
|
|
# Directory where arch-specific (JNI) version-independent jars are installed.
|
|
#
|
|
# By extension:
|
|
# %{_jnidir}-ext:
|
|
# - version dependent jars
|
|
# %{_jnidir}-x.y.z:
|
|
# - jars for Java standard x.y.z (usually symlinks to %{_jnidir}-ext)
|
|
# To simplify things only %{_jnidir} is defined.
|
|
#
|
|
# already in /usr/lib/macros on SUSE:
|
|
%_jnidir %{_prefix}/lib/java
|
|
|
|
#
|
|
# Root directory where all javadoc is installed. Also already in RH macros.
|
|
#
|
|
# already in /usr/lib/macros on SUSE:
|
|
# %_javadocdir %{_datadir}/javadoc
|
|
|
|
#
|
|
# Directory for maven depmaps
|
|
#
|
|
%_mavendepmapdir /etc/maven
|
|
%_mavendepmapfragdir /etc/maven/fragments
|
|
|
|
#
|
|
# Current default JVM home.
|
|
#
|
|
# already in /usr/lib/macros on SUSE:
|
|
%java_home %(. %{_javadir}-utils/java-functions; set_jvm; echo $JAVA_HOME)
|
|
|
|
#==============================================================================
|
|
# ---- default Java commands
|
|
|
|
%ant ant
|
|
%jar %{java_home}/bin/jar
|
|
%java %(. %{_javadir}-utils/java-functions; set_javacmd; echo $JAVACMD)
|
|
%javac %{java_home}/bin/javac
|
|
%javadoc %{java_home}/bin/javadoc
|
|
|
|
|
|
#==============================================================================
|
|
# ---- default icons directories as per the icon theme freedesktop spec
|
|
|
|
%_iconstheme hicolor
|
|
%_iconsbasedir %{_datadir}/icons/%{_iconstheme}
|
|
|
|
#
|
|
# The following is a bit heavy and will be removed
|
|
#
|
|
%_icons16dir %{_iconsbasedir}/16x16/apps
|
|
%_icons22dir %{_iconsbasedir}/22x22/apps
|
|
%_icons48dir %{_iconsbasedir}/48x48/apps
|
|
%_icons64dir %{_iconsbasedir}/64x64/apps
|
|
%_icons96dir %{_iconsbasedir}/96x96/apps
|
|
%_icons192dir %{_iconsbasedir}/192x192/apps
|
|
%_iconsscaldir %{_iconsbasedir}/scalable/apps
|
|
|
|
|
|
#
|
|
# Fenrus icons
|
|
#
|
|
# %1 the name of the icon (typically the name of the package). RedHat
|
|
# requires 3 icons sizes (48, 32, 16), all should be present.
|
|
%clr_icons() \
|
|
install -D -m 644 %1-48.png $RPM_BUILD_ROOT%{_datadir}/icons/hicolor/48x48/apps/%{name}.png\
|
|
install -D -m 644 %1-32.png $RPM_BUILD_ROOT%{_datadir}/icons/hicolor/32x32/apps/%{name}.png\
|
|
install -D -m 644 %1-16.png $RPM_BUILD_ROOT%{_datadir}/icons/hicolor/16x16/apps/%{name}.png\
|
|
%{nil}
|
|
|
|
|
|
#==============================================================================
|
|
# ---- default .desktop directories per the desktop-entry freedesktop.org spec
|
|
|
|
%_desktopdir %{_datadir}/applications
|
|
|
|
%_fixperms /usr/bin/chmod -Rf a+rX,u+w,g-w,o-w
|
|
|
|
# Compression type and level for source/binary package payloads.
|
|
# "w9.gzdio" gzip level 9 (default).
|
|
# "w9.bzdio" bzip2 level 9.
|
|
# "w7.xzdio" xz level 7, xz's default.
|
|
# "w7.lzdio" lzma-alone level 7, lzma's default
|
|
#
|
|
%_source_payload w0.gzdio
|
|
%_binary_payload w19.zstdio
|
|
|
|
|
|
#==============================================================================
|
|
# ---- macros for compatibility
|
|
|
|
# __perl was removed in rpm 4.15, and it is used by autospec's 'cpan' pattern.
|
|
%__perl /usr/bin/perl
|
|
# __objcopy was removed in rpm 4.17, and it was previously passed as an
|
|
# argument to Clear's 'brp-strip-static-lto' script. The script works okay at
|
|
# the moment without arguments, but just in case that changes, keep this macro
|
|
# defined.
|
|
%__objcopy /usr/bin/objcopy
|