# http://qa.mandriva.com/twiki/bin/view/Main/BackPorting # RHEL4: Save as /etc/rpm/macros.mdk4rh or similar # RHEL3: Save as /etc/rpm/macros, or if you can't, add the location of this file # to macrofiles list in /usr/lib/rpm/redhat/rpmrc %distversion 4es %distsuffix rhel %dist .%{distsuffix}%{distversion} %mkrel(c:) %{-c: 0.%{-c*}.}%{1}.%{distsuffix}%{distversion} %notmdk 1 %mdkversion 1000 %_logdir /var/log %configure2_5x \ CONFIGURE_TOP="${CONFIGURE_TOP:-.}"; \ CFLAGS="${CFLAGS:-%optflags}" ; export CFLAGS ; \ CXXFLAGS="${CXXFLAGS:-%optflags}" ; export CXXFLAGS ; \ FFLAGS="${FFLAGS:-%optflags}" ; export FFLAGS ; \ %{?__cputoolize:%{__cputoolize} -c $CONFIGURE_TOP;} \ %{?__libtoolize:(cd $CONFIGURE_TOP; [ -f configure.in -o -f configure.ac ] && %{__libtoolize} --copy --force) ;} \ $CONFIGURE_TOP/configure --build=%{_target_platform} \\\ --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}\ %pyver %(python -V 2>&1 | cut -f2 -d" " | cut -f1,2 -d".") %_make_bin make %make %{_make_bin} %_smp_mflags \ %mklibname(ds) %{_lib}%{1}%{?2:%{2}}%{?3:_%{3}}%{-s:-static}%{-d:-devel} %serverbuild export CFLAGS="%optflags -fno-omit-frame-pointer"; export CXXFLAGS="%optflags -fno-omit-frame-pointer"; export RPM_OPT_FLAGS="%optflags -fno-omit-frame-pointer" #%makeinstall_std() make DESTDIR=%{?buildroot:%{buildroot}} install %*\ #find %{buildroot} -name '.packlist' -exec rm -f {} \\;\ #%{nil} %makeinstall_std(C:) make DESTDIR=%{?buildroot:%{buildroot}} install %{-C:-C %{-C*} }%{?*:%*}\ find %{buildroot} -name '.packlist' -exec rm -f {} \\;\ %{nil} #find %{buildroot} -name 'perllocal.pod' -exec rm -f {} \\;\ %update_menus true %clean_menus true %_extension .bz2 %__install_info /sbin/install-info %_install_info() if [[ -f %{_infodir}/%{1}%{_extension} ]];then %{__insta ll_info} %{_infodir}/%{1}%{_extension} --dir=%{_infodir}/dir;fi \ %{nil} %_remove_install_info() if [ "$1" = "0" ]; then if [[ -f %{_infodir}/%{1}%{_exte nsion} ]];then %{__install_info} %{_infodir}/%{1}%{_extension} --dir=%{_infodir} /dir --remove ;fi; fi \ %{nil} %_menudir /usr/lib/menu %_iconsdir %{_datadir}/icons %_miconsdir %{_iconsdir}/mini %_liconsdir %{_iconsdir}/large #%_pre_useradd ldap /var/ldap /bin/false #%_post_service ldap2.3 #%_preun_service ldap2.3 #%_postun_userdel ldap %_postun_userdel() true %_pre_useradd() /usr/sbin/useradd -r -M -s %{3} -d %{2} -c "system user for %{name}" %{1} || : \ %{nil} %_post_service() if [ $1 -eq 1 ]\ then /sbin/chkconfig --add %{1}\ else\ if [ -f /etc/rc3.d/S??%{1} ]\ then /sbin/chkconfig --add %{1}\ fi\ if [ -f /var/lock/subsys/%{1} ]\ then /sbin/service %{1} restart >/dev/null 2>/dev/null||:\ fi\ fi\ %{nil} %_preun_service() if [ $1 -eq 0 ]\ then\ /sbin/service %{1} stop > /dev/null 2>/dev/null || :\ /sbin/chkconfig --del %{1}\ fi\ %{nil} # Run clean_perl from spec-helper to clean up perl modules %__os_install_post \ /usr/lib/rpm/brp-compress \ /usr/lib/rpm/brp-strip \ /usr/lib/rpm/brp-strip-static-archive \ /usr/lib/rpm/brp-strip-comment-note \ /etc/rpm/clean_perl \ %{nil} %_use_internal_dependency_generator 0 %__find_provides /etc/rpm/filter.sh '%{?_provides_exceptions:%{_provides_exceptions}}%{!?_provides_exceptions: }' /usr/lib/rpm/find-provides %__find_requires /etc/rpm/filter.sh '%{?_requires_exceptions:%{_requires_exceptions}}%{!?_requires_exceptions: }' /usr/lib/rpm/find-requires %{?buildroot:%{buildroot}} %{?_target_cpu:%{_target_cpu}} %_post_webapp [ $1 == 1 ] && /sbin/service httpd condrestart ||: %_postun_webapp [ $1 == 0 ] && /sbin/service httpd condreload ||: %_gamesdir games %_gamesdatadir %{_datadir}/%{_gamesdir} %_gamesbindir %{_prefix}/%{_gamesdir} %_update_desktop_database_bin %{_bindir}/update-desktop-database %_update_mime_database_bin %{_bindir}/update-mime-database %update_desktop_database if [ -x %{_update_desktop_database_bin} ]; then \ %{_update_desktop_database_bin} %{_datadir}/applications > /dev/null || \ true ; fi \ %{nil} %clean_desktop_database if [ "$1" = "0" -a -x %{_update_desktop_database_bin} ]; then \ %{_update_desktop_database_bin} %{_datadir}/applications > /dev/null || true ; fi \ %{nil} %update_mime_database if [ -x %{_update_mime_database_bin} ]; then \ %{_update_mime_database_bin} %{_datadir}/mime > /dev/null || true ; fi \ %{nil} %clean_mime_database if [ "$1" = "0" -a -x %{_update_mime_database_bin} ]; \ then %{_update_mime_database_bin} %{_datadir}/mime > /dev/null || true ; fi \ %{nil}