|
68 | 68 | GIT_REPO=$(basename "${GERRIT_PROJECT}") |
69 | 69 | GIT_URL="https://${GERRIT_HOST}/${GERRIT_PROJECT}" |
70 | 70 |
|
71 | | - BASE_PACKAGES="git bison flex cmake gcc-c++ libacl-devel krb5-devel dbus-devel rpm-build redhat-rpm-config gdb" |
72 | | - BUILDREQUIRES_EXTRA="libnsl2-devel libnfsidmap-devel libwbclient-devel userspace-rcu-devel libcephfs-devel" |
73 | | - if [ "${CENTOS_VERSION}" = "7" ]; then |
74 | | - yum -y install libgfapi-devel |
75 | | - yum -y install ${BASE_PACKAGES} libnfsidmap-devel libwbclient-devel libcap-devel libblkid-devel userspace-rcu-devel userspace-rcu python2-devel |
76 | | - elif [ "${CENTOS_VERSION}" = "8s" ]; then |
77 | | - yum install -y ${BASE_PACKAGES} libacl-devel libblkid-devel libcap-devel redhat-rpm-config rpm-build libgfapi-devel xfsprogs-devel |
78 | | - yum install --enablerepo=powertools -y ${BUILDREQUIRES_EXTRA} |
79 | | - yum -y install selinux-policy-devel sqlite samba-winbind |
80 | | - elif [ "${CENTOS_VERSION}" = "9s" ]; then |
81 | | - yum install -y ${BASE_PACKAGES} libacl-devel libblkid-devel libcap-devel redhat-rpm-config rpm-build libgfapi-devel xfsprogs-devel |
82 | | - yum install --enablerepo=crb -y ${BUILDREQUIRES_EXTRA} |
83 | | - yum -y install selinux-policy-devel sqlite samba-winbind |
84 | | - fi |
| 71 | + BASE_PACKAGES="git bison flex cmake gcc-c++ libacl-devel krb5-devel dbus-devel rpm-build redhat-rpm-config gdb" |
| 72 | + BUILDREQUIRES_EXTRA="libnsl2-devel libnfsidmap-devel libwbclient-devel userspace-rcu-devel libcephfs-devel" |
| 73 | + |
| 74 | + if [ "${CENTOS_VERSION}" = "7" ]; then |
| 75 | + yum -y install libgfapi-devel |
| 76 | + yum -y install ${BASE_PACKAGES} libnfsidmap-devel libwbclient-devel libcap-devel libblkid-devel userspace-rcu-devel userspace-rcu python2-devel |
| 77 | + elif [ "${CENTOS_VERSION}" = "8s" ]; then |
| 78 | + yum install -y ${BASE_PACKAGES} libacl-devel libblkid-devel libcap-devel redhat-rpm-config rpm-build libgfapi-devel xfsprogs-devel |
| 79 | + yum install --enablerepo=powertools -y ${BUILDREQUIRES_EXTRA} |
| 80 | + yum -y install selinux-policy-devel sqlite samba-winbind |
| 81 | + elif [ "${CENTOS_VERSION}" = "9s" ]; then |
| 82 | + yum install -y ${BASE_PACKAGES} \ |
| 83 | + libacl-devel \ |
| 84 | + libblkid-devel \ |
| 85 | + libcap-devel \ |
| 86 | + redhat-rpm-config \ |
| 87 | + rpm-build \ |
| 88 | + libgfapi-devel \ |
| 89 | + xfsprogs-devel \ |
| 90 | + python3-devel |
| 91 | + yum install --enablerepo=crb -y ${BUILDREQUIRES_EXTRA} |
| 92 | + yum -y install selinux-policy-devel sqlite samba-winbind |
| 93 | + fi |
85 | 94 |
|
86 | 95 | git init "${GIT_REPO}" |
87 | 96 | pushd "${GIT_REPO}" |
88 | 97 |
|
89 | | - #Its observed that fetch is failing so this little hack is added! Will delete in future if it turns out useless! |
| 98 | + #Its observed that fetch is failing so this little hack is added! Will delete in future if it turns out useless! |
90 | 99 | git fetch --depth=1 "${GIT_URL}" "${GERRIT_REFSPEC}" > /dev/null |
91 | | - if [ $? = 0 ]; then |
92 | | - echo "Fetch succeeded" |
93 | | - else |
94 | | - sleep 2 |
95 | | - git fetch "${GIT_URL}" "${GERRIT_REFSPEC}" |
96 | | - fi |
| 100 | + |
| 101 | + if [ $? = 0 ]; then |
| 102 | + echo "Fetch succeeded" |
| 103 | + else |
| 104 | + sleep 2 |
| 105 | + git fetch "${GIT_URL}" "${GERRIT_REFSPEC}" |
| 106 | + fi |
97 | 107 |
|
98 | 108 | git checkout -b "${GERRIT_REFSPEC}" FETCH_HEAD |
99 | 109 |
|
100 | 110 | # update libntirpc |
101 | | - git submodule update --recursive --init || git submodule sync |
| 111 | + git submodule update --recursive --init || git submodule sync --recursive |
102 | 112 |
|
103 | 113 | mkdir build |
104 | 114 | pushd build |
105 | 115 |
|
106 | | - cmake -DCMAKE_BUILD_TYPE=Maintainer -DUSE_FSAL_GLUSTER=ON -DUSE_DBUS=ON -D_MSPAC_SUPPORT=OFF ../src |
| 116 | + cmake ../src \ |
| 117 | + -DCMAKE_BUILD_TYPE=Maintainer \ |
| 118 | + -DUSE_FSAL_GLUSTER=ON \ |
| 119 | + -DUSE_FSAL_CEPH=OFF \ |
| 120 | + -DUSE_FSAL_RGW=OFF \ |
| 121 | + -DUSE_DBUS=ON \ |
| 122 | + -DUSE_ADMIN_TOOLS=ON |
| 123 | + |
| 124 | + # We have noticed issues with bcond_with missing for some variables |
| 125 | + # unwind_enriched_bt |
| 126 | + sed -i 's/^ unwind_enriched_bt$/%bcond_with unwind_enriched_bt/g' ../src/nfs-ganesha.spec |
| 127 | + |
| 128 | + # monitoring |
| 129 | + sed -i 's/^ monitoring$/%bcond_with monitoring/g' ../src/nfs-ganesha.spec |
| 130 | + |
107 | 131 | make dist |
108 | 132 | rpmbuild -ta --define "_srcrpmdir $PWD" --define "_rpmdir $PWD" *.tar.gz |
| 133 | + |
109 | 134 | rpm_arch=$(rpm -E '%{_arch}') |
110 | 135 | ganesha_version=$(rpm -q --qf '%{VERSION}-%{RELEASE}' -p *.src.rpm) |
| 136 | + |
111 | 137 | if [ -e ${rpm_arch}/libntirpc-devel*.rpm ]; then |
112 | 138 | ntirpc_version=$(rpm -q --qf '%{VERSION}-%{RELEASE}' -p ${rpm_arch}/libntirpc-devel*.rpm) |
113 | 139 | ntirpc_rpm=${rpm_arch}/libntirpc-${ntirpc_version}.${rpm_arch}.rpm |
114 | 140 | fi |
| 141 | + |
115 | 142 | yum -y install {x86_64,noarch}/*.rpm |
116 | 143 |
|
117 | | - #Test block |
118 | | - ulimit -a |
119 | | - ulimit -c unlimited |
120 | | - ulimit -a |
| 144 | + #Test block |
| 145 | + ulimit -a |
| 146 | + ulimit -c unlimited |
| 147 | + ulimit -a |
121 | 148 |
|
122 | 149 | # start nfs-ganesha service with an empty configuration |
123 | 150 | echo "NFSv4 { Graceless = true; }" > /etc/ganesha/ganesha.conf |
@@ -206,27 +233,39 @@ then |
206 | 233 | fi |
207 | 234 |
|
208 | 235 | #Enabling ACL for the volume if ENABLE_ACL param is set to True |
209 | | -if [ "${ENABLE_ACL}" == "True" ] |
210 | | -then |
211 | | - conf_file="/etc/ganesha/exports/export."${GLUSTER_VOLUME}".conf" |
212 | | - sed -i s/'Disable_ACL = .*'/'Disable_ACL = false;'/g ${conf_file} |
213 | | - cat ${conf_file} |
214 | | - |
215 | | - #Parsing export id from volume export conf file |
216 | | - export_id=$(grep 'Export_Id' ${conf_file} | sed 's/^[[:space:]]*Export_Id.*=[[:space:]]*\([0-9]*\).*/\1/') |
217 | | - |
218 | | - dbus-send --type=method_call --print-reply --system --dest=org.ganesha.nfsd /org/ganesha/nfsd/ExportMgr org.ganesha.nfsd.exportmgr.UpdateExport string:${conf_file} string:"EXPORT(Export_Id = ${export_id})" |
| 236 | +if [ "${ENABLE_ACL}" == "True" ]; then |
| 237 | + conf_file="/etc/ganesha/exports/export."${GLUSTER_VOLUME}".conf" |
| 238 | + sed -i s/'Disable_ACL = .*'/'Disable_ACL = false;'/g ${conf_file} |
| 239 | + cat ${conf_file} |
| 240 | + |
| 241 | + #Parsing export id from volume export conf file |
| 242 | + export_id=$(grep 'Export_Id' ${conf_file} | \ |
| 243 | + sed 's/^[[:space:]]*Export_Id.*=[[:space:]]*\([0-9]*\).*/\1/') |
| 244 | + |
| 245 | + dbus-send --type=method_call \ |
| 246 | + --print-reply \ |
| 247 | + --system \ |
| 248 | + --dest=org.ganesha.nfsd \ |
| 249 | + /org/ganesha/nfsd/ExportMgr \ |
| 250 | + org.ganesha.nfsd.exportmgr.UpdateExport \ |
| 251 | + string:${conf_file} string:"EXPORT(Export_Id = ${export_id})" |
219 | 252 | fi |
220 | 253 |
|
221 | 254 | #Enabling Security_Label for the volume if SECURITY_LABEL param is set to True |
222 | | -if [ "${SECURITY_LABEL}" == "True" ] |
223 | | -then |
224 | | - conf_file="/etc/ganesha/exports/export."${GLUSTER_VOLUME}".conf" |
225 | | - sed -i s/'Security_Label = .*'/'Security_Label = True;'/g ${conf_file} |
226 | | - cat ${conf_file} |
227 | | - |
228 | | - #Parsing export id from volume export conf file |
229 | | - export_id=$(grep 'Export_Id' ${conf_file} | sed 's/^[[:space:]]*Export_Id.*=[[:space:]]*\([0-9]*\).*/\1/') |
230 | | - |
231 | | - dbus-send --type=method_call --print-reply --system --dest=org.ganesha.nfsd /org/ganesha/nfsd/ExportMgr org.ganesha.nfsd.exportmgr.UpdateExport string:${conf_file} string:"EXPORT(Export_Id = ${export_id})" |
| 255 | +if [ "${SECURITY_LABEL}" == "True" ]; then |
| 256 | + conf_file="/etc/ganesha/exports/export."${GLUSTER_VOLUME}".conf" |
| 257 | + sed -i s/'Security_Label = .*'/'Security_Label = True;'/g ${conf_file} |
| 258 | + cat ${conf_file} |
| 259 | + |
| 260 | + # Parsing export id from volume export conf file |
| 261 | + export_id=$(grep 'Export_Id' ${conf_file} | \ |
| 262 | + sed 's/^[[:space:]]*Export_Id.*=[[:space:]]*\([0-9]*\).*/\1/') |
| 263 | + |
| 264 | + dbus-send --type=method_call \ |
| 265 | + --print-reply \ |
| 266 | + --system \ |
| 267 | + --dest=org.ganesha.nfsd \ |
| 268 | + /org/ganesha/nfsd/ExportMgr \ |
| 269 | + org.ganesha.nfsd.exportmgr.UpdateExport \ |
| 270 | + string:${conf_file} string:"EXPORT(Export_Id = ${export_id})" |
232 | 271 | fi |
0 commit comments