added new options field to PKGBUILDs for package-by-package overrides
This commit is contained in:
parent
a10584aec4
commit
d0fb27cef4
3 changed files with 71 additions and 32 deletions
|
@ -20,7 +20,7 @@
|
||||||
# USA.
|
# USA.
|
||||||
#
|
#
|
||||||
|
|
||||||
myver='2.9.7'
|
myver='2.9.8'
|
||||||
|
|
||||||
usage() {
|
usage() {
|
||||||
echo "gensync $myver"
|
echo "gensync $myver"
|
||||||
|
@ -51,6 +51,18 @@ die() {
|
||||||
exit 1
|
exit 1
|
||||||
}
|
}
|
||||||
|
|
||||||
|
check_option() {
|
||||||
|
local i
|
||||||
|
for i in ${options[@]}; do
|
||||||
|
local uc=`echo $i | tr [:lower:] [:upper:]`
|
||||||
|
local lc=`echo $i | tr [:upper:] [:lower:]`
|
||||||
|
if [ "$uc" = "$1" -o "$lc" = "$1" ]; then
|
||||||
|
echo $1
|
||||||
|
return
|
||||||
|
fi
|
||||||
|
done
|
||||||
|
}
|
||||||
|
|
||||||
get_md5checksum()
|
get_md5checksum()
|
||||||
{
|
{
|
||||||
if [ "$pkgdir" != "" ]; then
|
if [ "$pkgdir" != "" ]; then
|
||||||
|
@ -69,7 +81,7 @@ get_md5checksum()
|
||||||
db_write_entry()
|
db_write_entry()
|
||||||
{
|
{
|
||||||
unset pkgname pkgver pkgrel pkgdesc force
|
unset pkgname pkgver pkgrel pkgdesc force
|
||||||
unset groups replaces provides depends conflicts
|
unset groups replaces provides depends conflicts options
|
||||||
source $1 || return 1
|
source $1 || return 1
|
||||||
cd $gstmpdir
|
cd $gstmpdir
|
||||||
mkdir $pkgname-$pkgver-$pkgrel || return 1
|
mkdir $pkgname-$pkgver-$pkgrel || return 1
|
||||||
|
@ -107,7 +119,7 @@ db_write_entry()
|
||||||
done
|
done
|
||||||
echo "" >>desc
|
echo "" >>desc
|
||||||
fi
|
fi
|
||||||
if [ "$force" = "y" -o "$force" = "Y" ]; then
|
if [ "$force" = "y" -o "$force" = "Y" -o "`check_option FORCE`" ]; then
|
||||||
echo "%FORCE%" >>desc
|
echo "%FORCE%" >>desc
|
||||||
echo "" >>desc
|
echo "" >>desc
|
||||||
fi
|
fi
|
||||||
|
|
|
@ -20,11 +20,29 @@
|
||||||
# USA.
|
# USA.
|
||||||
#
|
#
|
||||||
|
|
||||||
myver='2.9.7'
|
myver='2.9.8'
|
||||||
startdir=`pwd`
|
startdir=`pwd`
|
||||||
PKGDEST=$startdir
|
PKGDEST=$startdir
|
||||||
USE_COLOR="n"
|
USE_COLOR="n"
|
||||||
|
|
||||||
|
# Options
|
||||||
|
BUILDSCRIPT="./PKGBUILD"
|
||||||
|
CLEANUP=0
|
||||||
|
CLEANCACHE=0
|
||||||
|
DEP_BIN=0
|
||||||
|
DEP_SRC=0
|
||||||
|
DEP_SUDO=0
|
||||||
|
FORCE=0
|
||||||
|
GENMD5=0
|
||||||
|
INSTALL=0
|
||||||
|
KEEPDOCS=0
|
||||||
|
NOBUILD=0
|
||||||
|
NOCCACHE=0
|
||||||
|
NODEPS=0
|
||||||
|
NOEXTRACT=0
|
||||||
|
NOSTRIP=0
|
||||||
|
RMDEPS=0
|
||||||
|
|
||||||
# source Arch's abs.conf if it's present
|
# source Arch's abs.conf if it's present
|
||||||
[ -f /etc/abs/abs.conf ] && source /etc/abs/abs.conf
|
[ -f /etc/abs/abs.conf ] && source /etc/abs/abs.conf
|
||||||
|
|
||||||
|
@ -72,6 +90,18 @@ strip_url() {
|
||||||
echo $1 | sed 's|^.*://.*/||g'
|
echo $1 | sed 's|^.*://.*/||g'
|
||||||
}
|
}
|
||||||
|
|
||||||
|
check_option() {
|
||||||
|
local i
|
||||||
|
for i in ${options[@]}; do
|
||||||
|
local uc=`echo $i | tr [:lower:] [:upper:]`
|
||||||
|
local lc=`echo $i | tr [:upper:] [:lower:]`
|
||||||
|
if [ "$uc" = "$1" -o "$lc" = "$1" ]; then
|
||||||
|
echo $1
|
||||||
|
return
|
||||||
|
fi
|
||||||
|
done
|
||||||
|
}
|
||||||
|
|
||||||
checkdeps() {
|
checkdeps() {
|
||||||
local missdep=""
|
local missdep=""
|
||||||
local deplist=""
|
local deplist=""
|
||||||
|
@ -219,24 +249,6 @@ usage() {
|
||||||
echo
|
echo
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
# Options
|
|
||||||
BUILDSCRIPT="./PKGBUILD"
|
|
||||||
CLEANUP=0
|
|
||||||
CLEANCACHE=0
|
|
||||||
DEP_BIN=0
|
|
||||||
DEP_SRC=0
|
|
||||||
DEP_SUDO=0
|
|
||||||
FORCE=0
|
|
||||||
GENMD5=0
|
|
||||||
INSTALL=0
|
|
||||||
NOBUILD=0
|
|
||||||
NOCCACHE=0
|
|
||||||
NODEPS=0
|
|
||||||
NOEXTRACT=0
|
|
||||||
NOSTRIP=0
|
|
||||||
RMDEPS=0
|
|
||||||
|
|
||||||
ARGLIST=$@
|
ARGLIST=$@
|
||||||
|
|
||||||
while [ "$#" -ne "0" ]; do
|
while [ "$#" -ne "0" ]; do
|
||||||
|
@ -335,6 +347,7 @@ fi
|
||||||
|
|
||||||
unset pkgname pkgver pkgrel pkgdesc url license groups provides md5sums force
|
unset pkgname pkgver pkgrel pkgdesc url license groups provides md5sums force
|
||||||
unset replaces depends conflicts backup source install build makedepends
|
unset replaces depends conflicts backup source install build makedepends
|
||||||
|
unset options
|
||||||
# some applications (eg, blackbox) will not build with some languages
|
# some applications (eg, blackbox) will not build with some languages
|
||||||
unset LC_ALL LANG
|
unset LC_ALL LANG
|
||||||
umask 0022
|
umask 0022
|
||||||
|
@ -573,7 +586,6 @@ else
|
||||||
exit 0
|
exit 0
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
|
||||||
if [ "`id -u`" = "0" ]; then
|
if [ "`id -u`" = "0" ]; then
|
||||||
# chown all source files to root.root
|
# chown all source files to root.root
|
||||||
chown -R root.root $startdir/src
|
chown -R root.root $startdir/src
|
||||||
|
@ -613,11 +625,14 @@ if [ $? -gt 0 ]; then
|
||||||
exit 2
|
exit 2
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# remove info/doc files
|
if [ ! "`check_option KEEPDOCS`" -a "$KEEPDOCS" = "0" ]; then
|
||||||
cd $startdir
|
# remove info/doc files
|
||||||
rm -rf pkg/usr/info pkg/usr/share/info
|
msg "Removing info/doc files..."
|
||||||
rm -rf pkg/usr/doc pkg/usr/share/doc
|
cd $startdir
|
||||||
rm -rf pkg/{usr,opt/gnome}/share/gtk-doc
|
rm -rf pkg/usr/info pkg/usr/share/info
|
||||||
|
rm -rf pkg/usr/doc pkg/usr/share/doc
|
||||||
|
rm -rf pkg/{usr,opt/gnome}/share/gtk-doc
|
||||||
|
fi
|
||||||
|
|
||||||
# move /usr/share/man files to /usr/man
|
# move /usr/share/man files to /usr/man
|
||||||
if [ -d pkg/usr/share/man ]; then
|
if [ -d pkg/usr/share/man ]; then
|
||||||
|
@ -652,7 +667,7 @@ done
|
||||||
cd $startdir
|
cd $startdir
|
||||||
|
|
||||||
# strip binaries
|
# strip binaries
|
||||||
if [ "$NOSTRIP" = "0" ]; then
|
if [ ! "`check_option NOSTRIP`" -a "$NOSTRIP" = "0" ]; then
|
||||||
msg "Stripping debugging symbols from libraries..."
|
msg "Stripping debugging symbols from libraries..."
|
||||||
find pkg/{,usr,usr/local,opt/*}/lib -type f -not -name "*.dll" -not -name "*.exe" \
|
find pkg/{,usr,usr/local,opt/*}/lib -type f -not -name "*.dll" -not -name "*.exe" \
|
||||||
-exec /usr/bin/strip --strip-debug '{}' \; 2>&1 \
|
-exec /usr/bin/strip --strip-debug '{}' \; 2>&1 \
|
||||||
|
|
|
@ -21,7 +21,7 @@
|
||||||
# USA.
|
# USA.
|
||||||
#
|
#
|
||||||
|
|
||||||
myver='2.9.7'
|
myver='2.9.8'
|
||||||
|
|
||||||
usage() {
|
usage() {
|
||||||
echo "updatesync $myver"
|
echo "updatesync $myver"
|
||||||
|
@ -54,6 +54,18 @@ die()
|
||||||
exit 1
|
exit 1
|
||||||
}
|
}
|
||||||
|
|
||||||
|
check_option() {
|
||||||
|
local i
|
||||||
|
for i in ${options[@]}; do
|
||||||
|
local uc=`echo $i | tr [:lower:] [:upper:]`
|
||||||
|
local lc=`echo $i | tr [:upper:] [:lower:]`
|
||||||
|
if [ "$uc" = "$1" -o "$lc" = "$1" ]; then
|
||||||
|
echo $1
|
||||||
|
return
|
||||||
|
fi
|
||||||
|
done
|
||||||
|
}
|
||||||
|
|
||||||
get_md5checksum()
|
get_md5checksum()
|
||||||
{
|
{
|
||||||
if [ "$pkgdir" != "" ]; then
|
if [ "$pkgdir" != "" ]; then
|
||||||
|
@ -72,7 +84,7 @@ get_md5checksum()
|
||||||
db_write_entry()
|
db_write_entry()
|
||||||
{
|
{
|
||||||
unset pkgname pkgver pkgrel pkgdesc force
|
unset pkgname pkgver pkgrel pkgdesc force
|
||||||
unset groups replaces provides depends conflicts
|
unset groups replaces provides depends conflicts options
|
||||||
source $1 || return 1
|
source $1 || return 1
|
||||||
cd $ustmpdir
|
cd $ustmpdir
|
||||||
mkdir $pkgname-$pkgver-$pkgrel || return 1
|
mkdir $pkgname-$pkgver-$pkgrel || return 1
|
||||||
|
@ -110,7 +122,7 @@ db_write_entry()
|
||||||
done
|
done
|
||||||
echo "" >>desc
|
echo "" >>desc
|
||||||
fi
|
fi
|
||||||
if [ "$force" = "y" -o "$force" = "Y" ]; then
|
if [ "$force" = "y" -o "$force" = "Y" -o "`check_option FORCE`" ]; then
|
||||||
echo "%FORCE%" >>desc
|
echo "%FORCE%" >>desc
|
||||||
echo "" >>desc
|
echo "" >>desc
|
||||||
fi
|
fi
|
||||||
|
|
Loading…
Add table
Reference in a new issue