1 1.1 rin #! /bin/sh 2 1.1 rin # 3 1.1 rin # $NetBSD: tre2netbsd,v 1.1 2017/11/17 16:08:20 rin Exp $ 4 1.1 rin # 5 1.1 rin # Copyright (c) 2000 The NetBSD Foundation, Inc. 6 1.1 rin # All rights reserved. 7 1.1 rin # 8 1.1 rin # Redistribution and use in source and binary forms, with or without 9 1.1 rin # modification, are permitted provided that the following conditions 10 1.1 rin # are met: 11 1.1 rin # 1. Redistributions of source code must retain the above copyright 12 1.1 rin # notice, this list of conditions and the following disclaimer. 13 1.1 rin # 2. Redistributions in binary form must reproduce the above copyright 14 1.1 rin # notice, this list of conditions and the following disclaimer in the 15 1.1 rin # documentation and/or other materials provided with the distribution. 16 1.1 rin # 17 1.1 rin # THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS 18 1.1 rin # ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED 19 1.1 rin # TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR 20 1.1 rin # PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS 21 1.1 rin # BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 22 1.1 rin # CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 23 1.1 rin # SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 24 1.1 rin # INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 25 1.1 rin # CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 26 1.1 rin # ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 27 1.1 rin # POSSIBILITY OF SUCH DAMAGE. 28 1.1 rin # 29 1.1 rin # based on nvi2netbsd, 30 1.1 rin # itself based on bind2netbsd by Bernd Ernesti and changes by Simon Burge 31 1.1 rin # 32 1.1 rin # Rough instructions for importing new tre release from their git repository: 33 1.1 rin # 34 1.1 rin # $ cd /some/where/temporary 35 1.1 rin # $ git clone https://github.com/laurikari/tre.git 36 1.1 rin # $ sh /usr/src/external/bsd/tre/tre2netbsd tre `pwd` 37 1.1 rin # $ cd src/external/bsd/tre/dist 38 1.1 rin # $ cvs import src/external/bsd/tre/dist LAURIKARI tre-yyyymmdd 39 1.1 rin # >>> if any conflicts, merge, fix and commit them. 40 1.1 rin # >>> check out src/external/bsd/tre/dist. 41 1.1 rin # $ cd checked-out-directory 42 1.1 rin # >>> next step requires autoconf, automake, gettext, and libtool. 43 1.1 rin # $ utils/autogen.sh 44 1.1 rin # $ ./configure --prefix=/usr --without-alloca 45 1.1 rin # >>> merge newly generated files: 46 1.1 rin # >>> config.h into /usr/src/external/bsd/tre/include 47 1.1 rin # >>> lib/tre-config.h into /usr/src/external/bsd/tre/include 48 1.1 rin # >>> tre.pc into /usr/src/external/bsd/tre/lib 49 1.1 rin 50 1.1 rin prog="$(basename "$0")" 51 1.1 rin r="$1" 52 1.1 rin d="$2"/src/external/bsd/tre/dist 53 1.1 rin 54 1.1 rin if [ $# -ne 2 ]; then echo "${prog} src dest"; exit 1; fi 55 1.1 rin 56 1.1 rin case "$d" in 57 1.1 rin /*) 58 1.1 rin ;; 59 1.1 rin *) 60 1.1 rin d="`/bin/pwd`/$d" 61 1.1 rin ;; 62 1.1 rin esac 63 1.1 rin 64 1.1 rin case "$r" in 65 1.1 rin /*) 66 1.1 rin ;; 67 1.1 rin *) 68 1.1 rin r="`/bin/pwd`/$r" 69 1.1 rin ;; 70 1.1 rin esac 71 1.1 rin 72 1.1 rin echo preparing directory "$d" 73 1.1 rin rm -rf "$d" 74 1.1 rin mkdir -p "$d" 75 1.1 rin 76 1.1 rin ### Copy the files and directories 77 1.1 rin echo copying "$r" to "$d" 78 1.1 rin cd "$r" 79 1.1 rin pax -rw * "$d" 80 1.1 rin 81 1.1 rin echo removing unneeded directories and files 82 1.1 rin 83 1.1 rin ### Remove unneeded files 84 1.1 rin cd "$d" 85 1.1 rin rm -fr `find . -name '.git*'` 86 1.1 rin 87 1.1 rin exit 0 88