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

4
debian/postinst vendored
View File

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

View File

@ -19,17 +19,17 @@ directory and replace this page.
# #
Generic information: Generic information:
=echo " your ip address: $REMOTE_ADDR" =echo " your ip address: $REMOTE_ADDR"
=echo " server time....: `date`" =echo " server time....: $(date)"
=echo " server uptime..: `uptime | sed 's/.*up *\([^,]*\), .*/\1/'`" =echo " server uptime..: $(uptime | sed 's/.*up *\([^,]*\), .*/\1/')"
=echo " server version.: $SERVER_VERSION \"$SERVER_CODENAME\"" =echo " server version.: $SERVER_VERSION \"$SERVER_CODENAME\""
=echo " server platform: $SERVER_ARCH" =echo " server platform: $SERVER_ARCH"
=echo " description....: $SERVER_DESCRIPTION" =echo " description....: $SERVER_DESCRIPTION"
Server configuration: 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 " server hostname: $SERVER_HOST"
=echo " root directory.: $DOCUMENT_ROOT" =echo " root directory.: $DOCUMENT_ROOT"
=echo " running as user: `whoami`" =echo " running as user: $(whoami)"
=echo " output charset.: $GOPHER_CHARSET" =echo " output charset.: $GOPHER_CHARSET"
=echo " output width...: $COLUMNS characters" =echo " output width...: $COLUMNS characters"

View File

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