From 2a7663aeecd348b46db2e3563ce48cd642b94a07 Mon Sep 17 00:00:00 2001 From: kayrus Date: Wed, 19 Mar 2014 14:37:01 +0400 Subject: [PATCH 1/5] Added redhat/centos spec file --- redhat/osmpbf.spec | 45 +++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 45 insertions(+) create mode 100644 redhat/osmpbf.spec diff --git a/redhat/osmpbf.spec b/redhat/osmpbf.spec new file mode 100644 index 0000000..31a14bb --- /dev/null +++ b/redhat/osmpbf.spec @@ -0,0 +1,45 @@ +Name: osmpbf +Version: 1.3.3 +Release: 1%{?dist} +Summary: C version of the PBF library code +License: LGPL-3+ +URL: https://github.com/scrosby/OSM-binary +Source0: OSM-binary-%{version}.tar.bz2 +BuildRequires: cmake, protobuf-devel, protobuf-lite-devel +BuildRequires: gcc, gcc-c++ + +%description +Osmpbf is a Java/C library to read and write OpenStreetMap PBF files. +PBF (Protocol buffer Binary Format) is a binary file format for OpenStreetMap +data that uses Google Protocol Buffers as low-level storage. + +For more information see http://wiki.openstreetmap.org/wiki/PBF_Format + +%prep +%setup -q -n OSM-binary-%{version} + +%build +cmake -DCMAKE_SKIP_RPATH=ON \ + -DCMAKE_INSTALL_PREFIX=%{_prefix}\ + -DLIBRARY_OUTPUT_PATH:PATH=%{_libdir} . + +%{__make} %{?jobs:-j%jobs} + +%install +%{__make} DESTDIR=%{buildroot} install +mkdir %{buildroot}/usr/lib64 +mv %{buildroot}/usr/lib/libosmpbf.a %{buildroot}/usr/lib64 +rm -rf %{buildroot}/usr/lib/ + +%files +%defattr(-, root, root, -) +%{_includedir}/%{name} +%{_libdir}/libosmpbf.a +%{_bindir}/osmpbf-outline + +%changelog +* Wed Mar 19 2014 - 1.3.3-1 +- Bump version + +* Mon Sep 23 2013 - 1.3.1-1 +- Initial release From 53938b17e106d3b9c63c060a390024b2bf37031f Mon Sep 17 00:00:00 2001 From: kayrus Date: Wed, 19 Mar 2014 18:36:07 +0400 Subject: [PATCH 2/5] Updated spec file --- redhat/osmpbf.spec | 39 +++++++++++++++++++++++--------------- redhat/osmpbf_libdir.patch | 21 ++++++++++++++++++++ 2 files changed, 45 insertions(+), 15 deletions(-) create mode 100644 redhat/osmpbf_libdir.patch diff --git a/redhat/osmpbf.spec b/redhat/osmpbf.spec index 31a14bb..15f9c1d 100644 --- a/redhat/osmpbf.spec +++ b/redhat/osmpbf.spec @@ -1,10 +1,11 @@ Name: osmpbf Version: 1.3.3 -Release: 1%{?dist} +Release: 2%{?dist} Summary: C version of the PBF library code License: LGPL-3+ URL: https://github.com/scrosby/OSM-binary Source0: OSM-binary-%{version}.tar.bz2 +Patch0: osmpbf_libdir.patch BuildRequires: cmake, protobuf-devel, protobuf-lite-devel BuildRequires: gcc, gcc-c++ @@ -17,29 +18,37 @@ For more information see http://wiki.openstreetmap.org/wiki/PBF_Format %prep %setup -q -n OSM-binary-%{version} +%patch0 -p1 %build -cmake -DCMAKE_SKIP_RPATH=ON \ - -DCMAKE_INSTALL_PREFIX=%{_prefix}\ - -DLIBRARY_OUTPUT_PATH:PATH=%{_libdir} . - -%{__make} %{?jobs:-j%jobs} +%{__make} -C src %{?jobs:-j%jobs} +%{__make} -C tools %{?jobs:-j%jobs} %install -%{__make} DESTDIR=%{buildroot} install -mkdir %{buildroot}/usr/lib64 -mv %{buildroot}/usr/lib/libosmpbf.a %{buildroot}/usr/lib64 -rm -rf %{buildroot}/usr/lib/ - +%{__make} -C src DESTDIR=%{buildroot} PREFIX=%{_prefix} LIBDIR=%{_libdir} install +%{__make} -C tools DESTDIR=%{buildroot} PREFIX=%{_prefix} install +mkdir -p $RPM_BUILD_ROOT%{_bindir} +mkdir -p $RPM_BUILD_ROOT%{_libdir} +mkdir -p $RPM_BUILD_ROOT%{_mandir}/man1 +mkdir -p $RPM_BUILD_ROOT%{_includedir}/osmpbf +install -m 644 src/libosmpbf.a $RPM_BUILD_ROOT%{_libdir}/ +install -m 644 include/osmpbf/*.h $RPM_BUILD_ROOT%{_includedir}/osmpbf/ +install -m 755 tools/osmpbf-outline $RPM_BUILD_ROOT%{_bindir}/ +install -m 644 tools/osmpbf-outline.1 $RPM_BUILD_ROOT%{_mandir}/man1/ + %files %defattr(-, root, root, -) -%{_includedir}/%{name} -%{_libdir}/libosmpbf.a +%doc COPYING.osmpbf README ReleaseNotes.txt +%dir %{_includedir}/osmpbf +%{_includedir}/osmpbf/*.h %{_bindir}/osmpbf-outline +%{_mandir}/man1/osmpbf-outline.1* +%{_libdir}/libosmpbf.a %changelog -* Wed Mar 19 2014 - 1.3.3-1 +* Wed Mar 19 2014 g - 1.3.3-21 - Bump version +- Updated spec file to use normal make -* Mon Sep 23 2013 - 1.3.1-1 +* Mon Sep 23 2013 g - 1.3.1-1 - Initial release diff --git a/redhat/osmpbf_libdir.patch b/redhat/osmpbf_libdir.patch new file mode 100644 index 0000000..d105897 --- /dev/null +++ b/redhat/osmpbf_libdir.patch @@ -0,0 +1,21 @@ +--- a/src/Makefile 2014-03-15 19:11:32.000000000 +0400 ++++ b/src/Makefile 2014-03-19 18:31:26.546120548 +0400 +@@ -1,6 +1,7 @@ + + # these default settings can be overridden by setting environment variables + PREFIX ?= /usr/local ++LIBDIR ?= $(PREFIX)/lib + CXX ?= g++ + CXXFLAGS ?= -O3 + AR ?= ar +@@ -23,8 +24,8 @@ + cp *.pb.h ../include/osmpbf/ + + install: +- install -m 755 -d $(DESTDIR)$(PREFIX)/lib +- install -m 644 libosmpbf.a $(DESTDIR)$(PREFIX)/lib ++ install -m 755 -d $(DESTDIR)$(LIBDIR) ++ install -m 644 libosmpbf.a $(DESTDIR)$(LIBDIR) + install -m 755 -d $(DESTDIR)$(PREFIX)/include/osmpbf + install -m 644 ../include/osmpbf/osmpbf.h $(DESTDIR)$(PREFIX)/include/osmpbf + install -m 644 ../include/osmpbf/fileformat.pb.h $(DESTDIR)$(PREFIX)/include/osmpbf From 038213bc1831f35999fae7768fe10abac6c717d7 Mon Sep 17 00:00:00 2001 From: kayrus Date: Wed, 19 Mar 2014 18:36:43 +0400 Subject: [PATCH 3/5] Typo fixed --- redhat/osmpbf.spec | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/redhat/osmpbf.spec b/redhat/osmpbf.spec index 15f9c1d..caae905 100644 --- a/redhat/osmpbf.spec +++ b/redhat/osmpbf.spec @@ -46,7 +46,7 @@ install -m 644 tools/osmpbf-outline.1 $RPM_BUILD_ROOT%{_mandir}/man1/ %{_libdir}/libosmpbf.a %changelog -* Wed Mar 19 2014 g - 1.3.3-21 +* Wed Mar 19 2014 g - 1.3.3-2 - Bump version - Updated spec file to use normal make From f5e20cd33e26175e12fe28dea815a001365c5c16 Mon Sep 17 00:00:00 2001 From: kayrus Date: Wed, 19 Mar 2014 18:37:33 +0400 Subject: [PATCH 4/5] Typo fixed --- redhat/osmpbf.spec | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/redhat/osmpbf.spec b/redhat/osmpbf.spec index caae905..532d960 100644 --- a/redhat/osmpbf.spec +++ b/redhat/osmpbf.spec @@ -46,9 +46,9 @@ install -m 644 tools/osmpbf-outline.1 $RPM_BUILD_ROOT%{_mandir}/man1/ %{_libdir}/libosmpbf.a %changelog -* Wed Mar 19 2014 g - 1.3.3-2 +* Wed Mar 19 2014 - 1.3.3-2 - Bump version - Updated spec file to use normal make -* Mon Sep 23 2013 g - 1.3.1-1 +* Mon Sep 23 2013 - 1.3.1-1 - Initial release From c8844a6e90a9e5950e88aa8b56a7aa842bf3b8b9 Mon Sep 17 00:00:00 2001 From: kayrus Date: Wed, 26 Mar 2014 18:45:48 +0400 Subject: [PATCH 5/5] Updated redhat spec and Makefile --- redhat/osmpbf.spec | 11 +---------- redhat/osmpbf_libdir.patch | 21 --------------------- src/Makefile | 5 +++-- 3 files changed, 4 insertions(+), 33 deletions(-) delete mode 100644 redhat/osmpbf_libdir.patch diff --git a/redhat/osmpbf.spec b/redhat/osmpbf.spec index 532d960..eed25e2 100644 --- a/redhat/osmpbf.spec +++ b/redhat/osmpbf.spec @@ -5,8 +5,7 @@ Summary: C version of the PBF library code License: LGPL-3+ URL: https://github.com/scrosby/OSM-binary Source0: OSM-binary-%{version}.tar.bz2 -Patch0: osmpbf_libdir.patch -BuildRequires: cmake, protobuf-devel, protobuf-lite-devel +BuildRequires: protobuf-devel, protobuf-lite-devel BuildRequires: gcc, gcc-c++ %description @@ -18,7 +17,6 @@ For more information see http://wiki.openstreetmap.org/wiki/PBF_Format %prep %setup -q -n OSM-binary-%{version} -%patch0 -p1 %build %{__make} -C src %{?jobs:-j%jobs} @@ -27,13 +25,6 @@ For more information see http://wiki.openstreetmap.org/wiki/PBF_Format %install %{__make} -C src DESTDIR=%{buildroot} PREFIX=%{_prefix} LIBDIR=%{_libdir} install %{__make} -C tools DESTDIR=%{buildroot} PREFIX=%{_prefix} install -mkdir -p $RPM_BUILD_ROOT%{_bindir} -mkdir -p $RPM_BUILD_ROOT%{_libdir} -mkdir -p $RPM_BUILD_ROOT%{_mandir}/man1 -mkdir -p $RPM_BUILD_ROOT%{_includedir}/osmpbf -install -m 644 src/libosmpbf.a $RPM_BUILD_ROOT%{_libdir}/ -install -m 644 include/osmpbf/*.h $RPM_BUILD_ROOT%{_includedir}/osmpbf/ -install -m 755 tools/osmpbf-outline $RPM_BUILD_ROOT%{_bindir}/ install -m 644 tools/osmpbf-outline.1 $RPM_BUILD_ROOT%{_mandir}/man1/ %files diff --git a/redhat/osmpbf_libdir.patch b/redhat/osmpbf_libdir.patch deleted file mode 100644 index d105897..0000000 --- a/redhat/osmpbf_libdir.patch +++ /dev/null @@ -1,21 +0,0 @@ ---- a/src/Makefile 2014-03-15 19:11:32.000000000 +0400 -+++ b/src/Makefile 2014-03-19 18:31:26.546120548 +0400 -@@ -1,6 +1,7 @@ - - # these default settings can be overridden by setting environment variables - PREFIX ?= /usr/local -+LIBDIR ?= $(PREFIX)/lib - CXX ?= g++ - CXXFLAGS ?= -O3 - AR ?= ar -@@ -23,8 +24,8 @@ - cp *.pb.h ../include/osmpbf/ - - install: -- install -m 755 -d $(DESTDIR)$(PREFIX)/lib -- install -m 644 libosmpbf.a $(DESTDIR)$(PREFIX)/lib -+ install -m 755 -d $(DESTDIR)$(LIBDIR) -+ install -m 644 libosmpbf.a $(DESTDIR)$(LIBDIR) - install -m 755 -d $(DESTDIR)$(PREFIX)/include/osmpbf - install -m 644 ../include/osmpbf/osmpbf.h $(DESTDIR)$(PREFIX)/include/osmpbf - install -m 644 ../include/osmpbf/fileformat.pb.h $(DESTDIR)$(PREFIX)/include/osmpbf diff --git a/src/Makefile b/src/Makefile index edd36bc..cc75a5b 100644 --- a/src/Makefile +++ b/src/Makefile @@ -1,6 +1,7 @@ # these default settings can be overridden by setting environment variables PREFIX ?= /usr/local +LIBDIR ?= $(PREFIX)/lib CXX ?= g++ CXXFLAGS ?= -O3 AR ?= ar @@ -23,8 +24,8 @@ libosmpbf.a: fileformat.pb.o osmformat.pb.o cp -v $(subst .proto,.pb.h,$<) ../include/osmpbf/ install: - install -m 755 -d $(DESTDIR)$(PREFIX)/lib - install -m 644 libosmpbf.a $(DESTDIR)$(PREFIX)/lib + install -m 755 -d $(DESTDIR)$(LIBDIR) + install -m 644 libosmpbf.a $(DESTDIR)$(LIBDIR) install -m 755 -d $(DESTDIR)$(PREFIX)/include/osmpbf install -m 644 ../include/osmpbf/osmpbf.h $(DESTDIR)$(PREFIX)/include/osmpbf install -m 644 ../include/osmpbf/fileformat.pb.h $(DESTDIR)$(PREFIX)/include/osmpbf