Index: head/deskutils/calibre/Makefile =================================================================== --- head/deskutils/calibre/Makefile (revision 445399) +++ head/deskutils/calibre/Makefile (revision 445400) @@ -1,99 +1,101 @@ # Created by: stas # $FreeBSD$ PORTNAME= calibre PORTVERSION= 3.3.0 +PORTREVISION= 1 CATEGORIES= deskutils python MASTER_SITES= http://download.calibre-ebook.com/${PORTVERSION}/ MAINTAINER= madpilot@FreeBSD.org COMMENT= Ebook management application LICENSE= GPLv3 LIB_DEPENDS= libfontconfig.so:x11-fonts/fontconfig \ libpoppler-qt5.so:graphics/poppler-qt5 \ libwmflite.so:graphics/libwmf \ libchm.so:misc/chmlib \ libicudata.so:devel/icu \ libpodofo.so:graphics/podofo \ libmtp.so:multimedia/libmtp \ libfreetype.so:print/freetype2 BUILD_DEPENDS= ${PYTHON_PKGNAMEPREFIX}sqlite3>=0:databases/py-sqlite3 \ ${PYTHON_PKGNAMEPREFIX}dateutil>=0:devel/py-dateutil \ ${PYTHON_PKGNAMEPREFIX}pillow>=0:graphics/py-pillow \ ${PYTHON_PKGNAMEPREFIX}lxml>=0:devel/py-lxml \ ${PYTHON_PKGNAMEPREFIX}cssutils>=1.0.1,1:www/py-cssutils \ ${PYTHON_PKGNAMEPREFIX}apsw>=0:databases/py-apsw \ ${PYTHON_PKGNAMEPREFIX}msgpack-python>=0.3:devel/py-msgpack-python \ ${PYTHON_PKGNAMEPREFIX}regex>=0:textproc/py-regex RUN_DEPENDS= xdg-open:devel/xdg-utils \ ${PYTHON_PKGNAMEPREFIX}cssutils>=1.0.1,1:www/py-cssutils \ ${PYTHON_PKGNAMEPREFIX}dnspython>=0:dns/py-dnspython \ ${PYTHON_PKGNAMEPREFIX}dateutil>=0:devel/py-dateutil \ ${PYTHON_PKGNAMEPREFIX}beautifulsoup32>=0:www/py-beautifulsoup32 \ ${PYTHON_PKGNAMEPREFIX}pillow>=0:graphics/py-pillow \ ${PYTHON_PKGNAMEPREFIX}lxml>=0:devel/py-lxml \ ${PYTHON_PKGNAMEPREFIX}mechanize>=0:www/py-mechanize \ ${PYTHON_PKGNAMEPREFIX}sqlite3>=0:databases/py-sqlite3 \ ${PYTHON_PKGNAMEPREFIX}dbus>=0:devel/py-dbus \ ${PYTHON_PKGNAMEPREFIX}netifaces>=0:net/py-netifaces \ ${PYTHON_PKGNAMEPREFIX}cssselect>=0:www/py-cssselect \ ${PYTHON_PKGNAMEPREFIX}apsw>=0:databases/py-apsw \ ${PYTHON_PKGNAMEPREFIX}msgpack-python>=0.3:devel/py-msgpack-python \ ${PYTHON_PKGNAMEPREFIX}regex>=0:textproc/py-regex \ ${PYTHON_PKGNAMEPREFIX}chardet>=0:textproc/py-chardet \ pdftohtml:graphics/poppler-utils USE_RC_SUBR= calibre EXTRACT_BEFORE_ARGS= -x -s '/^calibre/~-src/' -f USES= desktop-file-utils gettext-runtime gnome localbase:ldflags pkgconfig \ python:2 pyqt:5 shared-mime-info shebangfix ssl tar:xz -SHEBANG_FILES= resources/calibre-portable.sh \ - src/calibre/ebooks/metadata/odt.py \ - src/calibre/utils/*.py \ - src/odf/*.py +SHEBANG_GLOB= *.sh *.py +python_OLD_CMD= "/usr/bin/env python" /bin/python /usr/bin/python /usr/local/bin/python \ + "/usr/bin/env python2" /bin/python2 /usr/bin/python2 /usr/local/bin/python2 USE_PYQT= core gui network sip svg webkit widgets webkitwidgets xmlpatterns USE_QT5= buildtools_build core dbus gui qmake_build widgets USE_GL= egl gl USE_GNOME= glib20 USE_XORG= xrender xext x11 WRKSRC= ${WRKDIR}/${PORTNAME}-src-${PORTVERSION} MAKE_ENV+= FC_INC_DIR="${LOCALBASE}/include/fontconfig" \ FC_LIB_DIR="${LOCALBASE}/lib" \ OVERRIDE_CFLAGS="${CFLAGS}" \ OVERRIDE_LDFLAGS="${LDFLAGS}" \ PODOFO_LIB_DIR="${LOCALBASE}/lib" \ PODOFO_INC_DIR="${LOCALBASE}/include/podofo" \ WITH_USB=yes \ CALIBRE_CONFIG_DIRECTORY=${WRKDIR}/calibre-config \ XDG_DATA_DIRS=${STAGEDIR}${PREFIX}/share \ XDG_CONFIG_HOME=${WRKDIR}/xdg-config \ XDG_UTILS_INSTALL_MODE=system \ QMAKE=${QMAKE} -.include +post-patch: + @${REINPLACE_CMD} -e "s|#!/usr/bin/env python2|#!${PYTHON_CMD}|" \ + ${WRKSRC}/setup/install.py do-build: @${MKDIR} ${WRKDIR}/calibre-config ${WRKDIR}/xdg-config @(cd ${BUILD_WRKSRC}; ${SETENV} ${MAKE_ENV} ${PYTHON_CMD} \ ${PYSETUP} build) do-install: @${MKDIR} ${STAGEDIR}${PREFIX}/lib/${PYTHON_VERSION}/site-packages \ ${STAGEDIR}${PREFIX}/share/icons/hicolor \ ${STAGEDIR}${PREFIX}/share/applications \ ${STAGEDIR}${PREFIX}/share/desktop-directories \ ${STAGEDIR}${PREFIX}/share/mime/packages # Create this file to avoid what looks like a bug in xdg-desktop-menu @${TOUCH} ${STAGEDIR}${PREFIX}/share/applications/defaults.list (cd ${BUILD_WRKSRC}; ${SETENV} ${MAKE_ENV} ${PYTHON_CMD} \ ${PYSETUP} install --prefix ${PREFIX} \ --staging-root ${STAGEDIR}${PREFIX}) @${RM} ${STAGEDIR}${PREFIX}/bin/calibre-uninstall \ ${STAGEDIR}${PREFIX}/share/applications/defaults.list @${RMDIR} ${STAGEDIR}${PREFIX}/share/desktop-directories @${STRIP_CMD} ${STAGEDIR}${PREFIX}/lib/calibre/calibre/plugins/* -.include +.include Index: head/deskutils/calibre/files/calibre.in =================================================================== --- head/deskutils/calibre/files/calibre.in (revision 445399) +++ head/deskutils/calibre/files/calibre.in (revision 445400) @@ -1,70 +1,70 @@ #!/bin/sh # # $FreeBSD$ # # PROVIDE: calibre # REQUIRE: DAEMON # KEYWORD: shutdown # # Add the following lines to /etc/rc.conf to enable calibre_server: # # calibre_enable (bool): Set it to "YES" to enable calibre # Default is "NO". # calibre_port (int): port that calibre_server listens on # Default is 8080 # calibre_user (string): user that calibre_server runs as # Default is calibre # calibre_home (string): home directory for calibre_server # Default is the home directory of calibre_user # calibre_url_prefix (string): prefix to append to all URLs # default is unset # calibre_logfile (string): log file location # Default /var/log/calibre-server/calibre-server.log # calibre_logsize (int): size of log file before being rotated in MBs # Default 10 MB # calibre_flags (string): Any further flags to customize configuration # Default empty # calibre_library (string): path to library folder to serve content from # # ########################################################## . /etc/rc.subr name=calibre rcvar=calibre_enable load_rc_config $name : ${calibre_enable:=NO} : ${calibre_user:=calibre} : ${calibre_library:=/nonexistent} : ${calibre_logfile:=/var/log/calibre-server/calibre-server.log} : ${calibre_logsize:=10} pidfile=/var/run/${name}/${name}.pid -command=/usr/local/bin/calibre-server -command_interpreter=python2 +command=%%PREFIX%%/bin/calibre-server +command_interpreter=%%LOCALBASE%%/bin/python2.7 required_dirs=${calibre_library} start_precmd=calibre_prestart calibre_home=${calibre_home:-$(getent passwd ${calibre_user} | awk -F: '{print $6}')} calibre_env="${calibre_env} HOME=${calibre_home:-/nonexistent}" if [ ! -z "${calibre_port}" ]; then command_args="${command_args} --port=${calibre_port}" fi if [ ! -z "${calibre_url_prefix}" ]; then command_args="${command_args} --url-prefix=${calibre_url_prefix}" fi command_args="${command_args} --log ${calibre_logfile} --pidfile ${pidfile} --max-log-size ${calibre_logsize} --daemonize ${calibre_library}" calibre_prestart() { install -d -o ${calibre_user} -m 755 /var/run/${name} install -d -o ${calibre_user} -m 755 `dirname ${calibre_logfile}` } run_rc_command "$1"