Note: This web site is only kept up to date for OSG Software 1.2 (VDT 2.0.0). If you are looking for information for the most recent release, the RPM-based OSG Software 3.0, please see the OSG documentation web site

Native Packaging - Table of Macros for Spec Files

VDT-Specific Macros (implemented for the nmi autogenerated builds)

NameExpansion
%_vdt_prefix /opt/vdt
%_vdt_location %{_vdt_prefix}
%_buildroot_vdt %{buildroot}%{_vdt_prefix}
%_vdt_bindir %{_vdt_prefix}/bin
%_vdt_datadir %{_vdt_prefix}/share
%_vdt_includedir %{_vdt_prefix}/include
%_vdt_confdir %{_vdt_prefix}/etc
%_vdt_libdir %{_vdt_prefix}/%{_lib}
%_vdt_mandir %{_vdt_prefix}/man
%_vdt_sbindir %{_vdt_prefix}/sbin
%_vdt_localstatedir %{_vdt_prefix}/var
%_vdt_internaldir %{_vdt_prefix}/vdt

RPM predefined macros (Centos 5.5 AMD64)

Name Expansion
%_prefix /usr
%_exec_prefix %_prefix
%_bindir %{_exec_prefix}/bin
%_datadir %{_prefix}/share
%_includedir %{_prefix}/include
%_sysconfdir /etc
%_initrddir %{_sysconfdir}/rc.d/init.d
%_lib lib64
%_libdir %{_exec_prefix}/%{_lib}
%_libexecdir %{_exec_prefix}/libexec
%_localstatedir /var
%_mandir /usr/share/man
%_sbindir %{_exec_prefix}/sbin
%_usr /usr
%_usrsrc %{_usr}/src
%_var /var

Note that RPM also has macros for command line utilities. However, I haven't seen much actual, consistent usage of them in actual spec files, with the exception of %configure. For sake of reference, though, here are examples:

Name Expansion
%__mkdir /bin/mkdir
%__python /usr/bin/python
%__chown_Rhf %{__chown} -Rhf
%__cxx g++
%__global_cflags -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4
%__awk gawk

The %configure macro is more frequently used, since it passes several useful flags to the configure script. Here is its expansion:

  CFLAGS="${CFLAGS:-%optflags}" ; export CFLAGS ; 
  CXXFLAGS="${CXXFLAGS:-%optflags}" ; export CXXFLAGS ; 
  FFLAGS="${FFLAGS:-%optflags}" ; export FFLAGS ; 
  for i in $(find . -name config.guess -o -name config.sub) ; do 
           [ -f /usr/lib/rpm/redhat/$(basename $i) ] &&               %{__rm} -f $i && %{__cp} -fv /usr/lib/rpm/redhat/$(basename $i) $i ; 
  done ; 
  ./configure --build=%{_build} --host=%{_host}         --target=%{_target_platform}         --program-prefix=%{?_program_prefix}         --prefix=%{_prefix}         --exec-prefix=%{_exec_prefix}         --bindir=%{_bindir}         --sbindir=%{_sbindir}         --sysconfdir=%{_sysconfdir}         --datadir=%{_datadir}         --includedir=%{_includedir}         --libdir=%{_libdir}         --libexecdir=%{_libexecdir}         --localstatedir=%{_localstatedir}         --sharedstatedir=%{_sharedstatedir}         --mandir=%{_mandir}         --infodir=%{_infodir}

Last updated by matyas — 2011-09-09