# 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 %{?_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.147 Release: %mkrel 8 Source0: %{name}-%{version}.tar.xz #Source1: rpm-helper.req # Patch that need a review Patch1: rpm-mageia-setup-1.145-fix-rpm49-build.patch # Patches already in mageia svn Patch2: rpm-mageia-setup-1.147-add-osgi-maven-support.patch Patch3: rpm-mageia-setup-1.147-Use-upstream-desktop-file.prov.patch Patch4: rpm-mageia-setup-1.147-Better-handle-maven-prov.patch Patch5: rpm-mageia-setup-1.147-Better-handle-osgi-prov.patch Patch6: rpm-mageia-setup-1.147-kmod.prov-handle-xz.patch #Patch7: rpm-mageia-setup-1.147-systemd-require-versioned-rpm-helper.patch Patch8: %{name}-1.147-fix-rename-macro.patch License: GPLv2+ Group: System/Configuration/Packaging Url: http://www.mageia.org/ BuildRequires: rpm-devel %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 # needed for script to extract pkgconfig info Requires: pkgconfig Requires: python-pkg-resources Requires: rpmlint-mageia-policy Requires: %name = %version-%release # for product version macros Requires: %{_real_vendor}-release %description build The %{distribution} rpm configuration and scripts dedicated to build rpms. %prep %setup -q %patch1 -p0 %patch2 -p0 %patch3 -p0 %patch4 -p0 %patch5 -p0 %patch6 -p0 #patch7 -p1 %patch8 -p0 %build %configure2_5x %make %install %makeinstall_std mkdir -p %{buildroot}%{_sysconfdir}/rpm/macros.d # FIXME better fix the Makefile directly in the source code 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} # install rpm-helper.req #install -m 755 %{SOURCE1} %{buildroot}%{_prefix}/lib/rpm/%{_real_vendor}/ %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 %files %dir %{_prefix}/lib/rpm/%{_real_vendor} %{_prefix}/lib/rpm/%{_real_vendor}/rpmrc %{_prefix}/lib/rpm/%{_real_vendor}/rpmpopt %{_prefix}/lib/rpm/rpmb_deprecated %dir %{_sysconfdir}/rpm/macros.d %{_sysconfdir}/rpm/macros.d/20common.macros %files build %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