| |
@@ -0,0 +1,54 @@
|
| |
+ How to start
|
| |
+ ============
|
| |
+
|
| |
+ If you want to contribute to the Rust SIG, you can start by packaging some crates.
|
| |
+
|
| |
+ First of all you need to fork our `playground on Pagure`_::
|
| |
+
|
| |
+ $ git clone ssh://git@pagure.io/fedora-rust/playground.git
|
| |
+ $ cd playground
|
| |
+
|
| |
+ Then you can package your own crate::
|
| |
+
|
| |
+ $ mkdir <crate> && cd <crate>
|
| |
+ $ rust2rpm <crate>
|
| |
+
|
| |
+ In case you need to patch Cargo.toml (e.g. there are windows libraries as dependencies), you can either patch it manually or use rust2rpm with -p switch.
|
| |
+
|
| |
+ Now that you have a spec file, you can do a build using either rpmbuild or mock. In case you want to use rpmbuild, you just need to install dependencies to your system with dnf::
|
| |
+
|
| |
+ $ sudo dnf builddep rust-<crate>.spec
|
| |
+
|
| |
+ and it should work just fine
|
| |
+
|
| |
+ Note: If you are running Fedora 26, you need to install all necessary repositories and patched version of RPM (with rich deps). Later versions should work out of the box.
|
| |
+
|
| |
+ Now you need to run the build. Follow these steps::
|
| |
+
|
| |
+ $ rpmdev-setuptree # or rpmdev-wipetree in case you already have issued setuptree before
|
| |
+ $ spectool -g <spec file> # will download all sources (usually crates)
|
| |
+ $ rpmbuild -ba <spec file> -D "_sourcedir $(pwd)" # Build RPM package and use this directory as a source directory
|
| |
+
|
| |
+ The second option is to use `mock`_. First of all you need to install and configure mock::
|
| |
+
|
| |
+ $ sudo dnf install mock
|
| |
+ $ sudo usermod -a -G mock <your_username>
|
| |
+
|
| |
+ Next create a source RPM using rpmbuild::
|
| |
+
|
| |
+ $ rpmbuild -bs <spec file>
|
| |
+
|
| |
+ Finally you must configure mock to use Rust SIG specific repositories. For example::
|
| |
+
|
| |
+ $ cp /etc/mock/fedora-26-x86_64.cfg <path-to-your-rusty-config>
|
| |
+ $ vim <path-to-your-rusty-config>
|
| |
+ # Now add this repository for newer RPM https://copr.fedorainfracloud.org/coprs/g/rpm-software-management/with-rich-dependency/
|
| |
+ # and this one for Rust dependencies https://copr.fedorainfracloud.org/coprs/g/rust/playground/
|
| |
+
|
| |
+ and run it::
|
| |
+
|
| |
+ $ mock -r <path-to-your-rusty-config> rebuild <SRPM>
|
| |
+
|
| |
+
|
| |
+ .. _playground on Pagure: https://pagure.io/fedora-rust/playground
|
| |
+ .. _mock: https://github.com/rpm-software-management/mock/wiki
|
| |
Tutorial based on my experience with rust2rpm.