1 |
#define lc_distro %(echo %{distribution} | tr "A-Z" "a-z") |
2 |
# FIXME: force distro to mageia to get rid of rpm-manbo-setup* |
3 |
%define lc_distro 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 |
# we want /etc/rpm/platform and rpmgenplatform only on rpm5.org < 5.2 |
18 |
%define rpmplatform %{?evr_tuple_select: 0}%{!?evr_tuple_select: %(if rpm --help | grep -q yaml; then echo 1; else echo 0; fi)} |
19 |
|
20 |
%{?_with_emacsspecmode: %define have_emacsmodespec 1} |
21 |
%{?_without_emacsspecmode: %define have_emacsmodespec 0} |
22 |
|
23 |
Summary: The %{distribution} rpm configuration and scripts |
24 |
Name: rpm-%{lc_distro}-setup |
25 |
Version: 1.115 |
26 |
Release: %mkrel 9 |
27 |
Source0: %{name}-%{version}.tar.gz |
28 |
License: GPLv2+ |
29 |
Group: System/Configuration/Packaging |
30 |
Url: http://www.mageia.org/ |
31 |
BuildRoot: %{_tmppath}/%{name}-buildroot |
32 |
# for "make test": |
33 |
BuildRequires: rpm-devel |
34 |
%if !%rpmplatform |
35 |
Conflicts: rpm = 4.4.8 |
36 |
Conflicts: rpm = 4.4.6 |
37 |
# older rpm do not load /usr/lib/rpm/manbo/rpmrc: |
38 |
Conflicts: rpm <= 1:4.4.2.3-0.rc1.1mdv2008.1 |
39 |
%endif |
40 |
Obsoletes: rpm-manbo-setup |
41 |
Obsoletes: rpm-mandriva-setup <= 1.114 |
42 |
Provides: rpm-mandriva-setup = %{version}-%{release} |
43 |
# (blino) FIXME: temporary while drakxtools is not updated and rebuilt with perl 5.12 |
44 |
Provides: perl-suid |
45 |
|
46 |
%description |
47 |
The %{distribution} rpm configuration and scripts. |
48 |
|
49 |
%package build |
50 |
Group: System/Configuration/Packaging |
51 |
Summary: The %{distribution} rpm configuration and scripts to build rpms |
52 |
Requires: spec-helper |
53 |
Requires: multiarch-utils >= 1.0.3 |
54 |
Requires: pkgconfig |
55 |
Requires: python-pkg-resources |
56 |
Requires: %name = %version-%release |
57 |
# for product version macros |
58 |
Requires: mageia-release |
59 |
%if %have_emacsmodespec |
60 |
Conflicts: rpm < 4.4.1 |
61 |
%endif |
62 |
Conflicts: spec-helper <= 0.26.1 |
63 |
Obsoletes: rpm-manbo-setup-build |
64 |
Obsoletes: rpm-mandriva-setup-build <= 1.114 |
65 |
Provides: rpm-mandriva-setup-build = %{version}-%{release} |
66 |
|
67 |
%description build |
68 |
The %{distribution} rpm configuration and scripts dedicated to build rpms. |
69 |
|
70 |
%prep |
71 |
%setup -q |
72 |
|
73 |
%build |
74 |
%configure2_5x \ |
75 |
%if %rpmplatform |
76 |
--with-rpmplatform \ |
77 |
%endif |
78 |
|
79 |
%make |
80 |
|
81 |
%install |
82 |
rm -rf $RPM_BUILD_ROOT |
83 |
%makeinstall_std |
84 |
|
85 |
mkdir -p %buildroot%{_sysconfdir}/rpm/macros.d |
86 |
|
87 |
mv %buildroot%_prefix/lib/rpm/%{lc_distro}/macros %buildroot%{_sysconfdir}/rpm/macros.d/20common.macros |
88 |
mv %buildroot%{_sysconfdir}/rpm/macros.d/{build.macros,20build.macros} |
89 |
|
90 |
|
91 |
%if %have_emacsmodespec |
92 |
# spec mode for emacs |
93 |
install -d $RPM_BUILD_ROOT%{_datadir}/emacs/site-lisp/ |
94 |
install -m644 rpm-spec-mode.el $RPM_BUILD_ROOT%{_datadir}/emacs/site-lisp/ |
95 |
|
96 |
install -d $RPM_BUILD_ROOT%{_sysconfdir}/emacs/site-start.d |
97 |
cat <<EOF >$RPM_BUILD_ROOT%{_sysconfdir}/emacs/site-start.d/%{name}.el |
98 |
(setq auto-mode-alist (cons '("\\\\.spec$" . rpm-spec-mode) auto-mode-alist)) |
99 |
(autoload 'rpm-spec-mode "rpm-spec-mode" "RPM spec mode (for %{distribution})." t) |
100 |
EOF |
101 |
%endif |
102 |
|
103 |
%check |
104 |
make test |
105 |
|
106 |
%clean |
107 |
rm -rf $RPM_BUILD_ROOT |
108 |
|
109 |
%files |
110 |
%defattr(-,root,root) |
111 |
%dir %{_prefix}/lib/rpm/%{lc_distro} |
112 |
%if %rpmplatform |
113 |
%{_bindir}/rpmgenplatform |
114 |
%config(noreplace) %{_sysconfdir}/rpm/platform |
115 |
%ifarch x86_64 |
116 |
%config(noreplace) %{_sysconfdir}/rpm/platform32 |
117 |
%endif |
118 |
%endif |
119 |
%dir %{_sysconfdir}/rpm/macros.d |
120 |
%{_sysconfdir}/rpm/macros.d/20common.macros |
121 |
|
122 |
%files build |
123 |
%defattr(-,root,root) |
124 |
%doc NEWS ChangeLog |
125 |
%{_sysconfdir}/rpm/macros.d/20build.macros |
126 |
%{_prefix}/lib/rpm/%{lc_distro}/* |
127 |
%if %have_emacsmodespec |
128 |
%{_datadir}/emacs/site-lisp/rpm-spec-mode.el |
129 |
%config(noreplace) %{_sysconfdir}/emacs/site-start.d/%{name}.el |
130 |
%endif |
131 |
|
132 |
|