Skip to content

Commit 544b652

Browse files
Merge branch 'develop' into FOGL-6315
2 parents d6c5e33 + b242143 commit 544b652

File tree

4 files changed

+24
-13
lines changed

4 files changed

+24
-13
lines changed

plugins/make_deb

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
#!/bin/bash
22

33
##--------------------------------------------------------------------
4-
## Copyright (c) 2019 Dianomic Systems Inc.
4+
## Copyright (c) 2022 Dianomic Systems Inc.
55
##
66
## Licensed under the Apache License, Version 2.0 (the "License");
77
## you may not use this file except in compliance with the License.
@@ -188,6 +188,7 @@ do
188188
sed -i "s/fledge$/fledge (${fledge_version})/" ${deb_path}/control
189189
sed -i "s|__INSTALL_DIR__|${installs}|g" ${deb_path}/postinst
190190
sed -i "s/__PLUGIN_NAME__/${plugin_name}/g" ${deb_path}/postinst
191+
sed -i "s/__PLUGIN_TYPE__/${plugin_type_install}/g" ${deb_path}/postinst
191192
desc=`cat "${GIT_ROOT}/Description"`
192193
sed -i "s/__DESCRIPTION__/${desc}/g" ${deb_path}/control
193194
if [ ! -z "${service_notification_version}" ] ; then
@@ -232,6 +233,10 @@ EOF
232233
fi
233234
# plugin info version replaced in ${plugin_name}.py
234235
sed -i "s/'version':.*$/'version': '${version}',/g" ${GIT_ROOT}/python/fledge/plugins/${plugin_type}/${plugin_name}/${plugin_name}.py
236+
# Move python requirements to the plugin installed directory
237+
if [ -f "${GIT_ROOT}/python/requirements-${plugin_name}.txt" ]; then
238+
mv ${GIT_ROOT}/python/requirements-${plugin_name}.txt ${GIT_ROOT}/${installs}/requirements.txt
239+
fi
235240
cp -R ${GIT_ROOT}/python .
236241
cp -R ${GIT_ROOT}/VERSION.${plugin_type}.${plugin_name} ./python/fledge/plugins/${plugin_type}/${plugin_name}
237242
else

plugins/make_rpm

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
#!/bin/bash
22

33
##--------------------------------------------------------------------
4-
## Copyright (c) 2019 Dianomic Systems
4+
## Copyright (c) 2022 Dianomic Systems Inc.
55
##
66
## Licensed under the Apache License, Version 2.0 (the "License");
77
## you may not use this file except in compliance with the License.
@@ -196,6 +196,7 @@ do
196196
sed -i "s/__RELEASE__/${commit_count}/g" SPECS/plugin.spec
197197
sed -i "s/__NAME__/${pkg_name}/g" SPECS/plugin.spec
198198
sed -i "s/__PLUGIN_NAME__/${plugin_name}/g" SPECS/plugin.spec
199+
sed -i "s/__PLUGIN_TYPE__/${plugin_type_install}/g" SPECS/plugin.spec
199200
sed -i "s/__ARCH__/${arch}/g" SPECS/plugin.spec
200201
sed -i "s/__PACKAGE_NAME__/${package_name}/g" SPECS/plugin.spec
201202
sed -i "s|__INSTALL_DIR__|${installs}|g" SPECS/plugin.spec
@@ -241,6 +242,10 @@ EOF
241242
fi
242243
# plugin info version replaced in ${plugin_name}.py
243244
sed -i "s/'version':.*$/'version': '${version}',/g" ${GIT_ROOT}/python/fledge/plugins/${plugin_type}/${plugin_name}/${plugin_name}.py
245+
# Move python requirements to the plugin installed directory
246+
if [ -f "${GIT_ROOT}/python/requirements-${plugin_name}.txt" ]; then
247+
mv ${GIT_ROOT}/python/requirements-${plugin_name}.txt ${GIT_ROOT}/${installs}/requirements.txt
248+
fi
244249
cp -R ${GIT_ROOT}/python .
245250
cp -R ${GIT_ROOT}/VERSION.${plugin_type}.${plugin_name} ./python/fledge/plugins/${plugin_type}/${plugin_name}
246251
else

plugins/packages/DEBIAN/postinst

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
#!/bin/sh
22

33
##--------------------------------------------------------------------
4-
## Copyright (c) 2019 Dianomic Systems Inc.
4+
## Copyright (c) 2022 Dianomic Systems Inc.
55
##
66
## Licensed under the Apache License, Version 2.0 (the "License");
77
## you may not use this file except in compliance with the License.
@@ -38,12 +38,11 @@ if [ -f /usr/local/fledge/python/extras_install___PLUGIN_NAME__.sh ]; then
3838
sh /usr/local/fledge/python/extras_install___PLUGIN_NAME__.sh
3939
fi
4040

41-
# Install Python dependencies; if any
42-
if [ -f /usr/local/fledge/python/requirements-__PLUGIN_NAME__.txt ]; then
43-
pip3 install -Ir /usr/local/fledge/python/requirements-__PLUGIN_NAME__.txt
41+
# Install Python pip dependencies; if any
42+
if [ -f /usr/local/fledge/__INSTALL_DIR__/requirements.txt ]; then
43+
pip3 install -Ir /usr/local/fledge/__INSTALL_DIR__/requirements.txt
4444
fi
45-
46-
echo __PLUGIN_NAME__ plugin is installed.
45+
echo __PLUGIN_NAME__ __PLUGIN_TYPE__ plugin is installed.
4746
echo "
4847
__PLUGIN_NOTES__
4948
"

plugins/packages/RPM/SPECS/plugin.spec

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ __DESCRIPTION__
2525
#!/usr/bin/env bash
2626

2727
##--------------------------------------------------------------------
28-
## Copyright (c) 2019 Dianomic Systems Inc.
28+
## Copyright (c) 2022 Dianomic Systems Inc.
2929
##
3030
## Licensed under the Apache License, Version 2.0 (the "License");
3131
## you may not use this file except in compliance with the License.
@@ -54,7 +54,7 @@ __DESCRIPTION__
5454
#!/usr/bin/env bash
5555

5656
##--------------------------------------------------------------------
57-
## Copyright (c) 2019 Dianomic Systems Inc.
57+
## Copyright (c) 2022 Dianomic Systems Inc.
5858
##
5959
## Licensed under the Apache License, Version 2.0 (the "License");
6060
## you may not use this file except in compliance with the License.
@@ -87,7 +87,7 @@ PKG_NAME="__PACKAGE_NAME__"
8787
#!/usr/bin/env bash
8888

8989
##--------------------------------------------------------------------
90-
## Copyright (c) 2019 Dianomic Systems Inc.
90+
## Copyright (c) 2022 Dianomic Systems Inc.
9191
##
9292
## Licensed under the Apache License, Version 2.0 (the "License");
9393
## you may not use this file except in compliance with the License.
@@ -128,11 +128,13 @@ if [ -f /usr/local/fledge/python/extras_install___PLUGIN_NAME__.sh ]; then
128128
fi
129129

130130
# Install any Python dependencies
131-
if [ -f /usr/local/fledge/python/requirements-__PLUGIN_NAME__.txt ]; then
131+
if [ -f /usr/local/fledge/__INSTALL_DIR__/requirements.txt ]; then
132132
bash << EOF
133133
scl enable rh-python36 bash
134-
pip install -Ir /usr/local/fledge/python/requirements-__PLUGIN_NAME__.txt
134+
pip install -Ir /usr/local/fledge/__INSTALL_DIR__/requirements.txt
135135
EOF
136136
fi
137137

138+
echo __PLUGIN_NAME__ __PLUGIN_TYPE__ plugin is installed.
139+
138140
%files

0 commit comments

Comments
 (0)