File hg-fast-export.spec of Package hg-fast-export

# spec file for package hg-fast-export
# Copyright (c) 2015 SUSE LINUX Products GmbH, Nuernberg, Germany.
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
# upon. The license for this file, and modifications and additions to the
# file, is the same license as for the pristine package itself (unless the
# license for the pristine package is not an Open Source License, in which
# case the license is the MIT License). An "Open Source License" is a
# license that conforms to the Open Source Definition (Version 1.9)
# published by the Open Source Initiative.

# Please submit bugfixes or comments via

Name:           hg-fast-export
Version:        20140308
Release:        0
Summary:        Mercurial to git converter using git-fast-import
License:        GPL-2.0
Group:          Development/Tools/Version Control
# git clone %{URL}
# VERSION=`git log -n 1 --pretty=%ci | cut -d ' ' -f 1 | tr -d '-'`
# tar -cjf fast-export-${VERSION}.tar.gz fast-export/
%if 0%{?suse_version} && 0%{?suse_version} <= 1110
%{!?python_sitelib: %global python_sitelib %(python -c "from distutils.sysconfig import get_python_lib; print get_python_lib()")}
BuildArch:      noarch
BuildRequires:  python-devel
Requires:       git
Requires:       mercurial

hg-fast-export tool allows incremental import of mercurial repositories to git

It can automatically import a local hg repo into a local git repo using just
one command. Subsequent importing of new changesets is supported.

Included git-hg wrapper script can be used to transparently track Mercurial
repositories without a separate checkout. It also includes experimental support
for pushing back to Mercurial. 

%setup -q -a 1

sed --in-place 's@^ROOT=.*@ROOT="/usr/share/%{name}"@'
sed --in-place '/^#!\/usr\/bin\/env.*/d' *.py



# binaries
%{__install} -d -m 0755 %{buildroot}%{_bindir}
%{__install} -m 0755 debian/git-hg %{buildroot}%{_bindir}
%{__install} -m 0755 %{buildroot}/%{_bindir}/hg-fast-export
%{__install} -m 0755 %{buildroot}/%{_bindir}/hg-reset

# python lib
%{__install} -d -m 0755 %{buildroot}/%{python_sitelib}
%{__install} -m 0644* %{buildroot}/%{python_sitelib}

# other stuff
%{__install} -d -m 0755 %{buildroot}/%{_datadir}/%{name}
%{__install} -m 0644 %{buildroot}/%{_datadir}/%{name}/

# compile python stuff
%py_compile    %{buildroot}/%{python_sitelib}
%py_compile -O %{buildroot}/%{python_sitelib}
%py_compile    %{buildroot}/%{_datadir}/%{name}
%py_compile -O %{buildroot}/%{_datadir}/%{name}

# manual pages
%{__install} -d -m 0755 %{buildroot}/%{_mandir}/man1
%{__install} -m 0644 debian/*.1 %{buildroot}/%{_mandir}/man1/

%doc debian/copyright debian/README.git-hg

openSUSE Build Service is sponsored by