diff options
-rw-r--r-- | Keywords/fc.ucl | 11 | ||||
-rw-r--r-- | Keywords/fcfontsdir.ucl | 21 | ||||
-rw-r--r-- | Keywords/fmtutil.ucl | 15 | ||||
-rw-r--r-- | Keywords/fontsdir.ucl | 19 | ||||
-rw-r--r-- | Keywords/info.ucl | 13 | ||||
-rw-r--r-- | Keywords/sample.ucl | 31 | ||||
-rw-r--r-- | Keywords/shell.ucl | 24 |
7 files changed, 134 insertions, 0 deletions
diff --git a/Keywords/fc.ucl b/Keywords/fc.ucl new file mode 100644 index 000000000000..fbcc0672fca9 --- /dev/null +++ b/Keywords/fc.ucl @@ -0,0 +1,11 @@ +# $FreeBSD$ +# +# MAINTAINER: x11@FreeBSD.org + +actions: [dirrmtry] +post-install: <<EOD + fc-cache -s %D/%@ 2>/dev/null || true +EOD +post-deinstall: <<EOD + fc-cache -s %D/%@ 2>/dev/null || true +EOD diff --git a/Keywords/fcfontsdir.ucl b/Keywords/fcfontsdir.ucl new file mode 100644 index 000000000000..542465aea714 --- /dev/null +++ b/Keywords/fcfontsdir.ucl @@ -0,0 +1,21 @@ +# $FreeBSD$ +# +# MAINTAINER: x11@FreeBSD.org + +actions: [dirrmtry] +post-install: <<EOD + fc-cache -s %D/%@ 2>/dev/null || true + mkfontscale %D/%@ 2>/dev/null || true + mkfontdir %D/%@ 2>/dev/null || true +EOD +post-deinstall: <<EOD + fc-cache -s %D/%@ 2>/dev/null || true + mkfontscale %D/%@ 2>/dev/null || true + if [ -e %D/%@/fonts.scale -a "`stat -f '%%z' %D/%@/fonts.scale 2>/dev/null`" = '2' ]; then + rm %D/%@/fonts.scale + fi + mkfontdir %D/%@ 2>/dev/null || true + if [ -e %D/%@/fonts.dir -a "`stat -f '%%z' %D/%@/fonts.dir 2>/dev/null`" = '2' ]; then + rm %D/%@/fonts.dir + fi +EOD diff --git a/Keywords/fmtutil.ucl b/Keywords/fmtutil.ucl new file mode 100644 index 000000000000..b20f2ed9575c --- /dev/null +++ b/Keywords/fmtutil.ucl @@ -0,0 +1,15 @@ +# $FreeBSD$ +# +# MAINTAINER: portmgr@FreeBSD.org + +actions: [] +post-install: <<EOD + fmtutil-sys --missing >/dev/null +EOD +post-deinstall: <<EOD + set -- %@ + for f in $@; do + rm -f $f + rmdir -p ${f%/*} 2>/dev/null + done +EOD diff --git a/Keywords/fontsdir.ucl b/Keywords/fontsdir.ucl new file mode 100644 index 000000000000..d4974074f448 --- /dev/null +++ b/Keywords/fontsdir.ucl @@ -0,0 +1,19 @@ +# $FreeBSD$ +# +# MAINTAINER: x11@FreeBSD.org + +actions: [dirrmtry] +post-install: <<EOD + mkfontscale %D/%@ 2>/dev/null || true + mkfontdir %D/%@ 2>/dev/null || true +EOD +post-deinstall: <<EOD + mkfontscale %D/%@ 2>/dev/null || true + if [ -e %D/%@/fonts.scale -a "`stat -f '%%z' %D/%@/fonts.scale 2>/dev/null`" = '2' ]; then + rm %D/%@/fonts.scale + fi + mkfontdir %D/%@ 2>/dev/null || true + if [ -e %D/%@/fonts.dir -a "`stat -f '%%z' %D/%@/fonts.dir 2>/dev/null`" = '2' ]; then + rm %D/%@/fonts.dir + fi +EOD diff --git a/Keywords/info.ucl b/Keywords/info.ucl new file mode 100644 index 000000000000..b0d4b02ac4a4 --- /dev/null +++ b/Keywords/info.ucl @@ -0,0 +1,13 @@ +# $FreeBSD$ +# +# MAINTAINER: portmgr@FreeBSD.org + +actions: [file] +post-install: <<EOD + file=%D/%@ + indexinfo ${file%/*} +EOD +post-deinstall: <<EOD + file=%D/%@ + indexinfo ${file%/*} +EOD diff --git a/Keywords/sample.ucl b/Keywords/sample.ucl new file mode 100644 index 000000000000..6c9ac688bd0d --- /dev/null +++ b/Keywords/sample.ucl @@ -0,0 +1,31 @@ +# $FreeBSD$ +# +# MAINTAINER: portmgr@FreeBSD.org +# +# @sample etc/somefile.conf.sample +# +# This will install the somefile.conf.sample and automatically copy to +# somefile.conf if it doesn't exist. On deinstall it will remove the +# somefile.conf if it still matches the sample, otherwise it is +# kept. +# +# This replaces the old pattern: +# @unexec if cmp -s %D/etc/pkgtools.conf %D/etc/pkgtools.conf.sample; then rm -f %D/etc/pkgtools.conf; fi +# etc/pkgtools.conf.sample +# @exec [ -f %B/pkgtools.conf ] || cp %B/%f %B/pkgtools.conf + +actions: [file] +post-install: <<EOD + sample_file="%D/%@" + target_file="${sample_file%.sample}" + if ! [ -f "${target_file}" ]; then + /bin/cp -p "${sample_file}" "${target_file}" + fi +EOD +pre-deinstall: <<EOD + sample_file="%D/%@" + target_file="${sample_file%.sample}" + if cmp -s "${target_file}" "${sample_file}"; then + rm -f "${target_file}" + fi +EOD diff --git a/Keywords/shell.ucl b/Keywords/shell.ucl new file mode 100644 index 000000000000..70a21ad4fd4b --- /dev/null +++ b/Keywords/shell.ucl @@ -0,0 +1,24 @@ +# $FreeBSD$ +# +# MAINTAINER: portmgr@FreeBSD.org +# +# @shell bin/shell +# +# Handle adding and remove a path to a shell binary into /etc/shells +# it replaces the following code: +# +# bin/shell +# @exec echo "Updating /etc/shells"; cp /etc/shells /etc/shells.bak; (grep -v %D/%F /etc/shells.bak; echo %D/%F) >/etc/shells; rm -f /etc/shells.bak +# @unexec echo "Updating /etc/shells"; cp /etc/shells /etc/shells.bak; (grep -v %D/%F /etc/shells.bak) >/etc/shells; rm -f /etc/shells.bak + +actions: [file] +post-install: <<EOD + cp /etc/shells /etc/shells.bak + (grep -v %D/%@ /etc/shells.bak; echo %D/%@) > /etc/shells + rm -f /etc/shells.bak +EOD +pre-deinstall: <<EOD + cp /etc/shells /etc/shells.bak + grep -v %D/%@ /etc/shells.bak > /etc/shells + rm -f /etc/shells.bak +EOD |