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 6 |
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 |
Patch5: rpm-mageia-setup-1.147-Better-handle-osgi-prov.patch |
32 |
Patch6: rpm-mageia-setup-1.147-kmod.prov-handle-xz.patch |
33 |
License: GPLv2+ |
34 |
Group: System/Configuration/Packaging |
35 |
Url: http://www.mageia.org/ |
36 |
BuildRequires: rpm-devel |
37 |
|
38 |
%description |
39 |
The %{distribution} rpm configuration and scripts. |
40 |
|
41 |
%package build |
42 |
Group: System/Configuration/Packaging |
43 |
Summary: The %{distribution} rpm configuration and scripts to build rpms |
44 |
Requires: spec-helper |
45 |
Requires: multiarch-utils |
46 |
# needed for script to extract pkgconfig info |
47 |
Requires: pkgconfig |
48 |
Requires: python-pkg-resources |
49 |
Requires: rpmlint-mageia-policy |
50 |
Requires: %name = %version-%release |
51 |
# for product version macros |
52 |
Requires: %{_real_vendor}-release |
53 |
|
54 |
%description build |
55 |
The %{distribution} rpm configuration and scripts dedicated to build rpms. |
56 |
|
57 |
%prep |
58 |
%setup -q |
59 |
%patch1 -p0 |
60 |
%patch2 -p0 |
61 |
%patch3 -p0 |
62 |
%patch4 -p0 |
63 |
%patch5 -p0 |
64 |
%patch6 -p0 |
65 |
|
66 |
%build |
67 |
%configure2_5x |
68 |
|
69 |
%make |
70 |
|
71 |
%install |
72 |
rm -rf $RPM_BUILD_ROOT |
73 |
%makeinstall_std |
74 |
|
75 |
mkdir -p %{buildroot}%{_sysconfdir}/rpm/macros.d |
76 |
|
77 |
# FIXME better fix the Makefile directly in the source code |
78 |
mv %{buildroot}%{_prefix}/lib/rpm/%{_real_vendor}/macros %{buildroot}%{_sysconfdir}/rpm/macros.d/20common.macros |
79 |
mv %{buildroot}%{_sysconfdir}/rpm/macros.d/{build.macros,20build.macros} |
80 |
|
81 |
%if %have_emacsmodespec |
82 |
# spec mode for emacs |
83 |
install -d $RPM_BUILD_ROOT%{_datadir}/emacs/site-lisp/ |
84 |
install -m644 rpm-spec-mode.el $RPM_BUILD_ROOT%{_datadir}/emacs/site-lisp/ |
85 |
|
86 |
install -d $RPM_BUILD_ROOT%{_sysconfdir}/emacs/site-start.d |
87 |
cat <<EOF >$RPM_BUILD_ROOT%{_sysconfdir}/emacs/site-start.d/%{name}.el |
88 |
(setq auto-mode-alist (cons '("\\\\.spec$" . rpm-spec-mode) auto-mode-alist)) |
89 |
(autoload 'rpm-spec-mode "rpm-spec-mode" "RPM spec mode (for %{distribution})." t) |
90 |
EOF |
91 |
%endif |
92 |
|
93 |
%check |
94 |
make test |
95 |
|
96 |
%files |
97 |
%dir %{_prefix}/lib/rpm/%{_real_vendor} |
98 |
%{_prefix}/lib/rpm/%{_real_vendor}/rpmrc |
99 |
%{_prefix}/lib/rpm/%{_real_vendor}/rpmpopt |
100 |
%{_prefix}/lib/rpm/rpmb_deprecated |
101 |
%dir %{_sysconfdir}/rpm/macros.d |
102 |
%{_sysconfdir}/rpm/macros.d/20common.macros |
103 |
|
104 |
%files build |
105 |
%doc NEWS ChangeLog |
106 |
%{_sysconfdir}/rpm/macros.d/20build.macros |
107 |
%{_prefix}/lib/rpm/%{_real_vendor}/* |
108 |
%exclude %{_prefix}/lib/rpm/%{_real_vendor}/rpmrc |
109 |
%exclude %{_prefix}/lib/rpm/%{_real_vendor}/rpmpopt |
110 |
%exclude %{_prefix}/lib/rpm/rpmb_deprecated |
111 |
%if %have_emacsmodespec |
112 |
%{_datadir}/emacs/site-lisp/rpm-spec-mode.el |
113 |
%config(noreplace) %{_sysconfdir}/emacs/site-start.d/%{name}.el |
114 |
%endif |