diff options
author | rhatto <rhatto@370017ae-e619-0410-ac65-c121f96126d4> | 2008-05-11 22:17:21 +0000 |
---|---|---|
committer | rhatto <rhatto@370017ae-e619-0410-ac65-c121f96126d4> | 2008-05-11 22:17:21 +0000 |
commit | 730e77a486272513a3ede9ddea242ce91129353a (patch) | |
tree | c135552366ff4cbf1879fc7d59f8b204cc2510fd /media/sound | |
parent | 3046e0f510465282842486cfc32c540598b34082 (diff) | |
download | slackbuilds-730e77a486272513a3ede9ddea242ce91129353a.tar.gz slackbuilds-730e77a486272513a3ede9ddea242ce91129353a.tar.bz2 |
pd: added doinst.sh
git-svn-id: svn+slack://slack.fluxo.info/var/svn/slackbuilds@1885 370017ae-e619-0410-ac65-c121f96126d4
Diffstat (limited to 'media/sound')
-rwxr-xr-x | media/sound/pd/pd.SlackBuild | 39 |
1 files changed, 39 insertions, 0 deletions
diff --git a/media/sound/pd/pd.SlackBuild b/media/sound/pd/pd.SlackBuild index 2efc17b9..d4cfb389 100755 --- a/media/sound/pd/pd.SlackBuild +++ b/media/sound/pd/pd.SlackBuild @@ -176,6 +176,45 @@ pd: pd: EODESC +# 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 +} + +ln -s usr/lib64/pd/bin/pd-gui usr/bin/pd-gui ; ln -s usr/bin/pd usr/lib64/pd//bin/pd +EOSCRIPT + # Build the package cd "$PKG" makepkg -l y -c n "$REPOS/$PKG_NAME-$PKG_VERSION-$ARCH-$BUILD.tgz" || exit $ERROR_MKPKG |