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

Last change on this file since 8289 was 8289, checked in by joerg, 11 years ago

reactivate cpiling of osm2pgsql

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