source: wspkg/freebsd/freebsd.install.sh @ 4a0c481

Last change on this file since 4a0c481 was 4a0c481, checked in by Ting-Wei Lan <lantw44@…>, 8 years ago

將所有資料檔移出這個 repo,讓資料檔和 script 分開管理

  • Property mode set to 100755
File size: 1.0 KB
Line 
1#!/bin/sh
2
3msg_and_copy () {
4    echo "==> Copying $1 to $2" 1>&2
5    cp -r "$1" "$2"
6}
7
8msg_and_mkdir () {
9    echo "==> Creating directory $1" 1>&2
10    mkdir -p "$1"
11}
12
13if [ -z "$4" ]; then
14    echo "Usage: $0 category cat_makefile cat_makefile_inc dir"
15    echo "Example: "'`'"$0 local local.makefile local.makefile.inc 217' will do"
16    echo " mkdir -p                 /usr/ports/local"
17    echo " cp -r local.makefile     /usr/ports/local/Makefile"
18    echo " cp -r local.makefile.inc /usr/ports/local/Makefile.inc"
19    echo " cp -r 217                /usr/ports/local"
20    exit 1
21fi
22
23: ${PORTSDIR:="/usr/ports"}
24category="$1"
25cat_makefile="$2"
26cat_makefile_inc="$3"
27dir="$4"
28
29[ '!' -d "${PORTSDIR}/${category}" ] && \
30    msg_and_mkdir "${PORTSDIR}/${category}"
31[ '!' -f "${PORTSDIR}/${category}/Makefile" ] && \
32    msg_and_copy "${cat_makefile}" "${PORTSDIR}/${category}/Makefile"
33[ '!' -f "${PORTSDIR}/${category}/Makefile.inc" ] && \
34    msg_and_copy "${cat_makefile_inc}" "${PORTSDIR}/${category}/Makefile.inc"
35
36msg_and_copy "${dir}" "${PORTSDIR}/${category}"
Note: See TracBrowser for help on using the repository browser.