File README.packager of Package racer

# Updating this package

1. Install cargo and cargo-vendor from devel:languages:rust

2. If there is no official release available for d/l, then you will need
   to clone the wanted version of the package and archive it.
   See the list of version tags with 'git tag -l'

    git clone https://github.com/phildawes/racer
    cd racer
    git checkout 1.2.5
    git archive --format=tar --prefix=racer-1.2.5/ HEAD | xz >racer-1.2.5.tar.xz

3. Generate the vendor package

    cargo vendor
    tar c vendor/ | xz > vendor.tar.xz

3. Update the OBS package with these .tar.xz archives.

4. The required cargo config will be different to what cargo vendor outputs,
   if there is not already a config in the package, then the following is
   required:

    %prep
    %setup -q
    %setup -q -D -T -a 1
    mkdir cargo-home
    cat >cargo-home/config <<EOF
    [source.crates-io]
    registry = 'https://github.com/rust-lang/crates.io-index'
    replace-with = 'vendored-sources'
    [source.vendored-sources]
    directory = './vendor'
    EOF

    %build
    export CARGO_HOME=`pwd`/cargo-home/
    cargo build --release %{?_smp_mflags}

    %install
    mkdir build
    export CARGO_HOME=`pwd`/cargo-home/
    cargo install --root=build
    mkdir -p %{buildroot}%{_bindir}
    install -Dm0755 build/bin/racer %{buildroot}%{_bindir}/racer
    
  This method of packaging Rust programs and libraries is likely to change in
  the near future.
openSUSE Build Service is sponsored by