From 155c54ce623778c07f792655030adebc33ab381f Mon Sep 17 00:00:00 2001 From: Jochen Topf Date: Wed, 13 Apr 2011 21:41:59 +0200 Subject: [PATCH 1/6] Use LITE_RUNTIME option. This way we can link to the smaller libprotobuf-lite. We can't use reflection, but thats not really needed in most cases. --- src/fileformat.proto | 1 + src/osmformat.proto | 1 + 2 files changed, 2 insertions(+) diff --git a/src/fileformat.proto b/src/fileformat.proto index 2322ce0..974ee2f 100644 --- a/src/fileformat.proto +++ b/src/fileformat.proto @@ -15,6 +15,7 @@ */ +option optimize_for = LITE_RUNTIME; option java_package = "crosby.binary"; package OSMPBF; diff --git a/src/osmformat.proto b/src/osmformat.proto index 44e24f7..25d9e1c 100644 --- a/src/osmformat.proto +++ b/src/osmformat.proto @@ -15,6 +15,7 @@ */ +option optimize_for = LITE_RUNTIME; option java_package = "crosby.binary"; package OSMPBF; From 15f74101a4fda10ac4c0cc5ae644e4fe23ad7678 Mon Sep 17 00:00:00 2001 From: Jochen Topf Date: Wed, 13 Apr 2011 21:45:20 +0200 Subject: [PATCH 2/6] Add Makefile to build .h files and lib --- .gitignore | 3 +++ src/Makefile | 24 ++++++++++++++++++++++++ 2 files changed, 27 insertions(+) create mode 100644 .gitignore create mode 100644 src/Makefile diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..c016218 --- /dev/null +++ b/.gitignore @@ -0,0 +1,3 @@ +src/*.pb.h +src/*.pb.o +src/libosmpbf.a diff --git a/src/Makefile b/src/Makefile new file mode 100644 index 0000000..116d6ca --- /dev/null +++ b/src/Makefile @@ -0,0 +1,24 @@ + +CXX = g++ +CXXFLAGS = -O3 +AR = ar + +all: libosmpbf.a fileformat.pb.h osmformat.pb.h + +libosmpbf.a: fileformat.pb.o osmformat.pb.o + $(AR) -cr $@ fileformat.pb.o osmformat.pb.o + +%.pb.o: %.pb.cc + $(CXX) $(CXXFLAGS) -c -o $@ $< + +%.pb.cc %.pb.h: %.proto + protoc --proto_path=. --cpp_out=. $< + +install: + install -m 644 -g root -o root libosmpbf.a $(DESTDIR)/usr/lib + install -m 755 -g root -o root -d $(DESTDIR)/usr/include/osmpbf + install -m 644 -g root -o root fileformat.pb.h osmformat.pb.h $(DESTDIR)/usr/include/osmpbf + +clean: + rm -f *.pb.h *.pb.cc *.pb.o libosmpbf.a + From fb44931f3bae73f7a414d05fbab5755b3e1700d2 Mon Sep 17 00:00:00 2001 From: Jochen Topf Date: Wed, 13 Apr 2011 21:47:56 +0200 Subject: [PATCH 3/6] Consistent reference to LGPL --- src/fileformat.proto | 4 ++-- src/osmformat.proto | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/fileformat.proto b/src/fileformat.proto index 974ee2f..e6fd937 100644 --- a/src/fileformat.proto +++ b/src/fileformat.proto @@ -8,9 +8,9 @@ This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. + GNU Lesser General Public License for more details. - You should have received a copy of the GNU General Public License + You should have received a copy of the GNU Lesser General Public License along with this program. If not, see . */ diff --git a/src/osmformat.proto b/src/osmformat.proto index 25d9e1c..ddf2c84 100644 --- a/src/osmformat.proto +++ b/src/osmformat.proto @@ -8,9 +8,9 @@ This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. + GNU Lesser General Public License for more details. - You should have received a copy of the GNU General Public License + You should have received a copy of the GNU Lesser General Public License along with this program. If not, see . */ From 6916a4665635dc464206bf21ca1434680cea7862 Mon Sep 17 00:00:00 2001 From: Jochen Topf Date: Wed, 13 Apr 2011 22:15:47 +0200 Subject: [PATCH 4/6] what was this doing here? --- foo | 0 1 file changed, 0 insertions(+), 0 deletions(-) delete mode 100644 foo diff --git a/foo b/foo deleted file mode 100644 index e69de29..0000000 From c7dce29491432e150739b852e1e83f69ef46c759 Mon Sep 17 00:00:00 2001 From: Jochen Topf Date: Wed, 13 Apr 2011 22:40:46 +0200 Subject: [PATCH 5/6] Added README, debian config --- README | 9 +++++ debian/changelog | 5 +++ debian/compat | 1 + debian/control | 14 ++++++++ debian/copyright | 18 ++++++++++ debian/docs | 2 ++ debian/rules | 86 ++++++++++++++++++++++++++++++++++++++++++++ debian/source/format | 1 + src/Makefile | 1 + 9 files changed, 137 insertions(+) create mode 100644 README create mode 100644 debian/changelog create mode 100644 debian/compat create mode 100644 debian/control create mode 100644 debian/copyright create mode 100644 debian/docs create mode 100755 debian/rules create mode 100644 debian/source/format diff --git a/README b/README new file mode 100644 index 0000000..f09e399 --- /dev/null +++ b/README @@ -0,0 +1,9 @@ + +OSM PBF +======= + +See http://wiki.openstreetmap.org/wiki/PBF_Format . + +To build the Debian/Ubuntu package call: + debuild -I -us -uc + diff --git a/debian/changelog b/debian/changelog new file mode 100644 index 0000000..72d9d27 --- /dev/null +++ b/debian/changelog @@ -0,0 +1,5 @@ +osmpbf-dev (0.1) maverick; urgency=low + + * Initial debian package + + -- Jochen Topf Wed, 13 Apr 2011 21:50:15 +0100 diff --git a/debian/compat b/debian/compat new file mode 100644 index 0000000..7f8f011 --- /dev/null +++ b/debian/compat @@ -0,0 +1 @@ +7 diff --git a/debian/control b/debian/control new file mode 100644 index 0000000..2a6814f --- /dev/null +++ b/debian/control @@ -0,0 +1,14 @@ +Source: osmpbf-dev +Section: libdevel +Priority: optional +Maintainer: Jochen Topf +Build-Depends: debhelper (>= 7), libprotobuf-dev, protobuf-compiler +Standards-Version: 3.9.1 +Homepage: http://wiki.openstreetmap.org/wiki/PBF_Format + +Package: osmpbf-dev +Architecture: any +Depends: ${shlibs:Depends}, ${misc:Depends} +Description: Library for reading OSM PBF files. + Interface definition and library for reading binary + OpenStreetMap data files. diff --git a/debian/copyright b/debian/copyright new file mode 100644 index 0000000..7386ce0 --- /dev/null +++ b/debian/copyright @@ -0,0 +1,18 @@ +Copyright (c) 2010 Scott A. Crosby. + +This program is free software: you can redistribute it and/or modify +it under the terms of the GNU Lesser General Public License as +published by the Free Software Foundation, either version 3 of the +License, or (at your option) any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU Lesser General Public License for more details. + +You should have received a copy of the GNU Lesser General Public License +along with this program. If not, see . + +On Debian systems, the license text can usually be found in +/usr/share/common-licenses. + diff --git a/debian/docs b/debian/docs new file mode 100644 index 0000000..fe686d9 --- /dev/null +++ b/debian/docs @@ -0,0 +1,2 @@ +src/fileformat.proto +src/osmformat.proto diff --git a/debian/rules b/debian/rules new file mode 100755 index 0000000..c0e0dc2 --- /dev/null +++ b/debian/rules @@ -0,0 +1,86 @@ +#!/usr/bin/make -f +# -*- makefile -*- +# Sample debian/rules that uses debhelper. +# This file was originally written by Joey Hess and Craig Small. +# As a special exception, when this file is copied by dh-make into a +# dh-make output file, you may use that output file without restriction. +# This special exception was added by Craig Small in version 0.37 of dh-make. + +# Uncomment this to turn on verbose mode. +#export DH_VERBOSE=1 + +configure: configure-stamp +configure-stamp: + dh_testdir + + # Add here commands to configure the package. + + touch configure-stamp + +build: build-stamp + +build-stamp: configure-stamp + dh_testdir + + # Add here commands to compile the package. + $(MAKE) -C src + + touch $@ + +clean: + dh_testdir + dh_testroot + rm -f build-stamp configure-stamp + + # Add here commands to clean up after the build process. + $(MAKE) -C src clean || /bin/true + + dh_clean + +install: build + dh_testdir + dh_testroot + dh_prep + dh_installdirs + + # Add here commands to install the package into debian/osmpbf-dev. + $(MAKE) -C src DESTDIR=$(CURDIR)/debian/osmpbf-dev install + + +# Build architecture-independent files here. +binary-indep: build install +# We have nothing to do by default. + +# Build architecture-dependent files here. +binary-arch: build install + dh_testdir + dh_testroot + dh_installchangelogs + dh_installdocs + dh_installexamples + dh_install +# dh_installmenu +# dh_installdebconf +# dh_installlogrotate +# dh_installemacsen +# dh_installpam +# dh_installmime +# dh_python +# dh_installinit +# dh_installcron +# dh_installinfo + dh_installman + dh_link + dh_strip + dh_compress + dh_fixperms +# dh_perl +# dh_makeshlibs + dh_installdeb + dh_shlibdeps + dh_gencontrol + dh_md5sums + dh_builddeb + +binary: binary-indep binary-arch +.PHONY: build clean binary-indep binary-arch binary install configure diff --git a/debian/source/format b/debian/source/format new file mode 100644 index 0000000..89ae9db --- /dev/null +++ b/debian/source/format @@ -0,0 +1 @@ +3.0 (native) diff --git a/src/Makefile b/src/Makefile index 116d6ca..efd938a 100644 --- a/src/Makefile +++ b/src/Makefile @@ -15,6 +15,7 @@ libosmpbf.a: fileformat.pb.o osmformat.pb.o protoc --proto_path=. --cpp_out=. $< install: + install -m 755 -g root -o root -d $(DESTDIR)/usr/lib install -m 644 -g root -o root libosmpbf.a $(DESTDIR)/usr/lib install -m 755 -g root -o root -d $(DESTDIR)/usr/include/osmpbf install -m 644 -g root -o root fileformat.pb.h osmformat.pb.h $(DESTDIR)/usr/include/osmpbf From 64f587f2ebde06ecc349bad3cf99193a04682125 Mon Sep 17 00:00:00 2001 From: Jochen Topf Date: Thu, 14 Apr 2011 12:07:25 +0200 Subject: [PATCH 6/6] changed deb file from osmpbf-dev to libosmpbf-dev --- debian/changelog | 2 +- debian/control | 4 ++-- debian/rules | 4 ++-- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/debian/changelog b/debian/changelog index 72d9d27..7599db6 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,4 +1,4 @@ -osmpbf-dev (0.1) maverick; urgency=low +libosmpbf-dev (0.1) maverick; urgency=low * Initial debian package diff --git a/debian/control b/debian/control index 2a6814f..5452bb4 100644 --- a/debian/control +++ b/debian/control @@ -1,4 +1,4 @@ -Source: osmpbf-dev +Source: libosmpbf-dev Section: libdevel Priority: optional Maintainer: Jochen Topf @@ -6,7 +6,7 @@ Build-Depends: debhelper (>= 7), libprotobuf-dev, protobuf-compiler Standards-Version: 3.9.1 Homepage: http://wiki.openstreetmap.org/wiki/PBF_Format -Package: osmpbf-dev +Package: libosmpbf-dev Architecture: any Depends: ${shlibs:Depends}, ${misc:Depends} Description: Library for reading OSM PBF files. diff --git a/debian/rules b/debian/rules index c0e0dc2..72cb333 100755 --- a/debian/rules +++ b/debian/rules @@ -43,8 +43,8 @@ install: build dh_prep dh_installdirs - # Add here commands to install the package into debian/osmpbf-dev. - $(MAKE) -C src DESTDIR=$(CURDIR)/debian/osmpbf-dev install + # Add here commands to install the package into debian/libosmpbf-dev. + $(MAKE) -C src DESTDIR=$(CURDIR)/debian/libosmpbf-dev install # Build architecture-independent files here.