Я пользую cl-setup-system -T local
local относится к локальным шаблонам директории /var/calculate/templates. Для Clt-шаблонов нужно использовать вызов “cl-setup-system -T clt”. Неплохо было бы ещё добавить “-v” для того, чтобы видеть изменения.
cl-core-setup в данном случае покажет ещё связан Clt-шаблон с пакетом или нет.
Например, для настройки /etc/samba/smb.conf, вы можете пойти двумя путями:
# Создать шаблон "/etc/samba/smb.conf.default.clt"
:
# Calculate name=smb.conf link=smb.conf.default format=samba
# Создать шаблон "/etc/samba/smb.conf.clt"
и содержимым:
# Calculate merge(net-fs/samba)!= link=smb.conf.default format=samba
Суть в том, что smb.conf ebuild’ом не создаётся, поэтому в первом примере шаблон “привязывается” к файлу smb.conf.default, меняя конечное имя. В примере smb.conf.default используется как основа для шаблона smb.conf и связывается с ним при помощи параметра link.
Во втором случае мы создаём файл шаблона, который никак не связан с пакетом, поэтому добавляем параметр “merge”, явно связывая его с samba.
Проверить работу шаблона можно выполнив:
cl-core-setup --pkg-name=samba -T clt
Пример:
* Шаблон:
cat /etc/samba/smb.conf.clt
# Calculate merge(net-fs/samba)!= link=smb.conf.default format=samba
[global]
workgroup = CALCULATE
* Настроенный файл:
cat /etc/samba/smb.conf
#------------------------------------------------------------------------------
# Modified Calculate-core 3.2.1
# Processed template files:
# /etc/samba/smb.conf.clt
# For modify this file, create /etc/samba/smb.conf.clt template.
#------------------------------------------------------------------------------
# This is the main Samba configuration file. You should read the
# smb.conf(5) manual page in order to understand the options listed
# here. Samba has a huge number of configurable options (perhaps too
# many!) most of which are not shown in this example
#
# For a step to step guide on installing, configuring and using samba,
# read the Samba-HOWTO-Collection. This may be obtained from:
# http://www.samba.org/samba/docs/Samba-HOWTO-Collection.pdf
#
# Many working examples of smb.conf files can be found in the
# Samba-Guide which is generated daily and can be downloaded from:
# http://www.samba.org/samba/docs/Samba-Guide.pdf
#
# Any line which starts with a ; (semi-colon) or a # (hash)
# is a comment and is ignored. In this example we will use a #
# for commentry and a ; for parts of the config file that you
# may wish to enable
#
# NOTE: Whenever you modify this file you should run the command "testparm"
# to check that you have not made any basic syntactic errors.
#
#======================= Global Settings =====================================
[global]
# workgroup = NT-Domain-Name or Workgroup-Name, eg: MIDEARTH
workgroup = CALCULATE
# server string is the equivalent of the NT Description field
...