# ALT Linux compatibility and enchancement macroses.
# Collected by Vitaly Lipatov <lav@etersoft.ru>
# TODO: split by distros' version (check by package's version?)
# 05.02.2006, 12.02.2006, 09.04.2006, 22.02.2008
#

# introduced in rpm 4.0.4-alt83
# https://bugzilla.altlinux.org/show_bug.cgi?id=13925
%autoreconf %__autoreconf

# introduced in rpm 4.0.4-alt55
#  + Add macros: %_desktopdir, %_pixmapsdir (#8767)
%_desktopdir %_datadir/applications
%_pixmapsdir %_datadir/pixmaps

# introduced in rpm 4.0.4-alt54
#  + Added %__autoreconf macro (#8307)
%__autoreconf autoreconf -fisv

# introduced in rpm 4.0.4-alt42
%_x11x11dir %{_x11dir}/lib/X11
%_pkgconfigdir %{_libdir}/pkgconfig

# from mdk
%makeinstall_std %make_install DESTDIR=%buildroot install

# 
%_omfdir %_datadir/omf
# ALT Linux compatibility and enchancement macroses.
# Collected by Vitaly Lipatov <lav@etersoft.ru>
# TODO: split by distros' version (check by package's version?)
# TODO: can we use ifdef here?
# 05.02.2006, 12.02.2006
#
# These macros are not defined yet in Sisyphus (12.02.2006)

# for discussion:
%make_install_std %makeinstall_std

# If macros is component related (like kde, java, perl), use %name_somedir
# If macros for some dir, %_omfdir

%kde_docdir %_docdir/HTML
%gtk_docdir %_datadir/gtk-doc/html
%java_dir %_datadir/java
%java_docdir %_datadir/javadoc

%_kdedocdir %_docdir/HTML
%_gtkdocdir %_datadir/gtk-doc/html
%_javadir %_datadir/java
%_javadocdir %_datadir/javadoc

%_rpmmacrosdir %_sysconfdir/rpm/macros.d
# various for prev. distro...

# install rpm-build-fonts instead
#%_fontsdir %_datadir/fonts
#%_bitmapfontsdir %_fontsdir/bitmap
#%_type1fontsdir %_fontsdir/type1
#%_ttffontsdir %_fontsdir/ttf
#%_otffontsdir %_fontsdir/otf


%rpmcflags $RPM_OPT_FLAGS
#%rpmldflags 

%_aclocaldir %_datadir/aclocal

# Start service only after manual install
# this case is never run due no tty under rpm process install
# 1 - 1st install, 2 - update package
%start_service() \
        [ -z "$DURING_INSTALL" ] && [ "$1" = "1" ] && %_initdir/%{1} start || : \
%nil

# PLD compatibility
%groupadd /usr/sbin/groupadd -r -f 2>/dev/null
%useradd /usr/sbin/useradd -f 2>/dev/null
#%userremove userdel
#%groupremove groupdel

