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: 2.0 |
23 |
Release: %mkrel 3 |
24 |
Source0: %{name}-%{version}.tar.xz |
25 |
Source1: gettarball.sh |
26 |
# gi-find-deps.sh is a rpm helper for Provides and Requires. Script creates typelib()-style Provides/Requires. |
27 |
# (From: https://build.opensuse.org/package/show/openSUSE:Factory/gobject-introspection) |
28 |
Source3: gi-find-deps.sh |
29 |
Source4: gobjectintrospection.attr |
30 |
# NO PATCH ACCEPTED: WORK in GIT!!!! |
31 |
License: GPLv2+ |
32 |
Group: System/Packaging |
33 |
Url: http://www.mageia.org/ |
34 |
BuildRequires: rpm-devel |
35 |
%rename rpm-mandriva-setup |
36 |
|
37 |
%description |
38 |
The %{distribution} rpm configuration and scripts. |
39 |
|
40 |
%package build |
41 |
Group: System/Packaging |
42 |
Summary: The %{distribution} rpm configuration and scripts to build rpms |
43 |
Requires: spec-helper |
44 |
Requires: multiarch-utils |
45 |
# needed for script to extract pkgconfig info |
46 |
Requires: pkgconfig |
47 |
Requires: python-pkg-resources |
48 |
Requires: rpmlint-mageia-policy |
49 |
Requires: %name = %version-%release |
50 |
Requires: bash >= 4.3-24.2 |
51 |
# for product version macros |
52 |
Requires: %{_real_vendor}-release |
53 |
%rename rpm-mandriva-setup-build |
54 |
Requires: dwz |
55 |
Conflicts: lib64girepository-devel < 1.41.91-5 |
56 |
|
57 |
%description build |
58 |
The %{distribution} rpm configuration and scripts dedicated to build rpms. |
59 |
|
60 |
%prep |
61 |
%setup -q |
62 |
%apply_patches |
63 |
|
64 |
%build |
65 |
%configure2_5x |
66 |
|
67 |
%make |
68 |
|
69 |
%install |
70 |
%makeinstall_std |
71 |
install -D %{S:3} -m 0755 %{buildroot}%{_rpmconfigdir}/gi-find-deps.sh |
72 |
install -D %{S:4} -m 0644 %{buildroot}%{_rpmconfigdir}/fileattrs/gobjectintrospection.attr |
73 |
|
74 |
mkdir -p %{buildroot}%{_sysconfdir}/rpm/macros.d |
75 |
|
76 |
# FIXME better fix the Makefile directly in the source code |
77 |
mv %{buildroot}%{_prefix}/lib/rpm/%{_real_vendor}/macros %{buildroot}%{_sysconfdir}/rpm/macros.d/20common.macros |
78 |
mv %{buildroot}%{_sysconfdir}/rpm/macros.d/{build.macros,20build.macros} |
79 |
|
80 |
%if %have_emacsmodespec |
81 |
# spec mode for emacs |
82 |
install -d $RPM_BUILD_ROOT%{_datadir}/emacs/site-lisp/ |
83 |
install -m644 rpm-spec-mode.el $RPM_BUILD_ROOT%{_datadir}/emacs/site-lisp/ |
84 |
|
85 |
install -d $RPM_BUILD_ROOT%{_sysconfdir}/emacs/site-start.d |
86 |
cat <<EOF >$RPM_BUILD_ROOT%{_sysconfdir}/emacs/site-start.d/%{name}.el |
87 |
(setq auto-mode-alist (cons '("\\\\.spec$" . rpm-spec-mode) auto-mode-alist)) |
88 |
(autoload 'rpm-spec-mode "rpm-spec-mode" "RPM spec mode (for %{distribution})." t) |
89 |
EOF |
90 |
%endif |
91 |
|
92 |
%check |
93 |
make test |
94 |
|
95 |
%files |
96 |
%dir %{_prefix}/lib/rpm/%{_real_vendor} |
97 |
%{_prefix}/lib/rpm/%{_real_vendor}/rpmrc |
98 |
%dir %{_sysconfdir}/rpm/macros.d |
99 |
%{_sysconfdir}/rpm/macros.d/20common.macros |
100 |
|
101 |
%files build |
102 |
%doc NEWS |
103 |
%{_sysconfdir}/rpm/macros.d/20build.macros |
104 |
%{_sysconfdir}/rpm/macros.d/dwz.macros |
105 |
%{_prefix}/lib/rpm/%{_real_vendor}/* |
106 |
%{_prefix}/lib/rpm/gi-find-deps.sh |
107 |
%exclude %{_prefix}/lib/rpm/%{_real_vendor}/rpmrc |
108 |
%if %have_emacsmodespec |
109 |
%{_datadir}/emacs/site-lisp/rpm-spec-mode.el |
110 |
%config(noreplace) %{_sysconfdir}/emacs/site-start.d/%{name}.el |
111 |
%endif |
112 |
%{_rpmconfigdir}/fileattrs/*.attr |