]> git.pld-linux.org Git - packages/rpm.git/blob - rpm.macros
- added %__spec_install_post_compress_docs macro (complet),
[packages/rpm.git] / rpm.macros
1 #-----------------------------------------------------------------
2 %configure { \
3  if [ -n "$LINGUAS" ]; then unset LINGUAS; fi; \
4  LDFLAGS="${LDFLAGS}%{!?debug: -s}" ; export LDFLAGS ; \
5  CFLAGS="${CFLAGS:-%optflags}%{?debug: -g -O}" ; export CFLAGS ; \
6  CXXFLAGS="${CXXFLAGS:-%optflags}%{?debug: -g -O}" ; export CXXFLAGS ; \
7  FFLAGS="${FFLAGS:-%optflags}%{?debug: -g -O}" ; export FFLAGS ; \
8  ./configure %{_target_platform} \
9         --prefix=%{_prefix} \
10         --exec-prefix=%{_exec_prefix} \
11         --bindir=%{_bindir} \
12         --sbindir=%{_sbindir} \
13         --sysconfdir=%{_sysconfdir} \
14         --datadir=%{_datadir} \
15         --includedir=%{_includedir} \
16         --libdir=%{_libdir} \
17         --libexecdir=%{_libexecdir} \
18         --localstatedir=%{_localstatedir} \
19         --sharedstatedir=%{_sharedstatedir} \
20         --mandir=%{_mandir} \
21         --infodir=%{_infodir} \
22 }
23
24 #------------------------------------------------------------------------------
25 # The GNUconfigure macro does the following:
26 #       update config.guess and config.sub.
27 #       regenerate all autoconf/automake files
28 #       optionally change to a directory (make the directory if requested).
29 #       run configure with correct prefix, platform, and CFLAGS.
30 #       optionally restore current directory.
31 #
32 # Based on autogen.sh from GNOME and orginal GNUconfigure
33 #
34 %GNUconfigure(MCs:)      \
35   %{-C:_mydir="`pwd`"; %{-M: %{__mkdir} -p %{-C*};} cd %{-C*}} \
36   dirs="`find ${_mydir} -name configure.in -print`"; export dirs; \
37     for coin in `echo ${dirs}` \
38 do \
39   dr=`dirname ${coin}`; \
40 if test -f ${dr}/NO-AUTO-GEN; then \
41  : \
42 else \
43      macrodirs=`sed -n -e 's,AM_ACLOCAL_INCLUDE(\(.*\)),\1,gp' < ${coin}`; \
44     ( cd ${dr}; \
45       aclocalinclude="${ACLOCAL_FLAGS}"; \
46       for k in ${macrodirs}; do \
47         if test -d ${k}; then \
48           aclocalinclude="${aclocalinclude} -I ${k}"; \
49         ##else \
50         ##  echo "**Warning**: No such directory \`${k}'.  Ignored." \
51         fi \
52       done \
53       if grep "^AM_GNU_GETTEXT" configure.in >/dev/null; then \
54         if grep "sed.*POTFILES" configure.in >/dev/null; then \
55           : do nothing -- we still have an old unmodified configure.in \
56         else \
57           test -r ${dr}/aclocal.m4 || touch ${dr}/aclocal.m4; \
58           echo "no" | gettextize --force --copy; \
59           test -r ${dr}/aclocal.m4 && %{__chmod} u+w ${dr}/aclocal.m4; \
60         fi \
61       fi \
62       if grep "^AM_PROG_LIBTOOL" configure.in >/dev/null; then \
63         %{__libtoolize} --force --copy; \
64       fi \
65       aclocal ${aclocalinclude}; \
66       if grep "^AM_CONFIG_HEADER" configure.in >/dev/null; then \
67         %{__autoheader}; \
68       fi \
69       echo "Running automake --gnu ${am_opt} ..."; \
70       %{__automake} --add-missing --gnu ${am_opt}; \
71       %{__autoconf}; \
72     ); \
73   fi \
74 done \
75   %{-C:${_mydir}}%{!-C:.}/%{configure}
76   %{-C:cd ${_mydir}; unset _mydir}
77
78 # Location of autoconf macros
79 %_aclocaldir    %(aclocal --print-ac-dir)
80
81 # Fixed location of top applink dir
82 %_applnkdir      /usr/X11R6/share/applnk
83
84 # Current date
85 %date           %(LC_ALL="C" date +"%a %b %d %Y")
86
87 # tmp directory
88 %tmpdir         %(echo "${TMPDIR:-/tmp}")
89
90 # Example files, programs, scripts...
91 %_examplesdir   /usr/src/examples
92
93 # Find-requires and directories excluded from auto-req
94 %_noautoreqdir          %{_defaultdocdir} %{_examplesdir}
95 %_noautoreqdep          %{nil}
96 #%__find_requires_pre   /usr/lib/rpm/find-requires-pre %{_noautoreqdir}
97 #%__find_requires_core  /usr/lib/rpm/find-requires
98 #%__find_requires_post  /usr/lib/rpm/find-requires-post
99 #%__find_requires       %{__find_requires_pre} | %{__find_requires_core} | %{__find_requires_post}
100
101 # If non-empty "debug" macro defined, add "dbg" suffix to release number
102 %_rpmfilename           %%{NAME}-%%{VERSION}-%%{RELEASE}%{?debug:dbg}.%%{ARCH}.rpm
103
104 #-----------------------------------------------------------------
105 # find and gzip all files in %{_mandir} and %{infodir}
106 #
107 # Requires: xargs, find
108 #
109 %__spec_install_post_compress_docs { \
110 %{verbose:set -x}%{!verbose:exec > /dev/null}; \
111 if [ -d "$RPM_BUILD_ROOT%{_mandir}" ]; then \
112         find "$RPM_BUILD_ROOT%{_mandir}" -type f -print | xargs %{__gzip} -9nf; \
113 fi; \
114 if [ -d "$RPM_BUILD_ROOT%{_infodir}" ]; then \
115         find $RPM_BUILD_ROOT%{_infodir} -type f -print | xrgs %{__gzip} -9nf; \
116 fi; \
117 }
118
119 #-----------------------------------------------------------------
120 # find and gzip all files in %{_mandir} and %{infodir}
121 #
122 # Requires: find, awk, strip
123 #
124 %__spec_install_post_strip { \
125 %{?debug:#}if [ -x /usr/lib/rpm/remove-unneeded-elf-sections ]; then \
126         /usr/lib/rpm/remove-unneeded-elf-sections %{buildroot}; \
127 fi; \
128 }
129
130 #-----------------------------------------------------------------
131 # post %install sequence:
132 # - compress all man and info pages,
133 # - strip all ELF executables and ELF shared objects if not %debug.
134 #
135 %__spec_install_post { \
136 #%{__spec_install_post_strip} \
137 #%{__spec_install_post_compress_docs} \
138 }
This page took 0.032582 seconds and 4 git commands to generate.