# fss-0002
# dbus/dbus.h HAVE_DBUS_DBUS_H
# consider passing: --without-openal and/or --without-gstreamer

main:
  sed -i -e "s|/usr/bin/perl|$(type -p perl)|g" tools/examine-relay tools/winemaker tools/make_requests tools/make_authors tools/c2man.pl tools/winedump/function_grep.pl tools/winapi/winapi_extract tools/winapi/make_filter tools/winapi/msvcmaker tools/winapi/winapi_test tools/make_makefiles dlls/opengl32/make_opengl
  sed -i -e 's|fmaxf(|fmax(|g' -e 's|fminf(|fmin(|g' dlls/d3dx9_36/mesh.c
  ./configure $CONF $wine_64bit_mode
  #echo "#undef HAVE_OPENAL" >> include/config.h
  make pkgconfigdir=${TC}lib/pkgconfig/ depend
  make pkgconfigdir=${TC}lib/pkgconfig/
  make pkgconfigdir=${TC}lib/pkgconfig/ install
  if [[ -d /lib64 ]] ; then mv -v /lib64/* /lib/ && rm -Rf /lib64 ; fi
  if [[ -e /bin/wine64 ]] ; then mv -v /bin/wine64 /bin/wine ; fi
  if [[ -e /bin/wine64-preloader ]] ; then mv -v /bin/wine64-preloader /bin/wine-preloader ; fi
  cp -v ${PR}winetricks /bin/
  cp -v ${PR}wine{,_help,_notepad,_webbrowser,_wordpad}.png /share/icons/
  cp -v ${PR}wine-{help,notepad,webbrowser,wordpad,hh}.desktop /share/applications/
  chgrp e_wine /bin/{function_grep.pl,msiexec,notepad,regedit,regsvr32,widl,wmc,wrc}
  chgrp e_wine /bin/wine{,-preloader,boot,build,cfg,console,dbg,dump,file,gcc,maker,mine,path,server,cpp,g++}
  chgrp -R e_wine /share/wine /lib/wine /lib/libwine.so* /bin/winetricks
  chmod o-rx /bin/{function_grep.pl,msiexec,notepad,regedit,regsvr32,widl,wmc,wrc}
  chmod o-rx /bin/wine{,-preloader,boot,build,cfg,console,dbg,dump,file,gcc,maker,mine,path,server,cpp,g++}
  chmod o-rx -R /share/wine /lib/wine /lib/libwine.so* /bin/winetricks
  find /share/wine /lib/wine -type d -exec chmod g+s '{}' ';'
  chmod +x /bin/winetricks
  tkis_handle_documentation man applications /share/man
  rm -Rf /share/aclocal
