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
|
2002-11-20 16:55:36 +00:00
|
|
|
|
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
|
|
|
|
%configure \
|
2002-06-12 12:59:50 +00:00
|
|
|
CFLAGS="${CFLAGS:-%optflags}" ; export CFLAGS ; \
|
|
|
|
CXXFLAGS="${CXXFLAGS:-%optflags}" ; export CXXFLAGS ; \
|
2008-05-06 23:08:20 +00:00
|
|
|
FFLAGS="${FFLAGS:-%optflags -I%_fmoddir}" ; export FFLAGS ; \
|
2013-04-23 04:33:30 +00:00
|
|
|
FCFLAGS="${FCFLAGS:-%optflags -I%_fmoddir}" ; export FCFLAGS ; \
|
2011-07-07 17:17:24 +00:00
|
|
|
LDFLAGS="${LDFLAGS:-%__global_ldflags}"; export LDFLAGS; \
|
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 \\\
|
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.
|
|
|
|
%_smp_ncpus_max 16
|
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
|
|
|
|
|
|
|
%__os_install_post \
|
2014-04-27 13:53:45 +00:00
|
|
|
/usr/lib/rpm/brp-compress \
|
2010-03-01 08:58:17 +00:00
|
|
|
%{!?__debug_package:\
|
2014-04-27 13:53:45 +00:00
|
|
|
/usr/lib/rpm/brp-strip %{__strip} \
|
|
|
|
/usr/lib/rpm/brp-strip-comment-note %{__strip} %{__objdump} \
|
2010-03-01 08:58:17 +00:00
|
|
|
} \
|
2014-04-27 13:53:45 +00:00
|
|
|
/usr/lib/rpm/brp-strip-static-archive %{__strip} \
|
2015-05-19 11:28:55 +00:00
|
|
|
%{?py_auto_byte_compile:/usr/lib/rpm/brp-python-bytecompile %{__python} %{?_python_bytecompile_errors_terminate_build}} \
|
2014-04-27 13:53:45 +00:00
|
|
|
/usr/lib/rpm/brp-python-hardlink \
|
2007-06-19 18:28:50 +00:00
|
|
|
%{!?__jar_repack:/usr/lib/rpm/redhat/brp-java-repack-jars} \
|
2002-06-12 12:59:50 +00:00
|
|
|
%{nil}
|
|
|
|
|
2003-01-22 18:30:56 +00:00
|
|
|
# /usr/lib/rpm/redhat/brp-implant-ident-static
|
|
|
|
|
2002-06-12 12:59:50 +00:00
|
|
|
%__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
|
2011-09-16 20:49:56 +00:00
|
|
|
%_hardening_ldflags -specs=/usr/lib/rpm/redhat/redhat-hardened-ld
|
|
|
|
|
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)
|
|
|
|
%_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
|
|
|
|
2013-10-25 08:50:51 +00:00
|
|
|
%__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}
|
2011-08-08 14:58:51 +00:00
|
|
|
%__global_ldflags -Wl,-z,relro %{_hardened_ldflags}
|
2005-03-22 03:30:56 +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}" \
|
|
|
|
}
|