Updated spec file

This commit is contained in:
kayrus 2014-03-19 18:36:07 +04:00
parent 2a7663aeec
commit 53938b17e1
2 changed files with 45 additions and 15 deletions

View File

@ -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 <kay.diam@gmail.com> - 1.3.3-1
* Wed Mar 19 2014 g<kay.diam@gmail.com> - 1.3.3-21
- Bump version
- Updated spec file to use normal make
* Mon Sep 23 2013 <kay.diam@gmail.com> - 1.3.1-1
* Mon Sep 23 2013 g<kay.diam@gmail.com> - 1.3.1-1
- Initial release

View File

@ -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