source: subversion/applications/utils/debian/make_install_files.sh @ 5003

Last change on this file since 5003 was 5003, checked in by joerg, 12 years ago

utils/debian: move file mapnik-osm-updater

  • Property svn:executable set to *
File size: 4.5 KB
Line 
1#!/bin/sh
2
3dst_path=$1
4
5if [ ! -n "$dst_path" ] ; then
6    echo "Please specify a Directory to use as Basedirectory"
7    echo "Usage:"
8    echo "     $0 <working-dir>"
9    exit -1
10fi
11
12echo "copying Files to '$dst_path'"
13package_name=openstreetmap
14dst_path=${dst_path%/}
15
16perl_path="$dst_path/usr/share/perl5"
17bin_path="$dst_path/usr/bin"
18lib_path="$dst_path/usr/lib"
19share_path="$dst_path/usr/share/$package_name"
20man1_path="$dst_path/usr/man/man1"
21mkdir -p "$perl_path"
22mkdir -p "$bin_path"
23mkdir -p "$lib_path"
24mkdir -p "$share_path"
25mkdir -p "$man1_path"
26
27
28# ------------------------------------------------------------------
29# Utilities written in C
30
31echo ""
32echo "---> import/and2osm"
33(
34    cd import/and2osm/
35    make clean
36    make || exit -1
37    ) || exit -1
38cp import/and2osm/2AND  ${bin_path}/osm2AND
39
40#if false ; then
41# tweety@pack:~/svn.openstreetmap.org/applications/lib/libosm$ make
42# g++ -g -I/usr/local/include -I../ccoord   -c -o Components.o Components.cpp
43# Components.cpp:27:29: error: libshp/shapefil.h: No such file or directory
44# so
45#    libosm libimg
46# have to be added later to the loop
47for lib in ccoord ; do 
48        (
49            echo ""
50            echo "---> lib/$lib"
51            cd ../lib/$lib
52        #    for a in *.cpp ; do perl -p -i -e 's,libshp/shapefil.h,shapefil.h,g' $a; done
53            make clean
54            make || exit -1
55            ) || exit -1
56
57        cp ../lib/$lib/lib${lib}.a ${lib_path}
58    done
59
60# As soon as libosm compiles here on my debian machine
61if false ; then
62    echo ""
63    echo "---> filter/wayclean"
64    (
65        cd filter/wayclean
66        make clean
67        make || exit -1
68        ) || exit -1
69    cp filter/wayclean/wayclean ${bin_path}
70
71    echo ""
72    echo "---> osm2shp"
73    ( 
74        cd export/osm2shp
75        make clean
76        make || exit -1
77        ) || exit -1
78    cp export/osm2shp/osm2shp ${bin_path}
79fi
80# of later
81
82echo ""
83echo "---> color255"
84(
85    cd color255
86    make clean
87    make || exit -1
88) || exit -1
89cp color255/color255 ${bin_path}
90
91echo ""
92echo "---> osm2pqsql"
93(
94    cd export/osm2pgsql
95    make clean
96    make || exit -1
97    ) || exit -1
98cp export/osm2pgsql/osm2pgsql ${bin_path}
99
100echo ""
101echo "---> UTF8Sanitizer"
102(
103    cd planet.osm/C/
104    make clean
105    make || exit -1
106) || exit -1
107cp planet.osm/C/UTF8sanitizer ${bin_path}
108
109
110# ------------------------------------------------------------------
111# Copy Perl libraries
112find perl_lib/ -name "*.pm" | while read src_fn ; do 
113    dst_fn="$perl_path/${src_fn#perl_lib/}"
114    dst_dir="`dirname "$dst_fn"`"
115    test -d "$dst_dir" || mkdir -p "$dst_dir"
116    cp "$src_fn" "$dst_fn"
117done
118
119# Copy Perl Binaries
120find ./ -name "*.pl" | while read src_fn ; do 
121    dst_fn="$bin_path/${src_fn##*/}"
122    filename="`basename $src_fn`"
123    dst_fn="${dst_fn/.pl}"
124    if ! echo $dst_fn | grep -e osm ; then
125        dst_fn="`dirname ${dst_fn}`/osm-`basename ${dst_fn}`"
126    fi
127    man1_fn="$man1_path/${filename%.pl}.1"
128    if head -1 "$src_fn" | grep -q -e '^#! */usr/bin/perl' ; then
129        cp "$src_fn" "$dst_fn"
130    else
131        echo "WARNING!!! Perl Hash Bang is missing at File '$src_fn'"
132        echo "           I'm not adding this File to the debian Package"
133        echo "First Line: `head -1 "$src_fn"`"
134    fi
135
136
137
138    if perldoc "$src_fn" >/dev/null 2>&1 ; then
139        echo "Create Man Page from pod '$man1_fn'"
140        pod2man $src_fn >"$man1_fn"
141    else
142        if grep -q -e "--man" "$src_fn"; then
143            echo "Create Man Page '$man1_fn'"
144            perl $src_fn --man >"$man1_fn"
145        else
146            if grep -q -e "--help" "$src_fn"; then
147                echo "Create Man Page from Help '$man1_fn'"
148                perl $src_fn --help >"$man1_fn"
149            else
150                echo "!!!! No idea how to create Man Page for $src_fn"
151            fi
152        fi
153    fi
154done
155
156# Copy Python Binaries
157find ./ -name "*.py" | while read src_fn ; do 
158    dst_fn="$bin_path/${src_fn##*/}"
159    dst_fn="${dst_fn/.py}"
160    if head -1 "$src_fn" | grep -q -e '^#! */usr/bin/python' -e '^#!/usr/bin/env python'; then
161        cp "$src_fn" "$dst_fn"
162    else
163        echo "WARNING!!! Python Hash Bang is missing at File '$src_fn'"
164        echo "           I'm not adding this File to the debian Package"
165        echo "           First Line: `head -1 "$src_fn"`"
166    fi
167done
168
169
170
171
172# XXX
173# For later:
174# Add java tools, but for these a build.xml with a target jar or similar would be best
175
176
177# #######################################################
178# Osmosis
179# #######################################################
180cd osmosis
181ant dist_binary
182cd ..
183mkdir -p $dst_path/usr/local/share/osmosis/
184cp ./osmosis/dist/result/osmosis.jar $dst_path/usr/local/share/osmosis/
185
186
187cp debian/osmosis.sh "$bin_path/osmosis"
188
189
190#########################################################
191# Mapnik installation tool
192#########################################################
193cp export/osm2pgsql/mapnik-osm-updater.sh "$bin_path"
Note: See TracBrowser for help on using the repository browser.