3 # $NetBSD: lvm2netbsd,v 1.2 2009/12/02 00:59:19 haad Exp $
5 # Copyright (c) 2003 The NetBSD Foundation, Inc.
8 # Redistribution and use in source and binary forms, with or without
9 # modification, are permitted provided that the following conditions
11 # 1. Redistributions of source code must retain the above copyright
12 # notice, this list of conditions and the following disclaimer.
13 # 2. Redistributions in binary form must reproduce the above copyright
14 # notice, this list of conditions and the following disclaimer in the
15 # documentation and/or other materials provided with the distribution.
17 # THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
18 # ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
19 # TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
20 # PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
21 # BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
22 # CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
23 # SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
24 # INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
25 # CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
26 # ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
27 # POSSIBILITY OF SUCH DAMAGE.
29 # lvm2netbsd: convert a file source tree into a
30 # format suitable for import. Works on current dir.
31 # You can run this only once if you want it to work.
33 # configure.h file in lvm2tools/lib/ was generated with this command
35 # ./configure --with-cluster=none --with-snapshots=internal --with-clvmd=none
36 # --with-lvm1=none --with-cluster=none --disable-readline --enable-o_direct
37 # --disable-udev_sync --enable-devmapper
39 # based on texinfo2netbsd
43 lvm2_vers
=$
(cat VERSION | cut
-d ' ' -f 1)
45 import_date
=$
(date '+%m-%d-%y');
47 # (usually) NO NEED TO EDIT BELOW THIS LINE
50 ### Wipe out stuff we don't want
53 echo "Installing header files."
56 cp `cat .symlinks | xargs` .
;
59 #ifndef _LVM_VERSION_H
60 #define LVM_VERSION "$lvm2_vers-cvs ($import_date)"
67 echo "Adding NetBSD RCS ID tags to lvm2 sources"
70 find .
-type f
-name '*.[chly]' -print |
while read c
; do
71 sed -e '1{/$NetBSD/!{i\
75 /#ifndef[ ]lint/{N;/FILE_RCSID/s/\n/\
80 __RCSID("\$NetBSD\$");\
83 mv /tmp
/file3$$
$c && echo did
source mods
for $c
86 echo "Adding NetBSD RCS ID tags to manual pages"
87 #### Add RCS tags to man pages
88 find .
-type f
-name '*.[0-9].in' -print |
while read m
; do
89 base
=`basename $m .in`
90 sed -e '1{/$NetBSD/!i\
94 }' -e 's/__CSECTION__/1/g' \
95 -e 's/__FSECTION__/5/g' \
96 -e 's/__VERSION__/'"${file_vers}/g" \
97 -e 's,__MAGIC__,/usr/share/misc/magic,g' \
98 -e "s/#VERSION#/$lvm2_vers-cvs ($import_date)/" \
99 $m > `dirname $m`/$base && echo did manpage mods
for $base
104 ### Clean up any CVS directories that might be around.
105 echo "cleaning up CVS residue."
107 find .
-type d
-name "CVS" -print |
xargs rm -r
108 find .
-type f
-name ".gitignore" -print |
xargs rm -r
115 ver
=`echo ${lvm2_vers} | sed -e 's/\./-/g'`
116 echo You can import now. Use the following
command:
117 echo cvs import src
/external
/gpl
2/lvm
2/dist REDHAT LVM
${ver}