libk  Check-in [0a42ee4e26]

Overview
Comment:update install script
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA3-256: 0a42ee4e26e997d1f020ea02234fa14a1b9949f92b139c09140cd2d6501dd6c4
User & Date: lexi on 2020-03-04 06:59:41
Other Links: manifest | tags
Context
2020-03-04
12:47
tweak build infrastructure: global install script now respects prefix in all cases; update PKGBUILD to use install script correctly check-in: b6c435e95a user: lexi tags: trunk
06:59
update install script check-in: 0a42ee4e26 user: lexi tags: trunk
00:03
add Arch Build System build script check-in: c231d33808 user: lexi tags: trunk
Changes

Modified dist/PKGBUILD from [7b18c1e325] to [35af299ffd].

    32     32   	fi
    33     33   
    34     34   	cd "$srcdir/libk"
    35     35   	arch=$kind ./build.sh
    36     36   }
    37     37   
    38     38   package() {
    39         -	if test "$doc" = yes; then
    40         -		install -D "$srcdir/$pkgname/out/doc/html/"* -t "$pkgdir/usr/share/doc/libk/pdf/" 
    41         -		install -D "$srcdir/$pkgname/out/doc/pdf/"* -t "$pkgdir/usr/share/doc/libk/html/" 
    42         -		install -D "$srcdir/$pkgname/out/doc/man/"* -t "$pkgdir/usr/share/man/man3/" 
    43         -	fi
    44         -
    45         -	install -D "$srcdir/$pkgname"/out/{libk.{so,a},kboot.o} -t "$pkgdir/usr/lib/" 
    46         -	install -D "$srcdir/$pkgname/out/k/"* -t "$pkgdir/usr/include/k/" 
           39  +	export fakeroot=yes prefix="$pkgdir" build="$srcdir/$pkgname/out"
           40  +	"$srcdir/$pkgname/install.sh"
           41  +	# if test "$doc" = yes; then
           42  +	# 	install -D "$srcdir/$pkgname/out/doc/html/"* -t "$pkgdir/usr/share/doc/libk/pdf/" 
           43  +	# 	install -D "$srcdir/$pkgname/out/doc/pdf/"* -t "$pkgdir/usr/share/doc/libk/html/" 
           44  +	# 	install -D "$srcdir/$pkgname/out/doc/man/"* -t "$pkgdir/usr/share/man/man3/" 
           45  +	# fi
           46  +    #
           47  +	# install -D "$srcdir/$pkgname"/out/{libk.{so,a},kboot.o} -t "$pkgdir/usr/lib/" 
           48  +	# install -D "$srcdir/$pkgname/out/k/"* -t "$pkgdir/usr/include/k/" 
    47     49   }

Modified install.sh from [df12302eb0] to [e3ee508d22].

     1      1   #!/usr/bin/env bash
     2      2   source global/common.sh
     3      3   
            4  +# TODO: provide "modular" install option to avoid the traditional
            5  +# linux directory hierarchy on systems where this doesn't make sense.
            6  +
     4      7   check "prefix" "a directory to install to"
     5      8   build="${build:-out}"
     6      9   
     7         -bindir="$prefix/bin"
     8         -libdir="$prefix/lib"
           10  +bindir="${bindir:-$prefix/bin}"
           11  +libdir="${libdir:-$prefix/lib}"
     9     12   
    10         -if [ "$prefix" = "/" ]; then
           13  +if test "$prefix" = "/" -o "$fakeroot" = yes; then
    11     14   	say "installing docs and headers into usr instad of /"
    12         -	sharedir="$prefix/usr/share"
    13         -	incdir="$prefix/usr/include"
           15  +	sharedir="${sharedir:-$prefix/usr/share}"
           16  +	incdir="${incdir:-$prefix/usr/include}"
    14     17   else
    15         -	incdir="$prefix/include"
    16         -	sharedir="$prefix/share"
           18  +	incdir="${incdir:-$prefix/include}"
           19  +	sharedir="${sharedir:-$prefix/share}"
    17     20   fi
    18     21   
    19         -say "Starting install."
           22  +say "commencing install"
           23  +say " - prefix: $prefix"
           24  +say " - destinations:"
           25  +say "   * binaries: $bindir"
           26  +say "   * libraries: $libdir"
           27  +say "   * headers: $incdir"
           28  +say "   * shared files: $sharedir"
           29  +
           30  +mkdir -p "$bindir" "$libdir" "$incdir" "$sharedir"
    20     31   
    21     32   # Libraries
    22     33   # These may or may not exist, depending on what library build is done, so check
    23         -say "Installing libraries..."
    24         -[ -e "$build/libk.a" ] && install -Dm644 -t "$libdir" "$build/libk.a"
    25         -[ -e "$build/libk.so" ] && install -Dm644 -t "$libdir" "$build/libk.so"
    26         -[ -e "$build/boot.o" ] && install -Dm644 -t "$libdir/libk" "$build/boot.o"
           34  +say "installing libraries"
           35  +test -e "$build/libk.a"  && install -Dm644 -t "$libdir" "$build/libk.a"
           36  +test -e "$build/libk.so" && install -Dm644 -t "$libdir" "$build/libk.so"
           37  +test -e "$build/kboot.o" && install -Dm644 -t "$libdir" "$build/kboot.o"
    27     38   
    28     39   # Binaries
    29         -say "Installing binaries..."
    30         -install -Dm755 -t "$bindir" "$build/kcore.testbin"
    31         -install -Dm755 -t "$bindir" "$build/kcli.testbin"
           40  +say "installing binaries"
           41  +# *.testbin files should not be installed
    32     42   install -Dm755 -t "$bindir" "$build/kgraft.attach"
    33     43   
    34     44   # Includes
    35         -say "Installing includes..."
           45  +say "installing headers"
    36     46   for inc in "$build"/k/*; do
    37     47   	install -Dm644 -t "$incdir/k" "$inc"
    38     48   done
    39     49   
    40     50   # Documentation
    41         -say "Installing documentation..."
           51  +say "installing documentation"
    42     52   for man in "$build"/doc/man/*; do
    43     53   	install -Dm644 -t "$sharedir/man" "$man"
    44     54   done
    45     55   for html in "$build"/doc/html/*; do
    46     56   	install -Dm644 -t "$sharedir/doc/libk/html" "$html"
    47     57   done
    48     58   for pdf in "$build"/doc/pdf/*; do
    49     59   	install -Dm644 -t "$sharedir/doc/libk/pdf" "$pdf"
    50     60   done
    51         -say "Install done!"
           61  +say "install complete"