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
%_prefix		/usr
Elliot Lee 03bb291
%_sysconfdir		/etc
Elliot Lee 03bb291
%_localstatedir		/var
2f654df
%_infodir		%{_prefix}/share/info
2f654df
%_mandir		%{_prefix}/share/man
Elliot Lee 03bb291
2f654df
%_defaultdocdir		%{_prefix}/share/doc
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
27ac144
Elliot Lee 03bb291
#==============================================================================
Elliot Lee 03bb291
# ---- configure and makeinstall.
Elliot Lee 03bb291
#
4362927
%_configure_gnuconfig_hack	1
6c38f18
%_configure_libtool_hardening_hack	1
f2e3413
%_configure ./configure
6c38f18
%configure \
Elliot Lee 03bb291
  CFLAGS="${CFLAGS:-%optflags}" ; export CFLAGS ; \
Elliot Lee 03bb291
  CXXFLAGS="${CXXFLAGS:-%optflags}" ; export CXXFLAGS ; \
Jonathan Masters 9ed9b4e
  FFLAGS="${FFLAGS:-%optflags -I%_fmoddir}" ; export FFLAGS ; \
0466a24
  FCFLAGS="${FCFLAGS:-%optflags -I%_fmoddir}" ; export FCFLAGS ; \
4b29a24
  LDFLAGS="${LDFLAGS:-%__global_ldflags}"; export LDFLAGS; \
4362927
  [ "%_configure_gnuconfig_hack" = 1 ] && for i in $(find . -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 \\\
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
Elliot Lee 03bb291
%makeinstall \
Elliot Lee ecdfe2c
  %{__make} \\\
Elliot Lee 03bb291
	prefix=%{?buildroot:%{buildroot}}%{_prefix} \\\
Elliot Lee 03bb291
	exec_prefix=%{?buildroot:%{buildroot}}%{_exec_prefix} \\\
Elliot Lee 03bb291
	bindir=%{?buildroot:%{buildroot}}%{_bindir} \\\
Elliot Lee 03bb291
	sbindir=%{?buildroot:%{buildroot}}%{_sbindir} \\\
Elliot Lee 03bb291
	sysconfdir=%{?buildroot:%{buildroot}}%{_sysconfdir} \\\
Elliot Lee 03bb291
	datadir=%{?buildroot:%{buildroot}}%{_datadir} \\\
Elliot Lee 03bb291
	includedir=%{?buildroot:%{buildroot}}%{_includedir} \\\
Elliot Lee 03bb291
	libdir=%{?buildroot:%{buildroot}}%{_libdir} \\\
Elliot Lee 03bb291
	libexecdir=%{?buildroot:%{buildroot}}%{_libexecdir} \\\
Elliot Lee 03bb291
	localstatedir=%{?buildroot:%{buildroot}}%{_localstatedir} \\\
Elliot Lee 03bb291
	sharedstatedir=%{?buildroot:%{buildroot}}%{_sharedstatedir} \\\
Elliot Lee 03bb291
	mandir=%{?buildroot:%{buildroot}}%{_mandir} \\\
Elliot Lee 03bb291
	infodir=%{?buildroot:%{buildroot}}%{_infodir} \\\
Elliot Lee 03bb291
  install
Elliot Lee 03bb291
5f7da21
# Maximum number of CPU's to use when building, 0 for unlimited.
5f7da21
%_smp_ncpus_max 16
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
Elliot Lee 03bb291
%__os_install_post    \
Elliot Lee 03bb291
    /usr/lib/rpm/redhat/brp-compress \
055d0b7
    %{!?__debug_package:\
055d0b7
    /usr/lib/rpm/redhat/brp-strip %{__strip} \
Elliot Lee 1de7d81
    /usr/lib/rpm/redhat/brp-strip-comment-note %{__strip} %{__objdump} \
055d0b7
    } \
055d0b7
    /usr/lib/rpm/redhat/brp-strip-static-archive %{__strip} \
7cf1ad2
    /usr/lib/rpm/brp-python-bytecompile %{__python} %{?_python_bytecompile_errors_terminate_build} \
Jeremy Katz a959c1f
    /usr/lib/rpm/redhat/brp-python-hardlink \
Jeremy Katz 85ff376
    %{!?__jar_repack:/usr/lib/rpm/redhat/brp-java-repack-jars} \
Elliot Lee 03bb291
%{nil}
Elliot Lee 03bb291
Elliot Lee 47b9f84
#    /usr/lib/rpm/redhat/brp-implant-ident-static
Elliot Lee 47b9f84
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
d18a947
#	Template for debug information sub-package.
d18a947
# NOTE: This is a copy from rpm to get the ifnarch noarch fix, it can be removed later
d18a947
%debug_package \
d18a947
%ifnarch noarch\
d18a947
%global __debug_package 1\
Elliot Lee 5fbe73e
%package debuginfo \
d18a947
Summary: Debug information for package %{name}\
d18a947
Group: Development/Debug\
Jonathan Masters 9ed9b4e
AutoReqProv: 0\
Elliot Lee 5fbe73e
%description debuginfo\
d18a947
This package provides debug information for package %{name}.\
d18a947
Debug information is useful when developing applications that use this\
d18a947
package or when debugging this package.\
Elliot Lee 5fbe73e
%files debuginfo -f debugfiles.list\
d18a947
%defattr(-,root,root)\
d18a947
%endif\
d18a947
%{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
#
Tim Powers 4707ac9
# use internal dep generator?
Tim Powers 4707ac9
%_use_internal_dependency_generator 1
Tim Powers 4707ac9
Tim Powers 4707ac9
#
Elliot Lee 00cbca9
# Should missing %doc files terminate a build?
Elliot Lee 7f05ca8
%_missing_doc_files_terminate_build    1
Jonathan Masters 9ed9b4e
#
Jonathan Masters 9ed9b4e
# Should missing buildids terminate a build?
Jonathan Masters 9ed9b4e
%_missing_build_ids_terminate_build    1
Elliot Lee f0352fc
Elliot Lee f0352fc
#
Elliot Lee f0352fc
# Should unpackaged files in a build root terminate a build?
Elliot Lee 7f05ca8
%_unpackaged_files_terminate_build    1
Elliot Lee 3b777d0
7cf1ad2
#
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
5034f24
#_hardened_build	0
5034f24
%_hardened_cflags	%{?_hardened_build:%{_hardening_cflags}}
5034f24
%_hardened_ldflags	%{?_hardened_build:%{_hardening_ldflags}}
5181193
33b9cbd
%__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}
0ae4b38
%__global_ldflags	-Wl,-z,relro %{_hardened_ldflags}
Elliot Lee f41aa8c
b5b2aed
#==============================================================================
b5b2aed
# ---- 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
b5b2aed
# 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
}
b5b2aed