tech-pkg archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: pkg_summary(5), PROVIDES and REQUIRES



 >> Should I send-pr or you?

> Can you please send-pr it?

pkg/42907

How about the following patch?

A few notes about it:
1) \.[0-9]+$ and \.[0-9\.]+$ regexp patterns have been replaced
  with (\.[0-9]+)?$ for obvious reasons
2) libxxx.so symlinks are explicitely removed from PROVIDES
3) Libraries provided by the package itself are explicitely removed from
  REQUIRES.

My tests:
- as a result of 3) lang/perl5 package doesn't generate
  REQUIRES=/usr/pkg/lib/perl5/5.10.0/x86_64-netbsd-thread-multi/CORE/libperl.so
  anymore.
- as a result of 1) and 2) wip/fakeroot now have
  PROVIDES=/usr/pkg/lib/libfakeroot-0.so
- x11/eterm:
  PROVIDES=/usr/pkg/lib/libEterm-0.9.5.so
  ...
- I don't see any regression
    archivers/bzip2:
      PROVIDES=/usr/pkg/lib/libbz2.so.0
      REQUIRES=/usr/lib/libc.so.12
    devel/libmaa:
      PROVIDES=/usr/pkg/lib/libmaa.so.2
      REQUIRES=/usr/lib/libc.so.12
      REQUIRES=/usr/lib/libm.so.0

To me all this looks ok.

Index: mk/flavor/pkg/metadata.mk
===================================================================
RCS file: /cvsroot/pkgsrc/mk/flavor/pkg/metadata.mk,v
retrieving revision 1.32
diff -u -r1.32 metadata.mk
--- mk/flavor/pkg/metadata.mk   24 Jul 2009 06:54:37 -0000      1.32
+++ mk/flavor/pkg/metadata.mk   5 Mar 2010 07:49:57 -0000
@@ -64,11 +64,11 @@
        bins=`${AWK} '/(^|\/)(bin|sbin|libexec)\// { print 
"${DESTDIR}${PREFIX}/" $$0 } END { exit 0 }' ${_PLIST_NOKEYWORDS}`; \
        case ${OBJECT_FMT:Q}"" in                                       \
        ELF)                                                            \
-               libs=`${AWK} '/(^|\/)lib\/lib.*\.so\.[0-9]+$$/ { print 
"${DESTDIR}${PREFIX}/" $$0 } END { exit 0 }' ${_PLIST_NOKEYWORDS}`; \
+               libs=`${AWK} '/(^|\/)lib\/lib.*\.so(\.[0-9]+)?$$/ { print 
"${DESTDIR}${PREFIX}/" $$0 } END { exit 0 }' ${_PLIST_NOKEYWORDS}`; \
                if ${TEST} -n "$$bins" -o -n "$$libs"; then             \
                        requires=`($$ldd $$bins $$libs 2>/dev/null || ${TRUE}) 
| ${AWK} '$$2 == "=>" && $$3 ~ "/" { print $$3 }' | ${SORT} -u`; \
                fi;                                                     \
-               linklibs=`${AWK} '/.*\.so\.[0-9\.]+$$/ { print 
"${DESTDIR}${PREFIX}/" $$0 }' ${_PLIST_NOKEYWORDS}`; \
+               linklibs=`${AWK} '/.*\.so(\.[0-9]+)?$$/ { print 
"${DESTDIR}${PREFIX}/" $$0 }' ${_PLIST_NOKEYWORDS}`; \
                for i in $$linklibs; do                                 \
                        if ${TEST} -r $$i -a ! -x $$i -a ! -h $$i; then \
                                ${TEST} ${PKG_DEVELOPER:Uno:Q}"" = "no" || \
@@ -84,8 +84,12 @@
                fi;                                                     \
                ;;                                                      \
        esac;                                                           \
+       requires=`{ for i in $$requires $$requires; do echo $$i; done; \
+               ${AWK} '{ print "${PREFIX}/" $$0 }' ${_PLIST_NOKEYWORDS}; } | \
+               ${SORT} | uniq -c | awk '$$1 == 2 {print $$2}'`; \
        for i in "" $$libs; do                                          \
                ${TEST} "$$i" != "" || continue;                        \
+               ${TEST} -h "$$i" && echo "$$i" | grep '[.]so$$' > /dev/null && 
continue;        \
                ${ECHO} "PROVIDES=$${i}";                               \
        done | ${SED} -e 's,^PROVIDES=${DESTDIR},PROVIDES=,'            \
                >> ${.TARGET}.tmp;                                      \

 >> P.S.
 >> As for your patches in that email. On different systems shared libraries
 >> has different naming conventions and extension, e.g. HP-UX and Darwin.

> Please send-pr that also. Different PR. Also ideas of using objdump 
> versus ldd versus otool, for example,

AFAIK HP-UX uses the same naming convention for shared libraries as ELF
platforms but with .sl extension. As far as I can see in the code HP-UX
packages don't provide PROVIDES and REQUIRES at all. It would be better
if HP-UX user report PR about it. I just can not check this.

-- 
Best regards, Aleksey Cheusov.


Home | Main Index | Thread Index | Old Index