4 %distribution PLD Linux
6 %bugurl http://bugs.pld-linux.org/
7 %disturl http://www.pld-linux.org/
9 %disttag %{pld_release}
11 #==============================================================================
12 # ---- configure macros. note that most of these are inherited
15 %_sharedstatedir /var/lib
17 %_initrddir %{_sysconfdir}/rc.d/init.d
19 %_defaultdocdir %{_usr}/share/doc
21 %_fmoddir %{_libdir}/gfortran/modules
23 # Executed at after copying %doc to DOCDIR, with $DOCDIR set
24 %__compress_doc %{_rpmconfigdir}/compress-doc%{?_noautocompressdoc: --noautocompressdoc='%{_noautocompressdoc}'}
27 %{__spec_install_post_strip}\
28 %{__spec_install_post_chrpath}\
29 %{__spec_install_post_compress_modules}\
30 %{__spec_install_post_check_so}\
31 %{__spec_install_post_check_tmpfiles}\
32 %{__spec_install_post_check_shebangs}\
33 %{__spec_install_post_compress_docs}\
34 %{__spec_install_post_py_hardlink}\
35 %{__spec_install_post_perl_clean}\
36 %{__arch_install_post}\
40 %{expand:%%define __sip_%{?_enable_debug_packages} 1}%{?__sip_1:%{?__debug_package:%{__debug_install_post}}}%{expand:%%undefine __sip_%{?_enable_debug_packages}}\
41 %{__arch_install_post}\
45 #---------------------------------------------------------------------
46 # Template for debug information sub-package.
47 %_enable_debug_packages 1
51 %global __debug_package 1\
53 Summary: Debug information for package %{name}\
54 Summary(pl.UTF-8): Informacje dla debuggera dla pakietu %{name}\
55 Group: Development/Debug\
56 Requires: filesystem-debuginfo >= 3.0-16\
58 %description debuginfo\
59 This package provides debug information for package %{name}.\
60 Debug information is useful when developing applications that use this\
61 package or when debugging this package.\
62 %description debuginfo -l pl.UTF-8\
63 Ten pakiet dostarcza informacje dla debuggera dla pakietu %{name}.\
64 Informacje te są przydatne przy rozwijaniu aplikacji używających tego\
65 pakietu oraz przy odpluskwianiu samego pakietu.\
66 %files debuginfo -f debugfiles.list\
67 %defattr(-,root,root)\
71 #---------------------------------------------------------------------
72 # Overwrite RPM macros with PLD specific one here.
79 %_tmppath %(echo "${TMPDIR:-/var/tmp}")
82 %_topdir %(echo $HOME)/rpm
84 %buildroot %{_tmppath}/%{name}-%{version}-root-%(id -u -n)
86 %_source_payload w9.gzdio
87 %_binary_payload w6.xzdio
89 %_rpmfc_magic_path /usr/share/file/magic
91 # provides don't obsolete
94 # Disable automatic dependencies on symlinks for now (debuginfo packages pull too many deps)
95 %_check_symlink_deps 0
97 # Do not generate executable() dependencies for scriptlets,
98 # as it may give false positives, for example:
99 # [ ! -x /bin/prog ] || /bin/prog
100 # will generate R:/bin/prog and we don't want that as /bin/prog is optional in this case
101 # 0 - Use external generator
102 # 1 - Use internal generator if available
103 # 2 - Use __scriptlet_requires to process scriptlet dependencies
104 %_use_internal_dependency_generator 1
106 %_duplicate_files_terminate_build 1
107 %_files_listed_twice_terminate_build 1
108 %_unpackaged_files_terminate_build 0
109 %_unpackaged_subdirs_terminate_build 0
112 # Export package NEVRA (stamped with install tid) info for HRMIB on this path.
114 # XXX Note: escaped %% for use in headerSprintf()
115 %_hrmib_path /var/cache/hrmib/%{___NVRA}
117 #-----------------------------------------------------------------
118 # CFLAGS and LDFLAGS used to build
120 %debuginfocflags %{expand:%%define __dic_%{?_enable_debug_packages} 1}%{?__dic_1: -gdwarf-4 -fno-debug-types-section -fvar-tracking-assignments -g2}%{expand:%%undefine __dic_%{?_enable_debug_packages}}
121 # -feliminate-dwarf2-dups disabled until PR ld/3290 is fixed.
123 %debugcflags -O0 -g -Wall
124 %debugcppflags %{nil}
127 %optldflags -Wl,--as-needed -Wl,--no-copy-dt-needed-entries -Wl,-z,relro -Wl,-z,combreloc
130 # Warning: those macros are overwritten by macros.build,
131 # left here for compatibility
132 %rpmcflags %(awk 'BEGIN {
133 split("%{?debug:%debugcflags}%{!?debug:%optflags}%{?debuginfocflags}",I);
134 split("%{?filterout} %{?filterout_c} %{?filterout_ld}",F);
137 %rpmcppflags %(awk 'BEGIN {
138 split("%{?debug:%debugcppflags}%{!?debug:%optcppflags}%{?debuginfocppflags}",I);
139 split("%{?filterout} %{?filterout_cpp} %{?filterout_cpp}",F);
142 %rpmcxxflags %(awk 'BEGIN {
143 split("%{?debug:%debugcflags}%{!?debug:%optflags}%{?debuginfocflags}",I);
144 split("%{?filterout} %{?filterout_cxx} %{?filterout_ld}",F);
147 %rpmldflags %(awk 'BEGIN {
148 split("%{?optldflags}",I);
149 split("%{?filterout_ld}",F)
153 # common compilation flags
154 %_fortify_cflags -Wp,-D_FORTIFY_SOURCE=2
156 # cf http://wiki.mandriva.com/en/Development/Packaging/Problems#format_not_a_string_literal_and_no_format_arguments
157 %Werror_cflags -Wformat -Werror=format-security
159 # Use -Werror=trampolines to prevent GCC from generating code that require executable stack
160 %_ssp_cflags -fstack-protector-strong --param=ssp-buffer-size=4 -Werror=trampolines
161 %__common_cflags -O2 -fwrapv -pipe %{Werror_cflags} %{debuginfocflags} %{?_fortify_cflags} %{!?nospecflags:%{?specflags}}
162 %__common_cflags_with_ssp %{__common_cflags} %{?_ssp_cflags}
165 %ix86 i386 i486 i586 i686 pentium3 pentium4 athlon geode
166 %x8664 x86_64 amd64 ia32e
167 %ppc ppc ppc7400 ppc7450
169 # avoid fdatasync syscall flood during database operations.
172 #---------------------------------------------------------------------
173 # Expanded at end of %prep
175 %__chown_Rhf %{__chown} -Rhf
176 %__chgrp_Rhf %{__chgrp} -Rhf
177 %_fixowner [ `%{__id_u}` = '0' ] && %{__chown_Rhf} root
178 %_fixgroup [ `%{__id_u}` = '0' ] && %{__chgrp_Rhf} root