diff options
author | Ting-Wei Lan <lantw44@gmail.com> | 2014-02-16 17:44:51 +0800 |
---|---|---|
committer | Ting-Wei Lan <lantw44@gmail.com> | 2014-02-16 17:44:51 +0800 |
commit | 1c22b9c0c1290edac4853b1283a3165c558e7aed (patch) | |
tree | 8aca52748d2413a9b80073beb172b04c55d67b0b | |
parent | a7abd2f93628a4cdde843bd3ac68754a2e417627 (diff) | |
download | wspkg-1c22b9c0c1290edac4853b1283a3165c558e7aed.tar.gz wspkg-1c22b9c0c1290edac4853b1283a3165c558e7aed.tar.zst wspkg-1c22b9c0c1290edac4853b1283a3165c558e7aed.zip |
支援產生 FreeBSD meta-ports
-rw-r--r-- | .gitignore | 8 | ||||
-rw-r--r-- | freebsd.makefile.in | 23 | ||||
-rwxr-xr-x | freebsd.makefile.sh | 42 |
3 files changed, 73 insertions, 0 deletions
diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..1b27799 --- /dev/null +++ b/.gitignore @@ -0,0 +1,8 @@ +.*.swp +.*.swo +*.out +*.list +*.ports +*.control +*.makefile +/freebsd.ports.find diff --git a/freebsd.makefile.in b/freebsd.makefile.in new file mode 100644 index 0000000..788db04 --- /dev/null +++ b/freebsd.makefile.in @@ -0,0 +1,23 @@ +# Created by: Rong-En Fan <rafan@csie.ntu.edu.tw> +# $FreeBSD: This is not an official FreeBSD pors $ +# Modified by: Ting-Wei Lan <lantw44@csie.ntu.edu.tw> +# vim: set ts=8 sts=8 sw=8: + +PORTNAME= 217 +PORTVERSION= @TODAY@ +CATEGORIES= local +MASTER_SITES= # + +MAINTAINER= ta217@csie.ntu.edu.tw +COMMENT= Meta-port for all Packages in 217 + +LICENSE= BSD + +NO_BUILD= yes + +RUN_DEPENDS+= @FREEBSD_DOT_PORTS@ + +do-install: + @${DO_NADA} + +.include <bsd.port.mk> diff --git a/freebsd.makefile.sh b/freebsd.makefile.sh new file mode 100755 index 0000000..4a1c23a --- /dev/null +++ b/freebsd.makefile.sh @@ -0,0 +1,42 @@ +#!/bin/sh + +gen_list () { + exec 4< "${ports_file}" + + while read -r pkg_name pkg_ports 0<&4; do + echo " ${pkg_name}>=0:"'${PORTSDIR}'"/${pkg_ports} \\" + done + + exec 4<&- +} + +makefile_in_file="$1" +: ${makefile_in_file:="freebsd.makefile.in"} + +ports_file="$2" +: ${ports_file:="freebsd.ports"} + +exec 3< "${makefile_in_file}" + +saveIFS="${IFS}" +lineIFS="$(printf "\n")" +IFS="${lineIFS}" + +while read -r makefile_line 0<&3; do + case "${makefile_line}" in + "PORTVERSION="*) + printf "PORTVERSION=\t%s\n" "`date '+%Y.%m.%d'`" + ;; + "RUN_DEPENDS+="*) + echo 'RUN_DEPENDS+= \' + IFS="${saveIFS}" + gen_list + IFS="${lineIFS}" + ;; + *) + echo "${makefile_line}" + ;; + esac +done + +exec 3<&- |