|
| 1 | +RPM Spec File Notes |
| 2 | +------------------- |
| 3 | + |
| 4 | +The RPM spec file provided here is for Bitcoin-Core 0.12.0 and builds on CentOS |
| 5 | +7 with either the CentOS provided OpenSSL library or with LibreSSL as packaged |
| 6 | +at [LibreLAMP.com](https://librelamp.com/). It should hopefully not be too |
| 7 | +difficult to port the RPM spec file to most RPM based Linux distributions. |
| 8 | + |
| 9 | +When porting the spec file to build for a particular distribution, there are |
| 10 | +some important notes. |
| 11 | + |
| 12 | +## Sources |
| 13 | + |
| 14 | +It is considered good form for all sources to reference a URL where the source |
| 15 | +can be downloaded. |
| 16 | + |
| 17 | +Sources 0-9 should be reserved for source code tarballs. `Source0` should |
| 18 | +reference the release tarball available from https://bitcoin.org/bin/ and |
| 19 | +`Source1` should reference the BerkeleyDB source. |
| 20 | + |
| 21 | +Sources 10-99 are for source files that are maintained in the |
| 22 | +[Bitcoin git repository](https://github.com/bitcoin/bitcoin) but are not part of |
| 23 | +the release tarball. Most of these will reside in the `contrib` sub-directory. |
| 24 | + |
| 25 | +Sources 10-19 should be reserved for miscellaneous configuration files. |
| 26 | +Currently only `Source10` is used, for the example `bitcoin.conf` file. |
| 27 | + |
| 28 | +Sources 20-29 should be reserved for man pages. Currently only `Source20` |
| 29 | +through `Source23` are used. |
| 30 | + |
| 31 | +Sources 30-39 should be reserved for SELinux related files. Currently only |
| 32 | +`Source30` through `Source32` are used. Until those files are in a tagged |
| 33 | +release, the full URL specified in the RPM spec file will not work. You can get |
| 34 | +them from the git ropository where you retrieved this file. |
| 35 | + |
| 36 | +Sources 100+ are for files that are not source tarballs and are not maintained |
| 37 | +in the bitcoin git repository. At present only an SVG version of the Bitcoin |
| 38 | +icon is used. |
| 39 | + |
| 40 | +## Patches |
| 41 | + |
| 42 | +In general, patches should be avoided. When a packager feels a patch is |
| 43 | +necessary, the packager should bring the problem to the attention of the bitcoin |
| 44 | +developers so that an official fix to the issue can make it into the next |
| 45 | +release. |
| 46 | + |
| 47 | +### Patch0 bitcoin-0.12.0-libressl.patch |
| 48 | + |
| 49 | +This patch is only needed if building against LibreSSL. LibreSSL is not the |
| 50 | +standard TLS library on most Linux distributions. The patch will likely not be |
| 51 | +needed when 0.12.1 is released, a proper fix is already in the Bitcoin git |
| 52 | +master branch. |
| 53 | + |
| 54 | +## BuildRequires |
| 55 | + |
| 56 | +The packages specified in the `BuildRequires` are specified according to the |
| 57 | +package naming convention currently used in CentOS 7 and EPEL for CentOS 7. You |
| 58 | +may need to change some of the package names for other distributions. This is |
| 59 | +most likely to be the case with the Qt packages. |
| 60 | + |
| 61 | +## BerkeleyDB |
| 62 | + |
| 63 | +The `build-unix.md` file recommends building against BerkeleyDB 4.8.30. Even if |
| 64 | +that is the version your Linux distribution ships with, it probably is a good |
| 65 | +idea to build Bitcoin Core against a static version of that library compiled |
| 66 | +according to the instructions in the `build-unix.md` file so that any changes |
| 67 | +the distribution may make in the future will not result in a problem for users. |
| 68 | + |
| 69 | +The problem that can exist, clients built against different versions of |
| 70 | +BerkeleyDB may not be able read each other's `wallet.dat` file which can make it |
| 71 | +difficult for a user to recover from backup in the event of a system failure. |
| 72 | + |
| 73 | +## Graphical User Interface and Qt Version |
| 74 | + |
| 75 | +The RPM spec file will by default build the GUI client linked against the Qt5 |
| 76 | +libraries. If you wish instead to link against the Qt4 libraries you need to |
| 77 | +pass the switch `-D '_use_qt4 1'` at build time to the `rpmbuild` or `mock` |
| 78 | +command used to build the packages. |
| 79 | + |
| 80 | +If you would prefer not to build the GUI at all, you can pass the switch |
| 81 | +`-D '_no_gui 1'` to the `rpmbuild` or `mock` build command. |
| 82 | + |
| 83 | +## Desktop and KDE Files |
| 84 | + |
| 85 | +The desktop and KDE meta files are created in the spec file itself with the |
| 86 | +`cat` command. This is done to allow easy distribution specific changes without |
| 87 | +needing to use any patches. A specific time stamp is given to the files so that |
| 88 | +it does not they do not appear to have been updated every time the package is |
| 89 | +built. If you do make changes to them, you probably should update time stamp |
| 90 | +assigned to them in the `touch` command that specifies the time stamp. |
| 91 | + |
| 92 | +## SVG, PNG, and XPM Icons |
| 93 | + |
| 94 | +The `bitcoin.svg` file is from the source listed as `Source100`. It is used as |
| 95 | +the source for the PNG and XPM files. The generated PNG and XPM files are given |
| 96 | +the same time stamp as the source SVG file as a means of indicating they are |
| 97 | +derived from it. |
| 98 | + |
| 99 | +## Systemd |
| 100 | + |
| 101 | +This spec file assumes the target distribution uses systemd. That really only |
| 102 | +matters for the `bitcoin-server` package. At this point, most RPM based |
| 103 | +distributions that still receive vendor updates do in fact use systemd. |
| 104 | + |
| 105 | +The files to control the service are created in the RPM spec file itself using |
| 106 | +the `cat` command. This is done to make it easy to modify for other |
| 107 | +distributions that may implement things differently without needing to patch |
| 108 | +source. A specific time stamp is given to the files so that they do not appear |
| 109 | +to have been updated every time the package is built. If you do make changes to |
| 110 | +them, you probably should update the time stamp assigned to them in the `touch` |
| 111 | +command that specifies the time stamp. |
| 112 | + |
| 113 | +## SELinux |
| 114 | + |
| 115 | +The `bitcoin-server` package should have SELinux support. How to properly do |
| 116 | +that *may* vary by distribution and version of distribution. |
| 117 | + |
| 118 | +The SELinux stuff in this RPM spec file *should* be correct for CentOS, RHEL, |
| 119 | +and Fedora but it would be a good idea to review it before building the package |
| 120 | +on other distributions. |
| 121 | + |
| 122 | +## Tests |
| 123 | + |
| 124 | +The `%check` section takes a very long time to run. If your build system has a |
| 125 | +time limit for package build, you may need to make an exception for this |
| 126 | +package. On CentOS 7 the `%check` section completes successfully with both |
| 127 | +OpenSSL and LibreSSL, a failure really does mean something is wrong. |
| 128 | + |
| 129 | +## LibreSSL Build Notes |
| 130 | + |
| 131 | +To build against LibreSSL you will need to pass the switch |
| 132 | +`-D '_use_libressl 1'` to the `rpmbuild` or `mock` command or the spec file will |
| 133 | +want the OpenSSL development files. |
| 134 | + |
| 135 | +### LibreSSL and Boost |
| 136 | + |
| 137 | +LibreSSL (and some newer builds of OpenSSL) do not have support for SSLv3. This |
| 138 | +can cause issues with the Boost package if the Boost package has not been |
| 139 | +patched accordingly. On those distributions, you will either need to build |
| 140 | +Bitcoin-Core against OpenSSL or use a patched version of Boost in the build |
| 141 | +system. |
| 142 | + |
| 143 | +As SSLv3 is no longer safe, distributions that have not patched Boost to work |
| 144 | +with TLS libraries that do not support SSLv3 should have bug reports filed |
| 145 | +against the Boost package. This bug report has already been filed for RHEL 7 but |
| 146 | +it may need to be filed for other distributions. |
| 147 | + |
| 148 | +A patch for Boost: https://github.com/boostorg/asio/pull/23/files |
| 149 | + |
| 150 | +## ZeroMQ |
| 151 | + |
| 152 | +At this time, this RPM spec file does not support the ZeroMQ build options. A |
| 153 | +suitable version of ZeroMQ is not available for the platform this spec file was |
| 154 | +developed on (CentOS 7). |
| 155 | + |
| 156 | +## Legacy Credit |
| 157 | + |
| 158 | +This RPM spec file is largely based upon the work of Michael Hampton at |
| 159 | +[Ringing Liberty](https://www.ringingliberty.com/bitcoin/). He has been |
| 160 | +packaging Bitcoin for Fedora at least since 2012. |
| 161 | + |
| 162 | +Most of the differences between his packaging and this package are stylistic in |
| 163 | +nature. The major differences: |
| 164 | + |
| 165 | +1. He builds from a github tagged release rather than a release tarball. This |
| 166 | +should not result in different source code. |
| 167 | + |
| 168 | +2. He does not build BerkeleyDB but instead uses the BerkeleyDB provided by the |
| 169 | +Linux distribution. For the distributions he packages for, they currently all |
| 170 | +use the same version of BerkeleyDB so that difference is *probably* just |
| 171 | +academic. |
| 172 | + |
| 173 | +3. As of his 10.11.2 package he did not allow for building against LibreSSL, |
| 174 | +specifying a build without the Qt GUI, or specifying which version of the Qt |
| 175 | +libraries to use. |
| 176 | + |
| 177 | +4. I renamed the `bitcoin` package that contains the Qt GUI to `bitcoin-core` as |
| 178 | +that appears to be how the general population refers to it, in contrast to |
| 179 | +`bitcoin-xt` or `bitcoin-classic`. I wanted to make sure the general population |
| 180 | +knows what they are getting when installing the GUI package. |
| 181 | + |
| 182 | +As far as minor differences, I generally prefer to assign the file permissions |
| 183 | +in the `%files` portion of an RPM spec file rather than specifying the |
| 184 | +permissions of a file during `%install` and other minor things like that that |
| 185 | +are largely just cosmetic. |
0 commit comments