certificates: clean up config recipes

Since the config recipe packages will create symlinks to the certificate
manager template, RDEPEND rather than RRECOMMEND on the certificate
manager package (which provides the template).

Avoid obmc-phosphor-systemd.  Enabling systemd units is the realm of
packaging scripts and the SYSTEMD_LINK feature in obmc-phosphor-systemd
implements this incorrectly.  Just directly code install, pkg_postinst
and pkg_prerm here rather than trying to fix obmc-phosphor-systemd - the
extra indirection is more harmful to ease of comprehension for seasoned
Yocto developers than the couple of lines of code it saves.

(From meta-phosphor rev: 1a4e65e5847e299348b5f28ffa2b4b1837769deb)

Change-Id: Ideb12d62461b3b18ff5c92f3a76f1aa20c94a269
Tested: Built witherspoon image and verified rootfs unchanged.
Signed-off-by: Brad Bishop <bradleyb@fuzziesquirrel.com>
diff --git a/meta-phosphor/recipes-phosphor/certificate/phosphor-nslcd-cert-config.bb b/meta-phosphor/recipes-phosphor/certificate/phosphor-nslcd-cert-config.bb
index c1dacfd..d344851 100644
--- a/meta-phosphor/recipes-phosphor/certificate/phosphor-nslcd-cert-config.bb
+++ b/meta-phosphor/recipes-phosphor/certificate/phosphor-nslcd-cert-config.bb
@@ -1,15 +1,28 @@
-SUMMARY = "Phosphor certificate manager configuration for an nslcd certificate"
+SUMMARY = "Phosphor certificate manager configuration for a nslcd certificate"
 
 PR = "r1"
 
 LICENSE = "Apache-2.0"
 LIC_FILES_CHKSUM = "file://${PHOSPHORBASE}/LICENSE;md5=19407077e42b1ba3d653da313f1f5b4e"
 
-RRECOMMENDS_${PN} = "phosphor-certificate-manager"
+RDEPENDS_${PN} = "phosphor-certificate-manager"
 
 inherit allarch
-inherit obmc-phosphor-systemd
 
-SYSTEMD_SERVICE_${PN} = ""
-SYSTEMD_ENVIRONMENT_FILE_${PN} = "obmc/cert/nslcd"
-SYSTEMD_LINK_${PN} = "../phosphor-certificate-manager@.service:${SYSTEMD_DEFAULT_TARGET}.wants/phosphor-certificate-manager@nslcd.service"
+SRC_URI = "file://env"
+
+do_install() {
+	install -D ${WORKDIR}/env ${D}/${sysconfdir}/default/obmc/cert/nslcd
+}
+
+pkg_postinst_${PN}() {
+	LINK="$D$systemd_system_unitdir/multi-user.target.wants/phosphor-certificate-manager@nslcd.service"
+	TARGET="../phosphor-certificate-manager@.service"
+	mkdir -p $D$systemd_system_unitdir/multi-user.target.wants
+	ln -s $TARGET $LINK
+}
+
+pkg_prerm_${PN}() {
+	LINK="$D$systemd_system_unitdir/multi-user.target.wants/phosphor-certificate-manager@nslcd.service"
+	rm $LINK
+}