/[soft]/rpm/rpm-setup/trunk/build.macros.in
ViewVC logotype

Contents of /rpm/rpm-setup/trunk/build.macros.in

Parent Directory Parent Directory | Revision Log Revision Log


Revision 6508 - (show annotations) (download)
Sun Nov 25 13:59:39 2012 UTC (6 years, 4 months ago) by colin
File size: 20489 byte(s)
add some macros for udev rules and tmpfiles snippets
1
2 %__gzip /usr/bin/gzip
3
4 %_sys_macros_dir @RPMSYSCONFDIR@/macros.d
5 %build_sysmacrospath() %{_sys_macros_dir}/%{?1:%{1}}%{?!1:%{name}}.macros
6
7 # [Pixel, Dec 2008] deprecated, to remove as soon as rpm 4.6.0 dust settles down
8 %defaultbuildroot %{_tmppath}/%{name}-%{version}-%{release}-buildroot
9
10
11 # when %_with_git_repository is set, these macros modify the behaviour of "%prep" step:
12 %_after_setup %{?_with_git_repository:GIT_URL="%{?git_url}" GIT_REPOSITORY_CACHE=%{?git_repository_cache} @RPMVENDORDIR@/git-repository--after-tarball}
13 %_patch %{?_with_git_repository:PKG_NAME=%{name} @RPMVENDORDIR@/git-repository--apply-patch}%{?!_with_git_repository:%__patch -U}
14
15 # used by "git-repository--after-tarball":
16 %git_repository_cache %_topdir/%{name}.git
17
18
19 # Various programs used in rpm scripts
20 %_update_desktop_database_bin %{_bindir}/update-desktop-database
21 %_update_mime_database_bin %{_bindir}/update-mime-database
22 %_update_icon_cache_bin %{_bindir}/gtk-update-icon-cache
23 %_gconftool_bin %{_bindir}/gconftool-2
24 %_scrollkeeper_bin %{_bindir}/scrollkeeper-update
25
26 %__service /sbin/service
27 %__chkconfig /sbin/chkconfig
28
29 #==============================================================================
30 # ---- Required rpmrc macros.
31 # Macros that used to be initialized as a side effect of rpmrc parsing.
32 # These are the default values that can be overridden by other
33 # (e.g. per-platform, per-system, per-packager, per-package) macros.
34 #
35
36 %debug_package_and_restore %{debug_package} \
37 %package __restore__\
38 Summary: %{summary}\
39 Group: %{group}\
40 %description __restore__
41
42 %ix86 i386 i486 i586 i686 pentium3 pentium4 athlon k6
43
44 %sparc sun4 sun4m sun4c sun4d sun4u sparcv9b sparcv9v2 %{sparcx}
45 %sparcx sparc sparcv8 sparcv9 sparcv9v sparc64 sparc64v
46
47 # Multilibs
48 %_multilibpatt (/%{_lib}|/usr/%{_lib}(|/gconv)|/usr/local/%{_lib}|/usr/X11R6/%{_lib}|/opt/%{_lib})/[^/]*\\.([oa]|la|so[0-9.]*)$
49
50 %_arch_tag_suffix %([ "%{?_lib}" = "lib64" ] && echo "()(64bit)")
51 %arch_tagged() %{1}%{_arch_tag_suffix} %{?2:%{2} %{3}%{?!3:%{error:undefined 3rd argument in arch_tagged}}}
52
53 # Games macros
54 %_gamesdir games
55 %_gamesbindir %{_prefix}/%{_gamesdir}
56 %_gamesdatadir %{_datadir}/%{_gamesdir}
57
58 # Menu directories
59 %_menudir %{_prefix}/lib/menu
60 %_iconsdir %{_datadir}/icons
61 %_miconsdir %{_datadir}/icons/mini
62 %_liconsdir %{_datadir}/icons/large
63
64 %_xfontdir %_datadir/fonts
65
66 %_webconfdir %{_sysconfdir}/httpd/conf
67 %_webappconfdir %_webconfdir/sites.d
68 # compatibility
69 %webappconfdir %_webappconfdir
70
71 #==============================================================================
72 # ---- Build configuration macros.
73 #
74 # Package version macro.
75 # The type of package to produce, for compatibility with legacy
76 # versions of rpm.
77 #
78 # Script gets packaged file list on input.
79 # Returns list of multiarch files that are not marked as such,
80 # i.e. files in $RPM_BUILD_ROOT that have arch-dependent values
81 #
82 # Note: Disable (by commenting out) for legacy compatibility.
83 #%__check_multiarch_files @RPMLIBDIR@/check-multiarch-files %{buildroot}
84
85 # Use internal dependency generator rather than external helpers?
86 %_use_internal_dependency_generator 0
87
88 %__find_provides @RPMVENDORDIR@/filter.sh '%{?_provides_exceptions:%{_provides_exceptions}}%{!?_provides_exceptions: }' '%{?_exclude_files_from_autoprov:%{_exclude_files_from_autoprov}}%{!?_exclude_files_from_autoprov: }' '%{buildroot}' @RPMVENDORDIR@/find-provides
89 %__find_requires @RPMVENDORDIR@/filter.sh '%{?_requires_exceptions:%{_requires_exceptions}}%{!?_requires_exceptions: }' '%{?_exclude_files_from_autoreq:%{_exclude_files_from_autoreq}}%{!?_exclude_files_from_autoreq: }' '%{buildroot}' @RPMVENDORDIR@/find-requires %{?buildroot:%{buildroot}} %{?_target_cpu:%{_target_cpu}}
90
91 %find_lang @RPMVENDORDIR@/find-lang.pl %{buildroot}
92
93 # stuff below has been deprecated by rpm filetriggers [June 2008]
94 %update_menus %{nil}
95 %clean_menus %{nil}
96 %update_desktop_database %{nil}
97 %clean_desktop_database %{nil}
98 %update_mime_database %{nil}
99 %clean_mime_database %{nil}
100 %update_scrollkeeper %{nil}
101 %clean_scrollkeeper %{nil}
102
103 # Update Menu
104 %_update_menus_bin %{_bindir}/update-menus
105
106 # Update Window Managers session.
107 %_fndsession_bin %{_sbindir}/fndSession
108 %make_session %{nil}
109 %make_dm_session if [ -x %{_fndsession_bin} ]; then %{_fndsession_bin} || true ; fi \
110 %{nil}
111
112 # For rebuilding gcj-db
113 %_rebuildgcjdb_bin %{_bindir}/rebuild-gcj-db
114 %update_gcjdb if [ -x %{_rebuildgcjdb_bin} ]; then %{_rebuildgcjdb_bin} || true ; fi \
115 %{nil}
116
117 %clean_gcjdb if [ -x %{_rebuildgcjdb_bin} ]; then %{_rebuildgcjdb_bin} || true ; fi \
118 %{nil}
119
120 # Rebuild icon cache
121 #
122 # following themes are handled through filetriggers:
123 %icon_cache_through_filetrigger_hicolor 1
124 %icon_cache_through_filetrigger_gnome 1
125 %icon_cache_through_filetrigger_oxygen 1
126
127 %update_icon_cache() %{expand: %%{!?icon_cache_through_filetrigger_%1:if [ -x %%{_update_icon_cache_bin} ]; then \
128 %%{_update_icon_cache_bin} --force --quiet %%{_iconsdir}/%%{1} || true; fi \
129 %%{nil}}}
130
131 %clean_icon_cache() %{expand: %%{!?icon_cache_through_filetrigger_%1:if [ -x %%{_update_icon_cache_bin} -a -r %%{_iconsdir}/%%{1}/index.theme ]; then \
132 %%{_update_icon_cache_bin} --force --quiet %%{_iconsdir}/%%{1} || true ; fi \
133 %%{nil}}}
134
135 # GConf schemas:
136 # installation is handled by filetriggers
137 %post_install_gconf_schemas() %{nil}
138 # but uninstall still need to be done in %preun:
139 %preun_uninstall_gconf_schemas() if [ "$1" = "0" -a -x %{_gconftool_bin} ]; then \
140 SCHEMAS="" \
141 for SCHEMA in %{*} ; do \
142 SCHEMAS="$SCHEMAS %{_sysconfdir}/gconf/schemas/$SCHEMA.schemas" \
143 done \
144 GCONF_CONFIG_SOURCE=`%{_gconftool_bin} --get-default-source` %{_gconftool_bin} --makefile-uninstall-rule $SCHEMAS > /dev/null || true ; fi \
145 %{nil}
146
147 # Mageia Linux version
148 # - "9.1" => 910
149 # - "10.2.2" => 1022
150 # (user may copy the following line in specfile)
151 %mgaversion %distro_release
152
153 %distsuffix @DISTSUFFIX@
154
155 %__distro_section %{?distro_section:%distro_section}%{?!distro_section:core}
156 %mkrel(c:) %{-c: 0.%{-c*}.}%{1}%{?subrel:.%subrel}%{?distsuffix:%distsuffix}%{?!distsuffix:.mga}%{?distro_release:%distro_release}%([ "%{__distro_section}" != "core" ] && echo .%__distro_section)
157
158 # Include minimal debug information in build binaries.
159 # Requires _enable_debug_packages.
160 #
161 %_include_minidebuginfo 1
162
163 #------------------------------------------------------------------------------
164 # definions merged from manbo-setup-build
165 #
166 %_enable_debug_packages 1
167
168 # Default extension to use (for info files)
169 %_extension .xz
170
171 %__install_info /sbin/install-info
172
173 %_install_info() if [[ -f %{_infodir}/%{1}%{_extension} ]]; then %{__install_info} %{_infodir}/%{1}%{_extension} --dir=%{_infodir}/dir; fi \
174 %{nil}
175 # (nb: keep the "alone on its line ';'")
176 %_remove_install_info() if [ "$1" = "0" ]; then if [[ -f %{_infodir}/%{1}%{_extension} ]]; then %{__install_info} %{_infodir}/%{1}%{_extension} --dir=%{_infodir}/dir --remove ; fi; fi \
177 %{nil}
178
179
180 # Macro: %{mklibname <name> [<major> [<minor>]] [-s] [-d]}
181 # - %{mklibname test} => lib64test, on a lib64 platform
182 # - %{mklibname test 1 -d} => libtest1-devel
183 # - %{mklibname test 1 -d 0 -s} => libtest1_0-static-devel
184 %mklibname(ds) %{_lib}%{1}%{?2:%{2}}%{?3:_%{3}}%{-s:-static}%{-d:-devel}
185
186 # Dynamic EVRD tags macro for use with versioned provides/requires in place of
187 # '%{version}-%{release}', ie. to automatically add distepoch or epoch if present
188 %EVRD %{?epoch:%{epoch}:}%{?version:%{version}}%{?release:-%{release}}%{?distepoch::%{distepoch}}
189
190 %debugcflags %{?_enable_debug_packages:-g}
191
192 # common compilation flags
193
194 %_fortify_cflags -Wp,-D_FORTIFY_SOURCE=2
195
196 # cf http://wiki.mandriva.com/en/Development/Packaging/Problems#format_not_a_string_literal_and_no_format_arguments
197 %Werror_cflags -Wformat -Werror=format-security
198
199 %_ssp_cflags -fstack-protector --param=ssp-buffer-size=4%{?_serverbuild_flags: %_serverbuild_flags}
200 %__common_cflags -O2 %{debugcflags} -pipe %{Werror_cflags} %{?_fortify_cflags}
201 %__common_cflags_with_ssp %{__common_cflags} %{?_ssp_cflags}
202
203 # Servers opt flags.
204 # Also set the env variables for backward compatibility (mdv #32050).
205 %serverbuild %define _serverbuild_flags -fstack-protector-all \
206 export CFLAGS="%optflags"; export CXXFLAGS="%optflags"; export RPM_OPT_FLAGS="%optflags" \
207 %{nil}
208
209
210 %_smp_mflags %([ -z "$RPM_BUILD_NCPUS" ] \\\
211 && RPM_BUILD_NCPUS="`/usr/bin/getconf _NPROCESSORS_ONLN`"; \\\
212 [ "$RPM_BUILD_NCPUS" -gt 1 ] && echo "-j$RPM_BUILD_NCPUS")
213
214 %_make_bin make
215 %make %{_make_bin} %_smp_mflags
216
217 %makeinstall_std make DESTDIR=%{?buildroot:%{buildroot}} install
218
219 %__fix_libtool_ltmain_from_overlinking @RPMVENDORDIR@/fix-libtool-ltmain-from-overlinking
220 %__fix_libtool_from_moving_options_after_libs @RPMVENDORDIR@/fix-libtool-from-moving-options-after-libs
221 %__fix_dlsearch_path_in_libtool_for_multilib @RPMVENDORDIR@/fix-dlsearch-path-in-libtool-for-multilib
222
223 %__cputoolize cputoolize
224
225 %__libtoolize_configure %{?__libtoolize:(cd $CONFIGURE_TOP; [ ! -f configure.in -a ! -f configure.ac ] || %{__libtoolize} --copy --force)}
226
227 %ldflags %{?!_disable_ld_as_needed: -Wl,--as-needed}%{?!_disable_ld_no_undefined: -Wl,--no-undefined}%{?!_disable_ld_relro: -Wl,-z,relro}%{?!_disable_ld_O1: -Wl,-O1}%{?!_disable_ld_build_id: -Wl,--build-id}%{?!_disable_ld_enable_new_dtags: -Wl,--enable-new-dtags}
228
229 %setup_compile_flags \
230 CFLAGS="${CFLAGS:-%optflags}" ; export CFLAGS ; \
231 CXXFLAGS="${CXXFLAGS:-%optflags}" ; export CXXFLAGS ; \
232 FFLAGS="${FFLAGS:-%optflags}" ; export FFLAGS ; \
233 %(if [ -n '%ldflags' ]; then echo 'LDFLAGS="$LDFLAGS%ldflags"; export LDFLAGS ;'; fi)
234
235 %before_configure \
236 %setup_compile_flags \
237 CONFIGURE_TOP="${CONFIGURE_TOP:-.}"; \
238 %{?!_disable_ld_as_needed:@RPMVENDORDIR@/force-as-needed-for-shared-lib-in-libtool ;} \
239 %{?!_disable_ld_no_undefined:@RPMVENDORDIR@/drop-ld-no-undefined-for-shared-lib-modules-in-libtool ;} \
240 %{__fix_libtool_ltmain_from_overlinking} ; \
241 %{__fix_libtool_from_moving_options_after_libs} $CONFIGURE_TOP ; \
242 %{__fix_dlsearch_path_in_libtool_for_multilib} $CONFIGURE_TOP %{_lib}
243
244 # This is an improved version of %configure (from PLD team).
245 %configure \
246 %before_configure ; \
247 %{?!_disable_libtoolize:%{?__libtoolize_configure:%{__libtoolize_configure};}} \
248 [ -f $CONFIGURE_TOP/configure.in -o -f $CONFIGURE_TOP/configure.ac ] && \
249 CONFIGURE_XPATH="--x-includes=%{_prefix}/include --x-libraries=%{_prefix}/%{_lib}" \
250 $CONFIGURE_TOP/configure %{_target_platform} \\\
251 --program-prefix=%{?_program_prefix} \\\
252 --prefix=%{_prefix} \\\
253 --exec-prefix=%{_exec_prefix} \\\
254 --bindir=%{_bindir} \\\
255 --sbindir=%{_sbindir} \\\
256 --sysconfdir=%{_sysconfdir} \\\
257 --datadir=%{_datadir} \\\
258 --includedir=%{_includedir} \\\
259 --libdir=%{_libdir} \\\
260 --libexecdir=%{_libexecdir} \\\
261 --localstatedir=%{_localstatedir} \\\
262 --sharedstatedir=%{_sharedstatedir} \\\
263 --mandir=%{_mandir} \\\
264 --infodir=%{_infodir} \\\
265 $CONFIGURE_XPATH
266
267 %configure2_5x \
268 %before_configure ; \
269 %{?_enable_libtoolize:%{?__libtoolize_configure:%{__libtoolize_configure};}} \
270 [ -f $CONFIGURE_TOP/configure.in -o -f $CONFIGURE_TOP/configure.ac ] && \
271 CONFIGURE_XPATH="--x-includes=%{_prefix}/include --x-libraries=%{_prefix}/%{_lib}" \
272 $CONFIGURE_TOP/configure --build=%{_target_platform} \\\
273 --prefix=%{_prefix} \\\
274 --exec-prefix=%{_exec_prefix} \\\
275 --bindir=%{_bindir} \\\
276 --sbindir=%{_sbindir} \\\
277 --sysconfdir=%{_sysconfdir} \\\
278 --datadir=%{_datadir} \\\
279 --includedir=%{_includedir} \\\
280 --libdir=%{_libdir} \\\
281 --libexecdir=%{_libexecdir} \\\
282 --localstatedir=%{_localstatedir} \\\
283 --sharedstatedir=%{_sharedstatedir} \\\
284 --mandir=%{_mandir} \\\
285 --infodir=%{_infodir} \\\
286 $CONFIGURE_XPATH
287
288 #---------------------------------------------------------------------
289 # Expanded at beginning of %install scriptlet.
290 #
291
292 %__spec_install_pre %{___build_pre}\
293 [ "$RPM_BUILD_ROOT" != "/" ] && rm -rf "${RPM_BUILD_ROOT}"\
294 mkdir -p `dirname "$RPM_BUILD_ROOT"`\
295 mkdir "$RPM_BUILD_ROOT"\
296 %{nil}
297
298 #==============================================================================
299 # ---- Build policy macros.
300 #
301 #---------------------------------------------------------------------
302 # Expanded at end of %install scriptlet.
303 #
304
305 %__os_install_post \
306 %{?__spec_helper_post}%{?!__spec_helper_post:/usr/share/spec-helper/spec-helper} \
307 %{!?__jar_repack:/usr/lib/rpm/mageia/brp-java-repack-jars} \
308 %{nil}
309
310 %__debug_install_post \
311 @RPMLIBDIR@/find-debuginfo.sh %{?_find_debuginfo_dwz_opts} %{?_include_minidebuginfo:-m} "%{_builddir}/%{?buildsubdir}"\
312 %{nil}
313
314
315 #==============================================================================
316 # ---- specfile macros.
317 # Macro(s) here can be used reliably for reproducible builds.
318 # (Note: Above is the goal, below are the macros under development)
319 #
320
321 %old_makeinstall \
322 make \\\
323 prefix=%{?buildroot:%{buildroot}}%{_prefix} \\\
324 exec_prefix=%{?buildroot:%{buildroot}}%{_exec_prefix} \\\
325 bindir=%{?buildroot:%{buildroot}}%{_bindir} \\\
326 sbindir=%{?buildroot:%{buildroot}}%{_sbindir} \\\
327 sysconfdir=%{?buildroot:%{buildroot}}%{_sysconfdir} \\\
328 datadir=%{?buildroot:%{buildroot}}%{_datadir} \\\
329 includedir=%{?buildroot:%{buildroot}}%{_includedir} \\\
330 libdir=%{?buildroot:%{buildroot}}%{_libdir} \\\
331 libexecdir=%{?buildroot:%{buildroot}}%{_libexecdir} \\\
332 localstatedir=%{?buildroot:%{buildroot}}%{_localstatedir} \\\
333 sharedstatedir=%{?buildroot:%{buildroot}}%{_sharedstatedir} \\\
334 mandir=%{?buildroot:%{buildroot}}%{_mandir} \\\
335 infodir=%{?buildroot:%{buildroot}}%{_infodir} \\\
336 install
337
338
339 #------------------------------------------------------------------------------
340 # Useful python macros
341 %pyver %(python -V 2>&1 | cut -f2 -d" " | cut -f1,2 -d".")
342
343 #------------------------------------------------------------------------------
344 # Useful perl macros
345 # (initially from Artur Frysiak <wiget@t17.ds.pwr.wroc.pl>)
346 # (modified by Pixel <pixel@mandriva.com>)
347 #
348 # [...]
349 # Group: Development/Perl
350 # [...]
351 # %build
352 # perl Makefile.PL INSTALLDIRS=vendor
353 # %make
354 # [...]
355 # %install
356 # rm -rf $RPM_BUILD_ROOT
357 # make install PREFIX="$RPM_BUILD_ROOT/%{prefix}"
358 # [...]
359 # %files
360 # %defattr(644,root,root,755)
361 # %{perl_vendorlib}/CGI
362 # or
363 # %{perl_vendorarch}/DBI
364 # %{perl_vendorarch}/auto/DBI
365 # %{_mandir}/*/*
366 #
367
368
369 %perl_convert_version() %(perl -Mversion -le '
370 $x = "%{1}";
371 $y = $x;
372 $x =~ s/[[:alpha:]]*$//;
373 $y =~ s/^$x//;
374 $x =~ s/\D*$//;
375 $v = version->new($x)->normal;
376 $v =~ s/^v//;
377 print "$v$y";
378 ')
379
380 # kept for compatibility, but should not be used, especially the ugly perl_archlib!
381 %perl_sitearch %(eval "`perl -V:installsitearch`"; echo $installsitearch)
382 %perl_archlib %(eval "`perl -V:installarchlib`"; echo $installarchlib)
383
384 #--------------------------------------------------------------------------------
385 # Macro from conectiva
386
387 %rename() \
388 Obsoletes: %{1} <= %{?epoch:%epoch}%{?!epoch:0}:%{version}-%{release} \
389 Provides: %{1} = %{?epoch:%epoch}%{?!epoch:0}:%{version}-%{release}
390
391 # Shorthand for %{defined with_...}
392 # macros provided by rpm 4.4, but buggy :(
393 %_with() %{expand: %%{?_with_%1:1} %%{!?_with_%1: %%{?_without_%1:0} %%{!?_without_%1: %%{?with_%1:%%{with_%1}} %%{!?with_%1: %%{?without_%1:!%%{without_%1}} %%{!?without_%1: %%{?2:%%2} %%{!?2:1} } } } } }
394 %_without() !%{expand: %%{with %1 %{?2:%2}}}
395
396 %_package_i18n(g:f:) \
397 %%package -n %{?1:%{1}}%{?!1:%{name}}-i18n\
398 Summary: Internationalization and locale data for %{?1:%{1}}%{?!1:%{name}}\
399 License: %{license}\
400 Group: %{?-g:%{-g*}}%{?!-g:%{group}}\
401 \
402 %%description -n %{?1:%{1}}%{?!1:%{name}}-i18n\
403 Internationalization and locale data for %{?1:%{1}}%{?!1:%{name}}\
404 \
405 %%files -n %{?1:%{1}}%{?!1:%{name}}-i18n %{?-f:%{-f}}%{?!-f:-f %{?1:%{1}}%{?!1:%{name}}.lang}\
406 %{nil}
407
408
409 #------------------------------------------------------------------------------
410 # Python specific macros
411
412 # (from rpm 4.4.6)
413 %python_sitearch %(%{__python} -c "from distutils.sysconfig import get_python_lib; print get_python_lib(1)")
414 %python_sitelib %(%{__python} -c "from distutils.sysconfig import get_python_lib; print get_python_lib()")
415 %python_version %(%{__python} -c "import sys; print(sys.version[0:3])")
416
417 # More Python specific macro definitions (originally from PLD).
418 #
419 %py_ver %(python -c "import sys; v=sys.version_info[:2]; print '%%d.%%d'%%v" 2>/dev/null || echo PYTHON-NOT-FOUND)
420 %py_prefix %(python -c "import sys; print sys.prefix" 2>/dev/null || echo PYTHON-NOT-FOUND)
421 # backward compatibility
422 %py_libdir %py_purelibdir
423 %py_platlibdir %(python -c 'import distutils.sysconfig; print distutils.sysconfig.get_python_lib(standard_lib=1,plat_specific=1)' 2>/dev/null || echo PYTHON-LIBDIR-NOT-FOUND)
424 %py_purelibdir %(python -c 'import distutils.sysconfig; print distutils.sysconfig.get_python_lib(standard_lib=1,plat_specific=0)' 2>/dev/null || echo PYTHON-LIBDIR-NOT-FOUND)
425 %py_incdir %(python -c 'import distutils.sysconfig; print distutils.sysconfig.get_python_inc()' 2>/dev/null || echo PYTHON-INCLUDEDIR-NOT-FOUND)
426 %py_sitedir %py_puresitedir
427 %py_platsitedir %(python -c 'import distutils.sysconfig; print distutils.sysconfig.get_python_lib(plat_specific=1)' 2>/dev/null || echo PYTHON-LIBDIR-NOT-FOUND)
428 %py_puresitedir %(python -c 'import distutils.sysconfig; print distutils.sysconfig.get_python_lib()' 2>/dev/null || echo PYTHON-LIBDIR-NOT-FOUND)
429
430 %py_compile(O) \
431 find %1 -name '*.pyc' -exec rm -f {} \\; \
432 python -c "import sys, os, compileall; br='%{buildroot}'; compileall.compile_dir(sys.argv[1], ddir=br and (sys.argv[1][len(os.path.abspath(br)):]+'/') or None)" %1 \
433 %{-O: \
434 find %1 -name '*.pyo' -exec rm -f {} \\; \
435 python -O -c "import sys, os, compileall; br='%{buildroot}'; compileall.compile_dir(sys.argv[1], ddir=br and (sys.argv[1][len(os.path.abspath(br)):]+'/') or None)" %1 \
436 }
437 %py_requires(d) \
438 BuildRequires: python %{-d:python-devel}
439
440 #------------------------------------------------------------------------------
441 # Java Macros
442 #
443
444 %gcj_support 0
445 %gcj_native \
446 %if %{gcj_support} \
447 BuildRequires: java-gcj-compat-devel \
448 %else \
449 BuildArch: noarch \
450 %endif
451
452 %aot_compile_rpm_bin %{_bindir}/aot-compile-rpm
453
454 %gcj_compile \
455 %if %{gcj_support} \
456 %aot_compile_rpm_bin \
457 %endif
458
459 %gcj_files \
460 %if %{gcj_support} \
461 %dir %{_libdir}/gcj/%{name} \
462 %attr(-,root,root) %{_libdir}/gcj/%{name}/* \
463 %endif
464
465 %remove_java_binaries \
466 find . -name "*.jar" -delete
467
468 %create_jar_links() \
469 pushd %{buildroot}%{_javadir}; \
470 for jar in *-%{version}.jar; do ln -sf ${jar} ${jar/-%{version}/}; done \
471 popd
472
473 #------------------------------------------------------------------------------
474 # Ocaml macro
475 #
476
477 %ocaml_sitelib %(if [ -x /usr/bin/ocamlc ]; then ocamlc -where;fi)/site-lib
478
479 #------------------------------------------------------------------------------
480 # Ruby gem macros
481 #
482
483 %__gem_helper @RPMVENDORDIR@/gem_helper.rb
484
485 %gem_build(f:j:) \
486 export LC_CTYPE=UTF-8 \
487 %__gem_helper build \\\
488 %{-f:-f%{-f*}} \\\
489 %{!-j:%{_smp_mflags}}%{-j:-j%{-j*}}
490
491 %gem_install(i:n:C) \
492 export LC_CTYPE=UTF-8 \
493 DESTDIR=${DESTDIR:-%{buildroot}} \\\
494 %__gem_helper install \\\
495 --env-shebang --rdoc --ri --force --ignore-dependencies \\\
496 %{!-i:--install-dir %{buildroot}%{ruby_gemdir}}%{-i:--install-dir %{-i*}} \\\
497 %{!-n:--bindir %{buildroot}%{_bindir}}%{-n:--bindir%{-n*}} \\\
498 %{!-C:--fix-permissions}
499
500 #------------------------------------------------------------------------------
501 # Systemd macros
502 #
503
504 %_unitdir /usr/lib/systemd/system
505 %_udevrulesdir /usr/lib/udev/rules.d
506 %_tmpfilesdir /usr/lib/tmpfiles.d
507 %_tmpfilescreate() /usr/bin/systemd-tmpfiles --create %{1}.conf \
508 %{nil}
509
510 #------------------------------------------------------------------------------
511 # Redefine RPM sections to allow jumping over them using "--without <section>".
512 # This an interesting alternative to --short-circuit.
513 # The following are mostly equivalent:
514 # % rpmbuild -bi --short-circuit foo.spec && rpmbuild -bb --short-circuit foo.spec
515 # % rpmbuild -bb --without build foo.spec
516
517 %prep %%prep \
518 [ %{_with prep} -eq 1 ] || exit 0 \
519 [ %{_with build} -eq 1 ] || exit 0 \
520 [ %{_with install} -eq 1 ] || exit 0 \
521 %{nil}
522
523 %build %%build \
524 [ %{_with install} -eq 1 ] || exit 0 \
525 [ %{_with build} -eq 1 ] || exit 0 \
526 %{nil}
527
528 %install %{?_enable_debug_packages:%{?buildsubdir:%{debug_package_and_restore}}}\
529 %%install\
530 [ %{_with install} -eq 1 ] || exit 0 \
531 %{nil}
532
533 %check %%check \
534 [ %{_with check} -eq 1 ] || exit 0 \
535 %{nil}
536
537 # use internal dep generator?
538 # we can't use it for now as it breaks external dep generator
539 #%_use_internal_dependency_generator 1

  ViewVC Help
Powered by ViewVC 1.1.26