2002-06-12 12:59:50 +00:00
|
|
|
# Per-platform rpm configuration file.
|
|
|
|
|
|
|
|
#==============================================================================
|
|
|
|
# ---- per-platform macros.
|
|
|
|
#
|
|
|
|
%_vendor redhat
|
|
|
|
%_os linux
|
2002-06-28 05:25:23 +00:00
|
|
|
%_target_platform %{_target_cpu}-%{_vendor}-%{_target_os}%{?_gnu}
|
2002-06-12 12:59:50 +00:00
|
|
|
|
|
|
|
#==============================================================================
|
2002-10-03 16:31:51 +00:00
|
|
|
# ---- configure macros. note that most of these are inherited
|
|
|
|
# from the defaults.
|
2002-06-12 12:59:50 +00:00
|
|
|
#
|
|
|
|
%_localstatedir /var
|
|
|
|
|
2013-07-24 22:20:05 +00:00
|
|
|
%_pkgdocdir %{_docdir}/%{name}
|
|
|
|
%_docdir_fmt %%{NAME}
|
2002-06-12 12:59:50 +00:00
|
|
|
|
2008-05-06 23:08:20 +00:00
|
|
|
%_fmoddir %{_libdir}/gfortran/modules
|
|
|
|
|
2002-12-11 18:05:00 +00:00
|
|
|
%_enable_debug_packages 1
|
2012-06-27 10:32:42 +00:00
|
|
|
%_include_minidebuginfo 1
|
2017-07-31 12:43:55 +00:00
|
|
|
%_include_gdb_index 1
|
2017-07-31 12:45:06 +00:00
|
|
|
%_debugsource_packages 1
|
|
|
|
%_debuginfo_subpackages 1
|
2002-11-20 16:55:36 +00:00
|
|
|
|
2018-02-04 17:00:40 +00:00
|
|
|
#==============================================================================
|
|
|
|
# ---- compiler flags.
|
|
|
|
|
|
|
|
# C compiler flags. This is traditionally called CFLAGS in makefiles.
|
|
|
|
# Historically also available as %%{optflags}, and %%build sets the
|
|
|
|
# environment variable RPM_OPT_FLAGS to this value.
|
|
|
|
%build_cflags %{optflags}
|
|
|
|
|
|
|
|
# C++ compiler flags. This is traditionally called CXXFLAGS in makefiles.
|
|
|
|
%build_cxxflags %{optflags}
|
|
|
|
|
|
|
|
# Fortran compiler flags. Makefiles use both FFLAGS and FCFLAGS as
|
|
|
|
# the corresponding variable names.
|
|
|
|
%build_fflags %{optflags} -I%{_fmoddir}
|
|
|
|
|
|
|
|
# Link editor flags. This is usually called LDFLAGS in makefiles.
|
|
|
|
# (Some makefiles use LFLAGS instead.) The default value assumes that
|
|
|
|
# the flags, while intended for ld, are still passed through the gcc
|
|
|
|
# compiler driver. At the beginning of %%build, the environment
|
|
|
|
# variable RPM_LD_FLAGS to this value.
|
|
|
|
%build_ldflags -Wl,-z,relro %{_ld_symbols_flags} %{_hardened_ldflags}
|
|
|
|
|
|
|
|
# Expands to shell code to seot the compiler/linker environment
|
|
|
|
# variables CFLAGS, CXXFLAGS, FFLAGS, FCFLAGS, LDFLAGS if they have
|
|
|
|
# not been set already. RPM_OPT_FLAGS and RPM_LD_FLAGS have already
|
|
|
|
# been set implicitly at the start of the %%build section.
|
|
|
|
%set_build_flags \
|
|
|
|
CFLAGS="${CFLAGS:-%{build_cflags}}" ; export CFLAGS ; \
|
|
|
|
CXXFLAGS="${CXXFLAGS:-%{build_cxxflags}}" ; export CXXFLAGS ; \
|
|
|
|
FFLAGS="${FFLAGS:-%{build_fflags}}" ; export FFLAGS ; \
|
|
|
|
FCFLAGS="${FCFLAGS:-%{build_fflags}}" ; export FCFLAGS ; \
|
|
|
|
LDFLAGS="${LDFLAGS:-%{build_ldflags}}" ; export LDFLAGS
|
|
|
|
|
|
|
|
# Deprecated names. For backwards compatibility only.
|
|
|
|
%__global_cflags %{build_cflags}
|
|
|
|
%__global_cxxflags %{build_cxxflags}
|
|
|
|
%__global_fflags %{build_fflags}
|
|
|
|
%__global_fcflags %{build_fflags}
|
|
|
|
%__global_ldflags %{build_ldflags}
|
|
|
|
|
2002-06-12 12:59:50 +00:00
|
|
|
#==============================================================================
|
|
|
|
# ---- configure and makeinstall.
|
|
|
|
#
|
2014-04-08 10:30:58 +00:00
|
|
|
%_configure_gnuconfig_hack 1
|
2014-01-13 19:45:57 +00:00
|
|
|
%_configure_libtool_hardening_hack 1
|
2016-10-03 21:06:03 +00:00
|
|
|
# If defined, _configure_disable_silent_rules will cause --disable-silent-rules
|
|
|
|
# to be added to the list of options passed to the configure script.
|
|
|
|
# Eventually we'll want to turn this on by default, but this gives packagers a
|
|
|
|
# way to turn it back off.
|
|
|
|
# %_configure_disable_silent_rules 1
|
2014-01-13 19:45:57 +00:00
|
|
|
%configure \
|
2018-02-04 17:00:40 +00:00
|
|
|
%{set_build_flags}; \
|
2015-05-29 14:54:33 +00:00
|
|
|
[ "%_configure_gnuconfig_hack" = 1 ] && for i in $(find $(dirname %{_configure}) -name config.guess -o -name config.sub) ; do \
|
2013-04-22 11:14:06 +00:00
|
|
|
[ -f /usr/lib/rpm/redhat/$(basename $i) ] && %{__rm} -f $i && %{__cp} -fv /usr/lib/rpm/redhat/$(basename $i) $i ; \
|
|
|
|
done ; \
|
2014-01-13 19:45:57 +00:00
|
|
|
[ "%_configure_libtool_hardening_hack" = 1 ] && [ x != "x%{_hardened_ldflags}" ] && \
|
|
|
|
for i in $(find . -name ltmain.sh) ; do \
|
|
|
|
%{__sed} -i.backup -e 's~compiler_flags=$~compiler_flags="%{_hardened_ldflags}"~' $i \
|
|
|
|
done ; \
|
2010-01-22 13:34:07 +00:00
|
|
|
%{_configure} --build=%{_build} --host=%{_host} \\\
|
2003-07-15 13:44:02 +00:00
|
|
|
--program-prefix=%{?_program_prefix} \\\
|
2010-01-22 13:43:38 +00:00
|
|
|
--disable-dependency-tracking \\\
|
2016-10-03 17:55:00 +00:00
|
|
|
%{?_configure_disable_silent_rules:--disable-silent-rules} \\\
|
2003-07-15 13:38:58 +00:00
|
|
|
--prefix=%{_prefix} \\\
|
2002-06-12 12:59:50 +00:00
|
|
|
--exec-prefix=%{_exec_prefix} \\\
|
|
|
|
--bindir=%{_bindir} \\\
|
|
|
|
--sbindir=%{_sbindir} \\\
|
|
|
|
--sysconfdir=%{_sysconfdir} \\\
|
|
|
|
--datadir=%{_datadir} \\\
|
|
|
|
--includedir=%{_includedir} \\\
|
|
|
|
--libdir=%{_libdir} \\\
|
|
|
|
--libexecdir=%{_libexecdir} \\\
|
|
|
|
--localstatedir=%{_localstatedir} \\\
|
|
|
|
--sharedstatedir=%{_sharedstatedir} \\\
|
|
|
|
--mandir=%{_mandir} \\\
|
2014-01-13 19:45:57 +00:00
|
|
|
--infodir=%{_infodir}
|
2002-06-12 12:59:50 +00:00
|
|
|
|
2013-06-27 07:08:01 +00:00
|
|
|
# Maximum number of CPU's to use when building, 0 for unlimited.
|
2016-10-17 18:47:22 +00:00
|
|
|
#
|
|
|
|
# This was for some time capped at 16. Please see
|
|
|
|
# https://bugzilla.redhat.com/show_bug.cgi?id=669638 and
|
|
|
|
# https://bugzilla.redhat.com/show_bug.cgi?id=1384938 for the situation
|
|
|
|
# surrounding this.
|
|
|
|
#%_smp_ncpus_max 0
|
2002-06-12 12:59:50 +00:00
|
|
|
%_smp_mflags %([ -z "$RPM_BUILD_NCPUS" ] \\\
|
|
|
|
&& RPM_BUILD_NCPUS="`/usr/bin/getconf _NPROCESSORS_ONLN`"; \\\
|
2013-06-27 07:08:01 +00:00
|
|
|
ncpus_max=%{?_smp_ncpus_max}; \\\
|
|
|
|
if [ -n "$ncpus_max" ] && [ "$ncpus_max" -gt 0 ] && [ "$RPM_BUILD_NCPUS" -gt "$ncpus_max" ]; then RPM_BUILD_NCPUS="$ncpus_max"; fi; \\\
|
|
|
|
if [ "$RPM_BUILD_NCPUS" -gt 1 ]; then echo "-j$RPM_BUILD_NCPUS"; fi)
|
2002-06-12 12:59:50 +00:00
|
|
|
|
|
|
|
#==============================================================================
|
|
|
|
# ---- Build policy macros.
|
|
|
|
#
|
2010-01-22 13:24:29 +00:00
|
|
|
#
|
|
|
|
#---------------------------------------------------------------------
|
|
|
|
# Expanded at beginning of %install scriptlet.
|
|
|
|
#
|
|
|
|
|
|
|
|
%__spec_install_pre %{___build_pre}\
|
|
|
|
[ "$RPM_BUILD_ROOT" != "/" ] && rm -rf "${RPM_BUILD_ROOT}"\
|
|
|
|
mkdir -p `dirname "$RPM_BUILD_ROOT"`\
|
|
|
|
mkdir "$RPM_BUILD_ROOT"\
|
|
|
|
%{nil}
|
|
|
|
|
2002-06-12 12:59:50 +00:00
|
|
|
#---------------------------------------------------------------------
|
|
|
|
# Expanded at end of %install scriptlet.
|
|
|
|
#
|
|
|
|
|
2007-07-05 16:41:21 +00:00
|
|
|
%__arch_install_post /usr/lib/rpm/check-buildroot
|
2002-06-12 12:59:50 +00:00
|
|
|
|
2018-01-17 10:16:45 +00:00
|
|
|
# Build root policy macros. Standard naming:
|
|
|
|
# convert all '-' in basename to '_', add two leading underscores.
|
2018-01-25 19:26:12 +00:00
|
|
|
%__brp_ldconfig /usr/lib/rpm/redhat/brp-ldconfig
|
2018-01-17 10:16:45 +00:00
|
|
|
%__brp_compress /usr/lib/rpm/brp-compress
|
|
|
|
%__brp_strip /usr/lib/rpm/brp-strip %{__strip}
|
|
|
|
%__brp_strip_comment_note /usr/lib/rpm/brp-strip-comment-note %{__strip} %{__objdump}
|
|
|
|
%__brp_strip_static_archive /usr/lib/rpm/brp-strip-static-archive %{__strip}
|
|
|
|
%__brp_python_bytecompile /usr/lib/rpm/brp-python-bytecompile %{__python} %{?_python_bytecompile_errors_terminate_build}
|
|
|
|
%__brp_python_hardlink /usr/lib/rpm/brp-python-hardlink
|
2018-05-02 18:28:58 +00:00
|
|
|
# __brp_mangle_shebangs_exclude - shebangs to exclude
|
|
|
|
# __brp_mangle_shebangs_exclude_file - file from which to get shebangs to exclude
|
|
|
|
# __brp_mangle_shebangs_exclude_from - files to ignore
|
|
|
|
# __brp_mangle_shebangs_exclude_from_file - file from which to get files to ignore
|
|
|
|
%__brp_mangle_shebangs /usr/lib/rpm/redhat/brp-mangle-shebangs %{?__brp_mangle_shebangs_exclude:--shebangs "%{?__brp_mangle_shebangs_exclude}"} %{?__brp_mangle_shebangs_exclude_file:--shebangs-from "%{__brp_mangle_shebangs_exclude_file}"} %{?__brp_mangle_shebangs_exclude_from:--files "%{?__brp_mangle_shebangs_exclude_from}"} %{?__brp_mangle_shebangs_exclude_from_file:--files-from "%{__brp_mangle_shebangs_exclude_from_file}"}
|
2018-01-17 10:16:45 +00:00
|
|
|
|
2002-06-12 12:59:50 +00:00
|
|
|
%__os_install_post \
|
2018-01-25 19:26:12 +00:00
|
|
|
%{?__brp_ldconfig} \
|
2018-01-17 10:16:45 +00:00
|
|
|
%{?__brp_compress} \
|
2010-03-01 08:58:17 +00:00
|
|
|
%{!?__debug_package:\
|
2018-01-17 10:16:45 +00:00
|
|
|
%{?__brp_strip} \
|
|
|
|
%{?__brp_strip_comment_note} \
|
2010-03-01 08:58:17 +00:00
|
|
|
} \
|
2018-01-17 10:16:45 +00:00
|
|
|
%{?__brp_strip_static_archive} \
|
2018-01-17 10:57:53 +00:00
|
|
|
%{?py_auto_byte_compile:%{?__brp_python_bytecompile}} \
|
2018-01-17 10:16:45 +00:00
|
|
|
%{?__brp_python_hardlink} \
|
2018-01-10 12:38:28 +00:00
|
|
|
%{?__brp_mangle_shebangs} \
|
2002-06-12 12:59:50 +00:00
|
|
|
%{nil}
|
|
|
|
|
|
|
|
%__spec_install_post\
|
2002-09-16 16:22:01 +00:00
|
|
|
%{?__debug_package:%{__debug_install_post}}\
|
2002-06-12 12:59:50 +00:00
|
|
|
%{__arch_install_post}\
|
|
|
|
%{__os_install_post}\
|
|
|
|
%{nil}
|
|
|
|
|
2002-12-14 20:37:32 +00:00
|
|
|
%install %{?_enable_debug_packages:%{?buildsubdir:%{debug_package}}}\
|
|
|
|
%%install\
|
2008-05-06 23:08:20 +00:00
|
|
|
%{nil}
|
|
|
|
|
|
|
|
#
|
|
|
|
# Should missing buildids terminate a build?
|
|
|
|
%_missing_build_ids_terminate_build 1
|
2002-07-31 18:56:20 +00:00
|
|
|
|
2015-05-19 11:28:55 +00:00
|
|
|
#
|
|
|
|
## Automatically compile python files
|
|
|
|
%py_auto_byte_compile 1
|
|
|
|
|
2010-02-03 10:52:30 +00:00
|
|
|
#
|
|
|
|
## Should python bytecompilation errors terminate a build?
|
|
|
|
%_python_bytecompile_errors_terminate_build 1
|
|
|
|
|
2010-01-22 13:07:55 +00:00
|
|
|
# Use SHA-256 for FILEDIGESTS instead of default MD5
|
|
|
|
%_source_filedigest_algorithm 8
|
|
|
|
%_binary_filedigest_algorithm 8
|
|
|
|
|
2010-01-22 13:25:17 +00:00
|
|
|
# Use XZ compression for binary payloads
|
|
|
|
%_binary_payload w2.xzdio
|
|
|
|
|
2011-09-16 20:49:56 +00:00
|
|
|
%_hardening_cflags -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1
|
2014-01-13 19:45:57 +00:00
|
|
|
# we don't escape symbols '~', '"', etc. so be careful when changing this
|
2018-02-24 16:38:12 +00:00
|
|
|
%_hardening_ldflags -Wl,-z,now -specs=/usr/lib/rpm/redhat/redhat-hardened-ld
|
2011-09-16 20:49:56 +00:00
|
|
|
|
2015-02-12 19:11:00 +00:00
|
|
|
# Harden packages by default for Fedora 23:
|
|
|
|
# https://fedorahosted.org/fesco/ticket/1384 (accepted on 2014-02-11)
|
2018-01-19 10:21:06 +00:00
|
|
|
# Use "%undefine _hardened_build" to disable.
|
2015-02-12 19:11:00 +00:00
|
|
|
%_hardened_build 1
|
2011-09-16 20:49:56 +00:00
|
|
|
%_hardened_cflags %{?_hardened_build:%{_hardening_cflags}}
|
|
|
|
%_hardened_ldflags %{?_hardened_build:%{_hardening_ldflags}}
|
2011-08-01 16:26:41 +00:00
|
|
|
|
2017-10-03 13:53:23 +00:00
|
|
|
%_annobin_cflags -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1
|
|
|
|
|
|
|
|
# Add extra information to binary objects created by gcc for Fedora 28:
|
|
|
|
# https://pagure.io/fesco/issue/1780 (accepted on 2017-10-30)
|
2018-01-19 10:21:06 +00:00
|
|
|
# Use "%undefine _annotated_build" to disable.
|
2017-10-03 13:53:23 +00:00
|
|
|
%_annotated_build 1
|
|
|
|
%_annotated_cflags %{?_annotated_build:%{_annobin_cflags}}
|
|
|
|
|
2018-01-22 15:01:54 +00:00
|
|
|
# Fail linking if there are undefined symbols. Required for proper
|
2018-01-29 14:18:04 +00:00
|
|
|
# ELF symbol versioning support. Disabled by default.
|
|
|
|
# Use "%define _strict_symbol_defs_build 1" to enable.
|
|
|
|
#%_strict_symbol_defs_build 1
|
2018-01-22 15:01:54 +00:00
|
|
|
%_ld_symbols_flags %{?_strict_symbol_defs_build:-Wl,-z,defs}
|
|
|
|
|
2018-01-22 13:30:12 +00:00
|
|
|
%__global_compiler_flags -O2 -g -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS -fexceptions -fstack-protector-strong -grecord-gcc-switches %{_hardened_cflags} %{_annotated_cflags}
|
2016-11-30 11:39:02 +00:00
|
|
|
|
2010-01-22 13:30:02 +00:00
|
|
|
#==============================================================================
|
2014-04-27 08:58:18 +00:00
|
|
|
# ---- Generic auto req/prov filtering macros
|
2010-01-22 13:30:02 +00:00
|
|
|
#
|
|
|
|
# http://fedoraproject.org/wiki/PackagingDrafts/AutoProvidesAndRequiresFiltering
|
|
|
|
|
|
|
|
# prevent anything matching from being scanned for provides
|
|
|
|
%filter_provides_in(P) %{expand: \
|
|
|
|
%global __filter_prov_cmd %{?__filter_prov_cmd} %{__grep} -v %{-P} '%*' | \
|
|
|
|
}
|
|
|
|
|
|
|
|
# prevent anything matching from being scanned for requires
|
|
|
|
%filter_requires_in(P) %{expand: \
|
|
|
|
%global __filter_req_cmd %{?__filter_req_cmd} %{__grep} -v %{-P} '%*' | \
|
|
|
|
}
|
|
|
|
|
|
|
|
# filter anything matching out of the provides stream
|
|
|
|
%filter_from_provides() %{expand: \
|
|
|
|
%global __filter_from_prov %{?__filter_from_prov} | %{__sed} -e '%*' \
|
|
|
|
}
|
|
|
|
|
|
|
|
# filter anything matching out of the requires stream
|
|
|
|
%filter_from_requires() %{expand: \
|
|
|
|
%global __filter_from_req %{?__filter_from_req} | %{__sed} -e '%*' \
|
|
|
|
}
|
|
|
|
|
2014-04-27 08:58:18 +00:00
|
|
|
# actually set up the filtering bits
|
2010-01-22 13:30:02 +00:00
|
|
|
%filter_setup %{expand: \
|
|
|
|
%global _use_internal_dependency_generator 0 \
|
2012-11-09 11:40:39 +00:00
|
|
|
%global __deploop() while read FILE; do echo "${FILE}" | /usr/lib/rpm/rpmdeps -%{1}; done | /bin/sort -u \
|
2010-01-22 13:30:02 +00:00
|
|
|
%global __find_provides /bin/sh -c "%{?__filter_prov_cmd} %{__deploop P} %{?__filter_from_prov}" \
|
|
|
|
%global __find_requires /bin/sh -c "%{?__filter_req_cmd} %{__deploop R} %{?__filter_from_req}" \
|
|
|
|
}
|