/[packages]/updates/infra_5/rpm-mageia-setup/current/SPECS/rpm-mageia-setup.spec
ViewVC logotype

Contents of /updates/infra_5/rpm-mageia-setup/current/SPECS/rpm-mageia-setup.spec

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1132198 - (show annotations) (download)
Fri Jul 28 18:35:51 2017 UTC (6 years, 8 months ago) by akien
File size: 4430 byte(s)
Require rust-srpm-macros necessary for Cauldron builds
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.7
23 %define subrel 0.1
24 Release: %mkrel 1
25 # No patch allowed on SOURCE0
26 # prevent suse script to slow down build:
27 Patch0: gi-find-deps.sh.diff
28 # fix Suse attr matching:
29 Patch1: gobjectintrospection.attr.patch
30 Source0: %{name}-%{version}.tar.xz
31 Source1: gettarball.sh
32 #
33 # UPSTREAM TO SYNC:
34 #
35 # gi-find-deps.sh is a rpm helper for Provides and Requires. Script creates typelib()-style Provides/Requires.
36 # (From: https://build.opensuse.org/package/show/openSUSE:Factory/gobject-introspection)
37 Source3: gi-find-deps.sh
38 Source4: gobjectintrospection.attr
39 # kernel modules provides/requires
40 # (From: http://pkgs.fedoraproject.org/cgit/redhat-rpm-config.git/tree):
41 Source5: kmod.attr
42 Source6: kmod.prov
43 Source7: macros.dwz
44
45 #
46 # END OF UPSTREAM
47 #
48
49 # NO PATCH ACCEPTED: WORK in GIT!!!!
50 License: GPLv2+
51 Group: System/Packaging
52 Url: http://www.mageia.org/
53 BuildRequires: rpm-devel
54 %rename rpm-mandriva-setup
55
56 %description
57 The %{distribution} rpm configuration and scripts.
58
59 %package build
60 Group: System/Packaging
61 Summary: The %{distribution} rpm configuration and scripts to build rpms
62 Requires: spec-helper
63 Requires: multiarch-utils
64 # needed for script to extract pkgconfig info
65 Requires: pkgconfig
66 # python packaging
67 Requires: python-pkg-resources
68 # rust packaging
69 Requires: rust-srpm-macros
70 Requires: rpmlint-mageia-policy
71 Requires: %name = %version-%release
72 Requires: bash >= 4.3-24.2
73 # gi-find-deps uses the enhanced grep variant in order to do
74 # multi-line matching (for pkg.requires(..))
75 Requires: pcre
76 # gi-find-deps makes use of 'file' to identify the types.
77 Requires: file
78 # for product version macros
79 Requires: %{_real_vendor}-release
80 # for g-ir-dep-tool:
81 Requires: gobject-introspection
82 %rename rpm-mandriva-setup-build
83 Requires: dwz
84 Conflicts: %{mklibname -d girepository} < 1.41.91-7
85
86 %description build
87 The %{distribution} rpm configuration and scripts dedicated to build rpms.
88
89 %prep
90 %setup -q
91 install -D %{S:3} .
92 install -D %{S:4} .
93
94 %apply_patches
95
96 %build
97 %configure2_5x
98
99 %make
100
101 %install
102 %makeinstall_std
103
104 # upstream deps generators:
105 install -D gi-find-deps.sh %{S:6} -m 0755 %{buildroot}%{_rpmconfigdir}/
106 install -D gobjectintrospection.attr %{S:5} -m 0644 %{buildroot}%{_rpmconfigdir}/fileattrs/
107
108 mkdir -p %{buildroot}%{_sysconfdir}/rpm/macros.d
109 mkdir -p %{buildroot}%{_rpmconfigdir}/macros.d
110 install -D %{S:7} -m 0644 %{buildroot}%{_rpmconfigdir}/macros.d/
111
112 # FIXME better fix the Makefile directly in the source code
113 mv %{buildroot}%{_rpmconfigdir}/%{_real_vendor}/macros %{buildroot}%{_sysconfdir}/rpm/macros.d/20common.macros
114 mv %{buildroot}%{_sysconfdir}/rpm/macros.d/{build.macros,20build.macros}
115
116 %if %have_emacsmodespec
117 # spec mode for emacs
118 install -d $RPM_BUILD_ROOT%{_datadir}/emacs/site-lisp/
119 install -m644 rpm-spec-mode.el $RPM_BUILD_ROOT%{_datadir}/emacs/site-lisp/
120
121 install -d $RPM_BUILD_ROOT%{_sysconfdir}/emacs/site-start.d
122 cat <<EOF >$RPM_BUILD_ROOT%{_sysconfdir}/emacs/site-start.d/%{name}.el
123 (setq auto-mode-alist (cons '("\\\\.spec$" . rpm-spec-mode) auto-mode-alist))
124 (autoload 'rpm-spec-mode "rpm-spec-mode" "RPM spec mode (for %{distribution})." t)
125 EOF
126 %endif
127
128 %check
129 make test
130
131 %files
132 %dir %{_rpmconfigdir}/%{_real_vendor}
133 %{_rpmconfigdir}/%{_real_vendor}/rpmrc
134 %dir %{_sysconfdir}/rpm/macros.d
135 %{_sysconfdir}/rpm/macros.d/20common.macros
136
137 %files build
138 %doc NEWS
139 %{_sysconfdir}/rpm/macros.d/20build.macros
140 %{_rpmconfigdir}/%{_real_vendor}/*
141 %{_rpmconfigdir}/gi-find-deps.sh
142 %{_rpmconfigdir}/macros.d/*
143 %{_rpmconfigdir}/*.prov
144 %exclude %{_rpmconfigdir}/%{_real_vendor}/rpmrc
145 %if %have_emacsmodespec
146 %{_datadir}/emacs/site-lisp/rpm-spec-mode.el
147 %config(noreplace) %{_sysconfdir}/emacs/site-start.d/%{name}.el
148 %endif
149 %{_rpmconfigdir}/fileattrs/*.attr

  ViewVC Help
Powered by ViewVC 1.1.30