Skip to content

Commit

Permalink
squid: Fix man page locations, pinger setuid and directory layout
Browse files Browse the repository at this point in the history
  • Loading branch information
citrus-it committed Apr 10, 2024
1 parent 45898aa commit 7476b33
Show file tree
Hide file tree
Showing 5 changed files with 29 additions and 34 deletions.
33 changes: 16 additions & 17 deletions build/squid/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -21,15 +21,16 @@ PROG=squid
VER=6.9
PKG=ooce/network/proxy/squid
SUMMARY="Squid WEB Proxy"
DESC="Squid is a caching proxy for the Web supporting HTTP, HTTPS, FTP, and more."
DESC="Squid is a caching proxy for the Web supporting HTTP, HTTPS, FTP, "
DESC+="and more."

OPREFIX=$PREFIX
PREFIX+=/$PROG
CONFPATH=/etc$PREFIX
LOGPATH=/var$PREFIX/logs
VARPATH=/var$PREFIX
RUNPATH=$LOGPATH
PIDFILE=/var/run/squid.pid
LOGPATH=$VARPATH/logs
RUNPATH=$VARPATH/run
PIDFILE=$RUNPATH/squid.pid

set_arch 64

Expand All @@ -40,17 +41,16 @@ XFORM_ARGS="
-DPKGROOT=$PROG
-DUSER=squid
-DGROUP=squid
-DPIDFILE=${PIDFILE}
-DPIDFILE=$PIDFILE
"

CONFIGURE_OPTS="
--sysconfdir=/etc${PREFIX}
--localstatedir=/var${PREFIX}
--with-swapdir=/var${PREFIX}/cache
--mandir=/usr/share/man
--sysconfdir=$CONFPATH
--localstatedir=$VARPATH
--with-swapdir=$VARPATH/cache
--with-default-user=squid
--with-logdir=/var${PREFIX}/logs
--with-pidfile=${PIDFILE}
--with-logdir=$LOGPATH
--with-pidfile=$PIDFILE
--enable-large-cache-files
--disable-static
--with-mit-krb5
Expand Down Expand Up @@ -105,22 +105,21 @@ CONFIGURE_OPTS="
"

CONFIGURE_OPTS[amd64]+="
--libdir=$PREFIX/lib/amd64
--libdir=$PREFIX/${LIBDIRS[amd64]}
"

CXXFLAGS+=" -Wno-unknown-pragmas -Wno-deprecated-declarations"
export LIBLDAP_LIBS="-lldap -llber"
export LIBLDAP_PATH="-L$OPREFIX/lib/amd64 "
LDFLAGS[amd64]+=" -Wl,-z -Wl,ignore -L$OPREFIX/lib/amd64 -R$OPREFIX/lib/amd64"
export LIBLDAP_PATH="-L$OPREFIX/${LIBDIRS[amd64]}"
LDFLAGS[amd64]+=" -Wl,-z -Wl,ignore"
LDFLAGS[amd64]+=" -L$OPREFIX/${LIBDIRS[amd64]} -R$OPREFIX/${LIBDIRS[amd64]}"

init
download_source $PROG $PROG $VER
patch_source
prep_build
build
for f in squid; do
xform files/$f > $TMPDIR/$f
done
xform files/$PROG > $TMPDIR/$PROG
install_execattr
install_smf -oocemethod ooce $PROG.xml $PROG
make_package
Expand Down
2 changes: 1 addition & 1 deletion build/squid/files/exec_attr
Original file line number Diff line number Diff line change
@@ -1 +1 @@
Forced Privilege:solaris:cmd:::/opt/ooce/squid/libexec/amd64/pinger:privs=net_icmpaccess
Forced Privilege:solaris:cmd:::/$(PREFIX)/libexec/amd64/pinger:privs=net_icmpaccess
6 changes: 3 additions & 3 deletions build/squid/files/squid
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@

source /lib/svc/share/smf_include.sh

typeset -r SQUID_HOME=/$(PREFIX)
typeset -r CONF_FILE=/etc${SQUID_HOME}/squid.conf
typeset -r SQUID_HOME="/$(PREFIX)"
typeset -r CONF_FILE="/etc${SQUID_HOME}/squid.conf"
typeset -r SQUID="${SQUID_HOME}/sbin/squid"

[[ ! -f ${CONF_FILE} ]] && exit $SMF_EXIT_ERR_CONFIG
Expand All @@ -24,7 +24,7 @@ stop)
;;
*)
print "Usage: $0 {start|stop}"
exit 1
exit $SMF_EXIT_ERR_FATAL
;;
esac

Expand Down
2 changes: 1 addition & 1 deletion build/squid/files/squid.xml
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
<exec_method name="start"
type="method"
exec="/lib/svc/method/ooce/squid start"
timeout_seconds="60"></exec_method>
timeout_seconds="60" />

<exec_method name="stop"
type="method"
Expand Down
20 changes: 8 additions & 12 deletions build/squid/local.mog
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
# http://www.illumos.org/license/CDDL.
#
# Copyright 2020 Carsten Grzemba
# Copyright 2024 OmniOS Community Edition (OmniOSce) Association.

license COPYING license=GPLv2

Expand All @@ -19,21 +20,16 @@ group groupname=$(GROUP) gid=98
user ftpuser=false username=$(USER) uid=98 group=$(GROUP) \
gcos-field="$(PROG) User" home-dir=/var/$(PREFIX) password=NP

<transform file path=etc/opt/ooce/squid/.* -> set preserve renamenew>
<transform file path=etc/opt/ooce/squid -> set preserve renamenew>

# See also files/exec_attr
<transform file path=$(PREFIX)/libexec/amd64/pinger -> set mode 04555>

# Restart services on upgrade
<transform file path=$(PREFIX)/sbin/squid$ \
-> set restart_fmri svc:/ooce/proxy/$(PROG):default>

<transform dir path=$(PREFIX)/var \
-> drop >
<transform dir path=var/run \
-> drop >
<transform dir path=var/opt/ooce/squid/run(/.*)* \
-> drop >

<transform dir path=var/$(PREFIX)(/.*)* \
-> default group squid >
<transform dir path=var/$(PREFIX)(/.*)* \
-> default owner squid>
<transform dir path=var/$(PREFIX)/run/squid -> drop>
<transform dir path=var/$(PREFIX) -> set group squid>
<transform dir path=var/$(PREFIX) -> set owner squid>

0 comments on commit 7476b33

Please sign in to comment.