1Installation
2============
3
4Many major Linux distribution might already package ``rmlint`` -- but watch out for
5the version. If possible, we recommend using the `newest version`_ available.
6
7.. _`newest version`: https://github.com/sahib/rmlint/releases
8
9If there is no package yet or you want to try a development version, you gonna
10need to compile ``rmlint`` from source.
11
12Dependencies
13------------
14
15Hard dependencies:
16~~~~~~~~~~~~~~~~~~
17
18* **glib** :math:`\geq 2.32` (general C Utility Library)
19
20Soft dependencies:
21~~~~~~~~~~~~~~~~~~
22
23* **libblkid** (detecting mountpoints)
24* **libelf** (nonstripped binary detection)
25* **libjson-glib** (parsing rmlint's own json as caching layer)
26
27Build dependencies:
28~~~~~~~~~~~~~~~~~~~
29
30* **git** (version control)
31* **scons** (build system)
32* **sphinx** (manpage/documentation generation)
33* **gettext** (support for localization)
34
35Here's a list of readily prepared commands for known operating systems:
36
37* **Fedora** :math:`\geq 21`:
38
39  .. code-block:: bash
40
41    $ yum -y install pkgconf git scons python3-sphinx gettext json-glib-devel
42    $ yum -y install glib2-devel libblkid-devel elfutils-libelf-devel
43    # Optional dependencies for the GUI:
44    $ yum -y install pygobject3 gtk3 librsvg2
45
46  There are also pre-built packages on `Fedora Copr`_:
47
48  .. code-block:: bash
49
50    $ dnf copr enable eclipseo/rmlint
51    $ dnf install rmlint
52
53  Since **Fedora 29** we also have an `official package`_.
54
55.. _`official package`: https://bugzilla.redhat.com/show_bug.cgi?id=1655338
56
57.. _`Fedora Copr`: https://copr.fedorainfracloud.org/coprs/eclipseo/rmlint/
58
59* **ArchLinux:**
60
61  There is an official package in ``[community]`` here_:
62
63  .. code-block:: bash
64
65    $ pacman -S rmlint
66
67  Alternatively you can use ``rmlint-git`` in the AUR:
68
69  .. code-block:: bash
70
71    $ pacman -S pkgconf git scons python-sphinx
72    $ pacman -S glib2 libutil-linux elfutils json-glib
73    # Optional dependencies for the GUI:
74    $ pacman -S gtk3 python-gobject librsvg
75
76  There is also a `PKGBUILD`_ on the `ArchLinux AUR`_:
77
78  .. code-block:: bash
79
80    $ # Use your favourite AUR Helper.
81    $ yaourt -S rmlint-git
82
83  It is built from git ``master``, not from the ``develop`` branch.
84
85.. _here: https://www.archlinux.org/packages/?name=rmlint
86.. _`PKGBUILD`: https://aur.archlinux.org/packages/rm/rmlint-git/PKGBUILD
87.. _`ArchLinux AUR`: https://aur.archlinux.org/packages/rmlint-git
88
89* **Debian** / **Ubuntu** :math:`\geq 12.04`:
90
91  Note: Debian also `ships an official package`_.
92  Use the below instructions if you need a more recent version.
93
94  This most likely applies to most distributions that are derived from Ubuntu.
95  Note that the ``GUI`` depends on ``GTK+ >= 3.12``!
96  Ubuntu 14.04 LTS and earlier `still ships`_  with ``3.10``.
97
98  .. code-block:: bash
99
100    $ apt-get install pkg-config git scons python3-sphinx python3-nose gettext build-essential
101    # Optional dependencies for more features:
102    $ apt-get install libelf-dev libglib2.0-dev libblkid-dev libjson-glib-1.0 libjson-glib-dev
103    # Optional dependencies for the GUI:
104    $ apt-get install python3-gi gir1.2-rsvg gir1.2-gtk-3.0 python-cairo gir1.2-polkit-1.0 gir1.2-gtksource-3.0
105
106
107.. _`ships an official package`: https://packages.debian.org/de/sid/rmlint
108.. _`still ships`: https://github.com/sahib/rmlint/issues/171#issuecomment-199070974
109
110* **macOS**
111
112  ``rmlint`` can be installed via `homebrew`_:
113
114  Prerequisite: If homebrew has not already been installed on the system, execute:
115
116  .. code-block:: bash
117
118      $ /usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)".
119
120  With homebrew installed, execute:
121
122  .. code-block:: bash
123
124      $ brew install rmlint
125
126
127  See also this `issue`_ for more information on the homebrew formula.
128
129.. _homebrew: http://brew.sh
130.. _issue: https://github.com/sahib/rmlint/issues/175#issuecomment-253186769
131
132* **FreeBSD** :math:`\geq 10.1`:
133
134  .. code-block:: bash
135
136    $ pkg install git scons py27-sphinx pkgconf
137    $ pkg install glib gettext libelf json-glib
138
139-----
140
141Send us a note if you want to see your distribution here or the instructions
142need an update. The commands above install the full dependencies, therefore
143some packages might be stripped if you do not need the feature
144they enable. Only hard requirement for the commandline is ``glib``.
145
146Also be aware that the GUI needs at least :math:`gtk \geq 3.12` to work!
147
148Compilation
149-----------
150
151Compilation consists of getting the source and translating it into a usable
152binary. We use the build system ``scons``. Note that the following instructions
153build the software from the potentially unstable ``develop`` branch:
154
155.. code-block:: bash
156
157   $ # Omit -b develop if you want to build from the stable master
158   $ git clone -b develop https://github.com/sahib/rmlint.git
159   $ cd rmlint/
160   $ scons config       # Look what features scons would compile
161   $ scons DEBUG=1      # Optional, build locally.
162   # Install (and build if necessary). For releases you can omit DEBUG=1
163   $ sudo scons DEBUG=1 --prefix=/usr install
164
165Done!
166
167You should be now able to see the manpage with ``rmlint --help`` or ``man 1
168rmlint``.
169
170Uninstall with ``sudo scons uninstall`` and clean with ``scons -c``.
171
172You can also only type the ``install`` command above. The buildsystem is clever
173enough to figure out which targets need to be built beforehand.
174
175Troubleshooting
176---------------
177
178On some distributions (especially Debian derived) ``rmlint --gui`` might fail
179with ``/usr/bin/python3: No module named shredder`` (or similar). This is due
180some incompatible changes on Debian's side.
181
182See `this thread`_ for a workaround using ``PYTHONPATH``.
183
184
185.. _`this thread`: https://github.com/sahib/rmlint/issues/171#issuecomment-199070974
186