Elliot Lee 03bb291
# Per-platform rpm configuration file.
Elliot Lee 03bb291
Elliot Lee 03bb291
#==============================================================================
Elliot Lee 03bb291
# ---- per-platform macros.
Elliot Lee 03bb291
#
Elliot Lee 03bb291
%_vendor		redhat
Elliot Lee 03bb291
%_os			linux
cb63b82
%_target_platform	%{_target_cpu}-%{_vendor}-%{_target_os}%{?_gnu}
Elliot Lee 03bb291
Elliot Lee 03bb291
#==============================================================================
Jeremy Katz 8a919b8
# ---- configure macros.  note that most of these are inherited
Jeremy Katz 8a919b8
#      from the defaults.
Elliot Lee 03bb291
#
Elliot Lee 03bb291
%_localstatedir		/var
Elliot Lee 03bb291
e606f56
%_pkgdocdir             %{_docdir}/%{name}
e606f56
%_docdir_fmt            %%{NAME}
Elliot Lee 03bb291
Jonathan Masters 9ed9b4e
%_fmoddir		%{_libdir}/gfortran/modules
Jonathan Masters 9ed9b4e
Elliot Lee cec7d07
%_enable_debug_packages 1
98d1974
%_include_minidebuginfo 1
f6596a4
%_include_gdb_index     1
00e8557
%_debugsource_packages  1
00e8557
%_debuginfo_subpackages 1
27ac144
Elliot Lee 03bb291
#==============================================================================
Elliot Lee 03bb291
# ---- configure and makeinstall.
Elliot Lee 03bb291
#
4362927
%_configure_gnuconfig_hack	1
6c38f18
%_configure_libtool_hardening_hack	1
7359cf0
# If defined, _configure_disable_silent_rules will cause --disable-silent-rules
7359cf0
# to be added to the list of options passed to the configure script.
7359cf0
# Eventually we'll want to turn this on by default, but this gives packagers a
7359cf0
# way to turn it back off.
7359cf0
# %_configure_disable_silent_rules 1
6c38f18
%configure \
3081c4e
  CFLAGS="${CFLAGS:-%__global_cflags}" ; export CFLAGS ; \
3081c4e
  CXXFLAGS="${CXXFLAGS:-%__global_cxxflags}" ; export CXXFLAGS ; \
3081c4e
  FFLAGS="${FFLAGS:-%__global_fflags}" ; export FFLAGS ; \
3081c4e
  FCFLAGS="${FCFLAGS:-%__global_fcflags}" ; export FCFLAGS ; \
4b29a24
  LDFLAGS="${LDFLAGS:-%__global_ldflags}"; export LDFLAGS; \
a91c848
  [ "%_configure_gnuconfig_hack" = 1 ] && for i in $(find $(dirname %{_configure}) -name config.guess -o -name config.sub) ; do \
2a55717
      [ -f /usr/lib/rpm/redhat/$(basename $i) ] && %{__rm} -f $i && %{__cp} -fv /usr/lib/rpm/redhat/$(basename $i) $i ; \
2a55717
  done ; \
6c38f18
  [ "%_configure_libtool_hardening_hack" = 1 ] && [ x != "x%{_hardened_ldflags}" ] && \
6c38f18
      for i in $(find . -name ltmain.sh) ; do \
6c38f18
        %{__sed} -i.backup -e 's~compiler_flags=$~compiler_flags="%{_hardened_ldflags}"~' $i \
6c38f18
      done ; \
f2e3413
  %{_configure} --build=%{_build} --host=%{_host} \\\
Elliot Lee 4ccbbe7
	--program-prefix=%{?_program_prefix} \\\
850eda5
	--disable-dependency-tracking \\\
a0145ec
	%{?_configure_disable_silent_rules:--disable-silent-rules} \\\
Elliot Lee a2894a5
	--prefix=%{_prefix} \\\
Elliot Lee 03bb291
	--exec-prefix=%{_exec_prefix} \\\
Elliot Lee 03bb291
	--bindir=%{_bindir} \\\
Elliot Lee 03bb291
	--sbindir=%{_sbindir} \\\
Elliot Lee 03bb291
	--sysconfdir=%{_sysconfdir} \\\
Elliot Lee 03bb291
	--datadir=%{_datadir} \\\
Elliot Lee 03bb291
	--includedir=%{_includedir} \\\
Elliot Lee 03bb291
	--libdir=%{_libdir} \\\
Elliot Lee 03bb291
	--libexecdir=%{_libexecdir} \\\
Elliot Lee 03bb291
	--localstatedir=%{_localstatedir} \\\
Elliot Lee 03bb291
	--sharedstatedir=%{_sharedstatedir} \\\
Elliot Lee 03bb291
	--mandir=%{_mandir} \\\
6c38f18
	--infodir=%{_infodir}
Elliot Lee 03bb291
5f7da21
# Maximum number of CPU's to use when building, 0 for unlimited.
9a4753b
#
9a4753b
# This was for some time capped at 16.  Please see
9a4753b
# https://bugzilla.redhat.com/show_bug.cgi?id=669638 and
9a4753b
# https://bugzilla.redhat.com/show_bug.cgi?id=1384938 for the situation
9a4753b
# surrounding this.
9a4753b
#%_smp_ncpus_max 0
Elliot Lee 03bb291
%_smp_mflags %([ -z "$RPM_BUILD_NCPUS" ] \\\
Elliot Lee 03bb291
	&& RPM_BUILD_NCPUS="`/usr/bin/getconf _NPROCESSORS_ONLN`"; \\\
5f7da21
        ncpus_max=%{?_smp_ncpus_max}; \\\
5f7da21
        if [ -n "$ncpus_max" ] && [ "$ncpus_max" -gt 0 ] && [ "$RPM_BUILD_NCPUS" -gt "$ncpus_max" ]; then RPM_BUILD_NCPUS="$ncpus_max"; fi; \\\
5f7da21
        if [ "$RPM_BUILD_NCPUS" -gt 1 ]; then echo "-j$RPM_BUILD_NCPUS"; fi)
Elliot Lee 03bb291
Elliot Lee 03bb291
#==============================================================================
Elliot Lee 03bb291
# ---- Build policy macros.
Elliot Lee 03bb291
#
159a65f
#
159a65f
#---------------------------------------------------------------------
159a65f
#	Expanded at beginning of %install scriptlet.
159a65f
#
159a65f
159a65f
%__spec_install_pre %{___build_pre}\
159a65f
    [ "$RPM_BUILD_ROOT" != "/" ] && rm -rf "${RPM_BUILD_ROOT}"\
159a65f
    mkdir -p `dirname "$RPM_BUILD_ROOT"`\
159a65f
    mkdir "$RPM_BUILD_ROOT"\
159a65f
%{nil}
159a65f
Elliot Lee 03bb291
#---------------------------------------------------------------------
Elliot Lee 03bb291
#	Expanded at end of %install scriptlet.
Elliot Lee 03bb291
#
Elliot Lee 03bb291
Jesse Keating 9b11fc2
%__arch_install_post   /usr/lib/rpm/check-buildroot
Elliot Lee 03bb291
c4646d7
# Build root policy macros. Standard naming:
c4646d7
# convert all '-' in basename to '_', add two leading underscores.
12ace9b
%__brp_ldconfig /usr/lib/rpm/redhat/brp-ldconfig
c4646d7
%__brp_compress /usr/lib/rpm/brp-compress
c4646d7
%__brp_strip /usr/lib/rpm/brp-strip %{__strip}
c4646d7
%__brp_strip_comment_note /usr/lib/rpm/brp-strip-comment-note %{__strip} %{__objdump}
c4646d7
%__brp_strip_static_archive /usr/lib/rpm/brp-strip-static-archive %{__strip}
c4646d7
%__brp_python_bytecompile /usr/lib/rpm/brp-python-bytecompile %{__python} %{?_python_bytecompile_errors_terminate_build}
c4646d7
%__brp_python_hardlink /usr/lib/rpm/brp-python-hardlink
c4646d7
Elliot Lee 03bb291
%__os_install_post    \
12ace9b
    %{?__brp_ldconfig} \
c4646d7
    %{?__brp_compress} \
055d0b7
    %{!?__debug_package:\
c4646d7
    %{?__brp_strip} \
c4646d7
    %{?__brp_strip_comment_note} \
055d0b7
    } \
c4646d7
    %{?__brp_strip_static_archive} \
a747e7f
    %{?py_auto_byte_compile:%{?__brp_python_bytecompile}} \
c4646d7
    %{?__brp_python_hardlink} \
Elliot Lee 03bb291
%{nil}
Elliot Lee 03bb291
Elliot Lee 03bb291
%__spec_install_post\
61fb9e2
    %{?__debug_package:%{__debug_install_post}}\
Elliot Lee 03bb291
    %{__arch_install_post}\
Elliot Lee 03bb291
    %{__os_install_post}\
Elliot Lee 03bb291
%{nil}
Elliot Lee 03bb291
Tim Powers 1640cd5
%install %{?_enable_debug_packages:%{?buildsubdir:%{debug_package}}}\
Tim Powers 1640cd5
%%install\
Jonathan Masters 9ed9b4e
%{nil}
Jonathan Masters 9ed9b4e
Elliot Lee 00cbca9
#
Jonathan Masters 9ed9b4e
# Should missing buildids terminate a build?
Jonathan Masters 9ed9b4e
%_missing_build_ids_terminate_build    1
Elliot Lee f0352fc
Elliot Lee f0352fc
#
db967d3
## Automatically compile python files
db967d3
%py_auto_byte_compile 1
db967d3
db967d3
#
7cf1ad2
## Should python bytecompilation errors terminate a build?
7cf1ad2
%_python_bytecompile_errors_terminate_build 1
7cf1ad2
e2a80f3
# Use SHA-256 for FILEDIGESTS instead of default MD5
e2a80f3
%_source_filedigest_algorithm 8
e2a80f3
%_binary_filedigest_algorithm 8
e2a80f3
e56e816
# Use XZ compression for binary payloads
e56e816
%_binary_payload w2.xzdio
e56e816
5034f24
%_hardening_cflags	-specs=/usr/lib/rpm/redhat/redhat-hardened-cc1
6c38f18
# we don't escape symbols '~', '"', etc. so be careful when changing this
5034f24
%_hardening_ldflags	-specs=/usr/lib/rpm/redhat/redhat-hardened-ld
5034f24
d9235d2
# Harden packages by default for Fedora 23:
d9235d2
# https://fedorahosted.org/fesco/ticket/1384 (accepted on 2014-02-11)
3bf139f
# Use "%undefine _hardened_build" to disable.
d9235d2
%_hardened_build	1
5034f24
%_hardened_cflags	%{?_hardened_build:%{_hardening_cflags}}
5034f24
%_hardened_ldflags	%{?_hardened_build:%{_hardening_ldflags}}
5181193
b5ea4b2
%_annobin_cflags	-specs=/usr/lib/rpm/redhat/redhat-annobin-cc1
b5ea4b2
b5ea4b2
# Add extra information to binary objects created by gcc for Fedora 28:
b5ea4b2
# https://pagure.io/fesco/issue/1780 (accepted on 2017-10-30)
3bf139f
# Use "%undefine _annotated_build" to disable.
b5ea4b2
%_annotated_build	1
b5ea4b2
%_annotated_cflags	%{?_annotated_build:%{_annobin_cflags}}
b5ea4b2
078af19
# Fail linking if there are undefined symbols.  Required for proper
8d6c6d0
# ELF symbol versioning support.  Disabled by default.
8d6c6d0
# Use "%define _strict_symbol_defs_build 1" to enable.
8d6c6d0
#%_strict_symbol_defs_build	1
078af19
%_ld_symbols_flags		%{?_strict_symbol_defs_build:-Wl,-z,defs}
078af19
faa1ad4
%__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}
3081c4e
6dc7240
%__global_cflags	%{optflags}
3081c4e
%__global_cxxflags	%{optflags}
3081c4e
%__global_fflags	%{optflags} -I%_fmoddir
3081c4e
%__global_fcflags	%{optflags} -I%_fmoddir
078af19
%__global_ldflags	-Wl,-z,relro %{_ld_symbols_flags} %{_hardened_ldflags}
Elliot Lee f41aa8c
b5b2aed
#==============================================================================
20a4569
# ---- Generic auto req/prov filtering macros
b5b2aed
#
b5b2aed
# http://fedoraproject.org/wiki/PackagingDrafts/AutoProvidesAndRequiresFiltering
b5b2aed
b5b2aed
# prevent anything matching from being scanned for provides
b5b2aed
%filter_provides_in(P) %{expand: \
b5b2aed
%global __filter_prov_cmd %{?__filter_prov_cmd} %{__grep} -v %{-P} '%*' | \
b5b2aed
}
b5b2aed
b5b2aed
# prevent anything matching from being scanned for requires
b5b2aed
%filter_requires_in(P) %{expand: \
b5b2aed
%global __filter_req_cmd %{?__filter_req_cmd} %{__grep} -v %{-P} '%*' | \
b5b2aed
}
b5b2aed
b5b2aed
# filter anything matching out of the provides stream
b5b2aed
%filter_from_provides() %{expand: \
b5b2aed
%global __filter_from_prov %{?__filter_from_prov} | %{__sed} -e '%*' \
b5b2aed
}
b5b2aed
b5b2aed
# filter anything matching out of the requires stream
b5b2aed
%filter_from_requires() %{expand: \
b5b2aed
%global __filter_from_req %{?__filter_from_req} | %{__sed} -e '%*' \
b5b2aed
}
b5b2aed
20a4569
# actually set up the filtering bits
b5b2aed
%filter_setup %{expand: \
b5b2aed
%global _use_internal_dependency_generator 0 \
1891cc0
%global __deploop() while read FILE; do echo "${FILE}" | /usr/lib/rpm/rpmdeps -%{1}; done | /bin/sort -u \
b5b2aed
%global __find_provides /bin/sh -c "%{?__filter_prov_cmd} %{__deploop P} %{?__filter_from_prov}" \
b5b2aed
%global __find_requires /bin/sh -c "%{?__filter_req_cmd}  %{__deploop R} %{?__filter_from_req}" \
b5b2aed
}