- Make port PREFIX-safe (don't hardcode paths with /usr/local)

- Use REINPLACE_CMD to save few inodes

PR:		ports/174769
Submitted by:	myself
Approved by:	maintainer timeout (2 weeks+)
This commit is contained in:
Pawel Pekala 2013-01-16 19:45:12 +00:00
parent 9d84f7f209
commit 0747e019f2
Notes: svn2git 2021-03-31 03:12:20 +00:00
svn path=/head/; revision=310520
3 changed files with 8 additions and 81 deletions

View file

@ -1,12 +1,9 @@
# New ports collection makefile for: oneko
# Date created: 14 December 2012
# Whom: pjm
#
# Created by: pjm
# $FreeBSD$
#
PORTNAME= vboxtool
PORTVERSION= 0.5
PORTREVISION= 1
CATEGORIES= emulators
MASTER_SITES= SF
@ -27,6 +24,12 @@ USE_ZIP= yes
SAMPLESDIR= ${PREFIX}/share/${PORTNAME}
post-patch:
@${REINPLACE_CMD} -e 's|!/bin/bash|!/usr/bin/env bash|' \
-e 's|/etc/|${PREFIX}&|g' \
${WRKSRC}/script/vboxtool \
${WRKSRC}/script/vboxtoolinit
do-install:
@if [ ! -f ${PREFIX}/etc/${PORTNAME} ]; then \
${MKDIR} ${PREFIX}/etc/${PORTNAME};\

View file

@ -1,37 +0,0 @@
--- script/vboxtool.org 2012-04-29 21:59:59.000000000 +0200
+++ script/vboxtool 2012-06-16 01:26:32.000000000 +0200
@@ -1,4 +1,4 @@
-#!/bin/bash
+#!/usr/local/bin/bash
#
# vboxtool: Utility to retrieve status and control VirtualBox sessions
#
@@ -55,7 +55,7 @@
echo " --version|version Version info."
echo " --help|help This help."
echo ""
- echo "*Configuration. vboxtool depends on two config files, located in /etc/vboxtool."
+ echo "*Configuration. vboxtool depends on two config files, located in /usr/local/etc/vboxtool."
echo ""
echo "Configuration file $machines_conf:"
echo "- each line in this file is a separate machine"
@@ -84,7 +84,7 @@
echo ""
echo "*Start at boot, save on halt. VBoxTool is capable for autostart sessions at"
echo "boot time and autosave sessions when host is stopped. This depends on "
- echo "/etc/vboxtool/vboxtool.conf. In here, the variable vbox_user must be filled:"
+ echo "/usr/local/etc/vboxtool/vboxtool.conf. In here, the variable vbox_user must be filled:"
echo "vbox_user='<user name>'"
echo "Note the quotes. Fill for <user name> the name of the user under which"
echo "sessions are installed/running."
@@ -545,8 +545,8 @@
# Some constants
version='0.5'
-machines_conf='/etc/vboxtool/machines.conf'
-vboxtool_conf='/etc/vboxtool/vboxtool.conf'
+machines_conf='/usr/local/etc/vboxtool/machines.conf'
+vboxtool_conf='/usr/local/etc/vboxtool/vboxtool.conf'
vbox_folder="$HOME/.VirtualBox"
log_file="$vbox_folder/vboxtool.log"

View file

@ -1,39 +0,0 @@
--- script/vboxtoolinit.org 2012-04-29 21:59:59.000000000 +0200
+++ script/vboxtoolinit 2012-06-16 01:26:32.000000000 +0200
@@ -1,14 +1,14 @@
-#!/bin/bash
+#!/usr/local/bin/bash
#
# vboxtoolinit: Frontend for vboxtool for auto start sessions when booting and save
# sessions when host is stopped
#
-# This is a wrapper for vboxtool. It is to be placed in /etc/init.d to provide auto
+# This is a wrapper for vboxtool. It is to be placed in /usr/loca/etc/rc.d to provide auto
# start at boot time and stop when the host is halted. Because it's a wrapper, the
# original functions of vboxtool can be executed as usual, without cd'ing to
-# /etc/init.d.
+# /usr/local/etc/rc.d.
#
-# Usage: Should be placed in /etc/init.d
+# Usage: Should be placed in /usr/local/etc/rc.d
#
# Copyright (C) 2008 Mark Baaijens <mark.baaijens@gmail.com>
#
@@ -44,7 +44,7 @@
start()
{
# 'vboxtoolinit start' maps to 'vboxtool autostart'; when the host boots, all sessions in
- # the config file /etc/vboxtool/machines.conf are started
+ # the config file /usr/local/etc/vboxtool/machines.conf are started
nohup $su_command "vboxtool autostart" > /dev/null
}
@@ -62,7 +62,7 @@
}
# Some constants
-config_file='/etc/vboxtool/vboxtool.conf'
+config_file='/usr/local/etc/vboxtool/vboxtool.conf'
# Retrieve settings from config file, just by executing the config file.
# Config file $config_file should look like this: