set CPACK_DEBIAN_PACKAGE_REPLACES and CPACK_RPM_PACKAGE_OBSOLETES.