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 |
# fix build (debuginfo package is empty...): |
6 |
%define debug_package %{nil} |
7 |
|
8 |
# If dist tag isn't defined, define it |
9 |
%if %{?dist:0}%{?!dist:1} |
10 |
%define dist %{?distsuffix:%distsuffix}%{?!distsuffix:.mga}%{?distro_release:%distro_release} |
11 |
%endif |
12 |
|
13 |
# If mkrel isn't defined, define it |
14 |
%if %{?mkrel:0}%{?!mkrel:1} |
15 |
%define mkrel(c:) %{-c: 0.%{-c*}.}%{1}%{?dist:%dist}%{?subrel:.%subrel} |
16 |
%endif |
17 |
|
18 |
# This can be useful for backport, as rpm-4.2 |
19 |
# provides the emacs-spec mode |
20 |
%define have_emacsmodespec 1 |
21 |
|
22 |
%{?_with_emacsspecmode: %define have_emacsmodespec 1} |
23 |
%{?_without_emacsspecmode: %define have_emacsmodespec 0} |
24 |
|
25 |
Summary: The %{distribution} rpm configuration and scripts |
26 |
Name: rpm-%{_real_vendor}-setup |
27 |
Version: 2.20.1 |
28 |
Release: %mkrel 1 |
29 |
# prevent suse script to slow down build: |
30 |
Patch0: gi-find-deps.sh.diff |
31 |
# fix Suse attr matching: |
32 |
Patch1: gobjectintrospection.attr.patch |
33 |
Patch3: gobjectintrospection.attr2.patch |
34 |
# prevent emitting bogus requires: |
35 |
# (such as in sugar's src/jarabe/view/viewsource.py =>) |
36 |
Patch2: gi-find-deps.sh.patch |
37 |
# adapt to gobject-introspection-1.50.0 (g-ir-dep-tool -> g-ir-inspect) (mga#19454): |
38 |
Patch4: gi-find-deps.sh2.patch |
39 |
|
40 |
# No patch allowed on SOURCE0 |
41 |
Source0: %{name}-%{version}.tar.xz |
42 |
Source1: gettarball.sh |
43 |
# |
44 |
# UPSTREAM TO SYNC: |
45 |
# |
46 |
# gi-find-deps.sh is a rpm helper for Provides and Requires. Script creates typelib()-style Provides/Requires. |
47 |
# (From: https://build.opensuse.org/package/show/openSUSE:Factory/gobject-introspection) |
48 |
Source3: gi-find-deps.sh |
49 |
Source4: gobjectintrospection.attr |
50 |
# kernel modules provides/requires |
51 |
# (From: http://pkgs.fedoraproject.org/cgit/redhat-rpm-config.git/tree): |
52 |
Source5: kmod.attr |
53 |
Source6: kmod.prov |
54 |
Source7: macros.dwz |
55 |
|
56 |
Source102: macros.mono-srpm |
57 |
|
58 |
# |
59 |
# END OF UPSTREAM |
60 |
# |
61 |
|
62 |
# NO PATCH ACCEPTED: WORK in GIT!!!! |
63 |
License: GPLv2+ |
64 |
Group: System/Packaging |
65 |
Url: http://www.mageia.org/ |
66 |
BuildRequires: rpm-devel |
67 |
%rename rpm-mandriva-setup |
68 |
|
69 |
%description |
70 |
The %{distribution} rpm configuration and scripts. |
71 |
|
72 |
%package build |
73 |
Group: System/Packaging |
74 |
Summary: The %{distribution} rpm configuration and scripts to build rpms |
75 |
Requires: spec-helper |
76 |
Requires: multiarch-utils |
77 |
# needed for script to extract pkgconfig info |
78 |
Requires: pkgconfig |
79 |
# python packaging |
80 |
Requires: python-pkg-resources |
81 |
Requires: python-srpm-macros |
82 |
# rust packaging |
83 |
Requires: rust-srpm-macros |
84 |
Requires: rpmlint-mageia-policy |
85 |
Requires: %name = %version-%release |
86 |
Requires: bash >= 4.3-24.2 |
87 |
# gi-find-deps uses the enhanced grep variant in order to do |
88 |
# multi-line matching (for pkg.requires(..)) |
89 |
Requires: pcre |
90 |
# gi-find-deps makes use of 'file' to identify the types. |
91 |
Requires: file |
92 |
# for product version macros |
93 |
Requires: %{_real_vendor}-release |
94 |
# for g-ir-dep-tool: |
95 |
Requires: gobject-introspection |
96 |
%rename rpm-mandriva-setup-build |
97 |
Requires: dwz |
98 |
# to generate cmake() provides |
99 |
Requires: cmake-rpm-macros |
100 |
Conflicts: %{mklibname -d girepository} < 1.41.91-7 |
101 |
Conflicts: cmake < 1:3.4.1-7 |
102 |
|
103 |
%description build |
104 |
The %{distribution} rpm configuration and scripts dedicated to build rpms. |
105 |
|
106 |
%prep |
107 |
%setup -q |
108 |
install -D %{S:3} . |
109 |
install -D %{S:4} . |
110 |
|
111 |
%autopatch -p1 |
112 |
|
113 |
%build |
114 |
%configure2_5x |
115 |
|
116 |
%make_build |
117 |
|
118 |
%install |
119 |
%make_install |
120 |
|
121 |
# upstream deps generators: |
122 |
install -D gi-find-deps.sh %{S:6} -m 0755 %{buildroot}%{_rpmconfigdir}/ |
123 |
install -D gobjectintrospection.attr %{S:5} -m 0644 %{buildroot}%{_rpmconfigdir}/fileattrs/ |
124 |
|
125 |
mkdir -p %{buildroot}%{_sysconfdir}/rpm/macros.d |
126 |
mkdir -p %{buildroot}%{_rpmconfigdir}/macros.d |
127 |
install -D %{S:7} %{S:102} -m 0644 %{buildroot}%{_rpmconfigdir}/macros.d/ |
128 |
|
129 |
# FIXME better fix the Makefile directly in the source code |
130 |
mv %{buildroot}%{_rpmconfigdir}/%{_real_vendor}/macros %{buildroot}%{_sysconfdir}/rpm/macros.d/20common.macros |
131 |
mv %{buildroot}%{_sysconfdir}/rpm/macros.d/{build.macros,20build.macros} |
132 |
|
133 |
%if %have_emacsmodespec |
134 |
# spec mode for emacs |
135 |
install -d $RPM_BUILD_ROOT%{_datadir}/emacs/site-lisp/ |
136 |
install -m644 rpm-spec-mode.el $RPM_BUILD_ROOT%{_datadir}/emacs/site-lisp/ |
137 |
|
138 |
install -d $RPM_BUILD_ROOT%{_sysconfdir}/emacs/site-start.d |
139 |
cat <<EOF >$RPM_BUILD_ROOT%{_sysconfdir}/emacs/site-start.d/%{name}.el |
140 |
(setq auto-mode-alist (cons '("\\\\.spec$" . rpm-spec-mode) auto-mode-alist)) |
141 |
(autoload 'rpm-spec-mode "rpm-spec-mode" "RPM spec mode (for %{distribution})." t) |
142 |
EOF |
143 |
%endif |
144 |
|
145 |
%check |
146 |
make test |
147 |
|
148 |
%files |
149 |
%dir %{_rpmconfigdir}/%{_real_vendor} |
150 |
%{_rpmconfigdir}/%{_real_vendor}/rpmrc |
151 |
%dir %{_sysconfdir}/rpm/macros.d |
152 |
%{_sysconfdir}/rpm/macros.d/20common.macros |
153 |
|
154 |
%files build |
155 |
%doc NEWS |
156 |
%{_sysconfdir}/rpm/macros.d/20build.macros |
157 |
%{_rpmconfigdir}/%{_real_vendor}/* |
158 |
%{_rpmconfigdir}/gi-find-deps.sh |
159 |
%{_rpmconfigdir}/macros.d/* |
160 |
%{_rpmconfigdir}/*.prov |
161 |
%exclude %{_rpmconfigdir}/%{_real_vendor}/rpmrc |
162 |
%if %have_emacsmodespec |
163 |
%{_datadir}/emacs/site-lisp/rpm-spec-mode.el |
164 |
%config(noreplace) %{_sysconfdir}/emacs/site-start.d/%{name}.el |
165 |
%endif |
166 |
%{_rpmconfigdir}/fileattrs/*.attr |