# hardcoded so that build from another distro keeps this name # (mandatory to have correct package name and source name) %define _real_vendor mageia %if %{?distsuffix:0}%{?!distsuffix:1} %define distsuffix .mga %endif %if %{?mkrel:0}%{?!mkrel:1} %define mkrel(c:) %{-c: 0.%{-c*}.}%{1}%{?distsuffix:%distsuffix}%{?!distsuffix:.mga}%{?distro_release:%distro_release}%{?subrel:.%subrel} %endif # This can be useful for backport, as rpm-4.2 # provides the emacs-spec mode %define have_emacsmodespec 1 # we want /etc/rpm/platform and rpmgenplatform only on rpm5.org < 5.2 %define rpmplatform %{?evr_tuple_select: 0}%{!?evr_tuple_select: %(if rpm --help | grep -q yaml; then echo 1; else echo 0; fi)} %{?_with_emacsspecmode: %define have_emacsmodespec 1} %{?_without_emacsspecmode: %define have_emacsmodespec 0} Summary: The %{distribution} rpm configuration and scripts Name: rpm-%{_real_vendor}-setup Version: 1.142 Release: %mkrel 1 Source0: %{name}-%{version}.tar.xz License: GPLv2+ Group: System/Configuration/Packaging Url: http://www.mageia.org/ BuildRoot: %{_tmppath}/%{name}-buildroot BuildRequires: rpm-devel %if !%rpmplatform Conflicts: rpm = 4.4.8 Conflicts: rpm = 4.4.6 %endif %description The %{distribution} rpm configuration and scripts. %package build Group: System/Configuration/Packaging Summary: The %{distribution} rpm configuration and scripts to build rpms Requires: spec-helper Requires: multiarch-utils >= 1.0.3 Requires: pkgconfig Requires: python-pkg-resources Requires: %name = %version-%release # for product version macros Requires: mageia-release %if %have_emacsmodespec Conflicts: rpm < 4.4.1 %endif Conflicts: spec-helper <= 0.26.1 Obsoletes: rpm-mandriva-setup-build <= 1.114 Provides: rpm-mandriva-setup-build = %{version}-%{release} # (tmb) Obsolete to have a clean upgrade Obsoletes: rpm-manbo-setup-build %description build The %{distribution} rpm configuration and scripts dedicated to build rpms. %prep %setup -q %build %configure2_5x \ %if %rpmplatform --with-rpmplatform \ %endif %make %install rm -rf $RPM_BUILD_ROOT %makeinstall_std mkdir -p %{buildroot}%{_sysconfdir}/rpm/macros.d mv %{buildroot}%{_prefix}/lib/rpm/%{_real_vendor}/macros %{buildroot}%{_sysconfdir}/rpm/macros.d/20common.macros mv %{buildroot}%{_sysconfdir}/rpm/macros.d/{build.macros,20build.macros} %if %have_emacsmodespec # spec mode for emacs install -d $RPM_BUILD_ROOT%{_datadir}/emacs/site-lisp/ install -m644 rpm-spec-mode.el $RPM_BUILD_ROOT%{_datadir}/emacs/site-lisp/ install -d $RPM_BUILD_ROOT%{_sysconfdir}/emacs/site-start.d cat <$RPM_BUILD_ROOT%{_sysconfdir}/emacs/site-start.d/%{name}.el (setq auto-mode-alist (cons '("\\\\.spec$" . rpm-spec-mode) auto-mode-alist)) (autoload 'rpm-spec-mode "rpm-spec-mode" "RPM spec mode (for %{distribution})." t) EOF %endif %check make test %clean rm -rf $RPM_BUILD_ROOT %files %defattr(-,root,root) %dir %{_prefix}/lib/rpm/%{_real_vendor} %{_prefix}/lib/rpm/%{_real_vendor}/rpmrc %{_prefix}/lib/rpm/%{_real_vendor}/rpmpopt %{_prefix}/lib/rpm/rpmb_deprecated %if %rpmplatform %{_bindir}/rpmgenplatform %config(noreplace) %{_sysconfdir}/rpm/platform %ifarch x86_64 %config(noreplace) %{_sysconfdir}/rpm/platform32 %endif %endif %dir %{_sysconfdir}/rpm/macros.d %{_sysconfdir}/rpm/macros.d/20common.macros %files build %defattr(-,root,root) %doc NEWS ChangeLog %{_sysconfdir}/rpm/macros.d/20build.macros %{_prefix}/lib/rpm/%{_real_vendor}/* %exclude %{_prefix}/lib/rpm/%{_real_vendor}/rpmrc %exclude %{_prefix}/lib/rpm/%{_real_vendor}/rpmpopt %exclude %{_prefix}/lib/rpm/rpmb_deprecated %if %have_emacsmodespec %{_datadir}/emacs/site-lisp/rpm-spec-mode.el %config(noreplace) %{_sysconfdir}/emacs/site-start.d/%{name}.el %endif