aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSilvino <silvino@bk.ru>2019-06-11 00:27:06 +0100
committerSilvino <silvino@bk.ru>2019-06-11 00:27:06 +0100
commit5adacc390c152b1540372d653712cb41fcb76b7b (patch)
tree6c7fa82642984b059889796b66dc204dadc1b933
parenta55b4d39a97361fd4f04c6547835204b9e5371ac (diff)
downloaddoc-5adacc390c152b1540372d653712cb41fcb76b7b.tar.gz
ports distcc and ccache revision
-rw-r--r--core/conf/pkgmk.conf26
-rwxr-xr-xcore/conf/rc.d/distccd33
-rw-r--r--core/ports.html55
3 files changed, 103 insertions, 11 deletions
diff --git a/core/conf/pkgmk.conf b/core/conf/pkgmk.conf
index 18d8730..c94fea7 100644
--- a/core/conf/pkgmk.conf
+++ b/core/conf/pkgmk.conf
@@ -2,12 +2,20 @@
# /etc/pkgmk.conf: pkgmk(8) configuration
#
-export CFLAGS="-O2 -march=x86-64"
+export CFLAGS="-O2 -g -march=x86-64"
export CXXFLAGS="${CFLAGS}"
+# local compile only
export JOBS=$(nproc)
export MAKEFLAGS="-j $JOBS"
+## compile using distcc
+## set static cpu cores available
+###export MAKEFLAGS="-j 8"
+## get dynamically cpu cores available
+#export MAKEFLAGS="/usr/bin/distcc -j 2> /dev/null"
+#export SCONSFLAGS="$MAKEFLAGS"
+
case ${PKGMK_ARCH} in
"64"|"")
;;
@@ -23,16 +31,14 @@ case ${PKGMK_ARCH} in
;;
esac
-PKGMK_SOURCE_MIRRORS=(https://hive.gnu.systems/mirror/distfiles/)
+PKGMK_SOURCE_MIRRORS=(http://c1.ank/distfiles/ http://c1.ank/archive/distfiles/)
# PKGMK_SOURCE_DIR="$PWD"
PKGMK_SOURCE_DIR="/usr/ports/distfiles"
# PKGMK_PACKAGE_DIR="$PWD"
PKGMK_PACKAGE_DIR="/usr/ports/packages"
# PKGMK_WORK_DIR="$PWD/work"
-PKGMK_WORK_DIR="/usr/ports/work/${name}"
+PKGMK_WORK_DIR="/usr/ports/work/$name"
# PKGMK_DOWNLOAD="no"
-# PKGMK_IGNORE_SIGNATURE="no"
-# PKGMK_IGNORE_MD5SUM="no"
# PKGMK_IGNORE_FOOTPRINT="no"
# PKGMK_IGNORE_NEW="no"
# PKGMK_NO_STRIP="no"
@@ -40,5 +46,15 @@ PKGMK_WORK_DIR="/usr/ports/work/${name}"
# PKGMK_WGET_OPTS=""
# PKGMK_CURL_OPTS=""
# PKGMK_COMPRESSION_MODE="gz"
+# PKGMK_UP_TO_DATE=yes
+
+## ccache settings
+#export PATH="/usr/lib/ccache/:$PATH"
+#export CCACHE_DIR="/usr/ports/cache/ccache"
+#export CCACHE_PREFIX="distcc"
+#export CCACHE_COMPILERCHECK="%compiler% -dumpversion; crux"
+#
+#export DISTCC_HOSTS="localhost/4 worker/4"
+#export DISTCC_DIR="/urs/ports/distcc"
# End of file
diff --git a/core/conf/rc.d/distccd b/core/conf/rc.d/distccd
new file mode 100755
index 0000000..65a166d
--- /dev/null
+++ b/core/conf/rc.d/distccd
@@ -0,0 +1,33 @@
+#!/usr/bin/env bash
+#
+# /etc/rc.d/distccd: start/stop distcc daemon
+#
+
+. /etc/distcc.conf
+if [ -z "$DISTCC_ALLOW" ]; then
+ echo "Please define a range of IPs allowed to connect to this distccd"
+ echo "host in DISTCC_ALLOW in /etc/rc.conf. More detailed information"
+ echo "can be found in the distcc's README package."
+ exit 1
+fi
+
+DISTCC_USER="${DISTCC_USER:=nobody}"
+DISTCC_LOG_LEVEL="${DISTCC_LOG_LEVEL:=notice}"
+
+case $1 in
+start)
+ /usr/sbin/distccd --daemon --user "$DISTCC_USER" --allow "$DISTCC_ALLOW" --log-level "$DISTCC_LOG_LEVEL"
+ ;;
+stop)
+ killall -q /usr/sbin/distccd
+ ;;
+restart)
+ $0 stop
+ $0 start
+ ;;
+*)
+ echo "usage: $0 [start|stop|restart]"
+ ;;
+esac
+
+# End of file
diff --git a/core/ports.html b/core/ports.html
index 07d52d2..a61643d 100644
--- a/core/ports.html
+++ b/core/ports.html
@@ -148,15 +148,15 @@
prtdir /usr/ports/contrib
prtdir /usr/ports/ports
prtdir /usr/ports/mate
- prtdir /usr/ports/kde
+ prtdir /usr/ports/kde5
### use mypackage form local directory
# prtdir /home/packages/build:mypackage
### log options:
- # writelog enabled # (enabled|disabled)
- # logmode overwrite # (append|overwrite)
- # rmlog_on_success yes # (no|yes)
+ writelog enabled # (enabled|disabled)
+ logmode overwrite # (append|overwrite)
+ rmlog_on_success yes # (no|yes)
logfile /var/log/pkgbuild/%n.log
# path, %p=path to port dir, %n=port name
# %v=version, %r=release
@@ -198,14 +198,57 @@
$ prt-get depinst ccache distcc
</pre>
- <p>Add to /etc/profile;</p>
+ <p>Configure pkgmk and define number of cores available,
+ in this example get dynamically Edit /etc/pkgmk.conf;</p>
<pre>
+ ## local compile only
+ #export JOBS=$(nproc)
+ #export MAKEFLAGS="-j $JOBS"
+
+ # compile using distcc
+ # set static cpu cores available
+ ##export MAKEFLAGS="-j 8"
+ # get dynamically cpu cores available
+ export MAKEFLAGS="/usr/bin/distcc -j 2> /dev/null"
+ export SCONSFLAGS="$MAKEFLAGS"
+ </pre>
+
+ <p>Set ccaching directory and instructs to use distcc backend;</p>
+
+ <pre>
+ # ccache settings
export PATH="/usr/lib/ccache/:$PATH"
- export CCACHE_DIR="/var/cache/ccache"
+ export CCACHE_DIR="/usr/ports/cache/ccache"
+ export CCACHE_PREFIX="distcc"
export CCACHE_COMPILERCHECK="%compiler% -dumpversion; crux"
</pre>
+ <p>Set distcc hosts and respective number of cpu cores to send work;</p>
+ <pre>
+ export DISTCC_HOSTS="localhost/4 worker/4"
+ export DISTCC_DIR="/urs/ports/distcc"
+ </pre>
+
+ <p>Configure distcc daemon, edit /etc/rc.d/distccd;</p>
+
+ <pre>
+ #!/usr/bin/env bash
+ #
+ # /etc/rc.d/distccd: start/stop distcc daemon
+ #
+
+ . /etc/distcc.conf
+ if [ -z "$DISTCC_ALLOW" ]; then
+ </pre>
+
+ <p>Create /etc/distcc.conf;</p>
+
+ <pre>
+
+ </pre>
+
+
<a href="index.html">Core OS Index</a>
<p>
This is part of the Hive System Documentation.