aboutsummaryrefslogtreecommitdiffstats
path: root/iurt_root_command
Commit message (Expand)AuthorAgeFilesLines
* add a new wrapper to run command which needs privilegesFlorent Villard2006-08-281-0/+71
15'>15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546

%__gzip			/usr/bin/gzip

%_sys_macros_dir @RPMSYSCONFDIR@/macros.d
%build_sysmacrospath() %{_sys_macros_dir}/%{?1:%{1}}%{?!1:%{name}}.macros

# [Pixel, Dec 2008] deprecated, to remove as soon as rpm 4.6.0 dust settles down
%defaultbuildroot  %{_tmppath}/%{name}-%{version}-%{release}-buildroot


# when %_with_git_repository is set, these macros modify the behaviour of "%prep" step:
%_after_setup %{?_with_git_repository:GIT_URL="%{?git_url}" GIT_REPOSITORY_CACHE=%{?git_repository_cache} @RPMVENDORDIR@/git-repository--after-tarball}
%_patch %{?_with_git_repository:PKG_NAME=%{name} @RPMVENDORDIR@/git-repository--apply-patch}%{?!_with_git_repository:%__patch -U}

# used by "git-repository--after-tarball":
%git_repository_cache %_topdir/%{name}.git


# Various programs used in rpm scripts
%_update_desktop_database_bin %{_bindir}/update-desktop-database
%_update_mime_database_bin %{_bindir}/update-mime-database
%_update_icon_cache_bin %{_bindir}/gtk-update-icon-cache
%_gconftool_bin %{_bindir}/gconftool-2
%_scrollkeeper_bin %{_bindir}/scrollkeeper-update

%__service          /sbin/service
%__chkconfig        /sbin/chkconfig

#==============================================================================
# ---- Required rpmrc macros.
#	Macros that used to be initialized as a side effect of rpmrc parsing.
#	These are the default values that can be overridden by other
#	(e.g. per-platform, per-system, per-packager, per-package) macros.
#

%debug_package_and_restore %{debug_package} \
%package __restore__\
Summary: %{summary}\
Group: %{group}\
%description __restore__

%ix86 i386 i486 i586 i686 pentium3 pentium4 athlon k6

%sparc sun4 sun4m sun4c sun4d sun4u sparcv9b sparcv9v2 %{sparcx}
%sparcx sparc sparcv8 sparcv9 sparcv9v sparc64 sparc64v

#	Multilibs
%_multilibpatt		(/%{_lib}|/usr/%{_lib}(|/gconv)|/usr/local/%{_lib}|/usr/X11R6/%{_lib}|/opt/%{_lib})/[^/]*\\.([oa]|la|so[0-9.]*)$

%_arch_tag_suffix %([ "%{?_lib}" = "lib64" ] && echo "()(64bit)")
%arch_tagged() %{1}%{_arch_tag_suffix} %{?2:%{2} %{3}%{?!3:%{error:undefined 3rd argument in arch_tagged}}}

# Games macros
%_gamesdir	games
%_gamesbindir   %{_prefix}/%{_gamesdir}
%_gamesdatadir  %{_datadir}/%{_gamesdir}

# Menu directories
%_menudir %{_prefix}/lib/menu
%_iconsdir %{_datadir}/icons
%_miconsdir %{_datadir}/icons/mini
%_liconsdir %{_datadir}/icons/large

%_xfontdir %_datadir/fonts

%_webconfdir %{_sysconfdir}/httpd/conf
%_webappconfdir %_webconfdir/sites.d
# compatibility
%webappconfdir %_webappconfdir

#==============================================================================
# ---- Build configuration macros.
#
# Package version macro.
#	The type of package to produce, for compatibility with legacy
#	versions of rpm.
#
# Script gets packaged file list on input.
# Returns list of multiarch files that are not marked as such,
# i.e. files in $RPM_BUILD_ROOT that have arch-dependent values
#
# Note: Disable (by commenting out) for legacy compatibility.
#%__check_multiarch_files @RPMLIBDIR@/check-multiarch-files %{buildroot}

# Use internal dependency generator rather than external helpers?
%_use_internal_dependency_generator	0

%__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
%__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}}

%find_lang  @RPMVENDORDIR@/find-lang.pl %{buildroot}

# stuff below has been deprecated by rpm filetriggers [June 2008]
%update_menus %{nil}
%clean_menus %{nil}
%update_desktop_database %{nil}
%clean_desktop_database %{nil}
%update_mime_database %{nil}
%clean_mime_database %{nil}
%update_scrollkeeper %{nil}
%clean_scrollkeeper %{nil}

# Update Menu
%_update_menus_bin %{_bindir}/update-menus

# Update Window Managers session.
%_fndsession_bin %{_sbindir}/fndSession
%make_session %{nil}
%make_dm_session if [ -x %{_fndsession_bin} ]; then %{_fndsession_bin} || true ; fi \
%{nil}

# For rebuilding gcj-db
%_rebuildgcjdb_bin %{_bindir}/rebuild-gcj-db
%update_gcjdb if [ -x %{_rebuildgcjdb_bin} ]; then %{_rebuildgcjdb_bin} || true ; fi \
%{nil}

%clean_gcjdb if [ -x %{_rebuildgcjdb_bin} ]; then %{_rebuildgcjdb_bin} || true ; fi \
%{nil}

# Rebuild icon cache
#
# following themes are handled through filetriggers:
%icon_cache_through_filetrigger_hicolor 1
%icon_cache_through_filetrigger_gnome 1
%icon_cache_through_filetrigger_oxygen 1

%update_icon_cache() %{expand: %%{!?icon_cache_through_filetrigger_%1:if [ -x %%{_update_icon_cache_bin} ]; then \
%%{_update_icon_cache_bin} --force --quiet %%{_iconsdir}/%%{1} || true; fi \
%%{nil}}}

%clean_icon_cache() %{expand: %%{!?icon_cache_through_filetrigger_%1:if [ -x %%{_update_icon_cache_bin} -a -r %%{_iconsdir}/%%{1}/index.theme ]; then \
%%{_update_icon_cache_bin} --force --quiet %%{_iconsdir}/%%{1} || true ; fi \
%%{nil}}}

# GConf schemas:
# installation is handled by filetriggers
%post_install_gconf_schemas() %{nil}
# but uninstall still need to be done in %preun:
%preun_uninstall_gconf_schemas() if [ "$1" = "0" -a -x %{_gconftool_bin} ]; then \
SCHEMAS="" \
for SCHEMA in %{*} ; do \
  SCHEMAS="$SCHEMAS %{_sysconfdir}/gconf/schemas/$SCHEMA.schemas" \
done \
GCONF_CONFIG_SOURCE=`%{_gconftool_bin} --get-default-source` %{_gconftool_bin} --makefile-uninstall-rule  $SCHEMAS > /dev/null || true ; fi \
%{nil}

# Mageia Linux version
# - "9.1"    =>  910
# - "10.2.2" => 1022
# (user may copy the following line in specfile)
%mgaversion		%distro_release

%distsuffix @DISTSUFFIX@

%__distro_section %{?distro_section:%distro_section}%{?!distro_section:core}
%mkrel(c:) %{-c: 0.%{-c*}.}%{1}%{?subrel:.%subrel}%{?distsuffix:%distsuffix}%{?!distsuffix:.mga}%{?distro_release:%distro_release}%([ "%{__distro_section}" != "core" ] && echo .%__distro_section)

# Include minimal debug information in build binaries.
# Requires _enable_debug_packages.
#
%_include_minidebuginfo       1

#------------------------------------------------------------------------------
# definions merged from manbo-setup-build
#
%_enable_debug_packages 1

# Default extension to use (for info files)
%_extension .xz

%__install_info /sbin/install-info

%_install_info() if [[ -f %{_infodir}/%{1}%{_extension} ]]; then %{__install_info} %{_infodir}/%{1}%{_extension} --dir=%{_infodir}/dir; fi \
%{nil}
# (nb: keep the "alone on its line ';'")
%_remove_install_info() if [ "$1" = "0" ]; then if [[ -f %{_infodir}/%{1}%{_extension} ]]; then %{__install_info} %{_infodir}/%{1}%{_extension} --dir=%{_infodir}/dir --remove ; fi; fi \
%{nil}


# Macro: %{mklibname <name> [<major> [<minor>]] [-s] [-d]}
# - %{mklibname test}               => lib64test, on a lib64 platform
# - %{mklibname test 1 -d}      => libtest1-devel
# - %{mklibname test 1 -d 0 -s} => libtest1_0-static-devel
%mklibname(ds)  %{_lib}%{1}%{?2:%{2}}%{?3:_%{3}}%{-s:-static}%{-d:-devel}

# Dynamic EVRD tags macro for use with versioned provides/requires in place of
# '%{version}-%{release}', ie. to automatically add distepoch or epoch if present
%EVRD		%{?epoch:%{epoch}:}%{?version:%{version}}%{?release:-%{release}}%{?distepoch::%{distepoch}}

%debugcflags %{?_enable_debug_packages:-g}

# common compilation flags

%_fortify_cflags -Wp,-D_FORTIFY_SOURCE=2

# cf http://wiki.mandriva.com/en/Development/Packaging/Problems#format_not_a_string_literal_and_no_format_arguments
%Werror_cflags -Wformat -Werror=format-security

%_ssp_cflags -fstack-protector --param=ssp-buffer-size=4%{?_serverbuild_flags: %_serverbuild_flags}
%__common_cflags -O2 %{debugcflags} -pipe %{Werror_cflags} %{?_fortify_cflags}
%__common_cflags_with_ssp %{__common_cflags} %{?_ssp_cflags}

# Servers opt flags.
# Also set the env variables for backward compatibility (mdv #32050).
%serverbuild %define _serverbuild_flags -fstack-protector-all \
export CFLAGS="%optflags"; export CXXFLAGS="%optflags"; export RPM_OPT_FLAGS="%optflags" \
%{nil}


%_smp_mflags %([ -z "$RPM_BUILD_NCPUS" ] \\\
	&& RPM_BUILD_NCPUS="`/usr/bin/getconf _NPROCESSORS_ONLN`"; \\\
	[ "$RPM_BUILD_NCPUS" -gt 1 ] && echo "-j$RPM_BUILD_NCPUS")

%_make_bin make
%make %{_make_bin} %_smp_mflags

%makeinstall_std make DESTDIR=%{?buildroot:%{buildroot}} install

%__fix_libtool_ltmain_from_overlinking @RPMVENDORDIR@/fix-libtool-ltmain-from-overlinking
%__fix_libtool_from_moving_options_after_libs @RPMVENDORDIR@/fix-libtool-from-moving-options-after-libs
%__fix_dlsearch_path_in_libtool_for_multilib @RPMVENDORDIR@/fix-dlsearch-path-in-libtool-for-multilib

%__cputoolize cputoolize

%__libtoolize_configure %{?__libtoolize:(cd $CONFIGURE_TOP; [ ! -f configure.in -a ! -f configure.ac ] || %{__libtoolize} --copy --force)}

%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}

%setup_compile_flags \
  CFLAGS="${CFLAGS:-%optflags}" ; export CFLAGS ; \
  CXXFLAGS="${CXXFLAGS:-%optflags}" ; export CXXFLAGS ; \
  FFLAGS="${FFLAGS:-%optflags}" ; export FFLAGS ; \
  %(if [ -n '%ldflags' ]; then echo 'LDFLAGS="$LDFLAGS%ldflags"; export LDFLAGS ;'; fi)

%before_configure \
  %setup_compile_flags \
  CONFIGURE_TOP="${CONFIGURE_TOP:-.}"; \
  %{?!_disable_ld_as_needed:@RPMVENDORDIR@/force-as-needed-for-shared-lib-in-libtool ;} \