# Copyright 1999-2021 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 # $Header: $ EAPI="7" inherit eutils xdg-utils toolchain-funcs git-r3 SLOT="0" DESCRIPTION="Create and manage multiple choice questionnaries (MCQ), including automated marking." HOMEPAGE="https://www.auto-multiple-choice.net/" EGIT_CLONE_TYPE="shallow" EGIT_REPO_URI="https://gitlab.com/jojo_boulix/auto-multiple-choice.git" EGIT_COMMIT="${PV}" LICENSE="GPL-2+" KEYWORDS="~x86 ~amd64" IUSE="msmtp" DEPEND="virtual/tex-base virtual/latex-base media-fonts/dejavu media-fonts/ipaex dev-texlive/texlive-langchinese dev-texlive/texlive-langfrench app-text/texlive[cjk,extra,graphics,png,pstricks,science,truetype,xml,X,luatex,xetex,humanities,publishers] app-text/poppler[cairo] media-libs/netpbm app-text/dblatex app-text/docbook-xml-simple-dtd app-text/docbook-xsl-stylesheets media-libs/opencv app-text/pdftk" RDEPEND="${DEPEND} >=dev-lang/perl-5 dev-perl/Gtk3 media-gfx/imagemagick[perl] dev-perl/XML-Writer dev-perl/XML-LibXML dev-perl/Archive-Zip dev-perl/DBI dev-perl/Text-CSV dev-perl/DBD-SQLite dev-perl/Net-CUPS dev-perl/Email-Address dev-perl/Email-MIME dev-perl/Email-Sender dev-perl/Glib-Object-Introspection msmtp? ( mail-mta/msmtp )" # ----------------------------------------------- # Still not sure what to do about these messages. # # * QA Notice: The ebuild is installing to one or more unexpected paths: # * # * /usr/local # * /usr/share/doc/auto-multiple-choice # * /usr/share/doc/texmf # * # * Please fix the ebuild to use correct FHS/Gentoo policy paths. #strip: x86_64-pc-linux-gnu-strip --strip-unneeded -N __gentoo_check_ldflags__ -R .comment -R .GCC.command.line -R .note.gnu.gold-version # /usr/lib/AMC/exec/AMC-detect # /usr/lib/AMC/exec/AMC-buildpdf # /usr/lib/AMC/exec/AMC-pdfformfields # ----------------------------------------------- src_prepare() { # Patch Makefile.conf with a valid local PERLDIR PERL_LOCAL_DIR=$(perl -e 'print "$_\n" for @INC' | grep '/local/' | sort | head -n1) sed -i s?'^PERLDIR=.*$'?'PERLDIR='${PERL_LOCAL_DIR}?g Makefile.conf # Patch Makefile.conf with a valid local TEXDIR sed -i s?'^TEXDIR=.*$'?'TEXDIR=/usr/share/texmf-site/tex/latex/AMC'?g Makefile.conf # Patch doc/Makefile with proper TEXINPUTS sed -i s~'export TEXINPUTS=./img_pdf/:'~'export TEXINPUTS=./img_pdf/:/usr/share/dblatex/latex/style:/usr/share/dblatex/latex/misc/:'~ doc/Makefile eapply_user } src_compile() { emake version_files emake GCC_NETPBM="-I/usr/include/netpbm/ -lnetpbm" GCC="$(tc-getCC)" GCC_PP="$(tc-getCXX)" } src_install() { emake DESTDIR="${D}" install } pkg_postinst() { xdg_desktop_database_update xdg_mimeinfo_database_update elog "Running 'texhash' to add 'automultiplechoice.sty'." texhash || die 'An error occured while running texhash' } pkg_postrm() { xdg_desktop_database_update xdg_mimeinfo_database_update elog "Running 'texhash' to remove 'automultiplechoice.sty'." texhash || die 'An error occured while running texhash' } # EOF