1
0
mirror of https://github.com/gophernicus/gophernicus.git synced 2024-11-03 04:27:17 -05:00

replace cmd invocations with $(cmd)

This commit is contained in:
bdeshi 2020-02-05 13:27:27 +06:00
parent c86fcc1320
commit 0014aa3355
4 changed files with 29 additions and 29 deletions

View File

@ -26,7 +26,7 @@ MAP = gophermap
INETD = /etc/inetd.conf
XINETD = /etc/xinetd.d
# get OPTIONS line from gophernicus.env and use that also for inetd
INETOPT = `grep '^OPTIONS=' $(NAME).env | tail -n 1 | sed -e 's/OPTIONS="*//;s/"*$$//'`
INETOPT = $$(grep '^OPTIONS=' $(NAME).env | tail -n 1 | sed -e 's/OPTIONS="*//;s/"*$$//')
INETLIN = "gopher stream tcp nowait nobody $(SBINDIR)/$(BINARY) $(BINARY) $(INETOPT)"
INETPID = /var/run/inetd.pid
LAUNCHD = /Library/LaunchDaemons
@ -44,7 +44,7 @@ LDFLAGS =
IPCRM = /usr/bin/ipcrm
all:
@case `uname` in \
@case $$(uname) in \
Darwin) $(MAKE) ROOT="$(OSXROOT)" DESTDIR="$(OSXDIr)" src/$(BINARY); ;; \
Haiku) $(MAKE) EXTRA_LIBS="-lnetwork" src/$(BINARY); ;; \
*) if [ -f "/usr/include/tcpd.h" ]; then $(MAKE) withwrap; else $(MAKE) src/$(BINARY); fi; ;; \
@ -103,12 +103,12 @@ clean-deb:
if [ -d debian/$(PACKAGE) ]; then fakeroot debian/rules clean; fi
clean-shm:
if [ -x $(IPCRM) ]; then $(IPCRM) -M `awk '/SHM_KEY/ { print $$3 }' src/$(NAME).h` || true; fi
if [ -x $(IPCRM) ]; then $(IPCRM) -M $$(awk '/SHM_KEY/ { print $$3 }' src/$(NAME).h) || true; fi
# Install cases
install: clean-shm
@case `uname` in \
@case $$(uname) in \
Darwin) $(MAKE) ROOT="$(OSXROOT)" DESTDIR="$(OSXDIR)" install-files install-docs install-root install-osx install-done; ;; \
Haiku) $(MAKE) SBINDIR=/boot/common/bin DOCDIR=/boot/common/share/doc/$(PACKAGE) \
install-files install-docs install-root install-haiku install-done; ;; \
@ -128,7 +128,7 @@ install-done:
@echo "Gophernicus has now been succesfully installed. To try it out, launch"
@echo "your favorite gopher browser and navigate to your gopher root."
@echo
@echo "Gopher URL...: gopher://`hostname`/"
@echo "Gopher URL...: gopher://$$(hostname)/"
@for CONFFILE in /etc/sysconfig/gophernicus \
/etc/default/gophernicus \
/Library/LaunchDaemons/org.gophernicus.server.plist \
@ -167,7 +167,7 @@ install-inetd: install-files install-docs install-root
echo "::::: Gopher entry in $(INETD) already present -- please check! :::::"; \
else echo "Trying to add gopher entry to $(INETD)" ; \
echo "$(INETLIN)" >> $(INETD) ; \
if [ -r $(INETPID) ] ; then kill -HUP `cat $(INETPID)` ; \
if [ -r $(INETPID) ] ; then kill -HUP $$(cat $(INETPID)) ; \
else echo "::::: No PID for inetd found, not restarted -- please check! :::::" ; fi ; \
fi ; \
fi
@ -175,14 +175,14 @@ install-inetd: install-files install-docs install-root
install-xinetd: install-files install-docs install-root
if [ -d "$(XINETD)" -a ! -f "$(XINETD)/$(NAME)" ]; then \
sed -e "s/@HOSTNAME@/`hostname`/g" $(NAME).xinetd > $(XINETD)/$(NAME); \
sed -e "s/@HOSTNAME@/$$(hostname)/g" $(NAME).xinetd > $(XINETD)/$(NAME); \
[ -x /sbin/service ] && /sbin/service xinetd reload; \
fi
@echo
install-osx:
if [ -d "$(LAUNCHD)" -a ! -f "$(LAUNCHD)/$(PLIST)" ]; then \
sed -e "s/@HOSTNAME@/`hostname`/g" src/$(PLIST) > $(LAUNCHD)/$(PLIST); \
sed -e "s/@HOSTNAME@/$$(hostname)/g" src/$(PLIST) > $(LAUNCHD)/$(PLIST); \
launchctl load $(LAUNCHD)/$(PLIST); \
fi
@echo
@ -191,13 +191,13 @@ install-osx:
@echo
install-haiku:
if [ -f "$(NET_SRV)" -a ! "`grep -m1 gopher $(NET_SRV)`" ]; then \
if [ -f "$(NET_SRV)" -a ! "$$(grep -m1 gopher $(NET_SRV))" ]; then \
(echo ""; \
echo "service gopher {"; \
echo " family inet"; \
echo " protocol tcp"; \
echo " port 70"; \
echo " launch $(BINARY) -h `hostname`"; \
echo " launch $(BINARY) -h $$(hostname)"; \
echo "}") >> $(NET_SRV); \
fi
@echo
@ -243,7 +243,7 @@ uninstall-inetd:
else if grep '^gopher' $(INETD) >/dev/null 2>&1 && \
sed -i .bak -e 's/^gopher/#gopher/' $(INETD) ; then \
echo "commented out gopher entry in $(INETD), reloading inetd" ; \
[ -r $(INETPID) ] && kill -HUP `cat $(INETPID)` ; \
[ -r $(INETPID) ] && kill -HUP $$(cat $(INETPID)) ; \
else echo "::::: could not find gopher entry in $(INETD) :::::" ; \
fi ; \
fi

4
debian/postinst vendored
View File

@ -6,7 +6,7 @@
. /usr/share/debconf/confmodule
# Configuration
HOSTNAME="`hostname`"
HOSTNAME="$(hostname)"
ROOT=/var/gopher
PACKAGE=gophernicus
LOGDIR=/var/log/$PACKAGE
@ -18,7 +18,7 @@ USER=nobody
# Get hostname from debconf
db_get gophernicus/fqdn
if [ "$RET" ]; then
HOSTNAME="`echo $RET | tr -cd 'A-Za-z0-9.-'`"
HOSTNAME="$(echo $RET | tr -cd 'A-Za-z0-9.-')"
fi
# Configure gophernicus

View File

@ -19,17 +19,17 @@ directory and replace this page.
#
Generic information:
=echo " your ip address: $REMOTE_ADDR"
=echo " server time....: `date`"
=echo " server uptime..: `uptime | sed 's/.*up *\([^,]*\), .*/\1/'`"
=echo " server time....: $(date)"
=echo " server uptime..: $(uptime | sed 's/.*up *\([^,]*\), .*/\1/')"
=echo " server version.: $SERVER_VERSION \"$SERVER_CODENAME\""
=echo " server platform: $SERVER_ARCH"
=echo " description....: $SERVER_DESCRIPTION"
Server configuration:
=echo " config file....: `for FILE in /etc/sysconfig/gophernicus /etc/default/gophernicus /Library/LaunchDaemons/org.gophernicus.server.plist /boot/common/settings/network/services /lib/systemd/system/gophernicus\@.service /etc/xinetd.d/gophernicus /etc/inetd.conf; do if [ -f $FILE ]; then echo $FILE; break; fi; done`"
=echo " config file....: $(for FILE in /etc/sysconfig/gophernicus /etc/default/gophernicus /Library/LaunchDaemons/org.gophernicus.server.plist /boot/common/settings/network/services /lib/systemd/system/gophernicus\@.service /etc/xinetd.d/gophernicus /etc/inetd.conf; do if [ -f $FILE ]; then echo $FILE; break; fi; done)"
=echo " server hostname: $SERVER_HOST"
=echo " root directory.: $DOCUMENT_ROOT"
=echo " running as user: `whoami`"
=echo " running as user: $(whoami)"
=echo " output charset.: $GOPHER_CHARSET"
=echo " output width...: $COLUMNS characters"

View File

@ -215,7 +215,7 @@ if test -z "$dir_arg"; then
else
u_plus_rw='% 200'
fi
cp_umask=`expr '(' 777 - $mode % 1000 ')' $u_plus_rw`;;
cp_umask=$(expr '(' 777 - $mode % 1000 ')' $u_plus_rw);;
*)
if test -z "$stripcmd"; then
u_plus_rw=
@ -267,11 +267,11 @@ do
exit 1
fi
dstdir=$dst
dst=$dstdir/`basename "$src"`
dst=$dstdir/$(basename "$src")
dstdir_status=0
else
# Prefer dirname, but fall back on a substitute if dirname fails.
dstdir=`
dstdir=$(
(dirname "$dst") 2>/dev/null ||
expr X"$dst" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
X"$dst" : 'X\(//\)[^/]' \| \
@ -295,7 +295,7 @@ do
q
}
s/.*/./; q'
`
)
test -d "$dstdir"
dstdir_status=$?
@ -309,17 +309,17 @@ do
'')
# Create intermediate dirs using mode 755 as modified by the umask.
# This is like FreeBSD 'install' as of 1997-10-28.
umask=`umask`
umask=$(umask)
case $stripcmd.$umask in
# Optimize common cases.
*[2367][2367]) mkdir_umask=$umask;;
.*0[02][02] | .[02][02] | .[02]) mkdir_umask=22;;
*[0-7])
mkdir_umask=`expr $umask + 22 \
mkdir_umask=$(expr $umask + 22 \
- $umask % 100 % 40 + $umask % 20 \
- $umask % 10 % 4 + $umask % 2
`;;
);;
*) mkdir_umask=$umask,go-w;;
esac
@ -349,14 +349,14 @@ do
# HP-UX 11.23 and IRIX 6.5 mkdir -m -p sets group- or
# other-writeable bit of parent directory when it shouldn't.
# FreeBSD 6.1 mkdir -m -p sets mode of existing directory.
ls_ld_tmpdir=`ls -ld "$tmpdir"`
ls_ld_tmpdir=$(ls -ld "$tmpdir")
case $ls_ld_tmpdir in
d????-?r-*) different_mode=700;;
d????-?--*) different_mode=755;;
*) false;;
esac &&
$mkdirprog -m$different_mode -p -- "$tmpdir" && {
ls_ld_tmpdir_1=`ls -ld "$tmpdir"`
ls_ld_tmpdir_1=$(ls -ld "$tmpdir")
test "$ls_ld_tmpdir" = "$ls_ld_tmpdir_1"
}
}
@ -416,7 +416,7 @@ do
test -d "$prefix" || exit 1
else
case $prefix in
*\'*) qprefix=`echo "$prefix" | sed "s/'/'\\\\\\\\''/g"`;;
*\'*) qprefix=$(echo "$prefix" | sed "s/'/'\\\\\\\\''/g");;
*) qprefix=$prefix;;
esac
prefixes="$prefixes '$qprefix'"
@ -465,8 +465,8 @@ do
# If -C, don't bother to copy if it wouldn't change the file.
if $copy_on_change &&
old=`LC_ALL=C ls -dlL "$dst" 2>/dev/null` &&
new=`LC_ALL=C ls -dlL "$dsttmp" 2>/dev/null` &&
old=$(LC_ALL=C ls -dlL "$dst" 2>/dev/null) &&
new=$(LC_ALL=C ls -dlL "$dsttmp" 2>/dev/null) &&
eval "$initialize_posix_glob" &&
$posix_glob set -f &&