|
1 | | -# OpenSSL rpm builder for CentOS/RHEL - build latest OpenSSL binary |
| 1 | +# OpenSSL RPM Builder for CentOS/RHEL - Build latest OpenSSL binary |
2 | 2 |
|
3 | 3 |  |
4 | 4 |  |
5 | 5 |
|
6 | 6 | ## [OpenSSL official site](https://www.openssl.org/) |
7 | 7 |
|
8 | | -## Remove old versions |
9 | | -```` |
10 | | -rpm -qa | grep openssl |
11 | | -rpm -e --justdb --nodeps <yourpackage> |
12 | | -```` |
13 | | - |
14 | | -# OpenSSL 3.6.1 [release page](https://github.com/openssl/openssl/releases/tag/openssl-3.6.1): |
| 8 | +## Quick Start (Recommended) |
15 | 9 |
|
16 | | -## Build: |
| 10 | +Use the new unified build script that supports all OpenSSL versions: |
17 | 11 |
|
18 | 12 | ```bash |
19 | | -sudo yum -y groupinstall 'Development Tools' |
| 13 | +# Install development tools |
| 14 | +sudo yum -y groupinstall 'Development Tools' # or dnf on newer systems |
| 15 | + |
| 16 | +# Clone the repository |
20 | 17 | git clone https://github.com/philyuchkoff/openssl-RPM-Builder |
21 | 18 | cd openssl-RPM-Builder |
22 | | -chmod +x install-openssl_3.sh |
23 | | -sudo ./install-openssl_3.sh |
24 | | - ``` |
25 | | - |
26 | | - Builded RPM will be in |
27 | 19 |
|
28 | | - /root/rpmbuild/RPMS/x86_64/ |
29 | | - |
30 | | -After `install-openssl_3.sh` will finish, you can install builded rpm: |
| 20 | +# Build OpenSSL (uses latest stable version by default) |
| 21 | +sudo ./build-openssl.sh |
| 22 | + |
| 23 | +# Or specify a version |
| 24 | +sudo ./build-openssl.sh 3.6.1 |
| 25 | +sudo ./build-openssl.sh 1.1.1w |
| 26 | +``` |
| 27 | + |
| 28 | +The built RPMs will be located in: |
| 29 | +``` |
| 30 | +/root/rpmbuild/RPMS/x86_64/ |
| 31 | +``` |
| 32 | + |
| 33 | +### Advanced Usage |
31 | 34 |
|
32 | 35 | ```bash |
33 | | -sudo rpm -ivvh /root/rpmbuild/RPMS/x86_64/openssl-3.6.1-1.el9.x86_64.rpm --nodeps |
34 | | - ``` |
| 36 | +# List available OpenSSL versions |
| 37 | +./build-openssl.sh --list |
| 38 | + |
| 39 | +# Use custom installation directory |
| 40 | +sudo OPENSSL_DIR=/opt/openssl ./build-openssl.sh 3.6.1 |
35 | 41 |
|
36 | | -# OpenSSL 1.1.1w: |
37 | | -[OpenSSL 1.1.1 End of Life](https://www.openssl.org/blog/blog/2023/03/28/1.1.1-EOL/) |
| 42 | +# View help |
| 43 | +./build-openssl.sh --help |
| 44 | +``` |
| 45 | + |
| 46 | +## Remove old versions |
38 | 47 |
|
39 | | -## Build: |
| 48 | +Before installing the new OpenSSL RPMs, remove existing packages: |
40 | 49 |
|
41 | 50 | ```bash |
42 | | -sudo yum -y groupinstall 'Development Tools' |
43 | | -git clone https://github.com/philyuchkoff/openssl-RPM-Builder |
44 | | -cd openssl-RPM-Builder |
45 | | -chmod +x install-openssl_1.1.1.sh |
| 51 | +# List OpenSSL packages |
| 52 | +rpm -qa | grep openssl |
| 53 | + |
| 54 | +# Remove existing OpenSSL (use with caution) |
| 55 | +rpm -e --justdb --nodeps <package-name> |
| 56 | +``` |
| 57 | + |
| 58 | +## Legacy Scripts (Deprecated) |
| 59 | + |
| 60 | +The old version-specific scripts are still available for backward compatibility: |
| 61 | + |
| 62 | +```bash |
| 63 | +# OpenSSL 3.6.1 (deprecated - use unified script instead) |
| 64 | +sudo ./install-openssl_3.sh |
| 65 | + |
| 66 | +# OpenSSL 1.1.1w (deprecated - use unified script instead) |
46 | 67 | sudo ./install-openssl_1.1.1.sh |
47 | | - ``` |
48 | | - |
49 | | -Builded RPM will be in |
| 68 | +``` |
| 69 | + |
| 70 | +> **Note**: These scripts are deprecated and will be removed in a future version. Please migrate to the unified `build-openssl.sh` script. |
| 71 | +
|
| 72 | +## Version-Specific Information |
| 73 | + |
| 74 | +### OpenSSL 3.6.1 |
| 75 | +- [Release Page](https://github.com/openssl/openssl/releases/tag/openssl-3.6.1) |
| 76 | +- Current stable release |
| 77 | +- Recommended for new installations |
| 78 | + |
| 79 | +### OpenSSL 1.1.1w |
| 80 | +- [OpenSSL 1.1.1 End of Life](https://www.openssl.org/blog/blog/2023/03/28/1.1.1-EOL/) |
| 81 | +- Consider upgrading to OpenSSL 3.x if possible |
| 82 | +- Use only for compatibility with existing applications |
| 83 | + |
| 84 | +## Installation of Built RPMs |
| 85 | + |
| 86 | +After the build completes, install the generated RPM packages: |
| 87 | + |
| 88 | +```bash |
| 89 | +# Find the built RPMs |
| 90 | +ls /root/rpmbuild/RPMS/x86_64/openssl-*.rpm |
50 | 91 |
|
51 | | - /root/rpmbuild/RPMS/x86_64/ |
52 | | - |
53 | | -After `install-openssl_1.1.1.sh` will finish, you can install builded rpm: |
| 92 | +# Install the main package |
| 93 | +sudo rpm -ivvh /root/rpmbuild/RPMS/x86_64/openssl-<version>-1.el<release>.x86_64.rpm --nodeps |
| 94 | + |
| 95 | +# For development, also install the devel package |
| 96 | +sudo rpm -ivvh /root/rpmbuild/RPMS/x86_64/openssl-devel-<version>-1.el<release>.x86_64.rpm --nodeps |
| 97 | +``` |
| 98 | + |
| 99 | +## Verification |
| 100 | + |
| 101 | +Check the installation: |
54 | 102 |
|
55 | 103 | ```bash |
56 | | -sudo rpm -ivvh /root/rpmbuild/RPMS/x86_64/openssl-1.1.1w-1.el7.x86_64.rpm --nodeps |
57 | | - ``` |
| 104 | +# Check OpenSSL version |
| 105 | +openssl version |
| 106 | + |
| 107 | +# Example output: |
| 108 | +# OpenSSL 3.6.1 7 May 2024 |
| 109 | +# or |
| 110 | +# OpenSSL 1.1.1w 11 Sep 2023 |
| 111 | + |
| 112 | +# Verify RPM installation |
| 113 | +rpm -qa openssl |
| 114 | +# Example output: |
| 115 | +# openssl-3.6.1-1.el9.x86_64 |
| 116 | +``` |
| 117 | + |
| 118 | +## Architecture |
| 119 | + |
| 120 | +The OpenSSL RPM Builder is now modularized with the following components: |
| 121 | + |
| 122 | +``` |
| 123 | +openssl-RPM-Builder/ |
| 124 | +├── README.md # This file |
| 125 | +├── common.sh # Shared functions library |
| 126 | +├── config.sh # Default configuration |
| 127 | +├── build-openssl.sh # Main unified script |
| 128 | +├── install-openssl_1.1.1.sh # Legacy script (deprecated) |
| 129 | +└── install-openssl_3.sh # Legacy script (deprecated) |
| 130 | +``` |
| 131 | + |
| 132 | +### Benefits of the New Architecture |
58 | 133 |
|
59 | | -## Check: |
| 134 | +- **Reduced Code Duplication**: Common functionality is centralized in `common.sh` |
| 135 | +- **Easy Version Support**: Add new OpenSSL versions by updating the configuration |
| 136 | +- **Unified Interface**: One script supports all OpenSSL versions |
| 137 | +- **Better Error Handling**: Consistent error reporting and cleanup |
| 138 | +- **Flexible Configuration**: Customize paths and build options |
| 139 | +- **Backward Compatibility**: Existing workflows continue to work |
60 | 140 |
|
61 | | - $openssl version |
62 | | - OpenSSL 1.1.1w 11 Sep 2023 |
63 | | -or |
| 141 | +## Contributing |
64 | 142 |
|
65 | | - $rpm -qa openssl |
66 | | - openssl-1.1.1w-1.el7.x86_64 |
| 143 | +Feel free to submit issues and pull requests to improve the OpenSSL RPM Builder! |
67 | 144 |
|
68 | | -## For fun |
| 145 | +## For Fun |
69 | 146 |
|
70 | | -[](https://www.star-history.com/#philyuchkoff/openssl-RPM-Builder&type=date&legend=top-left) |
| 147 | +[](https://www.star-history.com/#philyuchkoff/openssl-RPM-Builder&type=date&legend=top-left) |
0 commit comments