]> git.pld-linux.org Git - packages/rpm.git/blob - rpm.macros
- added 4 macros:
[packages/rpm.git] / rpm.macros
1 %requires_eq() %(LC_ALL="C" rpm -q --queryformat 'Requires: %%{NAME} = %%{VERSION}' %1|grep -v "is not")
2 %perl_sitearch  %(eval "`perl -V:installsitearch`"; echo $installsitearch)
3 %perl_archlib  %(eval "`perl -V:installarchlib`"; echo $installarchlib)
4 # %%requires_pkg macro is obsoletes. Use %%requires_eq instead
5 #%requires_pkg() %(LC_ALL="C" rpm -q --queryformat 'Requires: %%{NAME} = %%{VERSION}' %1|grep -v "is not")
6
7 #------------------------------------------------------------------------------
8 # The GNUconfigure macro does the following:
9 #       update config.guess and config.sub.
10 #       regenerate all autoconf/automake files
11 #       optionally change to a directory (make the directory if requested).
12 #       run configure with correct prefix, platform, and CFLAGS.
13 #       optionally restore current directory.
14 #
15 # Based on autogen.sh from GNOME and orginal GNUconfigure
16 #
17 %GNUconfigure(MCs:)      \
18   %{-C:_mydir="`pwd`"; %{-M; %{__mkdirp} %{-C*};} cd %{-C*}} \
19   for coin in `find ${_mydir} -name configure.in -print` \
20 do \
21   dr=`dirname ${coin}`; \
22 if test -f ${dr}/NO-AUTO-GEN; then \
23  : \
24 else \
25      macrodirs=`sed -n -e 's,AM_ACLOCAL_INCLUDE(\(.*\)),\1,gp' < ${coin}`; \
26     ( cd ${dr}; \
27       aclocalinclude="${ACLOCAL_FLAGS}"; \
28       for k in ${macrodirs}; do \
29         if test -d ${k}; then \
30           aclocalinclude="${aclocalinclude} -I ${k}"; \
31         ##else \
32         ##  echo "**Warning**: No such directory \`${k}'.  Ignored." \
33         fi \
34       done \
35       if grep "^AM_GNU_GETTEXT" configure.in >/dev/null; then \
36         if grep "sed.*POTFILES" configure.in >/dev/null; then \
37           : do nothing -- we still have an old unmodified configure.in \
38         else \
39           test -r ${dr}/aclocal.m4 || touch ${dr}/aclocal.m4; \
40           echo "no" | gettextize --force --copy; \
41           test -r ${dr}/aclocal.m4 && %{__chmod} u+w ${dr}/aclocal.m4; \
42         fi \
43       fi \
44       if grep "^AM_PROG_LIBTOOL" configure.in >/dev/null; then \
45         %{__libtoolize} --force --copy; \
46       fi \
47       aclocal ${aclocalinclude}; \
48       if grep "^AM_CONFIG_HEADER" configure.in >/dev/null; then \
49         %{__autoheader}; \
50       fi \
51       echo "Running automake --gnu ${am_opt} ..."; \
52       %{__automake} --add-missing --gnu ${am_opt}; \
53       %{__autoconf}; \
54     ); \
55   fi \
56 done \
57   CFLAGS="${CFLAGS} %{optflags}" LDFLAGS="${LDFLAGS}" %{-C:${_mydir}}%{!-C:.}/configure %{_target_platform} --prefix=%{_prefix} %* \
58   %{-C:cd ${_mydir}; unset _mydir}
59
60 #------------------------------------------------------------------------------
61 # The GNUconfigureS macro does the following:
62 #       update config.guess and config.sub.
63 #       regenerate all autoconf/automake files
64 #       optionally change to a directory (make the directory if requested).
65 #       run configure with correct prefix, platform, CFLAGS and adds -s 
66 #       to LDFLAGS.
67 #       optionally restore current directory.
68 #
69 # Based on autogen.sh from GNOME and orginal GNUconfigure
70 #
71 %GNUconfigureS(MC:)      \
72   %{-C:_mydir="`pwd`"; %{-M; %{__mkdirp} %{-C*};} cd %{-C*}} \
73   for coin in `find ${_mydir} -name configure.in -print` \
74 do \
75   dr=`dirname ${coin}`; \
76 if test -f ${dr}/NO-AUTO-GEN; then \
77  : \
78 else \
79      macrodirs=`sed -n -e 's,AM_ACLOCAL_INCLUDE(\(.*\)),\1,gp' < ${coin}`; \
80     ( cd ${dr}; \
81       aclocalinclude="${ACLOCAL_FLAGS}"; \
82       for k in ${macrodirs}; do \
83         if test -d ${k}; then \
84           aclocalinclude="${aclocalinclude} -I ${k}"; \
85         ##else \
86         ##  echo "**Warning**: No such directory \`${k}'.  Ignored." \
87         fi \
88       done \
89       if grep "^AM_GNU_GETTEXT" configure.in >/dev/null; then \
90         if grep "sed.*POTFILES" configure.in >/dev/null; then \
91           : do nothing -- we still have an old unmodified configure.in \
92         else \
93           test -r ${dr}/aclocal.m4 || touch ${dr}/aclocal.m4; \
94           echo "no" | gettextize --force --copy; \
95           test -r ${dr}/aclocal.m4 && %{__chmod} u+w ${dr}/aclocal.m4; \
96         fi \
97       fi \
98       if grep "^AM_PROG_LIBTOOL" configure.in >/dev/null; then \
99         %{__libtoolize} --force --copy; \
100       fi \
101       aclocal ${aclocalinclude}; \
102       if grep "^AM_CONFIG_HEADER" configure.in >/dev/null; then \
103         %{__autoheader}; \
104       fi \
105       echo "Running automake --gnu ${am_opt} ..."; \
106       %{__automake} --add-missing --gnu ${am_opt}; \
107       %{__autoconf}; \
108     ); \
109   fi \
110 done \
111   CFLAGS="${CFLAGS} %{optflags}" LDFLAGS="${LDFLAGS} -s" %{-C:${_mydir}}%{!-C:.}/configure %{_target_platform} --prefix=%{_prefix} %* \
112   %{-C:cd ${_mydir}; unset _mydir}
113
114 ##############################
115 # run ./configure with corect target, CFLAGS and LDFLAGS
116
117 %configureS \
118   CFLAGS="${CFLAGS} %{optflags}" LDFLAGS="${LDFLAGS} -s" %{-C:${_mydir}}%{!-C:.}/configure %{_target_platform} --prefix=%{_prefix}
119
120 %configure \
121   CFLAGS="${CFLAGS} %{optflags}" LDFLAGS="${LDFLAGS}" %{-C:${_mydir}}%{!-C:.}/configure %{_target_platform} --prefix=%{_prefix}
This page took 0.042097 seconds and 4 git commands to generate.