-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathmacros
420 lines (345 loc) · 12.1 KB
/
macros
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
# Per-platform rpm configuration file.
#==============================================================================
# ---- per-platform macros.
#
%_vendor meego
%_os linux
%_target_platform %{_target_cpu}-%{_vendor}-%{_target_os}%{?_gnu}
#==============================================================================
# ---- configure macros. note that most of these are inherited
# from the defaults.
#
%_prefix /usr
%_sysconfdir /etc
%_localstatedir /var
%_infodir %{_datadir}/info
%_mandir %{_datadir}/man
%_initrddir %{_sysconfdir}/rc.d/init.d
%_fmoddir %{_libdir}/gfortran/modules
%_enable_debug_packages 1
# Default fuzz level for %patch in spec file.
%_default_patch_fuzz 2
%_source_filedigest_algorithm 8
%_binary_filedigest_algorithm 8
# Use zstd level 19 compression for source payloads
%_source_payload w19.zstdio
# Use zstd level 19 compression for binary payloads
%_binary_payload w19.zstdio
#==============================================================================
# ---- configure and makeinstall.
#
%reconfigure \
autoreconf -v --install --force || exit 1 \
%{configure}
%autogen \
%{set_build_flags}; \
./autogen.sh --build=%{_build} --host=%{_host} \\\
--target=%{_target_platform} \\\
--program-prefix=%{?_program_prefix} \\\
--prefix=%{_prefix} \\\
--exec-prefix=%{_exec_prefix} \\\
--bindir=%{_bindir} \\\
--sbindir=%{_sbindir} \\\
--sysconfdir=%{_sysconfdir} \\\
--datadir=%{_datadir} \\\
--includedir=%{_includedir} \\\
--libdir=%{_libdir} \\\
--libexecdir=%{_libexecdir} \\\
--localstatedir=%{_localstatedir} \\\
--sharedstatedir=%{_sharedstatedir} \\\
--mandir=%{_mandir} \\\
--infodir=%{_infodir}
%makeinstall \
%{__make} \\\
prefix=%{?buildroot:%{buildroot}}%{_prefix} \\\
exec_prefix=%{?buildroot:%{buildroot}}%{_exec_prefix} \\\
bindir=%{?buildroot:%{buildroot}}%{_bindir} \\\
sbindir=%{?buildroot:%{buildroot}}%{_sbindir} \\\
sysconfdir=%{?buildroot:%{buildroot}}%{_sysconfdir} \\\
datadir=%{?buildroot:%{buildroot}}%{_datadir} \\\
includedir=%{?buildroot:%{buildroot}}%{_includedir} \\\
libdir=%{?buildroot:%{buildroot}}%{_libdir} \\\
libexecdir=%{?buildroot:%{buildroot}}%{_libexecdir} \\\
localstatedir=%{?buildroot:%{buildroot}}%{_localstatedir} \\\
sharedstatedir=%{?buildroot:%{buildroot}}%{_sharedstatedir} \\\
mandir=%{?buildroot:%{buildroot}}%{_mandir} \\\
infodir=%{?buildroot:%{buildroot}}%{_infodir} \\\
install
%_smp_mflags %([ -z "$RPM_BUILD_NCPUS" ] \\\
&& RPM_BUILD_NCPUS="`/usr/bin/getconf _NPROCESSORS_ONLN`"; \\\
[ "$RPM_BUILD_NCPUS" -gt 1 ] && echo "-j$RPM_BUILD_NCPUS")
%install_info(:-:) \
lastarg() { shift $(($# - 1)) ; echo "$1" ; } \
if test -x sbin/install-info ; then \
if test -e "$(lastarg %{**})" ; then \
sbin/install-info %{**} \
fi \
fi ;
%install_info_delete(:-:) \
lastarg() { shift $(($# - 1)) ; echo "$1" ; } \
if test -x sbin/install-info ; then \
if ! test -e "$(lastarg %{**})" ; then \
sbin/install-info --quiet --delete %{**} \
fi ; \
fi ;
#==============================================================================
# ---- Build policy macros.
#
%__spec_install_pre %{___build_pre}\
[ "$RPM_BUILD_ROOT" != "/" ] && rm -rf "${RPM_BUILD_ROOT}"\
mkdir -p `dirname "$RPM_BUILD_ROOT"`\
mkdir "$RPM_BUILD_ROOT"\
%{nil}
#---------------------------------------------------------------------
# Expanded at end of %install scriptlet.
#
%__arch_install_post /usr/lib/rpm/check-buildroot
%__os_install_post \
/usr/lib/rpm/meego/brp-compress \
%{!?__debug_package:/usr/lib/rpm/meego/brp-strip %{__strip}} \
/usr/lib/rpm/meego/brp-strip-static-archive %{__strip} \
/usr/lib/rpm/meego/brp-strip-comment-note %{__strip} %{__objdump} \
/usr/lib/rpm/brp-python-bytecompile %{__python3} \
/usr/lib/rpm/brp-python-hardlink \
%{!?disable_docs_package:/usr/lib/rpm/meego/find-docs.sh %{buildroot}} \
%{!?__jar_repack:/usr/lib/rpm/meego/brp-java-repack-jars} \
%{?__brp_remove_la_files} \
%{nil}
# /usr/lib/rpm/meego/brp-implant-ident-static
%__spec_install_post\
%{?__debug_package:%{__debug_install_post}}\
%{__arch_install_post}\
%{__os_install_post}\
%{nil}
%lang_package \
%package locale \
Summary: Translations and Locale for package %{name}\
Group: Translations\
AutoReqProv: 0\
%description locale\
This package provides translations for package %{name}.\
%files locale -f %{name}.lang\
%defattr(-,root,root,-)\
%{nil}
%docs_package \
%package docs \
Summary: Documentation for package %{name}\
Group: Documentation\
AutoReqProv: 0\
%description docs\
This package provides documentation for package %{name}.\
%files docs -f documentation.list\
%defattr(-,root,root,-)\
%{nil}
# Bad hack to set $LANG to C during all RPM builds
%prep \
%%prep\
LANG=C\
export LANG\
unset DISPLAY\
%{nil}
%build %%build\
LANG=C\
export LANG\
unset DISPLAY\
CFLAGS="%optflags" ; export CFLAGS ; \
CXXFLAGS="${CXXFLAGS:-%optflags}" ; export CXXFLAGS ; \
FFLAGS="${FFLAGS:-%optflags -I%_fmoddir}" ; export FFLAGS ; \
LD_AS_NEEDED=1; export LD_AS_NEEDED ; \
%{nil}
%install %{?_enable_debug_packages:%{debug_package}}\
%%install\
LANG=C\
export LANG\
unset DISPLAY\
%{nil}
%check %%check\
unset DISPLAY\
%{nil}
%clean %%clean\
rm -rf %{?buildroot:%{buildroot}} \
%{nil}
%find_lang /usr/lib/rpm/find-lang.sh %{buildroot}
%find_docs /usr/lib/rpm/find-docs.sh %{buildroot}
#
# use internal dep generator?
%_use_internal_dependency_generator 1
#
# Should missing %doc files terminate a build?
%_missing_doc_files_terminate_build 1
#
# Should missing buildids terminate a build?
%_missing_build_ids_terminate_build 1
#
# Should unpackaged files in a build root terminate a build?
%_unpackaged_files_terminate_build 1
#
# Path to scripts to autogenerate package dependencies,
#
%__set_helper_env %{lua:
posix.setenv("RPMBUILD_SPECFILE",rpm.expand("%?_specfile"));
posix.setenv("RPMBUILD_SOURCEDIR",rpm.expand("%?_sourcedir"));
}
# Note: Used iff _use_internal_dependency_generator is zero.
#%__find_provides %{_rpmconfigdir}/rpmdeps --provides
#%__find_requires %{_rpmconfigdir}/rpmdeps --requires
#%__find_provides %{__set_helper_env}%{_rpmconfigdir}/meego/find-provides %name
#%__find_requires %{__set_helper_env}%{_rpmconfigdir}/meego/find-requires %name
%__find_provides /usr/lib/rpm/meego/find-provides
%__find_requires /usr/lib/rpm/meego/find-requires
%__global_cflags -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -Wformat -Wformat-security
# Disable lookups
%_hkp_keyserver %{nil}
#
# RPM macros for Java applications.
#
# JPackage Project <http://www.jpackage.org/>
# David Walluck <[email protected]>
# Ville Skyttä <scop at jpackage.org>
# Nicolas Mailhot <[email protected]>
#
#==============================================================================
# ---- default Java directories
#
# Root directory where all Java VMs/SDK/JREs are installed.
#
# already in /usr/lib/macros on SUSE:
%_jvmdir %{_prefix}/lib/jvm
#
# Root directory where all Java VMs/SDK/JREs expose their jars
#
# already in /usr/lib/macros on SUSE:
%_jvmjardir %{_prefix}/lib/jvm-exports
#
# Root directory for all Java VM/SDK/JRE's private things.
#
# already in /usr/lib/macros on SUSE:
%_jvmprivdir %{_prefix}/lib/jvm-private
#
# Root directory for all architecture dependent parts of Java VM/SDK/JRE's
#
%_jvmlibdir %{_prefix}/lib/jvm
#
# Root directory for all architecture independent parts of Java VM/SDK/JRE's
#
%_jvmdatadir %{_datadir}/jvm
#
# Root directory for all configurations parts of Java VM/SDK/JRE's
#
%_jvmsysconfdir %{_sysconfdir}/jvm
#
# Root directory for all common architecture dependent parts of Java VM/SDK/JRE's
#
%_jvmcommonlibdir %{_prefix}/lib/jvm-commmon
#
# Root directory for all common architecture independent parts of Java VM/SDK/JRE's
#
%_jvmcommondatadir %{_datadir}/jvm-commmon
#
# Root directory for all common configurations parts of Java VM/SDK/JRE's
#
%_jvmcommonsysconfdir %{_sysconfdir}/jvm-commmon
#
# Directory where arch and version independent jars are installed.
# This has already been integrated in RH macros following our request.
#
# By extension:
# %{_javadir}-ext:
# - version dependent jars
# %{_javadir}-x.y.z:
# - jars for Java standard x.y.z (usually symlinks to %{_javadir}-ext)
# %{_javadir}-utils:
# - Java-related scripts
#
# To simplify things only %{_javadir} is defined.
#
# already in /usr/lib/macros on SUSE:
# %_javadir %{_datadir}/java
#
# Directory where arch-specific (JNI) version-independent jars are installed.
#
# By extension:
# %{_jnidir}-ext:
# - version dependent jars
# %{_jnidir}-x.y.z:
# - jars for Java standard x.y.z (usually symlinks to %{_jnidir}-ext)
# To simplify things only %{_jnidir} is defined.
#
# already in /usr/lib/macros on SUSE:
%_jnidir %{_prefix}/lib/java
#
# Root directory where all javadoc is installed. Also already in RH macros.
#
# already in /usr/lib/macros on SUSE:
# %_javadocdir %{_datadir}/javadoc
#
# Directory for maven depmaps
#
%_mavendepmapdir /etc/maven
%_mavendepmapfragdir /etc/maven/fragments
#
# Current default JVM home.
#
# already in /usr/lib/macros on SUSE:
%java_home %(. %{_javadir}-utils/java-functions; set_jvm; echo $JAVA_HOME)
#==============================================================================
# ---- default Java commands
%ant ant
%jar %{java_home}/bin/jar
%java %(. %{_javadir}-utils/java-functions; set_javacmd; echo $JAVACMD)
%javac %{java_home}/bin/javac
%javadoc %{java_home}/bin/javadoc
#==============================================================================
# ---- default icons directories as per the icon theme freedesktop spec
%_iconstheme hicolor
%_iconsbasedir %{_datadir}/icons/%{_iconstheme}
#
# The following is a bit heavy and will be removed
#
%_icons16dir %{_iconsbasedir}/16x16/apps
%_icons22dir %{_iconsbasedir}/22x22/apps
%_icons48dir %{_iconsbasedir}/48x48/apps
%_icons64dir %{_iconsbasedir}/64x64/apps
%_icons96dir %{_iconsbasedir}/96x96/apps
%_icons192dir %{_iconsbasedir}/192x192/apps
%_iconsscaldir %{_iconsbasedir}/scalable/apps
#
# MeeGo icons
#
# %1 the name of the icon (typically the name of the package). RedHat
# requires 3 icons sizes (48, 32, 16), all should be present.
%meego_icons() \
install -D -m 644 %1-48.png $RPM_BUILD_ROOT%{_datadir}/icons/hicolor/48x48/apps/%{name}.png\
install -D -m 644 %1-32.png $RPM_BUILD_ROOT%{_datadir}/icons/hicolor/32x32/apps/%{name}.png\
install -D -m 644 %1-16.png $RPM_BUILD_ROOT%{_datadir}/icons/hicolor/16x16/apps/%{name}.png\
%{nil}
#==============================================================================
# ---- default .desktop directories per the desktop-entry freedesktop.org spec
%_desktopdir %{_datadir}/applications
#==============================================================================
# ---- Generic auto req/prov filtering macros
#
# http://fedoraproject.org/wiki/PackagingDrafts/AutoProvidesAndRequiresFiltering
# prevent anything matching from being scanned for provides
%filter_provides_in(P) %{expand: \
%global __filter_prov_cmd %{?__filter_prov_cmd} %{__grep} -v %{-P} '%*' | \
}
# prevent anything matching from being scanned for requires
%filter_requires_in(P) %{expand: \
%global __filter_req_cmd %{?__filter_req_cmd} %{__grep} -v %{-P} '%*' | \
}
# filter anything matching out of the provides stream
%filter_from_provides() %{expand: \
%global __filter_from_prov %{?__filter_from_prov} | %{__sed} -e '%*' \
}
# filter anything matching out of the requires stream
%filter_from_requires() %{expand: \
%global __filter_from_req %{?__filter_from_req} | %{__sed} -e '%*' \
}
# actually set up the filtering bits
%filter_setup %{expand: \
%global _use_internal_dependency_generator 0 \
%global __deploop() while read FILE; do /usr/lib/rpm/rpmdeps -%{1} ${FILE}; done | /bin/sort -u \
%global __find_provides /bin/sh -c "%{?__filter_prov_cmd} %{__deploop P} %{?__filter_from_prov}" \
%global __find_requires /bin/sh -c "%{?__filter_req_cmd} %{__deploop R} %{?__filter_from_req}" \
}