@@ -15,7 +15,11 @@ VCS: __VCS__
15
15
%define install_path /usr/local
16
16
17
17
Prefix: /usr/local
18
+ %if 0%{?centos } < 9 || 0%{?rhel } < 9
18
19
Requires: dbus-devel, glib2-devel, boost, openssl, rh-python36, yum-utils, gcc, autoconf, curl, libtool, rsyslog, wget, zlib, libuuid, avahi, sudo, krb5-workstation, curl-devel
20
+ %else
21
+ Requires: dbus-devel, glib2-devel, boost, openssl, python3, yum-utils, gcc, autoconf, curl, libtool, rsyslog, wget, zlib, libuuid, avahi, sudo, krb5-workstation, curl-devel
22
+ %endif
19
23
AutoReqProv: no
20
24
21
25
%description
211
215
set -e
212
216
213
217
PKG_NAME= "fledge"
218
+ OS_VERSION= $(cat /etc/os-release | grep 'VERSION_ID= ' | cut -f2 -d= | sed 's/"//g')
214
219
215
220
get_fledge_script () {
216
221
fledge_script= $(rpm -ql ${PKG_NAME} | grep 'fledge/bin/fledge$')
@@ -324,7 +329,12 @@ copy_fledge_sudoer_file() {
324
329
}
325
330
326
331
copy_service_file() {
327
- cp /usr/local /fledge/extras/scripts/fledge.service /etc/init.d/fledge
332
+ if [[ ${OS_VERSION} == *"7"* ]]
333
+ then
334
+ cp /usr/local /fledge/extras/scripts/fledge.service /etc/init.d/fledge
335
+ else
336
+ cp /usr/local /fledge/extras/scripts/fledge.service /etc/rc.d/init.d/fledge
337
+ fi
328
338
}
329
339
330
340
enable_fledge_service() {
@@ -400,14 +410,24 @@ install_pip3_packages () {
400
410
then
401
411
echo "# " >> /home/${SUDO_USER}/.bashrc
402
412
echo "# ${foglam_test}" >> /home/${SUDO_USER}/.bashrc
403
- echo "source scl_source enable rh-python36" >> /home/${SUDO_USER}/.bashrc
413
+ if [[ ${OS_VERSION} == *"7"* ]]
414
+ then
415
+ echo "source scl_source enable rh-python36" >> /home/${SUDO_USER}/.bashrc
416
+ fi
417
+ fi
418
+ if [[ ${OS_VERSION} == *"7"* ]]
419
+ then
420
+ source scl_source enable rh-python36
404
421
fi
405
- source scl_source enable rh-python36
406
422
407
423
# TODO: we may need with --no-cache-dir
408
- pip3 install -Ir /usr/local /fledge/python/requirements.txt
409
-
410
- sudo bash -c 'source scl_source enable rh-python36; python3 -m pip install dbus-python numpy== 1.19.5'
424
+ python3 -m pip install -Ir /usr/local /fledge/python/requirements.txt
425
+ if [[ ${OS_VERSION} == *"7"* ]]
426
+ then
427
+ sudo bash -c 'source scl_source enable rh-python36; python3 -m pip install dbus-python numpy== 1.19.5'
428
+ else
429
+ sudo bash -c 'python3 -m pip install dbus-python numpy== 1.19.5'
430
+ fi
411
431
set -e
412
432
}
413
433
0 commit comments