Libraries NOT stripped by new2dir make install

Please post any bugs you have found
Post Reply
Message
Author
User avatar
OscarTalks
Posts: 2196
Joined: Mon 06 Feb 2012, 00:58
Location: London, England

Libraries NOT stripped by new2dir make install

#1 Post by OscarTalks »

I quite like compiling and creating .pet packages but for years I have found that although the executable binaries get stripped, the shared libraries do not. I have to inspect these files and strip them manually before finally creating my .pet package.

So I am now testing the following possible fix and perhaps others would like to do the same.
In the file /usr/bin/new2dir
Look for the section:-

Code: Select all

#strip the file...
 if [ ! -h "$ONEFILE" ];then #make sure it isn't a symlink
  [ ! "`file "$ONEFILE" | grep 'ELF' | grep 'shared object'`" = "" ] && strip --strip-debug "$ONEFILE"
  [ ! "`file "$ONEFILE" | grep 'ELF' | grep 'executable'`" = "" ] && strip --strip-unneeded "$ONEFILE"
 fi
Change the argument --strip-debug to --strip-unneeded
(Same as the argument being used for executables)
So it looks like this:-

Code: Select all

#strip the file...
 if [ ! -h "$ONEFILE" ];then #make sure it isn't a symlink
  [ ! "`file "$ONEFILE" | grep 'ELF' | grep 'shared object'`" = "" ] && strip --strip-unneeded "$ONEFILE"
  [ ! "`file "$ONEFILE" | grep 'ELF' | grep 'executable'`" = "" ] && strip --strip-unneeded "$ONEFILE"
 fi
The shared (dynamic) libraries installed into your system, plus the copies which will be used to create the .pet or .sfs package should then be already stripped. Right-click and look at properties to verify.
Oscar in England
Image

User avatar
Mike Walsh
Posts: 6351
Joined: Sat 28 Jun 2014, 12:42
Location: King's Lynn, UK.

#2 Post by Mike Walsh »

Thanks for that, Oscar. I, too, have often wondered why packages weren't coming out as small as I felt they ought to have done.

Now we know why......

Cheers for the "detective work", mate! This should work with Trio's PetMaker, too (which I use a lot), since when all's said & done, it's still using the standard Puppy package tools 'under the hood'. Nice one.


Mike. :wink:

Post Reply