[opensuse-packaging] Handling license symlinks
Hello, creating the symlink to licenses in the licenses package is curently done by including a small script in each spec file, like: for FILE in COPYING copyright.txt ; 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 This is error-prone (see bug 306681) and adds lots of duplicated code to the spec files. Please add a small script to the licenses package or create a rpm macro that creates the symlink. If the rpm macro could also drop in a "Requires: licenses", it would be even better. The specfile should then contain commands like (replacing the example above): %symlink_license COPYING %symlink_license copyright.txt Oh, and please do this ASAP, before more package(r)s include the script in the spec file ;-) Regards, Christian Boltz -- 31.8.-3.9.2007: Weinfest und Jubiläum 1225 Jahre Insheim Pig Slip, Hifi-Delity, Human Fact, Frank Petersen und die Söhne Insheims spielen bei der Landjugend. Mehr Infos: www.Landjugend-Insheim.de --------------------------------------------------------------------- To unsubscribe, e-mail: opensuse-packaging+unsubscribe@opensuse.org For additional commands, e-mail: opensuse-packaging+help@opensuse.org
On 2007-08-31 14:13:34 +0200, Christian Boltz wrote:
creating the symlink to licenses in the licenses package is curently done by including a small script in each spec file, like:
for FILE in COPYING copyright.txt ; 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
This is error-prone (see bug 306681) and adds lots of duplicated code to the spec files.
Please add a small script to the licenses package or create a rpm macro that creates the symlink. If the rpm macro could also drop in a "Requires: licenses", it would be even better.
The specfile should then contain commands like (replacing the example above):
%symlink_license COPYING %symlink_license copyright.txt
Oh, and please do this ASAP, before more package(r)s include the script in the spec file ;-)
what bugnumber is that? darix -- openSUSE - SUSE Linux is my linux openSUSE is good for you www.opensuse.org --------------------------------------------------------------------- To unsubscribe, e-mail: opensuse-packaging+unsubscribe@opensuse.org For additional commands, e-mail: opensuse-packaging+help@opensuse.org
Christian Boltz wrote:
Hello,
creating the symlink to licenses in the licenses package is curently done by including a small script in each spec file, like:
for FILE in COPYING copyright.txt ; 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
This is error-prone (see bug 306681) and adds lots of duplicated code to the spec files.
Please add a small script to the licenses package or create a rpm macro that creates the symlink. If the rpm macro could also drop in a "Requires: licenses", it would be even better.
We already tried to solve this issue. The problem is (also) that there is no known list of license filenames (COPYING, copyright.txt, Copyright.txt, COPYING.english ...) Anyway, I'd be still for having the macro, probably two of them: 1.) automatic macro that tries known filenames 2.) manual macro that expects filenames as a parameter Adding or checking whether RPM requires 'licenses' would be very nice! ;) Bye Lukas
On 2007-08-31 14:20:21 +0200, Lukas Ocilka wrote:
Date: Fri, 31 Aug 2007 14:20:21 +0200 From: Lukas Ocilka <lukas.ocilka@suse.cz> Subject: Re: [opensuse-packaging] Handling license symlinks To: Christian Boltz <opensuse@cboltz.de> Cc: opensuse-packaging@opensuse.org X-DSPAM-Result: Innocent X-DSPAM-Confidence: 0.9906 X-DSPAM-Probability: 0.0000
Christian Boltz wrote:
Hello,
creating the symlink to licenses in the licenses package is curently done by including a small script in each spec file, like:
for FILE in COPYING copyright.txt ; 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
This is error-prone (see bug 306681) and adds lots of duplicated code to the spec files.
Please add a small script to the licenses package or create a rpm macro that creates the symlink. If the rpm macro could also drop in a "Requires: licenses", it would be even better.
We already tried to solve this issue. The problem is (also) that there is no known list of license filenames (COPYING, copyright.txt, Copyright.txt, COPYING.english ...)
Anyway, I'd be still for having the macro, probably two of them:
1.) automatic macro that tries known filenames 2.) manual macro that expects filenames as a parameter
Adding or checking whether RPM requires 'licenses' would be very nice!
we could run md5sum on all files in the documentation directory of the package and compare those against the known licenses md5sums. should be easy with a simple perl/python script. darix -- openSUSE - SUSE Linux is my linux openSUSE is good for you www.opensuse.org --------------------------------------------------------------------- To unsubscribe, e-mail: opensuse-packaging+unsubscribe@opensuse.org For additional commands, e-mail: opensuse-packaging+help@opensuse.org
* Christian Boltz (opensuse@cboltz.de) [20070831 14:14]: How about this (untestet): %license_req "Requires: licenses" # %{symlink_licenses file1 file2 file3 ...} %symlink_licenses \ for FILE in %{?*}; 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 Philipp --------------------------------------------------------------------- To unsubscribe, e-mail: opensuse-packaging+unsubscribe@opensuse.org For additional commands, e-mail: opensuse-packaging+help@opensuse.org
On Friday, 31. August 2007, Philipp Thomas wrote:
How about this (untestet):
a) buildrequires licenses missing b) the %doc macro runs after postinstall scripts, so one still has to update the %doc macro specs an easier fix would be to add a post-prep script hook that will just replace "COPYING" in the source dir with a symlink, so that %doc just copies the symlink into the package. Greetings, Dirk --------------------------------------------------------------------- To unsubscribe, e-mail: opensuse-packaging+unsubscribe@opensuse.org For additional commands, e-mail: opensuse-packaging+help@opensuse.org
On Aug 31, 07 15:04:30 +0200, Dirk Mueller wrote:
On Friday, 31. August 2007, Philipp Thomas wrote:
How about this (untestet):
a) buildrequires licenses missing b) the %doc macro runs after postinstall scripts, so one still has to update the %doc macro specs
an easier fix would be to add a post-prep script hook that will just replace "COPYING" in the source dir with a symlink, so that %doc just copies the symlink into the package.
I am currently undecided, weather the licenses package is a good idea at all. I started the licenses package, to have a centralized directory, where all licenses in a product can be found. Unfortunatly licenses package currently populates /usr/share/doc/licenses with all licenses in the distribution, without revealing which licenses belong to installed and available packages. Unfortunatly, this licenses package is error prone. Not very probable, but with possbile severe effects: if a package has a symlink for GPL, but this link is dangling, we violate the GPL. Does anybody know if the licenses package had a space saving effect on the media? Any tears if we roll back to the state we had before? cheers, Jw. -- o \ Juergen Weigert paint it green! __/ _=======.=======_ <V> | jw@suse.de wide open suse_/ _---|____________\/ \ | 0911 74053-508 (tm)__/ (____/ /\ (/) | __________________________/ _/ \_ vim:set sw=2 wm=8 SUSE LINUX Products GmbH, GF: Markus Rex, HRB 16746 (AG Nuernberg) "This bug is visible to non-employees. Please be respectful." (bugzilla) --------------------------------------------------------------------- To unsubscribe, e-mail: opensuse-packaging+unsubscribe@opensuse.org For additional commands, e-mail: opensuse-packaging+help@opensuse.org
On Mon, 3 Sep 2007, Juergen Weigert wrote:
On Aug 31, 07 15:04:30 +0200, Dirk Mueller wrote:
On Friday, 31. August 2007, Philipp Thomas wrote:
How about this (untestet):
a) buildrequires licenses missing b) the %doc macro runs after postinstall scripts, so one still has to update the %doc macro specs
an easier fix would be to add a post-prep script hook that will just replace "COPYING" in the source dir with a symlink, so that %doc just copies the symlink into the package.
I am currently undecided, weather the licenses package is a good idea at all. I started the licenses package, to have a centralized directory, where all licenses in a product can be found.
Unfortunatly licenses package currently populates /usr/share/doc/licenses with all licenses in the distribution, without revealing which licenses belong to installed and available packages.
Unfortunatly, this licenses package is error prone. Not very probable, but with possbile severe effects: if a package has a symlink for GPL, but this link is dangling, we violate the GPL.
Does anybody know if the licenses package had a space saving effect on the media?
Any tears if we roll back to the state we had before?
Well, I proposed to handle this problem with rpm provides / requires. That is, licenses should provide license-$MD5 for all licenses it includes and a package with the symlink should require this. That way no dangling symlink can happen unless you install with --nodeps. Richard. --------------------------------------------------------------------- To unsubscribe, e-mail: opensuse-packaging+unsubscribe@opensuse.org For additional commands, e-mail: opensuse-packaging+help@opensuse.org
Richard Guenther wrote:
On Mon, 3 Sep 2007, Juergen Weigert wrote:
... Unfortunatly, this licenses package is error prone. Not very probable, but with possbile severe effects: if a package has a symlink for GPL, but this link is dangling, we violate the GPL.
Does anybody know if the licenses package had a space saving effect on the media?
Any tears if we roll back to the state we had before?
Well, I proposed to handle this problem with rpm provides / requires. That is, licenses should provide license-$MD5 for all licenses it includes and a package with the symlink should require this. That way no dangling symlink can happen unless you install with --nodeps.
Libzypp supports --nodeps as a fallback solution for installing RPMs. First, it, of course, tries to install an RPM in a normal way, then libzypp tries that with --nodeps automatically. So even our package manager is able to install such package without installing licenses.rpm. Lukas
On Mon, Sep 03, 2007 at 01:05:56PM +0200, Lukas Ocilka wrote:
Libzypp supports --nodeps as a fallback solution for installing RPMs. First, it, of course, tries to install an RPM in a normal way, then libzypp tries that with --nodeps automatically.
Huh, isn't that already fixed? libzypp must install all rpms with '--force --nodeps' right from the start. Cheers, Michael. -- Michael Schroeder mls@suse.de SUSE LINUX Products GmbH, GF Markus Rex, HRB 16746 AG Nuernberg main(_){while(_=~getchar())putchar(~_-1/(~(_|32)/13*2-11)*13);} --------------------------------------------------------------------- To unsubscribe, e-mail: opensuse-packaging+unsubscribe@opensuse.org For additional commands, e-mail: opensuse-packaging+help@opensuse.org
On Monday, 3. September 2007, Lukas Ocilka wrote:
Libzypp supports --nodeps as a fallback solution for installing RPMs. First, it, of course, tries to install an RPM in a normal way, then libzypp tries that with --nodeps automatically.
Thats not a reason. we rely on package dependencies already for other licensing issues, and this would be no different. otherwise you could also say that if a user installs all his pacakges with all files but the COPYING file would also be a licensing violation. -- RPMLINT information under http://en.opensuse.org/Packaging/RpmLint --------------------------------------------------------------------- To unsubscribe, e-mail: opensuse-packaging+unsubscribe@opensuse.org For additional commands, e-mail: opensuse-packaging+help@opensuse.org
On Sep 03, 07 13:39:30 +0200, Dirk Mueller wrote:
On Monday, 3. September 2007, Lukas Ocilka wrote:
Libzypp supports --nodeps as a fallback solution for installing RPMs. First, it, of course, tries to install an RPM in a normal way, then libzypp tries that with --nodeps automatically.
Thats not a reason. we rely on package dependencies already for other licensing issues, and this would be no different.
Which other issues would that be?
otherwise you could also say that if a user installs all his pacakges with all files but the COPYING file would also be a licensing violation.
A distributor must ship the COPYING file, a user may ignore it. If our default installers fail to install it, then we may have a GPL violation. If a user explicitly disables its installation, he is fine. cheers, JW. -- o \ Juergen Weigert paint it green! __/ _=======.=======_ <V> | jw@suse.de wide open suse_/ _---|____________\/ \ | 0911 74053-508 (tm)__/ (____/ /\ (/) | __________________________/ _/ \_ vim:set sw=2 wm=8 SUSE LINUX Products GmbH, GF: Markus Rex, HRB 16746 (AG Nuernberg) "This bug is visible to non-employees. Please be respectful." (bugzilla) --------------------------------------------------------------------- To unsubscribe, e-mail: opensuse-packaging+unsubscribe@opensuse.org For additional commands, e-mail: opensuse-packaging+help@opensuse.org
On Monday, 3. September 2007, Juergen Weigert wrote:
Does anybody know if the licenses package had a space saving effect on the media?
Well, the GPL roughly takes 3kb of space per rpm on the media. out of a default KDE installation, exactly 256 packages ship a copy of GPL, eating roughly 768kb of space on the media. the licenses packages is 432kb in size. So assuming that all those 256 packages would be fixed (noone fixes them currently, not even all the yast2 packages which contain COPYING twice are fixed even though I filed a bugreport a couple of months ago), we could save 336kb of space. thats not an awful lot, given that we have packages on the CD where we could save 5MB with a blink of an eye. Greetings, Dirk -- RPMLINT information under http://en.opensuse.org/Packaging/RpmLint --------------------------------------------------------------------- To unsubscribe, e-mail: opensuse-packaging+unsubscribe@opensuse.org For additional commands, e-mail: opensuse-packaging+help@opensuse.org
On Mon, 3 Sep 2007, Dirk Mueller wrote:
On Monday, 3. September 2007, Juergen Weigert wrote:
Does anybody know if the licenses package had a space saving effect on the media?
Well, the GPL roughly takes 3kb of space per rpm on the media. out of a default KDE installation, exactly 256 packages ship a copy of GPL, eating roughly 768kb of space on the media.
the licenses packages is 432kb in size. So assuming that all those 256 packages would be fixed (noone fixes them currently, not even all the yast2 packages which contain COPYING twice are fixed even though I filed a bugreport a couple of months ago), we could save 336kb of space.
thats not an awful lot, given that we have packages on the CD where we could save 5MB with a blink of an eye.
Note that at the moment we ship a lot of packages without any license in (one of) the RPM(s) at all. Which is worse(?), so I don't see a problem but a chance in the license package to fix this issue as well. Richard. --------------------------------------------------------------------- To unsubscribe, e-mail: opensuse-packaging+unsubscribe@opensuse.org For additional commands, e-mail: opensuse-packaging+help@opensuse.org
not even all the yast2 packages which contain COPYING twice are fixed even though I filed a bugreport a couple of months ago),
Bug #? Pardon me my ignorance, but I haven't see any such bug although I maintain 5+ YaST packages B. -- \\\\\ Katarina Machalkova \\\\\\\__o YaST developer __\\\\\\\'/_ & hedgehog painter
On Tue, Sep 25, 2007 at 10:13:41AM +0200, Bubli wrote:
not even all the yast2 packages which contain COPYING twice are fixed even though I filed a bugreport a couple of months ago),
Bug #? Pardon me my ignorance, but I haven't see any such bug although I maintain 5+ YaST packages
https://bugzilla.novell.com/show_bug.cgi?id=299144 "yast2* packages contain both COPYING and COPYRIGHT.english" I will apply the fix after 10.3. -- Martin Vidner, YaST developer http://en.opensuse.org/User:Mvidner Kuracke oddeleni v restauraci je jako fekalni oddeleni v bazenu --------------------------------------------------------------------- To unsubscribe, e-mail: opensuse-packaging+unsubscribe@opensuse.org For additional commands, e-mail: opensuse-packaging+help@opensuse.org
Hello, on Montag, 3. September 2007, Juergen Weigert wrote: [...]
I am currently undecided, weather the licenses package is a good idea at all. I started the licenses package, to have a centralized directory, where all licenses in a product can be found.
Unfortunatly licenses package currently populates /usr/share/doc/licenses with all licenses in the distribution, without revealing which licenses belong to installed and available packages.
Unfortunatly, this licenses package is error prone. Not very probable, but with possbile severe effects: if a package has a symlink for GPL, but this link is dangling, we violate the GPL.
Does anybody know if the licenses package had a space saving effect on the media?
I just run awk on ARCHIVES.gz from Factory. All files with "LICENSE" or "COPYING" in the name and arch "i586" or "noarch" (3371 files) take a total of 58,265,259 bytes = 58 MB in the installed system. In comparison, /usr/share/doc/licenses takes about 4 MB. That's theory - you can save several MB. Now to practise: Currently there are 23 symlinks to the licenses package (beta3), so I think that you can't save space _currently_. It needs more packagers switching to symlinks until you see the space-saving effect. And you need an rpm macro to make it easy ("%sylink_license COPYING"). BTW: I don't have ARCHIVES.gz from the single CDs, so you'll have to take out the calculator yourself ;-) Regards, Christian Boltz -- Und früher waren die Winter nicht so kalt wie heute. Der 10er-Turm im Schwimmbad war viel niedriger. Aber ich hatte nachts oft Rückenschmerzen vom vielen Geldsäcke-aus-dem-Fenster-werfen. Gute alte Zeit. [Ratti in suse-linux] --------------------------------------------------------------------- To unsubscribe, e-mail: opensuse-packaging+unsubscribe@opensuse.org For additional commands, e-mail: opensuse-packaging+help@opensuse.org
Juergen Weigert <jw@suse.de> writes:
Any tears if we roll back to the state we had before?
No, not at all. It was a nice experience, but in the end not worth the effort. Just über-engineered. Try to keep it simple, also the packaging process. -- Karl Eichwalder R&D / Documentation SUSE LINUX Products GmbH, GF: Markus Rex, HRB 16746 (AG Nuernberg) --------------------------------------------------------------------- To unsubscribe, e-mail: opensuse-packaging+unsubscribe@opensuse.org For additional commands, e-mail: opensuse-packaging+help@opensuse.org
participants (11)
-
Christian Boltz
-
Dirk Mueller
-
Juergen Weigert
-
Karl Eichwalder
-
Katarina Machalkova
-
Lukas Ocilka
-
Marcus Rueckert
-
Martin Vidner
-
Michael Schroeder
-
Philipp Thomas
-
Richard Guenther