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