In %post section, automatically create symlinks /var/lib/jenkins/userContent/
jenkins-scripts to /var/lib/jenkins/jenkins-scripts.
Fixes: #1356
Change-Id: Ib8972db7bb1db616db377a0c3a4fca5f33e33ee5
Signed-off-by: Lin Yang <lin.a.yang@intel.com>
install -d %{buildroot}%{destdir}
cp -r job_*.py common requests %{buildroot}%{destdir}/
+%post
+if [ ! -d /var/lib/jenkins/userContent ]; then
+ mkdir -p /var/lib/jenkins/userContent
+fi
+ln -sf %{destdir} /var/lib/jenkins/userContent/jenkins-scripts
+
+%postun
+if [ -L /var/lib/jenkins/userContent/jenkins-scripts ]; then
+ rm -f /var/lib/jenkins/userContent/jenkins-scripts
+fi
+
%files
%defattr(-,jenkins,jenkins)
%dir /var/lib/jenkins/