Marcus Rueckert píše v Út 24. 07. 2007 v 17:22 +0200:
> On 2007-07-24 17:08:34 +0200, Lars Vogdt wrote:
> > Am Dienstag, 24. Juli 2007 16:55 schrieb Stanislav Brabec:
> > > This is what I use just now in my packages:
> > >
> > > for FILE in COPYING COPYING.LIB ; do
> > >     MD5SUM=$(md5sum $FILE | sed 's/ .*//')
> > >     if test -f /usr/share/doc/licenses/md5/$MD5SUM ; then
> > >         ln -sf /usr/share/doc/licenses/md5/$MD5SUM $FILE
> > >     fi
> > > done
> > >
> > > If you will replace list in the first line by an argument, you have a
> > > macro.
> > > You can also use "shopt -s nullglob" and add complete list of
> > > possible names.
> > 
> > Thanks Stanislav !
> > Michael: is this something we can add as rpm macro in 10.3 ?
> 
> s/macro/brp-fix/

If it will be done for all packages, then you need to auto add licenses
to Requires, if at least one link was created.

A simple attempt recursively checking docdir (untested):

function link_licenses {
    for FILE in * ; do
        if test -d "$FILE" ; then
            link_licenses "$FILE"/*
        else if ! test -L "$FILE" ; then
            MD5SUM=$(md5sum $FILE | sed 's/ .*//')
            if test -f /usr/share/doc/licenses/md5/$MD5SUM ; then
                requires_licenses=true
                ln -sf /usr/share/doc/licenses/md5/$MD5SUM $FILE
            fi
        fi
    done
}

shopt -s nullglob
requires_licenses=false
link_licenses /var/tmp/.../usr/share/doc/packages
... evaluate $requires_licenses

-- 
Best Regards / S pozdravem,

Stanislav Brabec
software developer
---------------------------------------------------------------------
SUSE LINUX, s. r. o.                          e-mail: [EMAIL PROTECTED]
Lihovarská 1060/12                            tel: +420 284 028 966
190 00 Praha 9                                fax: +420 284 028 951
Czech Republic                                http://www.suse.cz/

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to