66c68a
# RPM macros for Fedora MinGW.
66c68a
0c1e1f
%mingw32_pkg_name        %(echo %{name} | sed 's/^mingw-/mingw32-/')
0c1e1f
%mingw32_target          i686-w64-mingw32
1ea30e
66c68a
# Paths.
0c1e1f
%mingw32_sysroot         %{_prefix}/%{mingw32_target}/sys-root
0c1e1f
%mingw32_prefix          %{mingw32_sysroot}/mingw
0c1e1f
%mingw32_exec_prefix     %{mingw32_prefix}
0c1e1f
%mingw32_bindir          %{mingw32_exec_prefix}/bin
0c1e1f
%mingw32_sbindir         %{mingw32_exec_prefix}/sbin
0c1e1f
%mingw32_libexecdir      %{mingw32_exec_prefix}/libexec
0c1e1f
%mingw32_libdir          %{mingw32_exec_prefix}/lib
0c1e1f
%mingw32_datadir         %{mingw32_prefix}/share
0c1e1f
%mingw32_docdir          %{mingw32_prefix}/share/doc
0c1e1f
%mingw32_infodir         %{mingw32_prefix}/share/info
0c1e1f
%mingw32_mandir          %{mingw32_prefix}/share/man
0c1e1f
%mingw32_sysconfdir      %{mingw32_prefix}/etc
0c1e1f
%mingw32_sharedstatedir  %{mingw32_prefix}/com
0c1e1f
%mingw32_localstatedir   %{mingw32_prefix}/var
0c1e1f
%mingw32_includedir      %{mingw32_prefix}/include
66c68a
66c68a
# Build macros.
0c1e1f
%mingw32_host            %{mingw32_target}
d9bad0
0c1e1f
%mingw32_cflags          %{mingw32_cppflags} -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions --param=ssp-buffer-size=4
0c1e1f
%mingw32_cppflags        %{nil}
0c1e1f
%mingw32_ldflags         %{nil}
d9bad0
0c1e1f
%mingw32_cc              %{mingw32_target}-gcc
0c1e1f
%mingw32_cxx             %{mingw32_target}-g++
0c1e1f
%mingw32_cpp             %{mingw32_target}-gcc -E
0c1e1f
%mingw32_addr2line       %{mingw32_target}-addr2line
0c1e1f
%mingw32_ar              %{mingw32_target}-ar
0c1e1f
%mingw32_as              %{mingw32_target}-as
0c1e1f
%mingw32_c++             %{mingw32_target}-c++
0c1e1f
%mingw32_c++filt         %{mingw32_target}-c++filt
0c1e1f
%mingw32_dlltool         %{mingw32_target}-dlltool
0c1e1f
%mingw32_dllwrap         %{mingw32_target}-dllwrap
0c1e1f
%mingw32_gcov            %{mingw32_target}-gcov
0c1e1f
%mingw32_gprof           %{mingw32_target}-gprof
0c1e1f
%mingw32_ld              %{mingw32_target}-ld
0c1e1f
%mingw32_nm              %{mingw32_target}-nm
0c1e1f
%mingw32_objcopy         %{mingw32_target}-objcopy
0c1e1f
%mingw32_objdump         %{mingw32_target}-objdump
0c1e1f
%mingw32_ranlib          %{mingw32_target}-ranlib
0c1e1f
%mingw32_readelf         %{mingw32_target}-readelf
0c1e1f
%mingw32_size            %{mingw32_target}-size
0c1e1f
%mingw32_strings         %{mingw32_target}-strings
0c1e1f
%mingw32_strip           %{mingw32_target}-strip
0c1e1f
%mingw32_windmc          %{mingw32_target}-windmc
0c1e1f
%mingw32_windres         %{mingw32_target}-windres
66c68a
0c1e1f
%mingw32_env unset $(/usr/bin/env | egrep '^(\w+)=(.*)$' | egrep -vw 'PWD|USER|LANG' | /usr/bin/cut -d= -f1); \
0c1e1f
  if test -z "$PATH_ORIG" ; then \
0c1e1f
    PATH_ORIG="$PATH"; export PATH_ORIG; \
0c1e1f
  fi; \
0c1e1f
  PATH="%{mingw32_bindir}:$PATH_ORIG"; export PATH; \
0c1e1f
  HOST_CC=gcc; export HOST_CC; \
0c1e1f
  PKG_CONFIG_LIBDIR="%{mingw32_libdir}/pkgconfig:%{_mingw32_datadir}/pkgconfig"; export PKG_CONFIG_LIBDIR; \
2e732f
  unset PKG_CONFIG_PATH; \
0c1e1f
  _PREFIX="%{_bindir}/%{mingw32_target}-"; \
c0320e
  for i in `ls -1 ${_PREFIX}* | grep -v 'gcc-'`; do \
Kalev Lember 5b66ef
    x=`echo $i|sed "s,${_PREFIX},,"|tr "a-z+-." "A-ZX__"`; \
1ea30e
    declare -x $x="$i" ; export $x; \
1ea30e
  done; \
1ea30e
  unset _PREFIX; \
0c1e1f
  CC="${MINGW32_CC:-%mingw32_cc}"; export CC; \
0c1e1f
  CFLAGS="${MINGW32_CFLAGS:-%mingw32_cflags}"; export CFLAGS; \
0c1e1f
  CPPFLAGS="${MINGW32_CPPFLAGS:-%mingw32_cppflags}"; export CPPFLAGS; \
0c1e1f
  if [ -x "%{_bindir}/%{mingw32_cxx}" ]; then \
0c1e1f
    CXX="${MINGW32_CXX:-%mingw32_cxx}"; export CXX; \
0c1e1f
    CXXFLAGS="${MINGW32_CXXFLAGS:-%mingw32_cflags}"; export CXXFLAGS; \
c0320e
  else \
c0320e
    CXX=; export CXX; \
c0320e
    ac_cv_prog_CXX=no; export ac_cv_prog_CXX; \
c0320e
    CXXFLAGS=; export CXXFLAGS; \
c0320e
  fi; \
0c1e1f
  LDFLAGS="${MINGW32_LDFLAGS:-%mingw32_ldflags}"; export LDFLAGS; \
0c1e1f
  for i in `ls %{mingw32_bindir}/*|grep -- "-config\$"` ; do \
1ea30e
    x=`basename $i|tr "a-z+-" "A-ZX_"`; \
1ea30e
    declare -x $x="$i" ; export $x; \
1ea30e
  done; \
1ea30e
  unset x i
1ea30e
0c1e1f
%mingw32_pkg_config %{mingw32_target}-pkg-config
0c1e1f
0c1e1f
%mingw32_configure %{mingw32_env} ; \
3f88d6
  __mingw32_topdir=.; if ! test -x configure; then __mingw32_topdir=..; fi; \\\
0c1e1f
  $__mingw32_topdir/configure \\\
0c1e1f
	--host=%{mingw32_host} \\\
03e2b3
	--build=%_build \\\
0c1e1f
	--target=%{mingw32_target} \\\
0c1e1f
	--prefix=%{mingw32_prefix} \\\
0c1e1f
	--exec-prefix=%{mingw32_exec_prefix} \\\
0c1e1f
	--bindir=%{mingw32_bindir} \\\
0c1e1f
	--sbindir=%{mingw32_sbindir} \\\
0c1e1f
	--sysconfdir=%{mingw32_sysconfdir} \\\
0c1e1f
	--datadir=%{mingw32_datadir} \\\
0c1e1f
	--includedir=%{mingw32_includedir} \\\
0c1e1f
	--libdir=%{mingw32_libdir} \\\
0c1e1f
	--libexecdir=%{mingw32_libexecdir} \\\
0c1e1f
	--localstatedir=%{mingw32_localstatedir} \\\
0c1e1f
	--sharedstatedir=%{mingw32_sharedstatedir} \\\
0c1e1f
	--mandir=%{mingw32_mandir} \\\
0c1e1f
	--infodir=%{mingw32_infodir} \\\
0c1e1f
	${MINGW_CONFIGURE_ARGS} \\\
0c1e1f
	${MINGW32_CONFIGURE_ARGS}
0c1e1f
0c1e1f
%mingw32_make %{mingw32_env} ; \
2caed6
  make \\\
0c1e1f
	prefix=%{mingw32_prefix} \\\
0c1e1f
	exec_prefix=%{mingw32_exec_prefix} \\\
0c1e1f
	bindir=%{mingw32_bindir} \\\
0c1e1f
	sbindir=%{mingw32_sbindir} \\\
0c1e1f
	sysconfdir=%{mingw32_sysconfdir} \\\
0c1e1f
	datadir=%{mingw32_datadir} \\\
0c1e1f
	includedir=%{mingw32_includedir} \\\
0c1e1f
	libdir=%{mingw32_libdir} \\\
0c1e1f
	libexecdir=%{mingw32_libexecdir} \\\
0c1e1f
	localstatedir=%{mingw32_localstatedir} \\\
0c1e1f
	sharedstatedir=%{mingw32_sharedstatedir} \\\
0c1e1f
	mandir=%{mingw32_mandir} \\\
0c1e1f
	infodir=%{mingw32_infodir}
0c1e1f
0c1e1f
%mingw32_cmake %{mingw32_env} ; \
0c1e1f
  if test -f CMakeLists.txt; then __mingw32_topdir=.; \\\
0c1e1f
  elif test -f ../CMakeLists.txt; then __mingw32_topdir=..; \\\
0c1e1f
  else __mingw32_topdir=""; fi; \\\
0c1e1f
  PATH=%{_prefix}/%{mingw32_target}/bin:$PATH %__cmake \\\
0c1e1f
        -DCMAKE_VERBOSE_MAKEFILE=ON \\\
0c1e1f
        -DCMAKE_INSTALL_PREFIX:PATH=%{mingw32_prefix} \\\
0c1e1f
        -DCMAKE_INSTALL_LIBDIR:PATH=%{mingw32_libdir} \\\
0c1e1f
        -DINCLUDE_INSTALL_DIR:PATH=%{mingw32_includedir} \\\
0c1e1f
        -DLIB_INSTALL_DIR:PATH=%{mingw32_libdir} \\\
0c1e1f
        -DSYSCONF_INSTALL_DIR:PATH=%{mingw32_sysconfdir} \\\
0c1e1f
        -DSHARE_INSTALL_PREFIX:PATH=%{mingw32_datadir} \\\
0c1e1f
        %{?_cmake_skip_rpath} \\\
0c1e1f
        -DBUILD_SHARED_LIBS:BOOL=ON \\\
0c1e1f
        -DCMAKE_TOOLCHAIN_FILE=/usr/share/mingw/Toolchain-mingw32.cmake \\\
0c1e1f
        ${MINGW_CMAKE_ARGS} \\\
0c1e1f
        ${MINGW32_CMAKE_ARGS} \\\
0c1e1f
        $@ $__mingw32_topdir
c52d9a
0c1e1f
%mingw32_cmake_kde4 %{mingw32_env} ; \
0c1e1f
  if test -f CMakeLists.txt; then __mingw32_topdir=.; \\\
0c1e1f
  elif test -f ../CMakeLists.txt; then __mingw32_topdir=..; \\\
0c1e1f
  else __mingw32_topdir=""; fi; \\\
7cf0ed
  %__cmake \\\
7cf0ed
        -DCMAKE_VERBOSE_MAKEFILE=ON \\\
0c1e1f
        -DCMAKE_INSTALL_PREFIX:PATH=%{mingw32_prefix} \\\
0c1e1f
        -DCMAKE_INSTALL_LIBDIR:PATH=%{mingw32_libdir} \\\
0c1e1f
        -DINCLUDE_INSTALL_DIR:PATH=%{mingw32_includedir}/kde4 \\\
0c1e1f
        -DLIB_INSTALL_DIR:PATH=%{mingw32_libdir} \\\
0c1e1f
        -DSYSCONF_INSTALL_DIR:PATH=%{mingw32_sysconfdir} \\\
0c1e1f
        -DSHARE_INSTALL_PREFIX:PATH=%{mingw32_datadir} \\\
7cf0ed
        %{?_cmake_skip_rpath} \\\
7cf0ed
        -DBUILD_SHARED_LIBS:BOOL=ON \\\
0c1e1f
        -DCMAKE_TOOLCHAIN_FILE=/usr/share/mingw/Toolchain-mingw32.cmake \\\
0c1e1f
        ${MINGW_CMAKE_ARGS} \\\
0c1e1f
        ${MINGW32_CMAKE_ARGS} \\\
0c1e1f
        $@ $__mingw32_topdir
7cf0ed
0c1e1f
%mingw32_qmake_qt4 %{mingw32_env} ; \
0c1e1f
  /usr/bin/mingw32-qmake-qt4
7cf0ed
0c1e1f
%mingw32_description This is the cross-compiled version of this library / tool.\
b8b00e
You should only install this package if you want to cross-compile programs for \
b8b00e
Win32 (32 bit Windows).
0c1e1f
0c1e1f
%mingw32_debug_package                                                   \
0c1e1f
%package -n %{mingw32_pkg_name}-debuginfo                                \
0c1e1f
Summary: Debug information for package %{mingw32_pkg_name}               \
0c1e1f
Group: Development/Debug                                                 \
0c1e1f
BuildArch: noarch                                                        \
0c1e1f
%description -n %{mingw32_pkg_name}-debuginfo                            \
0c1e1f
This package provides debug information for package %{mingw32_pkg_name}. \
0c1e1f
Debug information is useful when developing applications that use this   \
0c1e1f
package or when debugging this package.                                  \
0c1e1f
%files -n %{mingw32_pkg_name}-debuginfo -f mingw32-debugfiles.list       \
0c1e1f
%defattr(-,root,root,-)                                                  \
0c1e1f
%{nil}
0c1e1f
0c1e1f
0c1e1f
# Maintain backwards compatibility with the original MinGW packaging guidelines
0c1e1f
# These can be dropped as soon as all packages are ported to the new packaging guidelines
0c1e1f
%_mingw32_pkg_name             %{mingw32_pkg_name}
0c1e1f
%_mingw32_target               %{mingw32_target}
0c1e1f
%_mingw32_sysroot              %{mingw32_sysroot}
0c1e1f
%_mingw32_prefix               %{mingw32_prefix}
0c1e1f
%_mingw32_exec_prefix          %{mingw32_exec_prefix}
0c1e1f
%_mingw32_bindir               %{mingw32_bindir}
0c1e1f
%_mingw32_sbindir              %{mingw32_sbindir}
0c1e1f
%_mingw32_libexecdir           %{mingw32_libexecdir}
0c1e1f
%_mingw32_libdir               %{mingw32_libdir}
0c1e1f
%_mingw32_datadir              %{mingw32_datadir}
0c1e1f
%_mingw32_docdir               %{mingw32_docdir}
0c1e1f
%_mingw32_infodir              %{mingw32_infodir}
0c1e1f
%_mingw32_mandir               %{mingw32_mandir}
0c1e1f
%_mingw32_sysconfdir           %{mingw32_sysconfdir}
0c1e1f
%_mingw32_sharedstatedir       %{mingw32_sharedstatedir}
0c1e1f
%_mingw32_localstatedir        %{mingw32_localstatedir}
0c1e1f
%_mingw32_includedir           %{mingw32_includedir}
0c1e1f
%_mingw32_host                 %{mingw32_host}
0c1e1f
%_mingw32_cflags               %{mingw32_cflags}
0c1e1f
%_mingw32_cppflags             %{mingw32_cppflags}
0c1e1f
%_mingw32_ldflags              %{mingw32_ldflags}
0c1e1f
%_mingw32_findprovides         %{mingw_findprovides}
0c1e1f
%_mingw32_findrequires         %{mingw_findrequires}
0c1e1f
%_mingw32_cc                   %{mingw32_cc}
0c1e1f
%_mingw32_cxx                  %{mingw32_cxx}
0c1e1f
%_mingw32_cpp                  %{mingw32_cpp}
0c1e1f
%_mingw32_addr2line            %{mingw32_addr2line}
0c1e1f
%_mingw32_ar                   %{mingw32_ar}
0c1e1f
%_mingw32_as                   %{mingw32_as}
0c1e1f
%_mingw32_c++                  %{mingw32_c++}
0c1e1f
%_mingw32_c++filt              %{mingw32_c++filt}
0c1e1f
%_mingw32_dlltool              %{mingw32_dlltool}
0c1e1f
%_mingw32_dllwrap              %{mingw32_dllwrap}
0c1e1f
%_mingw32_gcov                 %{mingw32_gcov}
0c1e1f
%_mingw32_gprof                %{mingw32_gprof}
0c1e1f
%_mingw32_ld                   %{mingw32_ld}
0c1e1f
%_mingw32_nm                   %{mingw32_nm}
0c1e1f
%_mingw32_objcopy              %{mingw32_objcopy}
0c1e1f
%_mingw32_objdump              %{mingw32_objdump}
0c1e1f
%_mingw32_ranlib               %{mingw32_ranlib}
0c1e1f
%_mingw32_readelf              %{mingw32_readelf}
0c1e1f
%_mingw32_size                 %{mingw32_size}
0c1e1f
%_mingw32_strings              %{mingw32_strings}
0c1e1f
%_mingw32_strip                %{mingw32_strip}
0c1e1f
%_mingw32_windmc               %{mingw32_windmc}
0c1e1f
%_mingw32_windres              %{mingw32_windres}
0c1e1f
%_mingw32_env                  %{mingw32_env}
0c1e1f
%_mingw32_pkg_config           %{mingw32_pkg_config}
0c1e1f
%_mingw32_configure            %{mingw32_configure}
0c1e1f
%_mingw32_make                 %{mingw32_make}
0c1e1f
%_mingw32_cmake                %{mingw32_cmake}
0c1e1f
%_mingw32_description          %{mingw32_description}
0c1e1f
0c1e1f
# The old implementation of the _mingw32_debug_package macro isn't
0c1e1f
# forward-compatible with the new implementation using mingw_debug_package
0c1e1f
# so keep the old implementation here for backwards compatibility
0c1e1f
%_mingw32_debug_install_post   \
0c1e1f
   %{mingw_finddebuginfo} %{_builddir}/%{?buildsubdir} old\
0c1e1f
%{nil}
0c1e1f
0c1e1f
%_mingw32_debug_package(n:) \
0c1e1f
%define __mingw32_debug_pkg_name %{-n*}%{!-n:%{_mingw32_pkg_name}}-debuginfo \
0c1e1f
%package -n %{__mingw32_debug_pkg_name} \
0c1e1f
Summary: Debug information for package %{name} \
0c1e1f
Group: Development/Debug \
0c1e1f
%description -n %{__mingw32_debug_pkg_name} \
0c1e1f
This package provides debug information for package %{_mingw32_pkg_name}.\
0c1e1f
Debug information is useful when developing applications that use this\
0c1e1f
package or when debugging this package.\
0c1e1f
%files -n %{__mingw32_debug_pkg_name} -f debugfiles.list\
0c1e1f
%defattr(-,root,root,-)\
0c1e1f
%{nil}
0c1e1f
0c1e1f
# This macro has been dropped from the new guidelines, keep
0c1e1f
# it here around for backwards compatibility
0c1e1f
%_mingw32_makeinstall %{mingw32_env} ; \
0c1e1f
  make \\\
0c1e1f
	prefix=%{?buildroot:%{buildroot}}%{mingw32_prefix} \\\
0c1e1f
	exec_prefix=%{?buildroot:%{buildroot}}%{mingw32_exec_prefix} \\\
0c1e1f
	bindir=%{?buildroot:%{buildroot}}%{mingw32_bindir} \\\
0c1e1f
	sbindir=%{?buildroot:%{buildroot}}%{mingw32_sbindir} \\\
0c1e1f
	sysconfdir=%{?buildroot:%{buildroot}}%{mingw32_sysconfdir} \\\
0c1e1f
	datadir=%{?buildroot:%{buildroot}}%{mingw32_datadir} \\\
0c1e1f
	includedir=%{?buildroot:%{buildroot}}%{mingw32_includedir} \\\
0c1e1f
	libdir=%{?buildroot:%{buildroot}}%{mingw32_libdir} \\\
0c1e1f
	libexecdir=%{?buildroot:%{buildroot}}%{mingw32_libexecdir} \\\
0c1e1f
	localstatedir=%{?buildroot:%{buildroot}}%{mingw32_localstatedir} \\\
0c1e1f
	sharedstatedir=%{?buildroot:%{buildroot}}%{mingw32_sharedstatedir} \\\
0c1e1f
	mandir=%{?buildroot:%{buildroot}}%{mingw32_mandir} \\\
0c1e1f
	infodir=%{?buildroot:%{buildroot}}%{mingw32_infodir} \\\
0c1e1f
  install