2 %_infodir %{_prefix}/share/info
3 %_mandir %{_prefix}/share/man
6 %_defaultdocdir %{_usr}/share/doc/packages
8 # _rootprefix can be set to (/,%{_prefix}) to customize systemd installation)
9 %_rootprefix %{_prefix}
10 %_unitdir_user %{_prefix}/lib/systemd/user
11 %_unitdir %{_rootprefix}/lib/systemd/system
13 # package build macros
14 # %make_install make install DESTDIR=%{?buildroot}
15 # %makeinstall make DESTDIR=%{?buildroot:%{buildroot}} install
16 %rb_arch %(echo %{_host_cpu}-linux | sed -e "s/i686/i586/" -e "s/armv5tel/armv4l/" -e "s/hppa2.0/hppa/")
17 %rb_ver %(/usr/bin/ruby -e 'puts VERSION.sub(/\\\.\\\d$/, "")')
19 # external kernel module helper macro(s)
20 %kernel_devel_uname_r %(/bin/rpm -q --provides $(/bin/rpm -q --whatprovides kernel-devel-uname-r) | sed -ne 's,kernel-devel-uname-r = ,, p')
21 %kernel_release %(/bin/rpm -q --queryformat '%{RPMTAG_VERSION}-%{RPMTAG_RELEASE}' $(/bin/rpm -q --whatprovides kernel))
22 %kernel_name %(/bin/rpm -q --queryformat '%{RPMTAG_NAME}' $(/bin/rpm -q --whatprovides kernel))
24 # this script calls all scripts in %{_rpmconfigdir}/brp-tizen.d
25 %__arch_install_post %{_rpmconfigdir}/check-buildroot
27 %__strip_install_post \
28 %{!?__debug_package:%{_rpmconfigdir}/brp-strip %{__strip}} \
29 %{_rpmconfigdir}/brp-strip-static-archive %{__strip} \
30 # %{_rpmconfigdir}/brp-strip-comment-note %{__strip} %{__objdump} \
34 %{_rpmconfigdir}//brp-compress \
35 %{!?_rpm_strip_disable:%{__strip_install_post}}\
36 %{_rpmconfigdir}/brp-python-hardlink \
37 %{!?disable_docs_package:%{_rpmconfigdir}/tizen/find-docs.sh %{buildroot}} \
40 # %{_rpmconfigdir}/tizen/brp-implant-ident-static
43 %{?__debug_package:%{__debug_install_post}}\
44 %{__arch_install_post}\
48 # macro: %configure_kernel_source
51 %configure_kernel_source() \
52 if test -d /usr/src/linux ; then \
53 pushd /usr/src/linux \
54 test -f .config || cp arch/%_arch/defconfig.default .config \
55 yes "" | make oldconfig \
63 NUM_ARGS=${#ALL_ARGS[@]} \
64 if test -x /sbin/install-info ; then \
65 if test -e "${ALL_ARGS[$((NUM_ARGS-1))]}" ; then \
66 /sbin/install-info "${ALL_ARGS[@]}" \
70 %install_info_delete(:-:) \
72 NUM_ARGS=${#ALL_ARGS[@]} \
73 if test -x /sbin/install-info ; then \
74 if ! test -e "${ALL_ARGS[$((NUM_ARGS-1))]}" ; then \
75 /sbin/install-info --quiet --delete "${ALL_ARGS[@]}" \
79 # find-supplements.ksyms parses this macro directly out of the spec file:
80 %supplements_kernel_module() \
81 %{expand:%(if ! rpm -q kernel-syms > /dev/null; then echo "%fail Please add the kernel-syms package to BuildRequires"; fi)}
84 %cflags_profile_generate -fprofile-generate
85 %cflags_profile_feedback -fprofile-use
92 CFLAGS="${CFLAGS:-%optflags}" ; export CFLAGS ; \
93 CXXFLAGS="${CXXFLAGS:-%optflags}" ; export CXXFLAGS ; \
94 FFLAGS="${FFLAGS:-%optflags -I%_fmoddir}" ; export FFLAGS ; \
95 ./configure --build=%{_build} --host=%{_host} \\\
96 --program-prefix=%{?_program_prefix} \\\
97 --prefix=%{_prefix} \\\
98 --exec-prefix=%{_exec_prefix} \\\
99 --bindir=%{_bindir} \\\
100 --sbindir=%{_sbindir} \\\
101 --sysconfdir=%{_sysconfdir} \\\
102 --datadir=%{_datadir} \\\
103 --includedir=%{_includedir} \\\
104 --libdir=%{_libdir} \\\
105 --libexecdir=%{_libexecdir} \\\
106 --localstatedir=%{_localstatedir} \\\
107 --sharedstatedir=%{_sharedstatedir} \\\
108 --mandir=%{_mandir} \\\
109 --infodir=%{_infodir}
113 CFLAGS="${CFLAGS:-%optflags}" ; export CFLAGS ; \
114 CXXFLAGS="${CXXFLAGS:-%optflags}" ; export CXXFLAGS ; \
115 FFLAGS="${FFLAGS:-%optflags -I%_fmoddir}" ; export FFLAGS ; \
116 autoreconf -v --install --force || exit 1 \
117 ./configure --build=%{_build} --host=%{_host} \\\
118 --program-prefix=%{?_program_prefix} \\\
119 --prefix=%{_prefix} \\\
120 --exec-prefix=%{_exec_prefix} \\\
121 --bindir=%{_bindir} \\\
122 --sbindir=%{_sbindir} \\\
123 --sysconfdir=%{_sysconfdir} \\\
124 --datadir=%{_datadir} \\\
125 --includedir=%{_includedir} \\\
126 --libdir=%{_libdir} \\\
127 --libexecdir=%{_libexecdir} \\\
128 --localstatedir=%{_localstatedir} \\\
129 --sharedstatedir=%{_sharedstatedir} \\\
130 --mandir=%{_mandir} \\\
131 --infodir=%{_infodir}
134 CFLAGS="${CFLAGS:-%optflags}" ; export CFLAGS ; \
135 CXXFLAGS="${CXXFLAGS:-%optflags}" ; export CXXFLAGS ; \
136 FFLAGS="${FFLAGS:-%optflags -I%_fmoddir}" ; export FFLAGS ; \
137 ./autogen.sh --build=%{_build} --host=%{_host} \\\
138 --program-prefix=%{?_program_prefix} \\\
139 --prefix=%{_prefix} \\\
140 --exec-prefix=%{_exec_prefix} \\\
141 --bindir=%{_bindir} \\\
142 --sbindir=%{_sbindir} \\\
143 --sysconfdir=%{_sysconfdir} \\\
144 --datadir=%{_datadir} \\\
145 --includedir=%{_includedir} \\\
146 --libdir=%{_libdir} \\\
147 --libexecdir=%{_libexecdir} \\\
148 --localstatedir=%{_localstatedir} \\\
149 --sharedstatedir=%{_sharedstatedir} \\\
150 --mandir=%{_mandir} \\\
151 --infodir=%{_infodir}
156 prefix=%{?buildroot:%{buildroot}}%{_prefix} \\\
157 exec_prefix=%{?buildroot:%{buildroot}}%{_exec_prefix} \\\
158 bindir=%{?buildroot:%{buildroot}}%{_bindir} \\\
159 sbindir=%{?buildroot:%{buildroot}}%{_sbindir} \\\
160 sysconfdir=%{?buildroot:%{buildroot}}%{_sysconfdir} \\\
161 datadir=%{?buildroot:%{buildroot}}%{_datadir} \\\
162 includedir=%{?buildroot:%{buildroot}}%{_includedir} \\\
163 libdir=%{?buildroot:%{buildroot}}%{_libdir} \\\
164 libexecdir=%{?buildroot:%{buildroot}}%{_libexecdir} \\\
165 localstatedir=%{?buildroot:%{buildroot}}%{_localstatedir} \\\
166 sharedstatedir=%{?buildroot:%{buildroot}}%{_sharedstatedir} \\\
167 mandir=%{?buildroot:%{buildroot}}%{_mandir} \\\
168 infodir=%{?buildroot:%{buildroot}}%{_infodir} \\\
174 DESTDIR=%{?buildroot:%{buildroot}} \\\
175 INSTALL_ROOT=%{?buildroot:%{buildroot}} \\\
177 rm -f %{?buildroot:%{buildroot}}%{_infodir}/dir \
178 find %{?buildroot:%{buildroot}} -regex ".*\\.la$" | xargs rm -f -- \
179 %{!?keepstatic:find %{?buildroot:%{buildroot}} -regex ".*\\.a$" | xargs rm -f --}
181 %_smp_mflags %([ -z "$RPM_BUILD_NCPUS" ] \\\
182 && RPM_BUILD_NCPUS="`/usr/bin/getconf _NPROCESSORS_ONLN`"; \\\
183 [ "$RPM_BUILD_NCPUS" -gt 1 ] && echo "-j$RPM_BUILD_NCPUS")
185 %lang_package(n:f:) \
186 %package %{-n:-n %{-n*}-}locale \
187 Summary: Translations and Locale for package %{name}\
188 Requires: %{-n:%{-n*}}%{!-n:%{name}} = %{version} \
189 Provides: %{-n:%{-n*}}%{!-n:%{name}}-lang-all = %{version} \
191 %description %{-n:-n %{-n*}-}locale\
192 This package provides translations for package %{name}.\
193 %files %{-n:-n %{-n*}-}locale -f %{-f:%{-f*}.lang} %{!-f:%{name}.lang}\
194 %defattr(-,root,root,-)\
199 Summary: Documentation for package %{name}\
202 This package provides documentation for package %{name}.\
203 %files docs -f documentation.list\
204 %defattr(-,root,root,-)\
207 # Bad hack to set $LANG to C during all RPM builds
219 CFLAGS="%optflags" ; export CFLAGS ; \
220 CXXFLAGS="${CXXFLAGS:-%optflags}" ; export CXXFLAGS ; \
221 FFLAGS="${FFLAGS:-%optflags -I%_fmoddir}" ; export FFLAGS ; \
222 LDFLAGS="${LDFLAGS:-%{?global_LDFLAGS}}"; export LDFLAGS ; \
223 LD_AS_NEEDED=1; export LD_AS_NEEDED ; \
226 %install %{?_enable_debug_packages:%{?buildsubdir:%{debug_package}}}\
231 rm -rf %{?buildroot:%{buildroot}} \
232 mkdir -p %{?buildroot:%{buildroot}} \
237 rm -rf %{?buildroot:%{buildroot}} \
240 %find_lang %{_rpmconfigdir}/find-lang.sh %{buildroot}
241 %find_docs %{_rpmconfigdir}/tizen/find-docs.sh %{buildroot}
245 #==============================================================================
246 # ---- default .desktop directories per the desktop-entry freedesktop.org spec
248 %_desktopdir %{_datadir}/applications
250 #==============================================================================
251 # ---- Generic auto req/prov filtering macros
253 # http://fedoraproject.org/wiki/PackagingDrafts/AutoProvidesAndRequiresFiltering
255 # prevent anything matching from being scanned for provides
256 %filter_provides_in(P) %{expand: \
257 %global __filter_prov_cmd %{?__filter_prov_cmd} %{__grep} -v %{-P} '%*' | \
260 # prevent anything matching from being scanned for requires
261 %filter_requires_in(P) %{expand: \
262 %global __filter_req_cmd %{?__filter_req_cmd} %{__grep} -v %{-P} '%*' | \
265 # filter anything matching out of the provides stream
266 %filter_from_provides() %{expand: \
267 %global __filter_from_prov %{?__filter_from_prov} | %{__sed} -e '%*' \
270 # filter anything matching out of the requires stream
271 %filter_from_requires() %{expand: \
272 %global __filter_from_req %{?__filter_from_req} | %{__sed} -e '%*' \
275 # actually set up the filtering bits
276 %filter_setup %{expand: \
277 %global _use_internal_dependency_generator 0 \
278 %global __deploop() while read FILE; do %{_rpmconfigdir}/rpmdeps -%{1} ${FILE}; done | /bin/sort -u \
279 %global __find_provides /bin/sh -c "%{?__filter_prov_cmd} %{__deploop P} %{?__filter_from_prov}" \
280 %global __find_requires /bin/sh -c "%{?__filter_req_cmd} %{__deploop R} %{?__filter_from_req}" \
284 rm -rf %{?buildroot:%{buildroot}}%{_infodir} \
285 rm -rf %{?buildroot:%{buildroot}}%{_defaultdocdir} \
286 rm -rf %{?buildroot:%{buildroot}}%{_datadir}/doc/%{name} \
287 rm -rf %{?buildroot:%{buildroot}}%{_datadir}/doc/%{name}-%{version} \
288 rm -rf %{?buildroot:%{buildroot}}%{_datadir}/gtk-doc \
289 rm -rf %{?buildroot:%{buildroot}}%{_datadir}/doc \
290 rm -rf %{?buildroot:%{buildroot}}%{_datadir}/man \
291 find %{?buildroot:%{buildroot}} -regex ".*/man/man./.*\.[0-9]" | xargs rm -f -- \
292 find %{?buildroot:%{buildroot}} -regex ".*/man/../man./.*\.[0-9]" | xargs rm -f -- \
293 find %{?buildroot:%{buildroot}} -regex ".*/man/man./.*\.[0-9]pm" | xargs rm -f --
297 mkdir -p %{buildroot}/%{_unitdir}/%{1} \
298 ln -s ../%{2} %{buildroot}/%{_unitdir}/%{1}/%{2} \
302 %_fontsdir %{_usr}/share/fonts
303 %_ttfontsdir %{_fontsdir}/truetype
304 %_miscfontsdir %{_fontsdir}/misc
305 %_fontsconfdir %{_sysconfdir}/fonts
306 %_fontsconfddir %{_fontsconfdir}/conf.d
307 %_fontsconfavaildir %{_datadir}/%{name}/conf.avail
311 Summary: Development files for package %{name}\
314 This package provides header files and other developer releated files for package %{name}.\
317 %{_libdir}/pkgconfig/*.pc\
321 %devel_desc This package contains all necessary include files and libraries needed \
322 to develop applications that require %{name}.\
325 %posttrans(n:) %%posttrans %{?-n:-n %{-n*}}%{*} \
326 echo "Running %{?-n:%{-n*}}%{!?-n:%{name}%{?1:-%{1}}} %%posttrans script" \