On 2018/09/07 13:54, Rafael Sadowski wrote: > Hi All, > > I don't understand the discussion about my last commit. What is happen > in my last kservice commit? I drop the following line > > @sample ${SYSCONFDIR}/xdg/menus/applications-kde5.menu > > because ${SYSCONFDIR}/xdg .aka /etc/xdg is wrong and don't exes it. > > Antoine, you'll see the following approach, correct? (btw I've solved > post-isnatll more beautifully in addition.) > > > Index: Makefile > =================================================================== > RCS file: /cvs/ports/devel/kf5/kservice/Makefile,v > retrieving revision 1.9 > diff -u -p -u -p -r1.9 Makefile > --- Makefile 6 Sep 2018 05:05:47 -0000 1.9 > +++ Makefile 7 Sep 2018 11:48:18 -0000 > @@ -2,7 +2,7 @@ > > COMMENT = plugin framework for KDE desktop services > DISTNAME = kservice-${VERSION} > -REVISION = 0 > +REVISION = 1 > > SHARED_LIBS = KF5Service 4.1 > > @@ -23,14 +23,11 @@ LIB_DEPENDS = devel/kf5/kconfig \ > devel/kf5/kdbusaddons \ > devel/kf5/ki18n > > -CONFIGURE_ARGS = -DCMAKE_POLICY_DEFAULT_CMP0058=OLD > +# avoid conflict with KDE4 > +CONFIGURE_ARGS = -DCMAKE_POLICY_DEFAULT_CMP0058=OLD \ > + -DAPPLICATIONS_MENU_NAME:STRING="applications-kde5.menu" > > TEST_IS_INTERACTIVE = X11 > PORTHOME = ${WRKDIR} > - > -# avoid conflict with KDE4 > -post-install: > - cd ${WRKINST}/etc/xdg/menus; \ > - mv applications.menu applications-kde5.menu > > .include <bsd.port.mk> > Index: pkg/PLIST > =================================================================== > RCS file: /cvs/ports/devel/kf5/kservice/pkg/PLIST,v > retrieving revision 1.4 > diff -u -p -u -p -r1.4 PLIST > --- pkg/PLIST 6 Sep 2018 05:05:47 -0000 1.4 > +++ pkg/PLIST 7 Sep 2018 11:48:18 -0000 > @@ -44,7 +44,7 @@ lib/cmake/KF5Service/KF5ServiceTargets.c > @man man/man8/kbuildsycoca5.8 > share/examples/xdg/kservice.categories > share/examples/xdg/menus/ > -share/examples/xdg/menus/applications-kde5.menu > +@sample share/examples/xdg/menus/applications-kde5.menu
@sample of a file (rather than a directory) is "attached" to the previous file. In this example above, in /usr/local/share/examples/xdg, pkg_add will copy kservice.categories and install it as applications-kde5.menu (as long as applications-kde5.menu doesn't already exist). > # fix {/usr/local,}/etc/{dbus-1,xdg} and friends > MODKF5_EXAMPLES_DIR = ${PREFIX}/share/examples/kde > MODKF5_post-install += \ > if [ -d ${PREFIX}/etc ]; then \ > cd ${PREFIX}/etc; \ > ${INSTALL_DATA_DIR} ${MODKF5_EXAMPLES_DIR}; \ > pax -rw * ${MODKF5_EXAMPLES_DIR}; \ > rm -Rf ${PREFIX}/etc; \ > fi; \ > if [ -d ${WRKINST}/etc/dbus-1 ]; then \ > cd ${WRKINST}/etc; \ > ${INSTALL_DATA_DIR} ${MODKF5_EXAMPLES_DIR}; \ > pax -rw dbus-1 ${MODKF5_EXAMPLES_DIR}; \ > rm -Rf ${WRKINST}/etc/dbus-1; \ > fi; \ > if [ -d ${WRKINST}/etc/xdg ]; then \ > cd ${WRKINST}/etc; \ > pax -rw xdg ${PREFIX}/share/examples; \ > rm -Rf ${WRKINST}/etc/xdg; \ > fi; > > Why are we doing this? Do we not want to spam KDE stuff under /etc? My first thought is that the last pax call should copy things to ${MODKF5_EXAMPLES_DIR}, and the PLIST should be @sample'ing them into /etc/xdg e.g. copying/pasting/tweaking the entries from the plist above share/examples/xdg/kservice.categories @sample ${SYSCONFDIR}/xdg/ @sample ${SYSCONFDIR}/xdg/kservice.categories share/examples/xdg/menus/ @sample ${SYSCONFDIR}/xdg/menus/ share/examples/xdg/menus/applications-kde5.menu @sample ${SYSCONFDIR}/xdg/menus/applications-kde5.menu The @sample entries to create the directories (${SYSCONFDIR}/xdg/, ${SYSCONFDIR}/xdg/menus) can be left out *if* a dependency already creates them. But it doesn't hurt to have them even if they're not strictly needed.