#!/bin/bash ############################################################################## # Program: find_aaaelflibpkgs # Purpose: Find contents of Slackware's a/aaa_elflibs package # Author : Stuart Winter with the Perl one-liner # by Jim Hawkins # Date...: 28-Aug-2006 # Version: 1.00 ############################################################################## # You can run this natively on ARMedslack but beware that it'll take # the best part of an hour! (when compiling KDE # simultaneously, anyway ;-) ) # # Usage: ./find_aaaelflibpkgs # # This script will output a file in the $CWD named: # 'x86_slackware_aaa_elflibs_pkg_list.txt' # which is used by aaa_elflibs.SlackBuild. # A list of the symlinks in the real Slackware package is also stored: # 'x86_slackware_aaa_elflibs_symlinks.txt' # The purpose of this is to manually check it against those in the resulting # .tgz for your port. # ############################################################################## CWD=$PWD # Drag in the ARMedslack build kit: we use the config in here to # find out where our real x86 Slackware tree is: source /usr/share/slackdev/buildkit.sh # Make a temporary extraction directory in which we'll explode Slackware's # aaa_elflibs package: TMP=/tmp/aaa-elfdingy rm -rf $TMP mkdir -pm755 $TMP # Unpack the Slackware manifest file - helps speedup the search: MANIFEST=$TMP/MANIFEST bzcat $SLACKSOURCE/../slackware/MANIFEST.bz2 > $MANIFEST # Extract the Slackware aaa_elflibs package so that we can determine its contents: cd $TMP tar zxvvf $SLACKSOURCE/../slackware/a/aaa_elflibs*.tgz # We want know about the symlinks too -- most are versionless symlinks # but there may also be some manually added ones -- we'll check these # later when we manually check over our port's resulting .tgz package: sh install/doinst.sh # Find all executable files: ( find . -type f \( -perm -100 -o -perm -010 -o -perm -001 \) -printf "%P\n" > $TMP/execfiles # Store the symlinks for later perusal: find . -type l -printf "%h/%l --> %P\n" > $CWD/x86_slackware_aaa_elflibs_symlinks.txt # Determine which library files belong to which package: ( cat $TMP/execfiles | while read lib; do cat $MANIFEST | \ perl -e'while (){$p=$1 if/Package: (.*\.tgz)/; print "$p:$ARGV[0]\n" if/\Q$ARGV[0]\E/}' $lib | \ egrep -v -- "aaa_elflibs|-solibs-" done ) | sort | uniq ) > $CWD/x86_slackware_aaa_elflibs_pkg_list.txt # Clean up: rm -rf $TMP