Compare commits

...

10 Commits

Author SHA1 Message Date
Tom G. Christensen
78e516ad61 Add support for lzma compressed tar archives 2019-06-02 09:22:41 +02:00
Tom G. Christensen
3cd10f85d4 Make pkgdef filename a global variable 2019-05-31 10:16:46 +02:00
Tom G. Christensen
7eb78af9ae Update copyright years 2019-05-30 11:16:49 +02:00
Tom G. Christensen
d38443871c Enable passing options to make in generic_build() 2019-05-30 11:12:18 +02:00
Tom G. Christensen
fe7f6cb97e Add support for lz compressed tar archives 2018-04-14 14:08:25 +02:00
Tom G. Christensen
f95e226c80 Update urls in license text 2018-04-09 20:37:52 +02:00
Tom G. Christensen
27e745bc1c Update copyright years 2018-04-09 20:31:40 +02:00
Tom G. Christensen
6e408949ea Make gnu symlink creation work again
Since the default configure_args is now expanded immediately it cannot depend
on variables defined later.
To fix this for users of gnu_link_progs another API change is necessary.

gnu_link_progs is now a private array of programs to link. The
private gnu_link function is renamed do_gnu_link. A new public function
named gnu_link is added which handles populating gnu_link_progs and
modifying configure_args.
2013-10-10 16:16:33 +02:00
Tom G. Christensen
6620dc6854 build.sh.functions: use build_arch in logfile name 2013-09-21 18:11:38 +02:00
Tom G. Christensen
6750c1f90d buildpkg.functions: change how pkgdirdesig and topinstalldir is defined
Instead of defining pkgdirdesig using topinstalldir do it the other way
around.
2013-09-21 11:58:36 +02:00
6 changed files with 53 additions and 37 deletions

View File

@ -1,7 +1,7 @@
GNU GENERAL PUBLIC LICENSE
Version 3, 29 June 2007
Copyright (C) 2007 Free Software Foundation, Inc. <http://fsf.org/>
Copyright (C) 2007 Free Software Foundation, Inc. <https://fsf.org/>
Everyone is permitted to copy and distribute verbatim copies
of this license document, but changing it is not allowed.
@ -645,7 +645,7 @@ the "copyright" line and a pointer to where the full notice is found.
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
along with this program. If not, see <https://www.gnu.org/licenses/>.
Also add information on how to contact you by electronic and paper mail.
@ -664,11 +664,11 @@ might be different; for a GUI interface, you would use an "about box".
You should also get your employer (if you work as a programmer) or school,
if any, to sign a "copyright disclaimer" for the program, if necessary.
For more information on this, and how to apply and follow the GNU GPL, see
<http://www.gnu.org/licenses/>.
<https://www.gnu.org/licenses/>.
The GNU General Public License does not permit incorporating your program
into proprietary programs. If your program is a subroutine library, you
may consider it more useful to permit linking proprietary applications with
the library. If this is what you want to do, use the GNU Lesser General
Public License instead of this License. But first, please read
<http://www.gnu.org/philosophy/why-not-lgpl.html>.
<https://www.gnu.org/licenses/why-not-lgpl.html>.

View File

@ -1,7 +1,7 @@
# Function library for buildpkg build.sh
# This is only for build.sh helper functions.
# Copyright (C) 2003 Jens Henrik Leonhard Jensen
# Copyright (C) 2003-2013 Tom G. Christensen <tgc@jupiterrise.com>
# Copyright (C) 2003-2019 Tom G. Christensen <tgc@jupiterrise.com>
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
@ -14,7 +14,7 @@
# GNU General Public License for more details.
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
# along with this program. If not, see <https://www.gnu.org/licenses/>.
# Written by Tom G. Christensen <tgc@jupiterrise.com>.
@ -88,7 +88,7 @@ timestamp()
log_start()
{
local func=$1
build_sh_logfile=${topdir}-${version}_${pkgver}-${os}-${arch}-${func}-$(timestamp).log
build_sh_logfile=${topdir}-${version}_${pkgver}-${os}-${build_arch}-${func}-$(timestamp).log
if [ $autolog -eq 1 ]; then
if [ -z "$(${__expr} "$nolog" : ".*\($func\)")" ]; then

View File

@ -1,5 +1,5 @@
# Global function library for buildpkg
# Copyright (C) 2003-2013 Tom G. Christensen <tgc@jupiterrise.com>
# Copyright (C) 2003-2019 Tom G. Christensen <tgc@jupiterrise.com>
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
@ -12,7 +12,7 @@
# GNU General Public License for more details.
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
# along with this program. If not, see <https://www.gnu.org/licenses/>.
# Written by Tom G. Christensen <tgc@jupiterrise.com>.
@ -67,7 +67,8 @@ topsrcdir=$topdir-$version # it may be necessary to override this
srcfiles=$buildpkgbase/srcfiles
topinstalldir=/usr/tgcware
pkgdirdesig=tgcware # topinstalldir suffix
topinstalldir=/usr/$pkgdirdesig
prefix=$topinstalldir
metainstalldir=$topinstalldir
@ -100,8 +101,6 @@ pkgprefix=SB
pkgname=$pkgprefix$topdir # overriding this will be common
name=$topdir # as will this ditto
pkgdirdesig=${topinstalldir##/*/} # topinstalldir suffix
# Functionality controls
symlinkman=0 # Don't replace .so linking with symlinks pr. default
symlinkman_verbose=0 # Be quiet
@ -153,6 +152,8 @@ patch_prefix="-p1"
gnu_prefix=g
# GNU dir
_gnudir=gnu
# Add --program-prefix to configure if gnu_link is requested?
gnu_configure=1
# Distfiles should be named like this
# <name>-<version>-<pkgver>.sb-<os>-<cpu>-<pkgdirdesig>
@ -397,7 +398,7 @@ get_files()
# unpack(): Unpack source
# params: $1 = source number (arrayindex)
# It will detect filetype and unpack
# .tar, .tgz, .gz, .bz2, .xz, .zip and .Z supported
# .tar, .tgz, .gz, .bz2, .xz, .lzma, .zip and .Z supported
unpack()
{
local source=${source[$1]}
@ -434,7 +435,8 @@ unpack()
'bz2') ${__bzip2} -dc $absfile | ${__tar} -xf -;;
'Z') ${__gzip} -dc $absfile | ${__tar} -xf -;;
'tgz') ${__gzip} -dc $absfile | ${__tar} -xf -;;
'xz') ${__xz} -dc $absfile | ${__tar} -xf -;;
'xz'|'lzma') ${__xz} -dc $absfile | ${__tar} -xf -;;
'lz') ${__lzip} -dc $absfile | ${__tar} -xf -;;
'zip') ${__unzip} -q $absfile;;
*) error $E_BAD_COMPRESS unpack
esac
@ -765,25 +767,39 @@ check_changelog()
fi
}
# gnu_link: Setup links in $prefix/$_gnudir
# do_gnu_link: Create symlinks in $prefix/$_gnudir
# params: list of programs to link
# For each program given, create a symlink from $prefix/${_bindir}/program to
# $prefix/gnu with the first character stripped from the name
gnu_link()
do_gnu_link()
{
local program
${__mkdir} -p ${stagedir}${prefix}/$_gnudir
setdir ${stagedir}${prefix}/$_gnudir
cd ${stagedir}${prefix}/$_gnudir
for program in $@
do
local dest=${program:1}
echo "Linking $prefix/${_bindir}/$program to $prefix/$_gnudir/$dest"
${__ln_s} ../${_bindir}/$program ${program:1}
${__ln_s} ../${_bindir}/$program ${dest}
done
}
# gnu_link: Prepare for gnu symlink setup
# params: list of programs to link
# Each param is added to the internal gnu_link_progs array
# It will also add --program-prefix=$gnu_prefix to configure_args if requested
gnu_link()
{
local item
for item in "$@"
do
gnu_link_progs+=($item)
done
[ $gnu_configure -eq 1 ] && configure_args=(--program-prefix=$gnu_prefix "${configure_args[@]}")
}
#####################################################
# Define generic functions for different build stages
#####################################################
@ -845,7 +861,7 @@ generic_build()
if [ $? -ne 0 ]; then
error $E_BAD_CONFIG generic_build
fi
${__make} $(_upls $make_build_target)
${__make} ${make_build_opts} $(_upls $make_build_target)
if [ $? -ne 0 ]; then
error $E_BAD_MAKE generic_build
fi
@ -935,13 +951,11 @@ generic_install()
if [ $autonuke -eq 1 ]; then
do_autonuke
fi
if [ -n "$gnu_link_progs" ]; then
# There are programs that should be linked to $prefix/$_gnudir
local prog
for prog in $gnu_link_progs; do
gnu_link ${gnu_prefix}${prog}
done
fi
# If there are programs that should be linked to $prefix/$_gnudir
local prog
for prog in "${gnu_link_progs[@]}"; do
do_gnu_link ${gnu_prefix}${prog}
done
}
# generic_install_perl(): Install already built perl module

View File

@ -1,6 +1,6 @@
# Function library for buildpkg framework
# It adds support for creating Irix packages in 'inst' format
# Copyright (C) 2003-2013 Tom G. Christensen <tgc@jupiterrise.com>
# Copyright (C) 2003-2019 Tom G. Christensen <tgc@jupiterrise.com>
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
@ -13,7 +13,7 @@
# GNU General Public License for more details.
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
# along with this program. If not, see <https://www.gnu.org/licenses/>.
# Written by Tom G. Christensen <tgc@jupiterrise.com>.

View File

@ -1,6 +1,6 @@
# Function library for buildpkg framework
# It adds support for creating Solaris packages in 'sysv' format
# Copyright (C) 2003-2013 Tom G. Christensen <tgc@jupiterrise.com>
# Copyright (C) 2003-2019 Tom G. Christensen <tgc@jupiterrise.com>
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
@ -13,7 +13,7 @@
# GNU General Public License for more details.
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
# along with this program. If not, see <https://www.gnu.org/licenses/>.
# Written by Tom G. Christensen <tgc@jupiterrise.com>.
@ -96,7 +96,7 @@ _mandir=share/man
_infodir=share/info
# Default configure args
configure_args=(${gnu_link_progs:+--program-prefix=$gnu_prefix} --prefix=$prefix --mandir=${prefix}/${_mandir} --infodir=${prefix}/${_infodir})
configure_args=(--prefix=$prefix --mandir=${prefix}/${_mandir} --infodir=${prefix}/${_infodir})
# Host specific configuration
[ -r $buildpkgscripts/config.`hostname`.solaris ] && . $buildpkgscripts/config.`hostname`.solaris
@ -108,6 +108,12 @@ configure_args=(${gnu_link_progs:+--program-prefix=$gnu_prefix} --prefix=$prefix
# evaluated (using _upls)
distfile='$secname-$version-$secver.tgc-$os-$build_arch-$pkgdirdesig'
# What pkgdef file to use
pkgdef_file=pkgdef
# Check and see if there is an arch specific pkgdef file
[ -r $metadir/pkgdef.$arch ] && pkgdef_file=pkgdef.$arch
[ -r $metadir/pkgdef.$build_arch ] && pkgdef_file=pkgdef.$build_arch
#####################################################
# "external" functions
#####################################################
@ -659,7 +665,7 @@ auto_deps()
done >> $metadir/depend.$secname.auto
}
# parse_pkgdef(): Read in $metadir/pkgdef
# parse_pkgdef(): Read in $metadir/$pkgdef_file
# params: none
# This will parse the package descriptions in
# pkgdef that tells us how many packages there
@ -673,11 +679,6 @@ parse_def()
local legalend=0
local hasaddedpkginfo=0
local condexpr=""
local pkgdef_file=pkgdef
# Check and see if there is an arch specific pkgdef file
[ -r $metadir/pkgdef.$arch ] && pkgdef_file=pkgdef.$arch
[ -r $metadir/pkgdef.$build_arch ] && pkgdef_file=pkgdef.$build_arch
while read line
do

View File

@ -9,6 +9,7 @@ __vtar=/usr/bin/tar # vendor supplied tar
__bzip2=/usr/tgcware/bin/bzip2
__gzip=/usr/tgcware/bin/gzip
__xz=/usr/tgcware/bin/xz
__lzip=/usr/tgcware/bin/lzip
__patch=/usr/tgcware/bin/patch # GNU patch 2.5 or better please!
__rm=/usr/bin/rm
__rmdir=/usr/bin/rmdir