diff options
author | rhatto <rhatto@370017ae-e619-0410-ac65-c121f96126d4> | 2008-04-25 18:51:16 +0000 |
---|---|---|
committer | rhatto <rhatto@370017ae-e619-0410-ac65-c121f96126d4> | 2008-04-25 18:51:16 +0000 |
commit | f9e86762ffce73dac9ce528664dd1eeb6d72e31e (patch) | |
tree | 22cf35a673b01e3ae13d59e390bcb53c2ebbbd18 | |
parent | 8195f54ac36517be045a85015929b794ebc2c32e (diff) | |
download | slackbuilds-f9e86762ffce73dac9ce528664dd1eeb6d72e31e.tar.gz slackbuilds-f9e86762ffce73dac9ce528664dd1eeb6d72e31e.tar.bz2 |
silc-client: rebuilt from mkbuild
git-svn-id: svn+slack://slack.fluxo.info/var/svn/slackbuilds@1838 370017ae-e619-0410-ac65-c121f96126d4
-rwxr-xr-x | net/im/silc-client/silc-client.SlackBuild | 46 |
1 files changed, 45 insertions, 1 deletions
diff --git a/net/im/silc-client/silc-client.SlackBuild b/net/im/silc-client/silc-client.SlackBuild index 8db82d88..da004511 100755 --- a/net/im/silc-client/silc-client.SlackBuild +++ b/net/im/silc-client/silc-client.SlackBuild @@ -40,7 +40,7 @@ PKG=${PKG:=$TMP/package-$PKG_NAME} REPOS=${REPOS:=$TMP} PREFIX=${PREFIX:=/usr} PKG_WORK="$TMP/$SRC_NAME" -CONF_OPTIONS=${CONF_OPTIONS:="--docdir=/usr/doc/$PKG_NAME-$PKG_VERSION"} +CONF_OPTIONS=${CONF_OPTIONS:="--sysconfdir=/etc --docdir=/usr/doc/$PKG_NAME-$PKG_VERSION"} NUMJOBS=${NUMJOBS:=""} # Set system libraries' path and optmization flags based on $ARCH @@ -142,6 +142,50 @@ silc-client: being developed in the IETF. silc-client: EODESC +# Move config files to .new to avoid overwriting any system config +for config_file in etc/silc.conf; do + mv $PKG/$config_file $PKG/$config_file.new +done + +# Add a post-installation script (doinst.sh) +cat << EOSCRIPT > "$PKG/install/doinst.sh" +config() { + NEW="\$1" + OLD="\$(dirname \$NEW)/\$(basename \$NEW .new)" + # If there's no config file by that name, mv it over: + if [ ! -r \$OLD ]; then + mv \$NEW \$OLD + elif [ "\$(cat \$OLD | md5sum)" = "\$(cat \$NEW | md5sum)" ]; then + # toss the redundant copy + rm \$NEW + fi + # Otherwise, we leave the .new copy for the admin to consider... +} + +mkgroup() { + GROUP="\$1" + if ! grep -qe "^\$GROUP:" etc/group; then + echo Creating group \$GROUP... + chroot . /usr/sbin/groupadd \$GROUP + fi +} + +mkuser() { + USER="\$1" + if [ ! -z "\$2" ]; then + GROUP="\$2" + else + GROUP="\$USER" + fi + if ! grep -qe "^\$USER:" etc/passwd; then + echo Creating user \$USER... + chroot . /usr/sbin/useradd \$USER -g \$GROUP + fi +} + +config etc/silc.conf +EOSCRIPT + # Build the package cd "$PKG" makepkg -l y -c n "$REPOS/$PKG_NAME-$PKG_VERSION-$ARCH-$BUILD.tgz" || exit $ERROR_MKPKG |