summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJudd Vinet <judd@archlinux.org>2006-01-22 02:16:41 +0000
committerJudd Vinet <judd@archlinux.org>2006-01-22 02:16:41 +0000
commitd0fb27cef44cf20e755fc0aa832d5da2671cf1ed (patch)
tree9ff2fb3c062df87eb88480ac5691e207573f984c
parenta10584aec48617b4152b7e0653eb8b43f062839a (diff)
downloadpacman-d0fb27cef44cf20e755fc0aa832d5da2671cf1ed.tar.xz
added new options field to PKGBUILDs for package-by-package overrides
-rwxr-xr-xscripts/gensync18
-rwxr-xr-xscripts/makepkg67
-rwxr-xr-xscripts/updatesync18
3 files changed, 71 insertions, 32 deletions
diff --git a/scripts/gensync b/scripts/gensync
index cf399562..505ead56 100755
--- a/scripts/gensync
+++ b/scripts/gensync
@@ -20,7 +20,7 @@
# USA.
#
-myver='2.9.7'
+myver='2.9.8'
usage() {
echo "gensync $myver"
@@ -51,6 +51,18 @@ die() {
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()
{
if [ "$pkgdir" != "" ]; then
@@ -69,7 +81,7 @@ get_md5checksum()
db_write_entry()
{
unset pkgname pkgver pkgrel pkgdesc force
- unset groups replaces provides depends conflicts
+ unset groups replaces provides depends conflicts options
source $1 || return 1
cd $gstmpdir
mkdir $pkgname-$pkgver-$pkgrel || return 1
@@ -107,7 +119,7 @@ db_write_entry()
done
echo "" >>desc
fi
- if [ "$force" = "y" -o "$force" = "Y" ]; then
+ if [ "$force" = "y" -o "$force" = "Y" -o "`check_option FORCE`" ]; then
echo "%FORCE%" >>desc
echo "" >>desc
fi
diff --git a/scripts/makepkg b/scripts/makepkg
index 5de49e87..84464c24 100755
--- a/scripts/makepkg
+++ b/scripts/makepkg
@@ -20,11 +20,29 @@
# USA.
#
-myver='2.9.7'
+myver='2.9.8'
startdir=`pwd`
PKGDEST=$startdir
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
[ -f /etc/abs/abs.conf ] && source /etc/abs/abs.conf
@@ -72,6 +90,18 @@ strip_url() {
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() {
local missdep=""
local deplist=""
@@ -219,24 +249,6 @@ usage() {
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=$@
while [ "$#" -ne "0" ]; do
@@ -335,6 +347,7 @@ fi
unset pkgname pkgver pkgrel pkgdesc url license groups provides md5sums force
unset replaces depends conflicts backup source install build makedepends
+unset options
# some applications (eg, blackbox) will not build with some languages
unset LC_ALL LANG
umask 0022
@@ -573,7 +586,6 @@ else
exit 0
fi
-
if [ "`id -u`" = "0" ]; then
# chown all source files to root.root
chown -R root.root $startdir/src
@@ -613,11 +625,14 @@ if [ $? -gt 0 ]; then
exit 2
fi
-# remove info/doc files
-cd $startdir
-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
+if [ ! "`check_option KEEPDOCS`" -a "$KEEPDOCS" = "0" ]; then
+ # remove info/doc files
+ msg "Removing info/doc files..."
+ cd $startdir
+ 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
if [ -d pkg/usr/share/man ]; then
@@ -652,7 +667,7 @@ done
cd $startdir
# strip binaries
-if [ "$NOSTRIP" = "0" ]; then
+if [ ! "`check_option NOSTRIP`" -a "$NOSTRIP" = "0" ]; then
msg "Stripping debugging symbols from libraries..."
find pkg/{,usr,usr/local,opt/*}/lib -type f -not -name "*.dll" -not -name "*.exe" \
-exec /usr/bin/strip --strip-debug '{}' \; 2>&1 \
diff --git a/scripts/updatesync b/scripts/updatesync
index b90417e6..940a2748 100755
--- a/scripts/updatesync
+++ b/scripts/updatesync
@@ -21,7 +21,7 @@
# USA.
#
-myver='2.9.7'
+myver='2.9.8'
usage() {
echo "updatesync $myver"
@@ -54,6 +54,18 @@ die()
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()
{
if [ "$pkgdir" != "" ]; then
@@ -72,7 +84,7 @@ get_md5checksum()
db_write_entry()
{
unset pkgname pkgver pkgrel pkgdesc force
- unset groups replaces provides depends conflicts
+ unset groups replaces provides depends conflicts options
source $1 || return 1
cd $ustmpdir
mkdir $pkgname-$pkgver-$pkgrel || return 1
@@ -110,7 +122,7 @@ db_write_entry()
done
echo "" >>desc
fi
- if [ "$force" = "y" -o "$force" = "Y" ]; then
+ if [ "$force" = "y" -o "$force" = "Y" -o "`check_option FORCE`" ]; then
echo "%FORCE%" >>desc
echo "" >>desc
fi