]> git.pld-linux.org Git - packages/rpm.git/blob - rpm.macros
- noautodep macros turned off stripping/gzipping - fixed
[packages/rpm.git] / rpm.macros
1 #-----------------------------------------------------------------
2 # CFLAGS and LDFLAGS used to build
3
4 %debugcflags    -O0 -g
5 %rpmcflags      %{?debug:%debugcflags}%{!?debug:%optflags}
6 %rpmldflags     %{!?debug:-s}
7
8 #-----------------------------------------------------------------
9 %configure { \
10  if [ -n "$LINGUAS" ]; then unset LINGUAS; fi; \
11  LDFLAGS="${LDFLAGS:-%rpmldflags}" ; export LDFLAGS ; \
12  CFLAGS="${CFLAGS:-%rpmcflags}" ; export CFLAGS ; \
13  CXXFLAGS="${CXXFLAGS:-%rpmcflags}" ; export CXXFLAGS ; \
14  FFLAGS="${FFLAGS:-%rpmcflags}" ; export FFLAGS ; \
15  ./configure %{_target_platform} \
16         --prefix=%{_prefix} \
17         --exec-prefix=%{_exec_prefix} \
18         --bindir=%{_bindir} \
19         --sbindir=%{_sbindir} \
20         --sysconfdir=%{_sysconfdir} \
21         --datadir=%{_datadir} \
22         --includedir=%{_includedir} \
23         --libdir=%{_libdir} \
24         --libexecdir=%{_libexecdir} \
25         --localstatedir=%{_localstatedir} \
26         --sharedstatedir=%{_sharedstatedir} \
27         --mandir=%{_mandir} \
28         --infodir=%{_infodir} \
29 }
30
31 #------------------------------------------------------------------------------
32 # The GNUconfigure macro does the following:
33 #       update config.guess and config.sub.
34 #       regenerate all autoconf/automake files
35 #       optionally change to a directory (make the directory if requested).
36 #       run configure with correct prefix, platform, and CFLAGS.
37 #       optionally restore current directory.
38 #
39 # Based on autogen.sh from GNOME and orginal GNUconfigure
40 #
41 %GNUconfigure(MCs:)      \
42   %{-C:_mydir="`pwd`"; %{-M: %{__mkdir} -p %{-C*};} cd %{-C*}} \
43   dirs="`find ${_mydir} -name configure.in -print`"; export dirs; \
44     for coin in `echo ${dirs}` \
45 do \
46   dr=`dirname ${coin}`; \
47 if test -f ${dr}/NO-AUTO-GEN; then \
48  : \
49 else \
50      macrodirs=`sed -n -e 's,AM_ACLOCAL_INCLUDE(\(.*\)),\1,gp' < ${coin}`; \
51     ( cd ${dr}; \
52       aclocalinclude="${ACLOCAL_FLAGS}"; \
53       for k in ${macrodirs}; do \
54         if test -d ${k}; then \
55           aclocalinclude="${aclocalinclude} -I ${k}"; \
56         ##else \
57         ##  echo "**Warning**: No such directory \`${k}'.  Ignored." \
58         fi \
59       done \
60       if grep "^AM_GNU_GETTEXT" configure.in >/dev/null; then \
61         if grep "sed.*POTFILES" configure.in >/dev/null; then \
62           : do nothing -- we still have an old unmodified configure.in \
63         else \
64           test -r ${dr}/aclocal.m4 || touch ${dr}/aclocal.m4; \
65           echo "no" | gettextize --force --copy; \
66           test -r ${dr}/aclocal.m4 && %{__chmod} u+w ${dr}/aclocal.m4; \
67         fi \
68       fi \
69       if grep "^AM_PROG_LIBTOOL" configure.in >/dev/null; then \
70         %{__libtoolize} --force --copy; \
71       fi \
72       aclocal ${aclocalinclude}; \
73       if grep "^AM_CONFIG_HEADER" configure.in >/dev/null; then \
74         %{__autoheader}; \
75       fi \
76       echo "Running automake --gnu ${am_opt} ..."; \
77       %{__automake} --add-missing --gnu ${am_opt}; \
78       %{__autoconf}; \
79     ); \
80   fi \
81 done \
82   %{-C:${_mydir}}%{!-C:.}/%{configure} \
83   %{-C:cd ${_mydir}; unset _mydir}
84
85 # Location of autoconf macros
86 %_aclocaldir    %(aclocal --print-ac-dir)
87
88 # Location of top applink dir
89 %_applnkdir      /usr/X11R6/share/applnk
90
91 # Location pixmaps for applnk/desktop files
92 %_pixmapsdir    /usr/X11R6/share/pixmaps
93
94 # Current date
95 %date           %(LC_ALL="C" date +"%a %b %d %Y")
96
97 # tmp directory
98 %tmpdir         %(echo "${TMPDIR:-/tmp}")
99
100 # Example files, programs, scripts...
101 %_examplesdir   /usr/src/examples
102
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 { \
113 echo "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>
160 %__spec_install_pre     %{___build_pre}\
161 rm -f %{_builddir}/__rpm_*\
162 %{nil}
163
164 %__spec_install_post \
165 %{?_noautoreqfiles:for f in %{_noautoreqfiles} ; do echo %{?buildroot:%{buildroot}}$f >> %{_builddir}/__rpm_noautoreqfiles ; done }\
166 %{?_noautoreq:for f in %{_noautoreq} ; do echo "$f" >> %{_builddir}/__rpm_noautoreq ; done }\
167 %{?_noautoreqdep:for f in %{_noautoreqdep} ; do echo "$f" >> %{_builddir}/__rpm_noautoreqdep ; done }\
168 %{?_noautoprovfiles:for f in %{_noautoprovfiles} ; do echo %{?buildroot:%{buildroot}}$f >> %{_builddir}/__rpm_noautoprovfiles ; done }\
169 %{?_noautoprov:for f in %{_noautoprov} ; do echo "$f" >> %{_builddir}/__rpm_noautoprov ; done }\
170 %{__spec_install_post_strip}\
171 %{__spec_install_post_compress_docs}\
172 %{__arch_install_post}\
173 %{__os_install_post}\
174 %{nil}
175
176 %__spec_clean_pre       %{___build_pre}\
177 rm -f %{_builddir}/__rpm_*\
178 %{nil}
179
180
181 #%_noautoreqfiles       "%{_defaultdocdir}.*" "%{_examplesdir}.*"
182 #%_noautoreq            %{nil}
183 #%_noautoreqdep         %{nil}
184 #%_noautoprovfiles      %{nil}
185 #%_noautoprov           %{nil}
186
187
This page took 0.048645 seconds and 4 git commands to generate.