- Completely remove nasty bashisms and stop requiring bash(1) for the build

- Clean up Makefile and augment description text again a bit while I'm here
This commit is contained in:
Alexey Dokuchaev 2012-09-28 18:31:46 +00:00
parent 56de9c77af
commit db4fea1b3d
Notes: svn2git 2021-03-31 03:12:20 +00:00
svn path=/head/; revision=305005
5 changed files with 303 additions and 39 deletions

View file

@ -1,9 +1,5 @@
# New ports collection makefile for: fbpanel
# Date created: Sat Jun 26 13:43:50 CEST 2004
# Whom: Tobias Roth <ports@fsck.ch>
#
# Created by: Tobias Roth <ports@fsck.ch>
# $FreeBSD$
#
PORTNAME= fbpanel
PORTVERSION= 6.1
@ -13,28 +9,25 @@ MASTER_SITES= SF
EXTRACT_SUFX= .tbz2
MAINTAINER= ports@FreeBSD.org
COMMENT= Desktop panel that includes a taskbar, pager, launchbar and more
COMMENT= Lightweight, NETWM compliant X11 desktop panel
BUILD_DEPENDS= bash:${PORTSDIR}/shells/bash
LICENSE= GPLv2
USE_XORG= x11 xmu xpm
USE_GNOME= gtk20
USE_BZIP2= yes
HAS_CONFIGURE= yes
CONFIGURE_ARGS= --prefix=${PREFIX}
USE_GMAKE= yes
USE_GNOME= gtk20
USE_PKGCONFIG= build
CONFIGURE_ARGS+= --prefix=${PREFIX}
MAN1= fbpanel.1
MANCOMPRESSED= no
MAN1= ${PORTNAME}.1
post-patch:
@${REINPLACE_CMD} -e 's|/bin/bash|${LOCALBASE}/bin/bash|' ${WRKSRC}/configure
@${REINPLACE_CMD} -e 's|/bin/bash|${LOCALBASE}/bin/bash|' ${WRKSRC}/scripts/rfs-pkg-config
@${REINPLACE_CMD} -e 's|/bin/bash|${LOCALBASE}/bin/bash|' ${WRKSRC}/scripts/install.sh
@${REINPLACE_CMD} -e 's|@DATADIR@|${DATADIR}|g' ${WRKSRC}/data/man/${PORTNAME}.1.in
@${REINPLACE_CMD} -e 's|bash|sh|' ${WRKSRC}/scripts/install.sh
@${REINPLACE_CMD} -e 's|@DATADIR@|${DATADIR}|' \
${WRKSRC}/data/man/${MAN1}.in
post-install:
@${INSTALL_MAN} ${WRKSRC}/data/man/${PORTNAME}.1 ${MANPREFIX}/man/man1
${INSTALL_MAN} ${WRKSRC}/data/man/${MAN1} ${MANPREFIX}/man/man1
.include <bsd.port.mk>

View file

@ -1,20 +1,274 @@
--- ./configure.orig 2010-04-04 11:02:40.000000000 +0200
+++ ./configure 2010-11-22 19:41:52.000000000 +0100
@@ -92,7 +92,7 @@
--- ./configure.orig 2010-04-04 17:02:40.000000000 +0800
+++ ./configure 2012-09-28 22:42:14.000000000 +0800
@@ -1,4 +1,4 @@
-#!/bin/bash
+#!/bin/sh
PID=$$
# NLS nuisances.
@@ -19,15 +19,15 @@
#########################
## Help ##
#########################
-function check_help ()
+check_help ()
{
- [ "$1" == "--help" ] && usage 0
+ [ "$1" = "--help" ] && usage 0
return 1
}
-function usage ()
+usage ()
{
echo "\`configure\' configures this package to adapt to many kinds of systems."
echo "Usage: ./configure [variables] [features]"
@@ -55,17 +55,17 @@
exit $1
}
-function error ()
+error ()
{
echo "error: $@"
exit 1
}
-function check_name ()
+check_name ()
{
local s=""
for i in `eval echo \\$$2`; do
- [ "$1" == "$i" ] && s=1 && break
+ [ "$1" = "$i" ] && s=1 && break
done
[ -z "$s" ] && return 0
error "Cam't add '$1' to $2: such name already exists."
@@ -80,7 +80,7 @@
# $1 - variable's name, shoud survive 'declare $1'
# $2 - help string, description
# $3 - default value, any bash code suitable for 'eval var=$default'
-function add_var ()
+add_var ()
{
check_name "$1" vars
vars="$vars $1" # to know var creation order, it's important
@@ -88,23 +88,23 @@
eval hlp_$1="\"$2\""
}
-function check_var ()
+check_var ()
{
local var val A
- [ "$(sed -e 's/--[^=]\+=[^=]*/AA/' <<< $1)" != AA ] && return 1
+ [ "$(sed -E -e 's/--[^=]+=[^=]*/AA/' <<< $1)" != AA ] && return 1
+ [ "$(echo $1 | sed -E 's/--[^=]+=[^=]*/AA/')" != AA ] && return 1
A=${1:2}
- A=${1:2}
+ A=${1#--}
var=${A%%=*}
@@ -167,7 +167,7 @@
- var=$(tr "[:upper:]-" "[:lower:]_" <<< $var)
+ var=$(echo $var | tr "[:upper:]-" "[:lower:]_")
val=${A#*=}
- [ "$vars" == "${vars/$var/}" ] && error "$var - unknown variable"
+ echo "$vars" | grep -qw "$var" || error "$var - unknown variable"
eval $var="\"${val}\""
function check_feature ()
return 0
}
-function update_vars ()
+update_vars ()
{
local val
for i in $vars; do
@@ -118,7 +118,7 @@
done
}
-function display_vars ()
+display_vars ()
{
local i
for i in $vars; do
@@ -126,25 +126,25 @@
done
}
-function dump_vars_h ()
+dump_vars_h ()
{
local i
if true; then
for i in $vars; do
eval val=\$$i
- echo "#define $(tr "[:lower:]-" "[:upper:]_" <<< $i) \"${val}\""
+ echo "#define $(echo $i | tr "[:lower:]-" "[:upper:]_") \"${val}\""
done
fi
}
-function dump_vars_mk ()
+dump_vars_mk ()
{
local i
if true; then
for i in $vars; do
eval val=\$$i
- echo "$(tr "[:lower:]-" "[:upper:]_" <<< $i) = $val"
+ echo "$(echo $i | tr "[:lower:]-" "[:upper:]_") = $val"
done
fi
@@ -157,7 +157,7 @@
# $1 - feature's name, shoud survive 'declare $1'
# $2 - help string, description
# $3 - "enabled" or "disabled" string
-function add_feature ()
+add_feature ()
{
check_name "$1" features
features="$features $1"
@@ -165,21 +165,21 @@
eval $1="'$3'"
}
-function check_feature ()
+check_feature ()
{
- [ "$(sed -e 's/--\(enable\|disable\)-.\+/AA/' <<< $1)" != AA ] && return 1
+ [ "$(sed -E -e 's/--(enable|disable)-.+/AA/' <<< $1)" != AA ] && return 1
A=${1:2}
- A=${1:2}
+ [ "$(echo $1 | sed -E 's/--(enable|disable)-.+/AA/')" != AA ] && return 1
+ A=${1#--}
var=${A#*-}
val=${A%%-*}
#echo "feat=$feat status=$status"
[ "$val" != "enable" ] && [ "$val" != "disable" ] && return 1
- [ "$features" == "${features/$var/}" ] && error "$var - unknown feature"
+ [ "$features" = "${features/$var/}" ] && error "$var - unknown feature"
eval $var="$val"d
return 0
}
-function display_features ()
+display_features ()
{
local i
for i in $features; do
@@ -187,13 +187,13 @@
done
}
-function update_features ()
+update_features ()
{
local val
for i in $features; do
eval val="\$$i"
if eval $i="\"$val\"" 2>/dev/null ; then
- eval [ "\$$i" == "enabled" -o "\$$i" == "disabled" ] && continue
+ eval [ "\$$i" = "enabled" -o "\$$i" = "disabled" ] && continue
fi
echo "Default value of '$i' couldn't be set from '$val'"
echo "Set it explicitly with '--$i=value'"
@@ -202,25 +202,25 @@
done
}
-function dump_features_h ()
+dump_features_h ()
{
local i
if true; then
for i in $features; do
str='#undef'
- eval [ "\$$i" == "enabled" ] && str='#define'
- echo "$str $(tr "[:lower:]-" "[:upper:]_" <<< $i)"
+ eval [ "\$$i" = "enabled" ] && str='#define'
+ echo "$str $(echo $i | tr "[:lower:]-" "[:upper:]_")"
done
fi
}
-function dump_features_mk ()
+dump_features_mk ()
{
local i
if true; then
for i in $features; do
- eval [ "\$$i" == "enabled" ] && str='#define'
- eval echo "$(tr "[:lower:]-" "[:upper:]_" <<< $i):=\$$i"
+ eval [ "\$$i" = "enabled" ] && str='#define'
+ eval echo "$(echo $i | tr "[:lower:]-" "[:upper:]_"):=\$$i"
done
fi
}
@@ -231,7 +231,7 @@
## Engine ##
#########################
-function parse_args ()
+parse_args ()
{
# parse command line variables
while [ $# -gt 0 ]; do
@@ -246,15 +246,15 @@
-function bslash ()
+bslash ()
{
p1="%%$1%%"
t=`eval echo \\${$1}`
- p2=`sed -e 's/\//\\\\\//g' <<< $t`
+ p2=`echo $t | sed -e 's/\//\\\\\//g'`
echo "s/$p1/$p2/g"
}
-function substitute ()
+substitute ()
{
if true; then
@@ -271,7 +271,7 @@
done
}
-function dump_config_h ()
+dump_config_h ()
{
echo "Creating config.h"
if true; then
@@ -287,7 +287,7 @@
fi > config.h
}
-function dump_config_mk ()
+dump_config_mk ()
{
echo "Creating config.mk"
if true; then
@@ -301,7 +301,7 @@
fi > config.mk
}
-function main ()
+main ()
{
parse_args "$@"
update_vars
@@ -343,7 +343,7 @@
#########################
## User settings here ##
#########################
-source scripts/custom.sh
+. scripts/custom.sh
#########################
## Run It All ##

View file

@ -9,33 +9,28 @@
.SH OPTIONS
.TP
@@ -48,8 +48,8 @@
@@ -48,7 +48,7 @@
\-- open configuration dialog
.TP
\fB\--profile <name>\fR
-\-- use specified profile. The profile is loaded from the file ~/.fbpanel/<name>.
-If that fails, fbpanel will load @DATADIR@/<name>.
+\-- use specified profile. The profile is loaded from the file ~/.config/fbpanel/<name>.
+If that fails, fbpanel will load /usr/local/share/fbpanel/<name>.
If that fails, fbpanel will load @DATADIR@/<name>.
No -p option is equivalent to -p default
.TP
\fB\-h\fR
@@ -67,21 +67,21 @@
@@ -67,8 +67,8 @@
.SH CUSTOMIZATION
To change default settings, copy profile file to your home directory
.br
- mkdir -p ~/.fbpanel
- cp @DATADIR@/default ~/.fbpanel
+ mkdir -p ~/.config/fbpanel
+ cp /usr/local/share/fbpanel/default ~/.config/fbpanel
+ cp @DATADIR@/default ~/.config/fbpanel
.br
and edit it. Default profile file contains comments and explanation inside,
so it should be easy. For full list of options please visit fbpanel's home page.
.SH FILES
.TP
-@DATADIR@/
+/usr/local/share/fbpanel/
@@ -78,10 +78,10 @@
@DATADIR@/
Directory with system-wide resources and default settings
.TP
-~/.fbpanel/

View file

@ -0,0 +1,17 @@
--- ./scripts/rfs-pkg-config.orig 2009-06-01 22:55:28.000000000 +0800
+++ ./scripts/rfs-pkg-config 2012-09-28 22:08:50.000000000 +0800
@@ -1,4 +1,4 @@
-#!/bin/bash
+#!/bin/sh
# Tt runs pkg-config in a way that everything is searched under RFS
# but reported including full path. Suitable for cross-compiling
@@ -28,7 +28,7 @@ fi
var=$(pkg-config --silence-errors "$@")
[ "$?" -ne 0 ] && exit 1
if [ -n "$RFS" ]; then
- sed -e "s/\\(^\\|[[:space:]]\\)-\(I\|L\)/\\1-\\2${RFS//\//\\/}/g" <<< "$var"
+ echo "$var" | sed -e "s/\\(^\\|[[:space:]]\\)-\(I\|L\)/\\1-\\2${RFS//\//\\/}/g"
else
echo "$var"
fi

View file

@ -1,6 +1,6 @@
Fbpanel is a lightweight, NETWM compliant X11 desktop panel. It works with
any NETWM compliant window manager (xfwm4, sawfish, openbox, metacity, etc.)
It provides:
It currently provides and features:
- Taskbar, launchbar, and pager
- Show desktop button (iconify or shade all windows)
@ -10,5 +10,10 @@ It provides:
- Menu with support for freedesktop.org application menu
- CPU, network, memory, and battery monitors
- General monitor (to display output of configured command)
- Ability to replace windows' icons
- Transparency support
- Customizable size and screen position
- Ability to run many instances each with its own configuration
- Modest resource usage
WWW: http://fbpanel.sourceforge.net/