Skip to content

Commit

Permalink
Merge pull request #1804 from jimklimov/centos6
Browse files Browse the repository at this point in the history
Revisit NUT CI build on CentOS 6
  • Loading branch information
jimklimov committed Jan 13, 2023
2 parents 12cd833 + e01e591 commit 8379a01
Show file tree
Hide file tree
Showing 5 changed files with 74 additions and 11 deletions.
12 changes: 12 additions & 0 deletions autogen.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,18 @@
# in a buildable state
# NOTE: uses cumbersome dumbest-possible shell syntax for extra portability

# perl tends to complain if locale is not set (or its files are absent)
if [ -z "${LANG-}" ]; then
LANG="C"
export LANG
fi

if [ -z "${LC_ALL-}" ] ; then
LC_ALL="C"
export LC_ALL
fi


if [ -n "${PYTHON-}" ] ; then
# May be a name/path of binary, or one with args - check both
(command -v "$PYTHON") \
Expand Down
4 changes: 3 additions & 1 deletion configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ AM_INIT_AUTOMAKE([subdir-objects])

dnl we need Autoconf 2.61 or better to enable features of Posix that are extensions to C
dnl (and actually 2.64 or better for m4/ax_check_compile_flag.m4 when it is sourced)
dnl UPDATE: As tested on CentOS 6, its "autoconf-2.63-5.1.el6.noarch" also suffices.
AC_MSG_CHECKING(for autoconf macro to enable system extensions)
m4_version_prereq(2.61, [
AC_MSG_RESULT(yes)
Expand All @@ -27,7 +28,8 @@ m4_version_prereq(2.61, [
AC_MSG_RESULT(no)
])

AC_PREREQ([2.64])
AC_PREREQ([2.63])
dnl #AC_PREREQ([2.64])

dnl Use "./configure --enable-maintainer-mode" to keep Makefile.in and Makefile
dnl in sync after Git updates.
Expand Down
58 changes: 51 additions & 7 deletions docs/config-prereqs.txt
Original file line number Diff line number Diff line change
Expand Up @@ -208,14 +208,20 @@ NOTE: For Jenkins agents, also need to `apt-get install openjdk-11-jdk-headless`
You may have to ensure that `/proc` is mounted in the target chroot
(or do this from the running container).

CentOS 7
~~~~~~~~
CentOS 6 and 7
~~~~~~~~~~~~~~

CentOS is another popular baseline among Linux distributions, being a free
derivative of the RedHat Linux, upon which many other distros are based as
well. These systems typically use the RPM package manager, using directly
`rpm` command, or `yum` or `dnf` front-ends depending on their generation.

For CI farm container setup, prepared root filesystem archives from
http://download.proxmox.com/images/system/ worked sufficiently well.

Prepare CentOS repository mirrors
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

For CentOS 7 it seems that not all repositories are equally good; some of
the software below is only served by EPEL (Extra Packages for Enterprise
Linux), as detailed at:
Expand All @@ -237,19 +243,55 @@ file (as the aged distributions become less served by mirrors), such as:
# lines, and comment away the mirrorlist= lines (if yum hiccups otherwise)
------

For systemd support on CentOS 7 (no equivalent found for CentOS 6),
you can use backports repository below:
------
:; curl https://copr.fedorainfracloud.org/coprs/jsynacek/systemd-backports-for-centos-7
> /etc/yum.repos.d/systemd-backports-for-centos-7.repo
------

For CentOS 6 (the oldest I could try) the situation is similar, with sites like
https://www.getpagespeed.com/server-setup/how-to-fix-yum-after-centos-6-went-eol
detailing how to replace `/etc/yum.repos.d/` contents (you can wholesale rename
the existing directory and populate a new one with `curl` downloads from the
article), and additional key trust for EPEL packages:
------
:; yum install https://dl.fedoraproject.org/pub/archive/epel/6/x86_64/epel-release-6-8.noarch.rpm
------

Set up CentOS packages for NUT
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

Instructions below apply to both CentOS 6 and 7 (a few nuances for 6 commented).

General developer system helpers mentioned in link:ci-farm-lxc-setup.txt[]:
------
:; yum update

:; yum install \
sudo vim mc p7zip pigz pbzip2
sudo vim mc p7zip pigz pbzip2 tar
------

To have SSH access to the build VM/Container, you may have to install and
enable it:
------
:; yum install \
openssh-server openssh-clients

:; chkconfig sshd on
:; service sshd start

# If there are errors loading generated host keys, remove mentioned files
# including the one with .pub extension and retry with:
#:; service sshd restart
------

NOTE: Below we request to install generic `python` per system defaults.
You may request specifically `python2` or `python3` (or both): current
NUT should be compatible with both (2.7+ at least).

NOTE: On CentOS, `libusb` means 0.1.x and `libusbx` means 1.x.x API version.
NOTE: On CentOS, `libusb` means 0.1.x and `libusbx` means 1.x.x API version
(latter is not available for CentOS 6).

NOTE: On CentOS, it seems that development against libi2c/smbus is not
supported. Neither the suitable devel packages were found, nor i2c-based
Expand All @@ -273,6 +315,7 @@ drivers in distro packaging of NUT. Resolution and doc PRs are welcome.
# :; yum install python3 python3-3.6.8
# You can find a list of what is (pre-)installed with:
# :; rpm -qa | grep -Ei 'perl|python'
# Note that CentOS 6 includes python-2.6.x and does not serve newer versions

# For spell-checking, highly recommended if you would propose pull requests:
:; yum install \
Expand All @@ -286,11 +329,11 @@ drivers in distro packaging of NUT. Resolution and doc PRs are welcome.
:; yum install \
gd-devel

# Optionally for sd_notify integration:
# Optionally for sd_notify integration (on CentOS 7+, not on 6):
:; yum install \
systemd-devel

# NOTE: "libusbx" is the CentOS way of naming "libusb-1.0"
# NOTE: "libusbx" is the CentOS way of naming "libusb-1.0" (not in CentOS 6)
# vs. the older "libusb" as the package with "libusb-0.1"
:; yum install \
cppunit-devel \
Expand Down Expand Up @@ -328,7 +371,8 @@ other described environments by adding a symlink `/usr/lib/ccache`:
:; ln -s ../lib64/ccache/ "$ALTROOT"/usr/lib/
------

NOTE: For Jenkins agents, also need to `yum install java-11-openjdk-headless`.
NOTE: For Jenkins agents, also need to `yum install java-11-openjdk-headless`
(not available for CentOS 6).

Arch Linux
~~~~~~~~~~
Expand Down
6 changes: 4 additions & 2 deletions docs/nut.dict
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
personal_ws-1.1 en 3076 utf-8
personal_ws-1.1 en 3078 utf-8
AAS
ABI
ACFAIL
Expand Down Expand Up @@ -1517,6 +1517,7 @@ backends
backgrounding
backport
backported
backports
backupspro
badpassword
baseurl
Expand Down Expand Up @@ -1626,6 +1627,7 @@ charset
checksum
chgrp
chipset
chkconfig
chmod
chown
chr
Expand Down Expand Up @@ -2822,8 +2824,8 @@ testtime
testuser
textproc
th
timehead
timeframe
timehead
timeline
timername
timestamp
Expand Down
5 changes: 4 additions & 1 deletion m4/ax_check_compile_flag.m4
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,10 @@
#serial 6

AC_DEFUN([AX_CHECK_COMPILE_FLAG],
[AC_PREREQ(2.64)dnl for _AC_LANG_PREFIX and AS_VAR_IF
[
dnl UPDATE: As tested on CentOS 6, its "autoconf-2.63-5.1.el6.noarch" also suffices.
AC_PREREQ(2.63)
dnl #AC_PREREQ(2.64)dnl for _AC_LANG_PREFIX and AS_VAR_IF
AS_VAR_PUSHDEF([CACHEVAR],[ax_cv_check_[]_AC_LANG_ABBREV[]flags_$4_$1])dnl
AC_CACHE_CHECK([whether _AC_LANG compiler accepts $1], CACHEVAR, [
ax_check_save_flags=$[]_AC_LANG_PREFIX[]FLAGS
Expand Down

0 comments on commit 8379a01

Please sign in to comment.