4 DISTNAME= grub-bazaar-snapshot
5 PKGNAME= grub2-${TODAY}
8 MAINTAINER= gregoire.sutre@gmail.com
9 HOMEPAGE= http://www.gnu.org/software/grub/grub-2.en.html
10 COMMENT= GRand Unified Bootloader, version 2 (development snapshot)
13 PKG_DESTDIR_SUPPORT= user-destdir
16 # XXX: Linux-*-powerpc and others?
18 ONLY_FOR_PLATFORM= *-*-i386 *-*-x86_64
20 PKG_SYSCONFSUBDIR= ${PKGBASE}
22 USE_TOOLS+= autoconf automake gettext-m4
23 USE_TOOLS+= gmake bison makeinfo
25 CONFIGURE_ARGS+= --sysconfdir=${PKG_SYSCONFDIR}
26 CONFIGURE_ARGS+= --program-transform-name=s,grub,grub2,
27 CONFIGURE_ARGS+= --enable-grub-fstest
28 CONFIGURE_ARGS+= --disable-efiemu
29 CONFIGURE_ARGS+= --disable-grub-emu-usb
30 CONFIGURE_ARGS+= --disable-grub-emu-pci
33 EGDIR= ${PREFIX}/share/examples/${PKGBASE}
35 # The modified Makefile installs all configuration scripts in ${EGDIR}.
36 MAKE_ENV+= EGDIR=${EGDIR}
38 .include "../../mk/bsd.prefs.mk"
40 EGFILES= 00_header 05_pkgsrc_theme 30_os-prober 40_custom
41 .if ${OPSYS} == "FreeBSD"
43 .elif ${OPSYS} == "Linux"
45 .elif ${OPSYS} == "NetBSD"
48 .for file in ${EGFILES}
49 CONF_FILES_PERMS+= ${EGDIR}/${file} ${PKG_SYSCONFDIR}/${file} ${ROOT_USER} ${ROOT_GROUP} 0755
51 CONF_FILES+= ${EGDIR}/README ${PKG_SYSCONFDIR}/README
52 CONF_FILES+= ${EGDIR}/default.conf.sample ${PKG_SYSCONFDIR}/default.conf
54 TODAY!= ${DATE} -u +'%Y%m%d'
56 # GRUB 2 current development trunk requires a recent version of gcc.
60 # GRUB 2's configure script sets the variables `target_cpu' and `platform',
61 # which are used to define the location of library directory. We must take
62 # this into account for PLIST. The following mimics the behavior of the
63 # configure script. Our job is simpler as we only accept i386 and x86_64
64 # (see definition of ONLY_FOR_PLATFORM above).
66 GRUB_TARGET_CPU= ${MACHINE_ARCH}
67 .if ${LOWER_VENDOR} == "apple"
72 .if ${GRUB_TARGET_CPU} == "x86_64" && ${GRUB_PLATFORM} == "pc"
75 PLIST_SUBST+= GRUB_TARGET_CPU=${GRUB_TARGET_CPU}
76 PLIST_SUBST+= GRUB_PLATFORM=${GRUB_PLATFORM}
79 # The following substitutions adjust the configuration paths:
80 # - $sysconfdir/grub.d is replaced by $sysconfdir in scripts, and by $EGDIR
82 # - $sysconfdir/default/grub is replaced by $sysconfdir/default.conf in
84 # - DEFAULT_DIRECTORY is adjusted in include/grub/emu/misc.h.
86 SUBST_CLASSES+= fix-paths-1 fix-paths-2 fix-paths-3
87 SUBST_STAGE.fix-paths-1= pre-configure
88 SUBST_MESSAGE.fix-paths-1= Fixing configuration paths in makefile.
89 SUBST_FILES.fix-paths-1= Makefile.in
90 SUBST_SED.fix-paths-1= -e 's,\$$(sysconfdir)/grub.d,\$$(EGDIR),g'
91 SUBST_STAGE.fix-paths-2= pre-configure
92 SUBST_MESSAGE.fix-paths-2= Fixing configuration paths in util/grub-mkconfig.in.
93 SUBST_FILES.fix-paths-2= util/grub-mkconfig.in
94 SUBST_SED.fix-paths-2= -e 's,\$${sysconfdir}/grub.d,\$${sysconfdir},g'
95 SUBST_SED.fix-paths-2+= -e 's,\$${sysconfdir}/default/grub,\$${sysconfdir}/default.conf,g'
96 SUBST_STAGE.fix-paths-3= pre-configure
97 SUBST_MESSAGE.fix-paths-3= Fixing default directory in include/grub/emu/misc.h.
98 SUBST_FILES.fix-paths-3= include/grub/emu/misc.h
99 SUBST_SED.fix-paths-3= -e 's,"/grub","/grub2",g'
100 SUBST_SED.fix-paths-3+= -e 's,"/boot/grub","/boot/grub2",g'
102 # This package uses help2man to generate man pages.
103 BUILD_DEPENDS+= help2man>=1.36:../../converters/help2man
105 # A recent version of flex is required to build.
106 BUILD_DEPENDS+= flex>=2.5.35:../../devel/flex
109 ${INSTALL_DATA} ${FILESDIR}/default.conf ${DESTDIR}${EGDIR}/default.conf.sample
110 ${INSTALL_SCRIPT} ${FILESDIR}/05_pkgsrc_theme ${DESTDIR}${EGDIR}/05_pkgsrc_theme
112 # Options for this package
113 .include "options.mk"
115 # Helper file to access the bazaar repository, download translations and font
116 # files, and generate the configure script with autogen.sh.
117 .include "download.mk"
119 .include "../../devel/gettext-lib/buildlink3.mk"
120 .include "../../mk/bsd.pkg.mk"