From ff15d66f2ca650aaf9f7e0c7850b3ce200a25144 Mon Sep 17 00:00:00 2001 From: "Slawomir Wojciech Wojtczak (vermaden)" Date: Sat, 25 Feb 2012 21:07:05 +0100 Subject: [PATCH] 1.1 --- automount | 75 ++++++++++++++++++++++--- port/distfiles/automount-1.0.tar.gz | Bin 2553 -> 3254 bytes port/distfiles/automount-1.0/automount | 75 ++++++++++++++++++++++--- port/sysutils/automount/Makefile | 5 +- port/sysutils/automount/distinfo | 5 +- port/sysutils/automount/pkg-install | 14 +++++ 6 files changed, 155 insertions(+), 19 deletions(-) create mode 100644 port/sysutils/automount/pkg-install diff --git a/automount b/automount index 4e8db72..92ed6b8 100755 --- a/automount +++ b/automount @@ -22,7 +22,72 @@ # (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF # THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -PATH=/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/local/sbin +PATH=${PATH}:/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/local/sbin + +__usage() { + cat << EOF +AUTOMOUNT is a devd(8) based automounter for FreeBSD. + +It supports following file systems: +UFS/FAT/exFAT/NTFS/EXT2/EXT3/EXT4 + +It needs these ports to mount NTFS/exFAT/EXT4 respectively: + o sysutils/fusefs-ntfs + o sysutils/fusefs-exfat + o sysutils/fusefs-ext4fuse + +By default it mounts/unmounts all removable media but +it is possible to set some additional options at the +/usr/local/etc/automount.conf config file. + +Below is a list of possible options with description. + +MNTPREFIX (set to /media by default) + With this options You can alter the default root + for mounting the removable media, for example to + the /mnt directory. + + example: MNTPREFIX="/media" + +ENCODING (set to en_US.ISO8859-1 by default) + Only used with FAT32 mounts, specifies which + encoding to use at the mount. + + example: ENCODING="pl_PL.ISO8859-2" + +CODEPAGE (set to cp437 by default) + Only used with FAT32 mounts, specifies which + code page to use at the mount. + + example: CODEPAGE="cp852" + +USER (unset by default) + If set to some username, the mount command will + chown(1) the mount directory with the user and + its primary user group. If used with FM option + allows to launch the specified file manager after + a successful mount. + + example: USER="vermaden" + +FM (unset by default) + If set to file manager command, the mount will + launch the specified command after successful + mount. Works only if USER parameter is also set. + + example: FM="nautilus --browser --no-desktop" + +USERUMOUNT (set to NO by default) + When set to YES it will 'chmod +s /sbin/umount' + which would allow an USER to unmount the file + system with their selected file manager. + + example: USERUMOUNT="YES" +EOF + exit 0 +} + +[ "${1}" = "-h" -o "${1}" = "--help" -o ${#} -eq 0 -o ${#} -eq 1 ] && __usage [ -f /usr/local/etc/automount.conf ] && . /usr/local/etc/automount.conf @@ -86,9 +151,6 @@ case ${2} in ;; (*NTFS*) # must be after FAT section: newfs_msdos -O NTFS -L NTFS dd < ${DEV} count=1 2> /dev/null | strings | head -1 | grep "NTFS" && { - which ntfsfix 1> /dev/null 2> /dev/null && { - ntfsfix ${DEV} # sysutils/ntfsprogs - } which ntfs-3g 1> /dev/null 2> /dev/null && { ntfs-3g -o noatime ${DEV} ${MNT} && ADD=1 # sysutils/fusefs-ntfs } || { @@ -122,7 +184,7 @@ case ${2} in case $( dd < ${DEV} count=1 2> /dev/null | strings | head -1 ) in (EXFAT) mount.exfat -o noatime ${DEV} ${MNT} && ADD=1 # sysutils/fusefs-exfat - __log "${DEV}:mount (ufs)" + __log "${DEV}:mount (exfat)" ;; esac ;; @@ -148,8 +210,7 @@ case ${2} in __log "${DEV}:umount" done __log "${DEV}:detach" + find ${MNTPREFIX} -type d -empty -maxdepth 1 -delete ;; esac - -find ${MNTPREFIX} -type d -empty -delete diff --git a/port/distfiles/automount-1.0.tar.gz b/port/distfiles/automount-1.0.tar.gz index 7228a94307357d8981c76efd42fd3332f91ca0b5..fd4b11def7fc6555f5b4d8f43b294201535a2823 100644 GIT binary patch literal 3254 zcmV;n3`z4JiwFQVKS@sj1MOOEQ`<-q-p~FOy@D)|Mfioc#942xu|-gou{ldlLM?Zc zkYucjZ29y8VH5xNdwNE)WiTO^-R$1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M+eU&Rkt diff --git a/port/distfiles/automount-1.0/automount b/port/distfiles/automount-1.0/automount index 4e8db72..92ed6b8 100755 --- a/port/distfiles/automount-1.0/automount +++ b/port/distfiles/automount-1.0/automount @@ -22,7 +22,72 @@ # (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF # THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -PATH=/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/local/sbin +PATH=${PATH}:/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/local/sbin + +__usage() { + cat << EOF +AUTOMOUNT is a devd(8) based automounter for FreeBSD. + +It supports following file systems: +UFS/FAT/exFAT/NTFS/EXT2/EXT3/EXT4 + +It needs these ports to mount NTFS/exFAT/EXT4 respectively: + o sysutils/fusefs-ntfs + o sysutils/fusefs-exfat + o sysutils/fusefs-ext4fuse + +By default it mounts/unmounts all removable media but +it is possible to set some additional options at the +/usr/local/etc/automount.conf config file. + +Below is a list of possible options with description. + +MNTPREFIX (set to /media by default) + With this options You can alter the default root + for mounting the removable media, for example to + the /mnt directory. + + example: MNTPREFIX="/media" + +ENCODING (set to en_US.ISO8859-1 by default) + Only used with FAT32 mounts, specifies which + encoding to use at the mount. + + example: ENCODING="pl_PL.ISO8859-2" + +CODEPAGE (set to cp437 by default) + Only used with FAT32 mounts, specifies which + code page to use at the mount. + + example: CODEPAGE="cp852" + +USER (unset by default) + If set to some username, the mount command will + chown(1) the mount directory with the user and + its primary user group. If used with FM option + allows to launch the specified file manager after + a successful mount. + + example: USER="vermaden" + +FM (unset by default) + If set to file manager command, the mount will + launch the specified command after successful + mount. Works only if USER parameter is also set. + + example: FM="nautilus --browser --no-desktop" + +USERUMOUNT (set to NO by default) + When set to YES it will 'chmod +s /sbin/umount' + which would allow an USER to unmount the file + system with their selected file manager. + + example: USERUMOUNT="YES" +EOF + exit 0 +} + +[ "${1}" = "-h" -o "${1}" = "--help" -o ${#} -eq 0 -o ${#} -eq 1 ] && __usage [ -f /usr/local/etc/automount.conf ] && . /usr/local/etc/automount.conf @@ -86,9 +151,6 @@ case ${2} in ;; (*NTFS*) # must be after FAT section: newfs_msdos -O NTFS -L NTFS dd < ${DEV} count=1 2> /dev/null | strings | head -1 | grep "NTFS" && { - which ntfsfix 1> /dev/null 2> /dev/null && { - ntfsfix ${DEV} # sysutils/ntfsprogs - } which ntfs-3g 1> /dev/null 2> /dev/null && { ntfs-3g -o noatime ${DEV} ${MNT} && ADD=1 # sysutils/fusefs-ntfs } || { @@ -122,7 +184,7 @@ case ${2} in case $( dd < ${DEV} count=1 2> /dev/null | strings | head -1 ) in (EXFAT) mount.exfat -o noatime ${DEV} ${MNT} && ADD=1 # sysutils/fusefs-exfat - __log "${DEV}:mount (ufs)" + __log "${DEV}:mount (exfat)" ;; esac ;; @@ -148,8 +210,7 @@ case ${2} in __log "${DEV}:umount" done __log "${DEV}:detach" + find ${MNTPREFIX} -type d -empty -maxdepth 1 -delete ;; esac - -find ${MNTPREFIX} -type d -empty -delete diff --git a/port/sysutils/automount/Makefile b/port/sysutils/automount/Makefile index 952c3dd..b5bc56b 100644 --- a/port/sysutils/automount/Makefile +++ b/port/sysutils/automount/Makefile @@ -7,6 +7,7 @@ PORTNAME= automount PORTVERSION= 1.0 +LICENSE= BSD CATEGORIES= sysutils MASTER_SITES= https://github.com/vermaden/automount/ @@ -15,12 +16,12 @@ COMMENT= devd(8) based automount sollution PLIST_FILES= sbin/automount etc/devd/automount_devd.conf etc/automount.conf.sample -do-build: +NO_BUILD= yes do-install: ${INSTALL_SCRIPT} ${WRKSRC}/automount ${PREFIX}/sbin ${INSTALL_DATA} ${WRKSRC}/automount_devd.conf ${PREFIX}/etc/devd/automount_devd.conf ${INSTALL_DATA} ${WRKSRC}/automount.conf.sample ${PREFIX}/etc/automount.conf.sample - /etc/rc.d/devd restart + ${SH} ${PKGINSTALL} ${PKGNAME} POST-INSTALL .include diff --git a/port/sysutils/automount/distinfo b/port/sysutils/automount/distinfo index 76098a2..97f205b 100644 --- a/port/sysutils/automount/distinfo +++ b/port/sysutils/automount/distinfo @@ -1,3 +1,2 @@ -MD5 (automount-1.0.tar.gz) = 050d33273d952436b492eaa9c13bcfb5 -SHA256 (automount-1.0.tar.gz) = dcbe2f11742c92ad9c2bc7d7c33b73efb9148cac46507edd505b4a4fa7198253 -SIZE (automount-1.0.tar.gz) = 2553 +SHA256 (automount-1.0.tar.gz) = 3ff5c3a251877624da7caf7d0594e85312a4e9c96a22a30fdf34d1fd302b5f4f +SIZE (automount-1.0.tar.gz) = 3254 diff --git a/port/sysutils/automount/pkg-install b/port/sysutils/automount/pkg-install new file mode 100644 index 0000000..5efa21e --- /dev/null +++ b/port/sysutils/automount/pkg-install @@ -0,0 +1,14 @@ +#!/bin/sh + +case ${2} in + (POST-INSTALL) + /etc/rc.d/devd restart + echo + echo + echo "Check /usr/local/sbin/automount --help for available options." + echo + echo + ;; + (PRE-INSTALL) : ;; +esac +