aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--distrib/Makefile11
-rw-r--r--distrib/coq.spec13
2 files changed, 14 insertions, 10 deletions
diff --git a/distrib/Makefile b/distrib/Makefile
index 7e1e69221a..cc46418c66 100644
--- a/distrib/Makefile
+++ b/distrib/Makefile
@@ -160,20 +160,25 @@ ${COQRPMPACKAGE}.src.rpm: ${COQPACKAGE}.tar.gz
cp -f petit-coq.gif ${RPMTOPDIR}/SOURCES
cp -f ${COQPACKAGE}.tar.gz ${RPMTOPDIR}/SOURCES
- mkdir ${RPMTOPDIR}/RPMS/${ARCH}
+ - rm ${RPMTOPDIR}/RPMS/${LOCALARCH}
- ln -s ${RPMTOPDIR}/RPMS/${ARCH} ${RPMTOPDIR}/RPMS/${LOCALARCH}
${RPM} -ba coq.spec
mv ${RPMTOPDIR}/SRPMS/${COQRPMPACKAGE}.src.rpm .
(if [ -f ${RPMTOPDIR}/RPMS/${ARCH}/${COQRPMPACKAGE}.${LOCALARCH}.rpm ];\
- then mv ${RPMTOPDIR}/RPMS/${ARCH}/${COQRPMPACKAGE}.${LOCALARCH}.rpm ${RPMTOPDIR}/RPMS/${ARCH}/${COQRPMPACKAGE}.${ARCH}.rpm;
+ then mv ${RPMTOPDIR}/RPMS/${ARCH}/${COQRPMPACKAGE}.${LOCALARCH}.rpm ${RPMTOPDIR}/RPMS/${ARCH}/${COQRPMPACKAGE}.${ARCH}.rpm;\
+ else mv ${RPMTOPDIR}/RPMS/${ARCH}/${COQRPMPACKAGE}.${ARCH}.rpm .;\
fi)
- - mv ${RPMTOPDIR}/RPMS/${ARCH}/${COQRPMPACKAGE}.${ARCH}.rpm .
# Sera déjà fait si le src.rpm vient d'être fait
${COQRPMPACKAGE}.${ARCH}.rpm: rpm-config ${COQRPMPACKAGE}.src.rpm
- mkdir ${RPMTOPDIR}/RPMS/${ARCH}
+ - rm ${RPMTOPDIR}/RPMS/${LOCALARCH}
- ln -s ${RPMTOPDIR}/RPMS/${ARCH} ${RPMTOPDIR}/RPMS/${LOCALARCH}
${RPM} --rebuild ${COQRPMPACKAGE}.src.rpm
- mv ${RPMTOPDIR}/RPMS/${ARCH}/${COQRPMPACKAGE}.${ARCH}.rpm .
+ (if [ -f ${RPMTOPDIR}/RPMS/${ARCH}/${COQRPMPACKAGE}.${LOCALARCH}.rpm ];\
+ then mv ${RPMTOPDIR}/RPMS/${ARCH}/${COQRPMPACKAGE}.${LOCALARCH}.rpm ${RPMTOPDIR}/RPMS/${ARCH}/${COQRPMPACKAGE}.${ARCH}.rpm;\
+ else mv ${RPMTOPDIR}/RPMS/${ARCH}/${COQRPMPACKAGE}.${ARCH}.rpm .;\
+ fi)
##########
contrib-tag:
diff --git a/distrib/coq.spec b/distrib/coq.spec
index 4027c7e8c9..19b35ce403 100644
--- a/distrib/coq.spec
+++ b/distrib/coq.spec
@@ -37,19 +37,18 @@ make -e COQINSTALLPREFIX=$RPM_BUILD_ROOT/ install
# To install only locally the binaries compiled with absolute paths
%post
-# This is because the Coq Team usually build Coq with Ocaml in /usr/local
+# This is a because the Coq Team usually build Coq with Ocaml in /usr/local
# but ocaml is actually in /usr if coming from a rpm package
-where=`ocamlc -v | tail -1 | sed -e 's/.*: \(.*\)/\1/'`
-if [ ! "$where" = "/usr/local/lib/ocaml" ]; then
- ln -s $where /usr/local/lib/ocaml
+# This works only if ocaml has been installed by rpm
+if [ ! -e /usr/local/lib/ocaml ]; then
+ ln -s /usr/lib/ocaml /usr/local/lib/ocaml || true
fi
%postun
# This is because the Coq Team usually build Coq with Ocaml in /usr/local
# but ocaml is actually in /usr if coming from a rpm package
-where=`ocamlc -v | tail -1 | sed -e 's/.*: \(.*\)/\1/'`
-if [ ! "$where" = "/usr/local/lib/ocaml" ]; then
- rm $where /usr/local/lib/ocaml
+if [ -L /usr/local/lib/ocaml ]; then
+ rm /usr/local/lib/ocaml
fi
%files