1 |
# hardcoded so that build from another distro keeps this name |
2 |
# (mandatory to have correct package name and source name) |
3 |
%define _real_vendor mageia |
4 |
|
5 |
%if %{?distsuffix:0}%{?!distsuffix:1} |
6 |
%define distsuffix .mga |
7 |
%endif |
8 |
|
9 |
%if %{?mkrel:0}%{?!mkrel:1} |
10 |
%define mkrel(c:) %{-c: 0.%{-c*}.}%{1}%{?distsuffix:%distsuffix}%{?!distsuffix:.mga}%{?distro_release:%distro_release}%{?subrel:.%subrel} |
11 |
%endif |
12 |
|
13 |
# This can be useful for backport, as rpm-4.2 |
14 |
# provides the emacs-spec mode |
15 |
%define have_emacsmodespec 1 |
16 |
|
17 |
%{?_with_emacsspecmode: %define have_emacsmodespec 1} |
18 |
%{?_without_emacsspecmode: %define have_emacsmodespec 0} |
19 |
|
20 |
Summary: The %{distribution} rpm configuration and scripts |
21 |
Name: rpm-%{_real_vendor}-setup |
22 |
Version: 1.147 |
23 |
Release: %mkrel 3 |
24 |
Source0: %{name}-%{version}.tar.xz |
25 |
# Patch that need a review |
26 |
Patch1: rpm-mageia-setup-1.145-fix-rpm49-build.patch |
27 |
# Patches already in mageia svn |
28 |
Patch2: rpm-mageia-setup-1.147-add-osgi-maven-support.patch |
29 |
Patch3: rpm-mageia-setup-1.147-Use-upstream-desktop-file.prov.patch |
30 |
Patch4: rpm-mageia-setup-1.147-Better-handle-maven-prov.patch |
31 |
License: GPLv2+ |
32 |
Group: System/Configuration/Packaging |
33 |
Url: http://www.mageia.org/ |
34 |
BuildRequires: rpm-devel |
35 |
|
36 |
%description |
37 |
The %{distribution} rpm configuration and scripts. |
38 |
|
39 |
%package build |
40 |
Group: System/Configuration/Packaging |
41 |
Summary: The %{distribution} rpm configuration and scripts to build rpms |
42 |
Requires: spec-helper |
43 |
Requires: multiarch-utils |
44 |
# needed for script to extract pkgconfig info |
45 |
Requires: pkgconfig |
46 |
Requires: python-pkg-resources |
47 |
Requires: %name = %version-%release |
48 |
# for product version macros |
49 |
Requires: %{_real_vendor}-release |
50 |
|
51 |
%description build |
52 |
The %{distribution} rpm configuration and scripts dedicated to build rpms. |
53 |
|
54 |
%prep |
55 |
%setup -q |
56 |
%patch1 -p0 |
57 |
%patch2 -p0 |
58 |
%patch3 -p0 |
59 |
%patch4 -p0 |
60 |
|
61 |
%build |
62 |
%configure2_5x |
63 |
|
64 |
%make |
65 |
|
66 |
%install |
67 |
rm -rf $RPM_BUILD_ROOT |
68 |
%makeinstall_std |
69 |
|
70 |
mkdir -p %{buildroot}%{_sysconfdir}/rpm/macros.d |
71 |
|
72 |
# FIXME better fix the Makefile directly in the source code |
73 |
mv %{buildroot}%{_prefix}/lib/rpm/%{_real_vendor}/macros %{buildroot}%{_sysconfdir}/rpm/macros.d/20common.macros |
74 |
mv %{buildroot}%{_sysconfdir}/rpm/macros.d/{build.macros,20build.macros} |
75 |
|
76 |
%if %have_emacsmodespec |
77 |
# spec mode for emacs |
78 |
install -d $RPM_BUILD_ROOT%{_datadir}/emacs/site-lisp/ |
79 |
install -m644 rpm-spec-mode.el $RPM_BUILD_ROOT%{_datadir}/emacs/site-lisp/ |
80 |
|
81 |
install -d $RPM_BUILD_ROOT%{_sysconfdir}/emacs/site-start.d |
82 |
cat <<EOF >$RPM_BUILD_ROOT%{_sysconfdir}/emacs/site-start.d/%{name}.el |
83 |
(setq auto-mode-alist (cons '("\\\\.spec$" . rpm-spec-mode) auto-mode-alist)) |
84 |
(autoload 'rpm-spec-mode "rpm-spec-mode" "RPM spec mode (for %{distribution})." t) |
85 |
EOF |
86 |
%endif |
87 |
|
88 |
%check |
89 |
make test |
90 |
|
91 |
%files |
92 |
%dir %{_prefix}/lib/rpm/%{_real_vendor} |
93 |
%{_prefix}/lib/rpm/%{_real_vendor}/rpmrc |
94 |
%{_prefix}/lib/rpm/%{_real_vendor}/rpmpopt |
95 |
%{_prefix}/lib/rpm/rpmb_deprecated |
96 |
%dir %{_sysconfdir}/rpm/macros.d |
97 |
%{_sysconfdir}/rpm/macros.d/20common.macros |
98 |
|
99 |
%files build |
100 |
%doc NEWS ChangeLog |
101 |
%{_sysconfdir}/rpm/macros.d/20build.macros |
102 |
%{_prefix}/lib/rpm/%{_real_vendor}/* |
103 |
%exclude %{_prefix}/lib/rpm/%{_real_vendor}/rpmrc |
104 |
%exclude %{_prefix}/lib/rpm/%{_real_vendor}/rpmpopt |
105 |
%exclude %{_prefix}/lib/rpm/rpmb_deprecated |
106 |
%if %have_emacsmodespec |
107 |
%{_datadir}/emacs/site-lisp/rpm-spec-mode.el |
108 |
%config(noreplace) %{_sysconfdir}/emacs/site-start.d/%{name}.el |
109 |
%endif |