]> git.pld-linux.org Git - packages/rpm.git/blame - rpm.macros
- release 41: remove texinfo from Requires list in build subpackage.
[packages/rpm.git] / rpm.macros
CommitLineData
a8bf9720
AF
1# PLD rpm macros
2
3%_defaultdocdir %{_usr}/share/doc
4%_fixowner [ `%{__id_u}` = '0' ] && %{__chown_Rhf} root.@ROOT_GROUP@
5%_fixgroup true
6%_topdir %(echo $HOME)/rpm
7%_exec_prefix %{_prefix}
8%_bindir %{_exec_prefix}/bin
9%_sbindir %{_exec_prefix}/sbin
10%_libexecdir %{_exec_prefix}/lib
11%_datadir %{_prefix}/share
12%_sharedstatedir %{_prefix}/com
13%_lib lib
14%_libdir %{_exec_prefix}/%{_lib}
15%_includedir %{_prefix}/include
16%_oldincludedir /usr/include
17%_sysconfdir /etc
18%_localstatedir /var
19%_infodir /usr/share/info
20%_mandir %{_prefix}/share/man
cd33aab7
AM
21#-----------------------------------------------------------------
22# CFLAGS and LDFLAGS used to build
23
24%debugcflags -O0 -g
25%rpmcflags %{?debug:%debugcflags}%{!?debug:%optflags}
26%rpmldflags %{!?debug:-s}
27
28#-----------------------------------------------------------------
9f0287b5 29%configure2_13 { \
cd33aab7
AM
30 if [ -n "$LINGUAS" ]; then unset LINGUAS; fi; \
31 LDFLAGS="${LDFLAGS:-%rpmldflags}" ; export LDFLAGS ; \
32 CFLAGS="${CFLAGS:-%rpmcflags}" ; export CFLAGS ; \
33 CXXFLAGS="${CXXFLAGS:-%rpmcflags}" ; export CXXFLAGS ; \
34 FFLAGS="${FFLAGS:-%rpmcflags}" ; export FFLAGS ; \
35 ./configure \
fa74a11c 36 --host=%{_target_platform} \
cd33aab7
AM
37 --prefix=%{_prefix} \
38 --exec-prefix=%{_exec_prefix} \
39 --bindir=%{_bindir} \
40 --sbindir=%{_sbindir} \
41 --sysconfdir=%{_sysconfdir} \
42 --datadir=%{_datadir} \
43 --includedir=%{_includedir} \
44 --libdir=%{_libdir} \
45 --libexecdir=%{_libexecdir} \
46 --localstatedir=%{_localstatedir} \
47 --sharedstatedir=%{_sharedstatedir} \
48 --mandir=%{_mandir} \
49 --infodir=%{_infodir} \
50}
51
85f82bec 52#----------------------------------------------------------------
9f0287b5 53%configure {./configure \
85f82bec
AF
54 LDFLAGS="${LDFLAGS:-%rpmldflags}" \
55 CFLAGS="${CFLAGS:-%rpmcflags}" \
56 CXXFLAGS="${CXXFLAGS:-%rpmcflags}" \
57 FFLAGS="${FFLAGS:-%rpmcflags}" \
9f0287b5
AF
58 %{?__cc:CC=%{__cc}} \
59 %{?__cxx:CXX=%{__cxx}} \
85f82bec
AF
60 --build=%{_target_platform} \
61 --prefix=%{_prefix} \
62 --exec-prefix=%{_exec_prefix} \
63 --bindir=%{_bindir} \
64 --sbindir=%{_sbindir} \
65 --sysconfdir=%{_sysconfdir} \
66 --datadir=%{_datadir} \
67 --includedir=%{_includedir} \
68 --libdir=%{_libdir} \
69 --libexecdir=%{_libexecdir} \
70 --localstatedir=%{_localstatedir} \
71 --sharedstatedir=%{_sharedstatedir} \
72 --mandir=%{_mandir} \
73 --infodir=%{_infodir} \
74}
75
cd33aab7
AM
76# Location of autoconf macros
77%_aclocaldir %(aclocal --print-ac-dir)
78
c5eece2c 79# Location of pkgconfig files
895ccc5b 80%_pkgconfigdir /usr/lib/pkgconfig
c5eece2c 81
cd33aab7
AM
82# Location of top applink dir
83%_applnkdir /usr/X11R6/share/applnk
84
85# Location pixmaps for applnk/desktop files
86%_pixmapsdir /usr/X11R6/share/pixmaps
87
c5eece2c
JB
88# Location of fonts directories
89%_fontsdir /usr/share/fonts
90
cd33aab7
AM
91# Current date
92%date %(LC_ALL="C" date +"%a %b %d %Y")
93
94# tmp directory
95%tmpdir %(echo "${TMPDIR:-/tmp}")
96
97# Example files, programs, scripts...
98%_examplesdir /usr/src/examples
99
bd63739a 100# The directory holding Linux kernel sources
101%_kernelsrcdir /usr/src/linux
102
cd33aab7
AM
103# If non-empty "debug" macro defined, add "dbg" suffix to release number
104%_rpmfilename %%{NAME}-%%{VERSION}-%%{RELEASE}%{?debug:dbg}.%%{ARCH}.rpm
105
106#-----------------------------------------------------------------
107# find and gzip all files in %{_mandir} and %{infodir}
108#
109# Requires: xargs, find
110#
111#%no_install_post_compress_docs 1
112%__spec_install_post_compress_docs { \
113echo "Compress man and info pages."; \
114%{!?no_install_post_compress_docs: \
115 %{?verbose:set -x;} \
116 for i in /usr/share/man /usr/X11R6/man /usr/share/info; do \
117 if [ -d "$RPM_BUILD_ROOT$i" ]; then \
118 find "$RPM_BUILD_ROOT$i" -name \*.bz2 -print | xargs -r %{__bzip2} -df; \
119 find "$RPM_BUILD_ROOT$i" -name \*.gz -print | xargs -r %{__gzip} -dnf; \
120 find "$RPM_BUILD_ROOT$i" -type f -print | xargs -r %{__gzip} -9nf; \
121 fi; \
122 done; \
123} }
124
125#-----------------------------------------------------------------
126# Strip executable binaries and shared object files
127#
128# Requires: find, awk, strip, cut, xargs
129#
130#%no_install_post_strip 1
131%__spec_install_post_strip {%{!?debug: \
132%{!?no_install_post_strip: \
133 %{?verbose:set -x;} \
134 echo "Strip executable binaries and shared object files."; \
135 filelist=`find $RPM_BUILD_ROOT -type f ! -regex ".*ld-[0-9.]*so.*"`; \
136 elfexelist=`echo $filelist | xargs -r file | \
137 awk '/ELF.*executable/ {print $1}' | cut -d: -f1`; \
138 elfsharedlist=`echo $filelist | xargs -r file | \
139 awk '/LF.*shared object/ {print $1}' | cut -d: -f1`; \
140 if [ -n "$elfexelist" ]; then \
141 strip --remove-section=.note --remove-section=.comment $elfexelist; \
142 fi; \
143 if [ -n "$elfsharedlist" ]; then \
144 strip --strip-unneeded --remove-section=.note --remove-section=.comment $elfsharedlist; \
145 fi; } \
146} }
147
148%_source_payload w9.gzdio
149%_binary_payload w9.bzdio
150
151#-----------------------------------------------------------------
152# post %install sequence:
153# - autodeps exceptions
154# - compress all man and info pages,
155# - strip all ELF executables and ELF shared objects if not %debug.
156
157###################################################################
158# Requires/Provides automation
159# exceptions system by Jacek Konieczny <jajcus@pld.org.pl>
f10da3d9
JK
160%__spec_prep_pre \
161_autoreqprov=n \
162%{?_noautoreqfiles:_autoreqprov=y}\
163%{?_noautoreq:_autoreqprov=y}\
164%{?_noautoreqdep:_autoreqprov=y}\
165%{?_noautoprovfiles:_autoreqprov=y}\
166%{?_noautoprov:_autoreqprov=y}\
167if [ "$_autoreqprov" = "y" ] ; then \
168 if [ -f %{_builddir}/__rpm_lock ] ; then \
169 echo "Some package using \%_noauto* macros is already being built" >&2 \
170 echo "If it is not true delete %{_builddir}/__rpm_lock" >&2 \
171 exit 1 \
172 else \
173 rm -f %{_builddir}/__rpm_*\
174 touch %{_builddir}/__rpm_lock \
175 fi \
176fi \
cd33aab7
AM
177%{nil}
178
81bcf939 179%__os_install_post \
cd33aab7
AM
180%{?_noautoreqfiles:for f in %{_noautoreqfiles} ; do echo %{?buildroot:%{buildroot}}$f >> %{_builddir}/__rpm_noautoreqfiles ; done }\
181%{?_noautoreq:for f in %{_noautoreq} ; do echo "$f" >> %{_builddir}/__rpm_noautoreq ; done }\
182%{?_noautoreqdep:for f in %{_noautoreqdep} ; do echo "$f" >> %{_builddir}/__rpm_noautoreqdep ; done }\
183%{?_noautoprovfiles:for f in %{_noautoprovfiles} ; do echo %{?buildroot:%{buildroot}}$f >> %{_builddir}/__rpm_noautoprovfiles ; done }\
184%{?_noautoprov:for f in %{_noautoprov} ; do echo "$f" >> %{_builddir}/__rpm_noautoprov ; done }\
185%{__spec_install_post_strip}\
186%{__spec_install_post_compress_docs}\
187%{__arch_install_post}\
cd33aab7
AM
188%{nil}
189
190%__spec_clean_pre %{___build_pre}\
f10da3d9
JK
191_autoreqprov=n \
192%{?_noautoreqfiles:_autoreqprov=y}\
193%{?_noautoreq:_autoreqprov=y}\
194%{?_noautoreqdep:_autoreqprov=y}\
195%{?_noautoprovfiles:_autoreqprov=y}\
196%{?_noautoprov:_autoreqprov=y}\
197%{?_noautoreqfiles:_autoreqprov=y}\
198if [ "$_autoreqprov" = "y" ] ; then \
199 rm -f %{_builddir}/__rpm_* \
200fi \
cd33aab7
AM
201%{nil}
202
203
204#%_noautoreqfiles "%{_defaultdocdir}.*" "%{_examplesdir}.*"
205#%_noautoreq %{nil}
206#%_noautoreqdep %{nil}
207#%_noautoprovfiles %{nil}
208#%_noautoprov %{nil}
This page took 0.08607 seconds and 4 git commands to generate.