[PATCH] Automatically fixup the *.desktop files and hook them into KDE

John Baldwin jhb at freebsd.org
Sun May 7 04:14:08 UTC 2006


The patch below patches the .desktop files in the share/xdg directory.
In addition, if WITH_KDE is defined it creates a symlink to the share/xdg
directory in /usr/local/share/applnk that causes the OpenOffice 2.0
applications to show up in the K menu and for the file associations to
just work after 'make install' now.

Index: Makefile
===================================================================
RCS file: /host/cvs/usr/cvs/ports/editors/openoffice.org-2.0/Makefile,v
retrieving revision 1.230
diff -u -r1.230 Makefile
--- Makefile	24 Apr 2006 11:48:15 -0000	1.230
+++ Makefile	7 May 2006 04:12:51 -0000
@@ -237,6 +237,15 @@
 	@${LN} -fs ${PREFIX}/bin/${EXECBASE} ${PREFIX}/bin/${EXECBASE}-spadmin
 	@${LN} -fs ${PREFIX}/bin/${EXECBASE} ${PREFIX}/bin/${EXECBASE}-swriter
 	@${PRINTF} "bin/openoffice.org\n" > ${TMPPLIST}
+	@${REINPLACE_CMD} -e 's#${RELEASE_NR}#${OOOVERSION}#g' \
+			-e '/^Exec/s/printeradmin/spadmin/' \
+			${PREFIX}/${INSTALLATION_BASEDIR}/share/xdg/*.desktop
+	@${RM} ${PREFIX}/${INSTALLATION_BASEDIR}/share/xdg/*.desktop.bak
+.if defined(WITH_KDE)
+	@ln -sf ${PREFIX}/${INSTALLATION_BASEDIR}/share/xdg \
+			${PREFIX}/share/applnk/${EXECBASE}
+	@${PRINTF} "share/applnk/${EXECBASE}\n" >> ${TMPPLIST}
+.endif
 	@cd ${PREFIX} ; ${FIND} -s bin -type f | ${GREP} ${EXECBASE} >> ${TMPPLIST}
 	@cd ${PREFIX} ; ${FIND} -s bin -type l | ${GREP} ${EXECBASE} >> ${TMPPLIST}
 	@cd ${PREFIX} ; ${FIND} -s ${INSTALLATION_BASEDIR} -type f >> ${TMPPLIST}

-- 
John Baldwin <jhb at FreeBSD.org>  <><  http://www.FreeBSD.org/~jhb/
"Power Users Use the Power to Serve"  =  http://www.FreeBSD.org


More information about the freebsd-openoffice mailing list