Elliot Lee 03bb29
# Per-platform rpm configuration file.
Elliot Lee 03bb29
Elliot Lee 03bb29
#==============================================================================
Elliot Lee 03bb29
# ---- per-platform macros.
Elliot Lee 03bb29
#
Elliot Lee 03bb29
%_vendor		redhat
Elliot Lee 03bb29
%_os			linux
cb63b8
%_target_platform	%{_target_cpu}-%{_vendor}-%{_target_os}%{?_gnu}
Elliot Lee 03bb29
Elliot Lee 03bb29
#==============================================================================
Jeremy Katz 8a919b
# ---- configure macros.  note that most of these are inherited
Jeremy Katz 8a919b
#      from the defaults.
Elliot Lee 03bb29
#
Elliot Lee 03bb29
%_localstatedir		/var
Elliot Lee 03bb29
e606f5
%_pkgdocdir             %{_docdir}/%{name}
e606f5
%_docdir_fmt            %%{NAME}
Elliot Lee 03bb29
Jonathan Masters 9ed9b4
%_fmoddir		%{_libdir}/gfortran/modules
Jonathan Masters 9ed9b4
Elliot Lee cec7d0
%_enable_debug_packages 1
98d197
%_include_minidebuginfo 1
27ac14
Elliot Lee 03bb29
#==============================================================================
Elliot Lee 03bb29
# ---- configure and makeinstall.
Elliot Lee 03bb29
#
436292
%_configure_gnuconfig_hack	1
6c38f1
%_configure_libtool_hardening_hack	1
6c38f1
%configure \
Elliot Lee 03bb29
  CFLAGS="${CFLAGS:-%optflags}" ; export CFLAGS ; \
Elliot Lee 03bb29
  CXXFLAGS="${CXXFLAGS:-%optflags}" ; export CXXFLAGS ; \
Jonathan Masters 9ed9b4
  FFLAGS="${FFLAGS:-%optflags -I%_fmoddir}" ; export FFLAGS ; \
0466a2
  FCFLAGS="${FCFLAGS:-%optflags -I%_fmoddir}" ; export FCFLAGS ; \
4b29a2
  LDFLAGS="${LDFLAGS:-%__global_ldflags}"; export LDFLAGS; \
a91c84
  [ "%_configure_gnuconfig_hack" = 1 ] && for i in $(find $(dirname %{_configure}) -name config.guess -o -name config.sub) ; do \
2a5571
      [ -f /usr/lib/rpm/redhat/$(basename $i) ] && %{__rm} -f $i && %{__cp} -fv /usr/lib/rpm/redhat/$(basename $i) $i ; \
2a5571
  done ; \
6c38f1
  [ "%_configure_libtool_hardening_hack" = 1 ] && [ x != "x%{_hardened_ldflags}" ] && \
6c38f1
      for i in $(find . -name ltmain.sh) ; do \
6c38f1
        %{__sed} -i.backup -e 's~compiler_flags=$~compiler_flags="%{_hardened_ldflags}"~' $i \
6c38f1
      done ; \
f2e341
  %{_configure} --build=%{_build} --host=%{_host} \\\
Elliot Lee 4ccbbe
	--program-prefix=%{?_program_prefix} \\\
850eda
	--disable-dependency-tracking \\\
Elliot Lee a2894a
	--prefix=%{_prefix} \\\
Elliot Lee 03bb29
	--exec-prefix=%{_exec_prefix} \\\
Elliot Lee 03bb29
	--bindir=%{_bindir} \\\
Elliot Lee 03bb29
	--sbindir=%{_sbindir} \\\
Elliot Lee 03bb29
	--sysconfdir=%{_sysconfdir} \\\
Elliot Lee 03bb29
	--datadir=%{_datadir} \\\
Elliot Lee 03bb29
	--includedir=%{_includedir} \\\
Elliot Lee 03bb29
	--libdir=%{_libdir} \\\
Elliot Lee 03bb29
	--libexecdir=%{_libexecdir} \\\
Elliot Lee 03bb29
	--localstatedir=%{_localstatedir} \\\
Elliot Lee 03bb29
	--sharedstatedir=%{_sharedstatedir} \\\
Elliot Lee 03bb29
	--mandir=%{_mandir} \\\
6c38f1
	--infodir=%{_infodir}
Elliot Lee 03bb29
5f7da2
# Maximum number of CPU's to use when building, 0 for unlimited.
5f7da2
%_smp_ncpus_max 16
Elliot Lee 03bb29
%_smp_mflags %([ -z "$RPM_BUILD_NCPUS" ] \\\
Elliot Lee 03bb29
	&& RPM_BUILD_NCPUS="`/usr/bin/getconf _NPROCESSORS_ONLN`"; \\\
5f7da2
        ncpus_max=%{?_smp_ncpus_max}; \\\
5f7da2
        if [ -n "$ncpus_max" ] && [ "$ncpus_max" -gt 0 ] && [ "$RPM_BUILD_NCPUS" -gt "$ncpus_max" ]; then RPM_BUILD_NCPUS="$ncpus_max"; fi; \\\
5f7da2
        if [ "$RPM_BUILD_NCPUS" -gt 1 ]; then echo "-j$RPM_BUILD_NCPUS"; fi)
Elliot Lee 03bb29
Elliot Lee 03bb29
#==============================================================================
Elliot Lee 03bb29
# ---- Build policy macros.
Elliot Lee 03bb29
#
159a65
#
159a65
#---------------------------------------------------------------------
159a65
#	Expanded at beginning of %install scriptlet.
159a65
#
159a65
159a65
%__spec_install_pre %{___build_pre}\
159a65
    [ "$RPM_BUILD_ROOT" != "/" ] && rm -rf "${RPM_BUILD_ROOT}"\
159a65
    mkdir -p `dirname "$RPM_BUILD_ROOT"`\
159a65
    mkdir "$RPM_BUILD_ROOT"\
159a65
%{nil}
159a65
Elliot Lee 03bb29
#---------------------------------------------------------------------
Elliot Lee 03bb29
#	Expanded at end of %install scriptlet.
Elliot Lee 03bb29
#
Elliot Lee 03bb29
Jesse Keating 9b11fc
%__arch_install_post   /usr/lib/rpm/check-buildroot
Elliot Lee 03bb29
Elliot Lee 03bb29
%__os_install_post    \
82a41d
    /usr/lib/rpm/brp-compress \
055d0b
    %{!?__debug_package:\
82a41d
    /usr/lib/rpm/brp-strip %{__strip} \
82a41d
    /usr/lib/rpm/brp-strip-comment-note %{__strip} %{__objdump} \
055d0b
    } \
82a41d
    /usr/lib/rpm/brp-strip-static-archive %{__strip} \
db967d
    %{?py_auto_byte_compile:/usr/lib/rpm/brp-python-bytecompile %{__python} %{?_python_bytecompile_errors_terminate_build}} \
82a41d
    /usr/lib/rpm/brp-python-hardlink \
Jeremy Katz 85ff37
    %{!?__jar_repack:/usr/lib/rpm/redhat/brp-java-repack-jars} \
Elliot Lee 03bb29
%{nil}
Elliot Lee 03bb29
Elliot Lee 47b9f8
#    /usr/lib/rpm/redhat/brp-implant-ident-static
Elliot Lee 47b9f8
Elliot Lee 03bb29
%__spec_install_post\
61fb9e
    %{?__debug_package:%{__debug_install_post}}\
Elliot Lee 03bb29
    %{__arch_install_post}\
Elliot Lee 03bb29
    %{__os_install_post}\
Elliot Lee 03bb29
%{nil}
Elliot Lee 03bb29
Tim Powers 1640cd
%install %{?_enable_debug_packages:%{?buildsubdir:%{debug_package}}}\
Tim Powers 1640cd
%%install\
Jonathan Masters 9ed9b4
%{nil}
Jonathan Masters 9ed9b4
Elliot Lee 00cbca
#
Jonathan Masters 9ed9b4
# Should missing buildids terminate a build?
Jonathan Masters 9ed9b4
%_missing_build_ids_terminate_build    1
Elliot Lee f0352f
Elliot Lee f0352f
#
db967d
## Automatically compile python files
db967d
%py_auto_byte_compile 1
db967d
db967d
#
7cf1ad
## Should python bytecompilation errors terminate a build?
7cf1ad
%_python_bytecompile_errors_terminate_build 1
7cf1ad
e2a80f
# Use SHA-256 for FILEDIGESTS instead of default MD5
e2a80f
%_source_filedigest_algorithm 8
e2a80f
%_binary_filedigest_algorithm 8
e2a80f
e56e81
# Use XZ compression for binary payloads
e56e81
%_binary_payload w2.xzdio
e56e81
5034f2
%_hardening_cflags	-specs=/usr/lib/rpm/redhat/redhat-hardened-cc1
6c38f1
# we don't escape symbols '~', '"', etc. so be careful when changing this
5034f2
%_hardening_ldflags	-specs=/usr/lib/rpm/redhat/redhat-hardened-ld
5034f2
d9235d
# Harden packages by default for Fedora 23:
d9235d
# https://fedorahosted.org/fesco/ticket/1384 (accepted on 2014-02-11)
d9235d
%_hardened_build	1
5034f2
%_hardened_cflags	%{?_hardened_build:%{_hardening_cflags}}
5034f2
%_hardened_ldflags	%{?_hardened_build:%{_hardening_ldflags}}
518119
33b9cb
%__global_cflags	-O2 -g -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector-strong --param=ssp-buffer-size=4 -grecord-gcc-switches %{_hardened_cflags}
0ae4b3
%__global_ldflags	-Wl,-z,relro %{_hardened_ldflags}
Elliot Lee f41aa8
b5b2ae
#==============================================================================
20a456
# ---- Generic auto req/prov filtering macros
b5b2ae
#
b5b2ae
# http://fedoraproject.org/wiki/PackagingDrafts/AutoProvidesAndRequiresFiltering
b5b2ae
b5b2ae
# prevent anything matching from being scanned for provides
b5b2ae
%filter_provides_in(P) %{expand: \
b5b2ae
%global __filter_prov_cmd %{?__filter_prov_cmd} %{__grep} -v %{-P} '%*' | \
b5b2ae
}
b5b2ae
b5b2ae
# prevent anything matching from being scanned for requires
b5b2ae
%filter_requires_in(P) %{expand: \
b5b2ae
%global __filter_req_cmd %{?__filter_req_cmd} %{__grep} -v %{-P} '%*' | \
b5b2ae
}
b5b2ae
b5b2ae
# filter anything matching out of the provides stream
b5b2ae
%filter_from_provides() %{expand: \
b5b2ae
%global __filter_from_prov %{?__filter_from_prov} | %{__sed} -e '%*' \
b5b2ae
}
b5b2ae
b5b2ae
# filter anything matching out of the requires stream
b5b2ae
%filter_from_requires() %{expand: \
b5b2ae
%global __filter_from_req %{?__filter_from_req} | %{__sed} -e '%*' \
b5b2ae
}
b5b2ae
20a456
# actually set up the filtering bits
b5b2ae
%filter_setup %{expand: \
b5b2ae
%global _use_internal_dependency_generator 0 \
1891cc
%global __deploop() while read FILE; do echo "${FILE}" | /usr/lib/rpm/rpmdeps -%{1}; done | /bin/sort -u \
b5b2ae
%global __find_provides /bin/sh -c "%{?__filter_prov_cmd} %{__deploop P} %{?__filter_from_prov}" \
b5b2ae
%global __find_requires /bin/sh -c "%{?__filter_req_cmd}  %{__deploop R} %{?__filter_from_req}" \
b5b2ae
}