5 kx
5 kx # cScm Configuration Daemon
5 kx
5 kx **cScm** Configuration Daemon – is a tool to convert SCM configuration files into binary format and store its in shared memory
5 kx for reading by **cSvn-ui** and **cGit-ui** CGI scripts.
5 kx
5 kx
5 kx ## Reqired packages
5 kx
5 kx **cScm** daemon depends on [libpcre2-32](https://www.pcre.org/) library. ArchLinux distribution has the **pcre2** binary package.
5 kx On RPM based systems you can find somethink like **pcre2-devel** RPM.
5 kx
5 kx
5 kx ## Installation
5 kx
5 kx The **cScm** package provides a regular Linux daemon with control scripts.
5 kx
5 kx
5 kx ### Download Sources
5 kx
5 kx To obtain sources we have to checkout its from SVN repository:
5 kx
5 kx ```Bash
7 kx svn checkout svn://radix.pro/scm-tools/cscm/tags/cscm-0.1.4 cscm-0.1.4
5 kx ```
5 kx and run the bootstrap script:
5 kx
5 kx ```Bash
5 kx cd csvn-0.1.4
5 kx ./bootstrap
5 kx ```
5 kx Also **cScm** source packages are available for download on the
5 kx [Radix.pro FTP-server](https://ftp.radix.pro/pub/cscm/).
5 kx
5 kx
5 kx #### Bootstrap Script
5 kx
5 kx The *bootstrap* script especialy created for *Autotools* install automation. To install
5 kx *Autotools* into sourse directory on build machine (i.e. when **build** == **host**) the *bootstrap*
5 kx script can be run without arguments.
5 kx
5 kx ```Bash
5 kx ./bootstrap
5 kx ```
5 kx
5 kx I this case *Autotools* will be installed from current root file system.
5 kx
5 kx For the cross environment the `--target-dest-dir` option allows to install some stuff from
5 kx development root file system:
5 kx
5 kx ```Bash
5 kx TARGET_DEST_DIR=/home/developer/prog/trunk-672/dist/.s9xx-glibc/enybox-x2 \
5 kx ./bootstrap --target-dest-dir=${TARGET_DEST_DIR}
5 kx ```
5 kx
5 kx For example, in this case the *aclocal.m4* script will be collected from the
5 kx `${TARGET_DEST_DIR}/usr/share/aclocal` directory.
5 kx
5 kx
5 kx ### Configuring Sources
5 kx
5 kx ```Bash
5 kx ./configure --prefix=/usr \
5 kx --sysconfdir=/etc \
5 kx --with-controldir=/etc/rc.d \
5 kx --with-logrotatedir=/etc/logrotate.d \
5 kx --with-homepath=/var/lib \
5 kx --with-logdir=/var/log \
5 kx --with-piddir=/var/run
5 kx ```
5 kx
5 kx
5 kx #### Install on the Build Machine
5 kx
5 kx ```Bash
5 kx make
5 kx make install
5 kx ```
5 kx
5 kx
5 kx #### Cross Compilation Example
5 kx
5 kx ```Bash
5 kx #!/bin/sh
5 kx
5 kx TARGET_DEST_DIR=/home/developer/prog/trunk-672/dist/.s9xx-glibc/enybox-x2
5 kx TOOLCHAIN_PATH=/opt/toolchains/aarch64-S9XX-linux-glibc/1.1.4/bin
5 kx TARGET=aarch64-s9xx-linux-gnu
5 kx
5 kx ./bootstrap --target-dest-dir=${TARGET_DEST_DIR}
5 kx
5 kx PKG_CONFIG=/usr/bin/pkg-config \
5 kx PKG_CONFIG_PATH=${TARGET_DEST_DIR}/usr/lib${LIBDIRSUFFIX}/pkgconfig:${TARGET_DEST_DIR}/usr/share/pkgconfig \
5 kx PKG_CONFIG_LIBDIR=${TARGET_DEST_DIR}/usr/lib${LIBDIRSUFFIX}/pkgconfig:${TARGET_DEST_DIR}/usr/share/pkgconfig \
5 kx STRIP="${TOOLCHAIN_PATH}/${TARGET}-strip" \
5 kx CC="${TOOLCHAIN_PATH}/${TARGET}-gcc --sysroot=${TARGET_DEST_DIR}" \
5 kx ./configure --prefix=/usr
5 kx --build=x86_64-pc-linux-gnu \
5 kx --host=${TARGET} \
5 kx --sysconfdir=/etc \
5 kx --with-controldir=/etc/rc.d \
5 kx --with-logrotatedir=/etc/logrotate.d \
5 kx --with-homepath=/var/lib \
5 kx --with-logdir=/var/log \
5 kx --with-piddir=/var/run
5 kx
5 kx make
5 kx make install DESTDIR=${TARGET_DEST_DIR}
5 kx ```
5 kx
5 kx Also we can make use of additional variables such as `CFLAGS`, `LDFLAGS`:
5 kx
5 kx ```Bash
5 kx LDFLAGS="-L${TARGET_DEST_DIR}/lib -L${TARGET_DEST_DIR}/usr/lib"
5 kx TARGET_INCPATH="-L${TARGET_DEST_DIR}/usr/include"
5 kx CFLAGS="${TARGET_INCPATH}"
5 kx CPPFLAGS="${TARGET_INCPATH}"
5 kx ```
5 kx
5 kx ### Post Install
5 kx
5 kx To run **cScm** daemon for some SCM engine we have to make control scripts executable:
5 kx
5 kx ```Bash
5 kx chmod a+x /etc/rc.d/rc.csvnd
5 kx chmod a+x /etc/rc.d/rc.cgitd
5 kx ```
5 kx
5 kx If you want to run the **cscmd** daemons on boot time then on systems with BSD-like initialization such as **Slackware** we have
5 kx to add following lines to the */etc/rc.d/rc.M* and */etc/rc.d/rc.6* scripts correspondengly:
5 kx
5 kx **/etc/rc.d/rc.M:**
5 kx
5 kx ```Bash
5 kx # Start cSvn SCM daemon:
5 kx if [ -x /etc/rc.d/rc.csvnd ]; then
5 kx /etc/rc.d/rc.csvnd start
5 kx fi
5 kx
5 kx # Start cGit SCM daemon:
5 kx if [ -x /etc/rc.d/rc.cgitd ]; then
5 kx /etc/rc.d/rc.cgitd start
5 kx fi
5 kx ```
5 kx
5 kx **/etc/rc.d/rc.6:**
5 kx
5 kx ```Bash
5 kx # Stop cSvn SCM daemon:
5 kx if [ -x /etc/rc.d/rc.csvnd ]; then
5 kx /etc/rc.d/rc.csvnd stop
5 kx fi
5 kx
5 kx # Stop cGit SCM daemon:
5 kx if [ -x /etc/rc.d/rc.cgitd ]; then
5 kx /etc/rc.d/rc.cgitd stop
5 kx fi
5 kx ```
5 kx
5 kx For systems which uses systemd initialization you have to setup your own systemd unit like following:
5 kx
5 kx **/etc/systemd/system/csvnd.service:**
5 kx
5 kx ```ini
5 kx [Unit]
5 kx Description=The cSvn daemon
5 kx After=network.target
5 kx
5 kx [Service]
5 kx PIDFile=/var/run/csvnd.pid
5 kx ExecStart=/usr/sbin/cscmd --daemonize --inotify --scm=svn --pid=/var/run/csvnd.pid --log=/var/log/csvnd.log --config=/etc/csvn-ui.rc
5 kx ExecReload=/bin/kill -s HUP $MAINPID
5 kx ExecStop=/bin/kill -s TERM $MAINPID
5 kx
5 kx [Install]
5 kx WantedBy=multi-user.target
5 kx ```
5 kx
5 kx **/etc/systemd/system/cgitd.service:**
5 kx
5 kx ```ini
5 kx [Unit]
5 kx Description=The cGit daemon
5 kx After=network.target
5 kx
5 kx [Service]
5 kx PIDFile=/var/run/cgitd.pid
5 kx ExecStart=/usr/sbin/cscmd --daemonize --inotify --scm=git --pid=/var/run/cgitd.pid --log=/var/log/cgitd.log --config=/etc/cgit-ui.rc
5 kx ExecReload=/bin/kill -s HUP $MAINPID
5 kx ExecStop=/bin/kill -s TERM $MAINPID
5 kx
5 kx [Install]
5 kx WantedBy=multi-user.target
5 kx ```
5 kx
5 kx
5 kx ## Binary Packages
5 kx
5 kx The instructions to build binary packages for popular Linux distributions are present in the
7 kx [**Documentation**](https://csvn.radix.pro/scm-tools/cscm/trunk/doc/) directory where you can find **RPM** **spec** file and also
5 kx **ArchLinux** Package Build script.
5 kx
5 kx
5 kx ## See Also
5 kx
7 kx > [**cscmd(8)**](https://csvn.radix.pro/scm-tools/cscm/trunk/doc/cscmd.8.md),
7 kx > [**csvn-ui.rc(5)**](https://csvn.radix.pro/scm-tools/csvn-ui/trunk/doc/csvn-ui.rc.5.md),
7 kx > [**cgit-ui.rc(5)**](https://csvn.radix.pro/scm-tools/cgit-ui/trunk/doc/cgit-ui.rc.5.md).
5 kx
5 kx
5 kx ## Copyright and License
5 kx
5 kx © Andrey V. Kosteltsev, 2019 – 2022.<br/>
5 kx Code and documentation released under [the **Radix.pro** License](https://csvn.radix.pro/cscm/trunk/LICENSE).