From a0b2dcc2a4ffa5dcf95fc138e5b645f7fcc45a31 Mon Sep 17 00:00:00 2001 From: Martin Sehnoutka Date: Jun 20 2017 14:46:01 +0000 Subject: [PATCH 1/4] "How to" page with packaging tutorial. --- diff --git a/howto.rst b/howto.rst new file mode 100644 index 0000000..ad5934a --- /dev/null +++ b/howto.rst @@ -0,0 +1,44 @@ +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 && cd + $ rust2rpm + +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-.spec + +and it should work fine (there is currently a problem with cargo and rustup, but I hope it will be fixed in upstream soon). +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 + +Next create a source RPM using rpmbuild:: + + $ rpmbuild -bs + +Finally you must configure mock to use Rust SIG specific repositories. For example:: + + $ vim /etc/mock/fedora-26-x86_64.cfg + # 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 fedora-26-x86_64 rebuild + + +.. _playground on Pagure: https://pagure.io/fedora-rust/playground +.. _mock: https://github.com/rpm-software-management/mock/wiki From 30e6a243bdac5a8bef535b70ff47265eade5718b Mon Sep 17 00:00:00 2001 From: Martin Sehnoutka Date: Jun 22 2017 06:58:46 +0000 Subject: [PATCH 2/4] Don't modify system mock config file --- diff --git a/howto.rst b/howto.rst index ad5934a..4c6f8f4 100644 --- a/howto.rst +++ b/howto.rst @@ -31,13 +31,14 @@ Next create a source RPM using rpmbuild:: Finally you must configure mock to use Rust SIG specific repositories. For example:: - $ vim /etc/mock/fedora-26-x86_64.cfg + $ cp /etc/mock/fedora-26-x86_64.cfg + $ vim # 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 fedora-26-x86_64 rebuild + $ mock -r rebuild .. _playground on Pagure: https://pagure.io/fedora-rust/playground From 2f11bf82143be85936acb7f74341818f2ac687b9 Mon Sep 17 00:00:00 2001 From: Martin Sehnoutka Date: Sep 04 2017 14:06:44 +0000 Subject: [PATCH 3/4] how to use rpmbuild with local sources --- diff --git a/howto.rst b/howto.rst index 4c6f8f4..55b1ae0 100644 --- a/howto.rst +++ b/howto.rst @@ -19,7 +19,14 @@ Now that you have a spec file, you can do a build using either rpmbuild or mock. $ sudo dnf builddep rust-.spec -and it should work fine (there is currently a problem with cargo and rustup, but I hope it will be fixed in upstream soon). +and it should work fine, if you have all necessary repositories and patched version of RPM (with rich deps). + +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 # will download all sources (usually crates) + $ rpmbuild -ba -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 From 77e531a468d36048b2e3afd7030081f8d1d1b063 Mon Sep 17 00:00:00 2001 From: Martin Sehnoutka Date: Sep 05 2017 07:18:29 +0000 Subject: [PATCH 4/4] note about f26 repos --- diff --git a/howto.rst b/howto.rst index 55b1ae0..4105b6c 100644 --- a/howto.rst +++ b/howto.rst @@ -19,7 +19,9 @@ Now that you have a spec file, you can do a build using either rpmbuild or mock. $ sudo dnf builddep rust-.spec -and it should work fine, if you have all necessary repositories and patched version of RPM (with rich deps). +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::