Skip to content

Instantly share code, notes, and snippets.

@loomsen
Created July 10, 2014 13:55
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save loomsen/a8dcf971fbcecd3f38e9 to your computer and use it in GitHub Desktop.
Save loomsen/a8dcf971fbcecd3f38e9 to your computer and use it in GitHub Desktop.
%global commit 9198d6fa2216125b656091dd998e0162deec2595
%global shortcommit %(c=%{commit}; echo ${c:0:7})
%define upname HyperLevelDB
Name: hyperleveldb
Version: 1.0.0
Release: 3%{?dist}
Summary: A fork of LevelDB intended to meet the needs of HyperDex while remaining compatible with LevelDB.
Group: Development/Libraries
License: https://github.com/rescrv/%{upname}/blob/master/LICENSE
URL: https://github.com/rescrv/%{upname}
Source0: https://github.com/rescrv/%{upname}/archive/%{commit}/%{upname}-%{commit}.tar.gz
BuildRoot: %(mktemp -ud %{_tmppath}/%{name}-%{version}-%{release}-XXXXXX)
BuildRequires: gcc autoconf automake libtool
Obsoletes: leveldb leveldb-devel
%description
A fork of LevelDB intended to meet the needs of HyperDex while remaining compatible with LevelDB.
%prep
%setup -qn %{upname}-%{commit}
%build
autoreconf -i
%configure
make %{?_smp_mflags}
%install
rm -rf %{buildroot}
make install DESTDIR=%{buildroot}
ln -s %{_includedir}/%{name} %{buildroot}%{_includedir}/leveldb
ln -s %{_libdir}/libhyperleveldb.a %{buildroot}%{_libdir}/libleveldb.a
ln -s %{_libdir}/libhyperleveldb.la %{buildroot}%{_libdir}/libleveldb.la
ln -s %{_libdir}/libhyperleveldb.so %{buildroot}%{_libdir}/libleveldb.so
ln -s %{_libdir}/libhyperleveldb.so.0 %{buildroot}%{_libdir}/libleveldb.so.0
ln -s %{_libdir}/libhyperleveldb.so.0.0.0 %{buildroot}%{_libdir}/libleveldb.so.0.0.0
ln -s %{_libdir}/pkgconfig/libhyperleveldb.pc %{buildroot}%{_libdir}/pkgconfig/libleveldb.pc
%clean
rm -rf %{buildroot}
%post -p /sbin/ldconfig
%postun -p /sbin/ldconfig
%files
%defattr(-,root,root,-)
%doc
%{_includedir}/%{name}/*
%{_includedir}/leveldb
%{_libdir}/pkgconfig/*
%{_libdir}/*
#%files -n %{name}-devel
%changelog
* Thu Jul 10 2014 Norbert Varzariu <root@loomsen.org> - 1.0.0-3
- create symlinks for leveldb
* Thu Jul 10 2014 Norbert Varzariu <root@loomsen.org> - 1.0.0-2
- initial build
%global commit 0807c33eaaa5146d3f8088bf23e058524055c4fd
%global shortcommit %(c=%{commit}; echo ${c:0:7})
Name: imposm3
Version: 3.0.0.%{shortcommit}
Release: 4%{?dist}
Summary: Imposm is an importer for OpenStreetMap data. It reads PBF files and imports the data into PostgreSQL/PostGIS.
Group: Development/Libraries
License: Apache Software License 2.0
URL: http://imposm.org/
Source0: https://github.com/omniscale/imposm3/archive/%{commit}/imposm3-%{commit}.tar.gz
BuildRoot: %(mktemp -ud %{_tmppath}/%{name}-%{version}-%{release}-XXXXXX)
BuildRequires: hyperleveldb golang-pkg-bin-linux-amd64 golang-src golang golang-pkg-linux-amd64 geos-devel geos protobuf-devel protobuf-compiler protobuf sqlite-devel sqlite git mercurial
Requires: hyperleveldb sqlite protobuf protobuf-compiler
%description
Imposm is an importer for OpenStreetMap data. It reads PBF files and imports the data into PostgreSQL/PostGIS. It can also update the DB from diff files.
It is designed to create databases that are optimized for rendering (i.e. generating tiles or for WMS services).
Imposm 3 is written in Go and it is a complete rewrite of the previous Python implementation. Configurations/mappings and cache files are not compatible with Imposm 2, but they share a similar architecture.
It is released as open source under the Apache License 2.0.
The development of Imposm 3 was sponsored by Omniscale and development will continue as resources permit. Please get in touch if you need commercial support or if you need specific features.
%prep
%build
#%setup -qn %{name}-%{commit}
%install
mkdir -p %{name}
cd %{name}
export GOPATH=`pwd`
git clone https://github.com/omniscale/imposm3 src/imposm3
pushd src/imposm3
git checkout %{commit}
popd
go get imposm3
#rm -rf %{buildroot}
go install %{name}
mkdir -p %{buildroot}/usr/bin
install -m 0755 bin/%{name} %{buildroot}/usr/bin/%{name}
%clean
rm -rf %{buildroot}
%files
%defattr(-,root,root,-)
%doc
%{_bindir}/%{name}
%changelog
* Thu Jul 10 2014 Norbert Varzariu <root@loomsen.org> - 3.0.0.0807c33-4
- typo fix
* Thu Jul 10 2014 Norbert Varzariu <root@loomsen.org>
- checkout %commit (otherwise we would always build the latest review, defining commit wouldn't make sense)
- add %commit to version string
* Thu Jul 10 2014 Norbert Varzariu <root@loomsen.org> - 3.0.0-2
- initial spec
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment