/* XXX "python 2.3 byte-compiled" */
{ "python ", RPMFC_PYTHON|RPMFC_INCLUDE },
+ { "libtool library ", RPMFC_LIBTOOL|RPMFC_INCLUDE },
+ { "pkgconfig ", RPMFC_PKGCONFIG|RPMFC_INCLUDE },
+
/* XXX .NET executables and libraries. file(1) cannot differ from win32
* executables unfortunately :( */
{ "PE executable", RPMFC_MONO|RPMFC_INCLUDE },
if (is_executable)
#endif
xx = rpmfcHelper(fc, 'R', "python");
- }
+ } else
+ if (fc->fcolor->vals[fc->ix] & RPMFC_LIBTOOL) {
+ xx = rpmfcHelper(fc, 'P', "libtool");
+#ifdef NOTYET
+ if (is_executable)
+#endif
+ xx = rpmfcHelper(fc, 'R', "libtool");
+ } else
+ if (fc->fcolor->vals[fc->ix] & RPMFC_PKGCONFIG) {
+ xx = rpmfcHelper(fc, 'P', "pkgconfig");
+#ifdef NOTYET
+ if (is_executable)
+#endif
+ xx = rpmfcHelper(fc, 'R', "pkgconfig");
+ } else
if (fc->fcolor->vals[fc->ix] & RPMFC_MONO) {
xx = rpmfcHelper(fc, 'P', "mono");
if (is_executable)
{ rpmfcELF, RPMFC_ELF },
{ rpmfcSCRIPT, (RPMFC_SCRIPT|RPMFC_PERL) },
{ rpmfcSCRIPT, (RPMFC_SCRIPT|RPMFC_PYTHON) },
+ { rpmfcSCRIPT, (RPMFC_SCRIPT|RPMFC_PKGCONFIG) },
+ { rpmfcSCRIPT, (RPMFC_SCRIPT|RPMFC_LIBTOOL) },
{ rpmfcSCRIPT, RPMFC_MONO },
{ NULL, 0 }
};
case S_IFLNK:
case S_IFREG:
default:
+#define _suffix(_s, _x) \
+ (slen >= sizeof(_x) && !strcmp((_s)+slen-(sizeof(_x)-1), (_x)))
+
/* XXX all files with extension ".pm" are perl modules for now. */
-/*@-branchstate@*/
- if (slen >= sizeof(".pm") && !strcmp(s+slen-(sizeof(".pm")-1), ".pm"))
+ if (_suffix(s, ".pm"))
ftype = "Perl5 module source text";
+
+ /* XXX all files with extension ".la" are libtool for now. */
+ else if (_suffix(s, ".la"))
+ ftype = "libtoo library file";
+
+ /* XXX all files with extension ".pc" are pkgconfig for now. */
+ else if (_suffix(s, ".pc"))
+ ftype = "pkgconfig file";
+
/* XXX skip all files in /dev/ which are (or should be) %dev dummies. */
else if (slen >= fc->brlen+sizeof("/dev/") && !strncmp(s+fc->brlen, "/dev/", sizeof("/dev/")-1))
ftype = "";
%__mono_provides @RPMCONFIGDIR@/mono-find-provides %{_builddir}/%{?buildsubdir} %{buildroot} %{_libdir}
%__mono_requires @RPMCONFIGDIR@/mono-find-requires %{_builddir}/%{?buildsubdir} %{buildroot} %{_libdir}
+%__libtool_provides @RPMCONFIGDIR@/libtooldeps.sh --provides %{buildroot} %{name}
+%__libtool_requires @RPMCONFIGDIR@/libtooldeps.sh --requires %{buildroot} %{name}
+
+%__pkgconfig_provides @RPMCONFIGDIR@/pkgconfigdeps.sh --provides
+%__pkgconfig_requires @RPMCONFIGDIR@/pkgconfigdeps.sh --requires
+
#
# fixowner, fixgroup, and fixperms are run at the end of hardcoded setup
# These macros are necessary only for legacy compatibility, and have moved
--- /dev/null
+#!/bin/sh
+
+[ $# -ge 2 ] || {
+ cat > /dev/null
+ exit 0
+}
+
+case $1 in
+-P|--provides)
+ shift
+ RPM_BUILD_ROOT="$1"
+ while read possible
+ do
+ case "$possible" in
+ *.la)
+ if grep -iq '^# Generated by ltmain.sh' "$possible" 2> /dev/null ; then
+ possible="`echo ${possible} | sed -e s,${RPM_BUILD_ROOT}/,/,`"
+ echo "libtool($possible)"
+ fi
+ ;;
+ esac
+ done
+ ;;
+-R|--requires)
+ while read possible ; do
+ case "$possible" in
+ *.la)
+ for dep in `grep '^dependency_libs='"$possible" 2> /dev/null | \
+ sed -e "s,^dependency_libs='\(.*\)',\1,g"`
+ do
+ case "$dep" in
+ /*.la)
+ echo "libtool($dep)"
+ ;;
+ esac
+ done
+ ;;
+ esac
+ done
+ ;;
+esac
+exit 0
--- /dev/null
+#!/bin/bash
+
+pkgconfig=/usr/bin/pkg-config
+test -x $pkgconfig || {
+ cat > /dev/null
+ exit 0
+}
+
+[ $# -ge 1 ] || {
+ cat > /dev/null
+ exit 0
+}
+
+case $1 in
+-P|--provides)
+ while read filename ; do
+ case "${filename}" in
+ *.pc)
+ # Query the dependencies of the package.
+ $pkgconfig --print-provides "$filename" 2> /dev/null | while read n r v ; do
+ # We have a dependency. Make a note that we need the pkgconfig
+ # tool for this package.
+ echo "pkgconfig($n)" "$r" "$v"
+ done
+ ;;
+ esac
+ done
+ ;;
+-R|--requires)
+ while read filename ; do
+ case "${filename}" in
+ *.pc)
+ $pkgconfig --print-requires "$filename" 2> /dev/null | while read n r v ; do
+ i="`expr $i + 1`"
+ [ $i -eq 1 ] && echo "pkgconfig"
+ echo "pkgconfig($n)" "$r" "$v"
+ done
+ esac
+ done
+ ;;
+esac
+exit 0