aboutsummaryrefslogtreecommitdiff
path: root/multimedia/py-periscope/Makefile
blob: 76033dc0d7d841621a85c91fd647190a0417ef1c (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
PORTNAME=	periscope
PORTVERSION=	0.2.4
PORTREVISION=	4
CATEGORIES=	multimedia python
MASTER_SITES=	https://storage.googleapis.com/google-code-archive-downloads/v2/code.google.com/periscope/
PKGNAMEPREFIX=	${PYTHON_PKGNAMEPREFIX}
DISTFILES=	python-${PORTNAME}_${PORTVERSION}.orig${EXTRACT_SUFX} \
		periscope.desktop
DIST_SUBDIR=	${PORTNAME}
EXTRACT_ONLY=	python-${PORTNAME}_${PORTVERSION}.orig${EXTRACT_SUFX}

MAINTAINER=	bofh@FreeBSD.org
COMMENT=	Subtitles searching module
WWW=		https://code.google.com/archive/p/periscope/

LICENSE=	LGPL3

BUILD_DEPENDS=	${PYTHON_PKGNAMEPREFIX}beautifulsoup>=4:www/py-beautifulsoup@${PY_FLAVOR}
RUN_DEPENDS:=	${BUILD_DEPENDS}

USES=		desktop-file-utils python
USE_PYTHON=	autoplist distutils

OPTIONS_DEFINE=	UNRAR
OPTIONS_DEFAULT=	UNRAR
UNRAR_RUN_DEPENDS=	unrar:archivers/unrar

NO_WRKSUBDIR=	yes
PLIST_FILES=	share/applications/periscope.desktop
NO_ARCH=	yes

post-patch:
	${REINPLACE_CMD} -e 's|from BeautifulSoup import|from bs4 import|' \
		${WRKSRC}/periscope/plugins/Podnapisi.py \
		${WRKSRC}/periscope/plugins/Subtitulos.py \
		${WRKSRC}/periscope/plugins/SubsWiki.py \
		${WRKSRC}/periscope/plugins/Addic7ed.py \
		${WRKSRC}/periscope/plugins/SubScene.py
	${REINPLACE_CMD} -e 's|import os, re, BeautifulSoup|import os, re, bs4|' \
		${WRKSRC}/periscope/plugins/TvSubtitles.py

pre-build:
	@${LOCALBASE}/bin/2to3-${PYTHON_VER} --no-diffs --nobackups --verbose --write \
		${WRKSRC}/

post-install:
	${INSTALL_DATA} ${DISTDIR}/${DIST_SUBDIR}/periscope.desktop \
		${STAGEDIR}${DESKTOPDIR}

.include <bsd.port.mk>