Skip to content

Commit

Permalink
Update Readme, add CONTRIBUTING
Browse files Browse the repository at this point in the history
  • Loading branch information
Dr-Bean committed Jan 17, 2016
1 parent b1fb94b commit 3d260cb
Show file tree
Hide file tree
Showing 2 changed files with 105 additions and 87 deletions.
78 changes: 78 additions & 0 deletions CONTRIBUTING.md
@@ -0,0 +1,78 @@
Contributing
============

You can contribute to spksrc and SynoCommunity in several ways. Apart from reporting bugs, adding suggestions or requesting new packages, you can open Pull Requests to add new packages or to improve existing packages. If you're good at writing, help out with adding and updating documentation. Lastly, donations towards maintaining the SynoCommunity repository infrastructure are much appreciated.
For other suggestions, open an issue so it can be discussed.


Issues
------
If you have questions, suggestions or you believe you have found a bug, we'd like to hear about it. Before you open a new issue, follow the recommendations below.

Do:

* Check the [FAQ](https://github.com/SynoCommunity/spksrc/wiki/Frequently-Asked-Questions);
* Search the [bug tracker](https://github.com/SynoCommunity/spksrc/issues) to see if the issue has not already been reported;
* Check if the package has specific documentation related to it via the [Package Documentation Index](https://github.com/SynoCommunity/spksrc/wiki/Package-Documentation-Index);
* if you're reporting a bug, make sure you include sufficient information. See [Issue Content](https://github.com/SynoCommunity/spksrc/blob/master/CONTRIBUTING.md#issue-content).

Don't:

* Don't ask questions or report bugs in a closed issue;
* Don't post a question in an open issue if your question is not directly related to it. If you're not sure, open a new issue.

Issue content
-------------

When you open a new issue to ask a question about a package, or want to report a bug, be sure to provide as much details as possible for someone else to reproduce what you experienced.

Include at least the following information or use [this link](https://github.com/SynoCommunity/spksrc/issues/new?title=[package]%3A%20Description%20&body=Issue%20description%3A%0AModel%3A%0AArchitecture%3A%0ADSM%20version%3A%0ALog%20file%3A) as a starting point.

Title:

[package name] Short description of question or bug

Content:

* In the issue body, describe what you did, what you expected to happen and what actually happened;
* Model and arch of your NAS. See [Architecture per Synology model](https://github.com/SynoCommunity/spksrc/wiki/Architecture-per-Synology-model);
* DSM version;
* Provide log files if available. Sometimes a log is shown in Package Center for that package. There might be a log available at `/usr/local/{package}/var/`;
* Wrap larger logs between triple backticks (```). Log files over ten lines should be placed on gist.github.com, Pastebin etc., and linked in the issue;
* If the package doesn't start, try to start the package via the command line: `/var/packages/{package}/scripts/start-stop-status start`, and provide the output.


Package Requests
----------------
You can request new packages via a Package Request.

Note that opening a request does not mean it will be honored, so please do not ask for ETA's. SynoCommunity is a community effort where anyone can contribute, even you!
You can show your support with a +1, or by adding a bounty via Bountysource.

Before opening a Package Request, make sure that there are no existing requests for the same software.
As part of your request, some basic information should be included. Contributors use that information as a starting point for packaging. Use the format below, or use the following link to open a request: [New Package Request](https://github.com/SynoCommunity/spksrc/issues/new?title=[request]%20&body=Description%3A%0AWebsite%3A%0ADocumentation%3A%0ABuild%2FInstallation%20documentation%3A%0ASource Code%3A%0ALicense%3A) and fill out the fields.

Title:

[request] Name of software

Content:

* Website: http://www.software.com
* Description: Provide a description of the software
* Documentation: Link to general documentation
* Build/Installation documentation: Link to build instructions, prerequisites etc.
* Source code: Link to source code
* License: GPL, Apache, etc.


Pull requests
----------
Pull requests to add packages to the [SynoCommunity repository](https://synocommunity.com) are always welcome, as are improvements to the spksrc framework or existing packages.

You'll first need to set up a development environment as outlined in the [README](https://github.com/SynoCommunity/spksrc/blob/master/README.rst#setup-development-environment). After that:
* Fork and clone spksrc: ``git clone https://You@github.com/You/spksrc.git``
* Create a new topic branch: `git checkout -b newfeature master`;
* After completing and testing your changes, submit a pull request.

A general approach on how to develop packages is outlined in the [spksrc example wiki page](https://github.com/SynoCommunity/spksrc/wiki/spksrc-example).
114 changes: 27 additions & 87 deletions README.rst
@@ -1,99 +1,41 @@
spksrc
======
spksrc is a cross compilation framework intended to compile and package softwares for Synology NAS
spksrc is a cross compilation framework intended to compile and package software for Synology NAS devices. Packages are made available via the `SynoCommunity repository`_.

Requirements
------------
To use spksrc, it is recommended to use a virtual machine with an x86, 32-bit version of Debian stable OS installed. Non-x86 architectures or 64-bit architectures are not supported.

You'll also need some stuff::

sudo aptitude install build-essential debootstrap python-pip automake libgmp3-dev libltdl-dev libunistring-dev libffi-dev ncurses-dev imagemagick libssl-dev pkg-config zlib1g-dev gettext git curl subversion check bjam intltool gperf flex bison xmlto php5 expect libgc-dev mercurial cython lzip cmake swig
sudo pip install -U setuptools pip wheel httpie

You may need to install some packages from testing like autoconf. Read about Apt-Pinning to know how to do that.

You are now ready to use spksrc and make almost all SPKs. If you have any problem, try installing the
missing packages on your virtual machine.

Usage
-----
Lets start with an example::

git clone https://github.com/SynoCommunity/spksrc.git
cd spksrc/
make setup
cd spk/transmission
make arch-88f6281

What have I done?
^^^^^^^^^^^^^^^^^

* You cloned the repository
* Went into the directory of the SPK for transmission
* Started building the SPK for the architecture 88f6281

* To list all available architectures use ``ls toolchains`` from within the ``spksrc`` directory. Remove the prefix syno- to have the actual architecture.
* An overview of which architecture is used per Synology model can be found on the wiki page `Architecture per Synology model`_

At the end of the process, the SPK will be available in ``spksrc/packages/``

What is spksrc doing?
^^^^^^^^^^^^^^^^^^^^^

* First spksrc will read ``spksrc/spk/transmission/Makefile``
* Download the adequate toolchain for the chosen architecture
* Recursively:

* Process dependencies if any
* Download the source in ``spksrc/distrib/``
* Extract the source
* ``configure``
* ``make``
* ``make install``
Contributing
------------
Before opening issues or package requests, see `CONTRIBUTING`_.

* Package all the requirements into a SPK under ``spksrc/packages/``:

* Binaries
* Installer script
* Start/Stop/Status script
* Package icon
* Wizards (optional)
* Help files (optional)
Setup Development Environment
-----------------------------
Docker
^^^^^^
* Fork and clone spksrc: ``git clone https://You@github.com/You/spksrc.git ~/spksrc``
* Install Docker on your host OS: `Docker installation`_. A wget-based alternative for linux: `Install Docker with wget`_.
* Download the spksrc docker container: ``docker pull synocommunity/spksrc``
* Run the container with ``docker run -it -v ~/spksrc:/spksrc synocommunity/spksrc /bin/bash``

Contribute
----------
The only thing you should be editing in spksrc is Makefiles. To make a SPK, start by cross-compiling
the underlying package. To do so:

* Copy a standard cross package like ``spksrc/cross/transmission/Makefile``
in your new package directory ``spksrc/cross/newpackage/``
* Edit the Makefile variables so it fits your new package
* Empty variables ``DEPENDS`` and ``CONFIGURE_ARGS`` in the Makefile
* Try to cross-compile and fix issues as they come (missing dependencies, configure arguments, patches)
Virtual machine
^^^^^^^^^^^^^^^
A virtual machine based on an x86, 32-bit version of Debian stable OS is recommended. Non-x86 architectures or 64-bit architectures are not supported.

* ``cd spksrc/cross/newpackage/``
* ``make arch-88f6281``
* Use ``make clean`` to clean up the whole working directory after a failed attempt

* On a successful cross-compilation create a PLIST file with the same syntax as
``spksrc/cross/transmission/PLIST`` but based on the auto-generated PLIST for your
new package at ``spksrc/cross/newpackage/work-88f6281/newpackage.plist``
* Install the requirements::

Once you have successfully cross compiled the new package, to create the SPK:
sudo aptitude install build-essential debootstrap python-pip automake libgmp3-dev libltdl-dev libunistring-dev libffi-dev ncurses-dev imagemagick libssl-dev pkg-config zlib1g-dev gettext git curl subversion check bjam intltool gperf flex bison xmlto php5 expect libgc-dev mercurial cython lzip cmake swig
sudo pip install -U setuptools pip wheel httpie

* Copy a standard SPK directory like ``spksrc/spk/transmission``
in your new SPK directory ``spksrc/spk/newspk``
* Edit the stuff to fit your needs
* You may need to install some packages from testing like autoconf. Read about Apt-Pinning to know how to do that.
* Start the virtual machine

After all that hard work, submit a pull request to have your work merged with the main repository
on GitHub and published in `SynoCommunity's repository`_.
For further instructions, refer to Pull Requests section of `CONTRIBUTING`_.

If you are not familiar with git or GitHub, please refer to the excellent `GitHub help pages`_.

Donate
------
If you like spksrc and packages made out of it, please consider making a donation to his authors:
If you like spksrc and packages created with it, consider making a donation to its core developers:

* Diaoul

Expand All @@ -112,7 +54,7 @@ If you like spksrc and packages made out of it, please consider making a donatio

.. image:: https://www.paypal.com/en_US/i/btn/btn_donate_LG.gif
:target: https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=T6BU3QXYH4CMG

* bru7us

.. image:: https://www.paypal.com/en_US/i/btn/btn_donate_LG.gif
Expand All @@ -121,17 +63,15 @@ If you like spksrc and packages made out of it, please consider making a donatio
.. image:: http://api.flattr.com/button/flattr-badge-large.png
:target: http://flattr.com/thing/1106801/

Bugs
----
If you find a bug please report it in the `bug tracker`_ if it has not already been reported. Be sure to provide as much information as possible.

License
-------
When not explicitly set, files are placed under a `3 clause BSD license`_


.. _Architecture per Synology model: https://github.com/SynoCommunity/spksrc/wiki/Architecture-per-Synology-model
.. _3 clause BSD license: http://www.opensource.org/licenses/BSD-3-Clause
.. _bug tracker: https://github.com/SynoCommunity/spksrc/issues
.. _GitHub help pages: https://help.github.com
.. _SynoCommunity's repository: http://www.synocommunity.com/
.. _CONTRIBUTING: https://github.com/SynoCommunity/spksrc/blob/master/CONTRIBUTING.md
.. _Docker installation: https://docs.docker.com/engine/installation
.. _Install Docker with wget: https://docs.docker.com/linux/step_one
.. _SynoCommunity repository: http://www.synocommunity.com

0 comments on commit 3d260cb

Please sign in to comment.