aboutsummaryrefslogtreecommitdiff
path: root/games/anki
diff options
context:
space:
mode:
authorRusmir Dusko <nemysis@FreeBSD.org>2013-12-12 21:10:36 +0000
committerRusmir Dusko <nemysis@FreeBSD.org>2013-12-12 21:10:36 +0000
commit9313a366e583a882aa4e08ea9518063f78ab9596 (patch)
treeb97fe401e5af18b29cce878e6cc309cde85c689a /games/anki
parent8e7e114792314cb4d69e8c6aef23837f8ed674f7 (diff)
downloadports-9313a366e583a882aa4e08ea9518063f78ab9596.tar.gz
ports-9313a366e583a882aa4e08ea9518063f78ab9596.zip
- Bump PORTREVISION
- Use patches instead of REINPLACE_CMD, for upstream - Cleanup Makefile, add patches, use Port Makefile - Change pkg-plist, adjust NLS Approved by: pawel / wg (mentors, implicit)
Notes
Notes: svn path=/head/; revision=336290
Diffstat (limited to 'games/anki')
-rw-r--r--games/anki/Makefile44
-rw-r--r--games/anki/files/patch-Makefile51
-rw-r--r--games/anki/files/patch-anki__lang.py11
-rw-r--r--games/anki/files/patch-runanki10
-rw-r--r--games/anki/pkg-plist45
5 files changed, 102 insertions, 59 deletions
diff --git a/games/anki/Makefile b/games/anki/Makefile
index e09dca2e8c86..55113e0785fd 100644
--- a/games/anki/Makefile
+++ b/games/anki/Makefile
@@ -3,6 +3,7 @@
PORTNAME= anki
PORTVERSION= 2.0.19
+PORTREVISION= 1
CATEGORIES= games python
MASTER_SITES= http://ankisrs.net/download/mirror/
EXTRACT_SUFX= .tgz
@@ -36,49 +37,18 @@ NLS_USES= gettext:run
.include <bsd.port.options.mk>
post-patch:
- @${REINPLACE_CMD} -e 's|/usr/share/|${PREFIX}/share/|' \
- ${WRKSRC}/runanki
- @${REINPLACE_CMD} -e 's|/usr/share/anki/locale|${PREFIX}/share/locale/|' \
- ${WRKSRC}/anki/lang.py
@${REINPLACE_CMD} \
-e 's|^Categories=.*|Categories=Education;Languages;KDE;Qt;Game;|' \
${WRKSRC}/${PORTNAME}.desktop
- @${FIND} ${WRKSRC} -name "*.bak" -delete
+ @${FIND} ${WRKSRC} -name "*.bak" -delete -or -name "*.orig" -delete
+
+.if ! ${PORT_OPTIONS:MNLS}
+ @${REINPLACE_CMD} -i '' '/mkdir -p qt-locale/,/cp -av locale/s/^/#/' \
+ ${WRKSRC}/Makefile
+.endif
do-build:
@${PYTHON_CMD} -m compileall ${WRKSRC}
@${PYTHON_CMD} -O -m compileall ${WRKSRC}
-do-install:
- ${INSTALL_SCRIPT} ${WRKSRC}/runanki ${STAGEDIR}${PREFIX}/bin/${PORTNAME}
-
-.for d in anki aqt designer oldanki tests tools
- @(cd ${WRKSRC} && ${COPYTREE_SHARE} ${d} ${STAGEDIR}${DATADIR})
-.endfor
-
- @${MKDIR} ${STAGEDIR}${DATADIR}/locale
- ${INSTALL_DATA} ${WRKSRC}/locale/qt* ${STAGEDIR}${DATADIR}/locale/
-
-.if ${PORT_OPTIONS:MNLS}
-. for f in af ar az bg bn ca cs da de el en_GB eo es et eu fa fi fr gl gu he \
- hu it ja km ko lt lv mn mr ms nb nl no oc pl pt pt_BR ro ru sk sl sr \
- sv th tlh tr uk vi wo zh_CN zh_HK zh_TW
- ${MKDIR} ${STAGEDIR}${PREFIX}/share/locale/${f}/LC_MESSAGES && \
- ${INSTALL_DATA} ${WRKSRC}/locale/${f}/LC_MESSAGES/${PORTNAME}.mo \
- ${STAGEDIR}${PREFIX}/share/locale/${f}/LC_MESSAGES/${PORTNAME}.mo
-. endfor
-.endif
-
- ${INSTALL_MAN} ${WRKSRC}/${PORTNAME}.1 ${STAGEDIR}${MAN1PREFIX}/man/man1/
- @${MKDIR} ${STAGEDIR}${DESKTOPDIR}
- ${INSTALL_DATA} ${WRKSRC}/${PORTNAME}.desktop ${STAGEDIR}${DESKTOPDIR}
- @${MKDIR} ${STAGEDIR}${PREFIX}/share/mime/packages/
- ${INSTALL_DATA} ${WRKSRC}/${PORTNAME}.xml \
- ${STAGEDIR}${PREFIX}/share/mime/packages/
-
-.for p in *.png *.xpm
- ${INSTALL_DATA} ${WRKSRC}/${p} \
- ${STAGEDIR}${PREFIX}/share/pixmaps/
-.endfor
-
.include <bsd.port.mk>
diff --git a/games/anki/files/patch-Makefile b/games/anki/files/patch-Makefile
new file mode 100644
index 000000000000..b25c8ae4532b
--- /dev/null
+++ b/games/anki/files/patch-Makefile
@@ -0,0 +1,51 @@
+--- ./Makefile.orig 2013-12-09 03:51:52.000000000 +0100
++++ ./Makefile 2013-12-12 21:03:24.000000000 +0100
+@@ -1,4 +1,4 @@
+-PREFIX=/usr
++PREFIX=/usr/local
+
+ all:
+ @echo "You can run Anki with ./runanki"
+@@ -6,24 +6,31 @@
+ @echo "Uninstall with 'sudo make uninstall'"
+
+ install:
+- rm -rf ${DESTDIR}${PREFIX}/share/anki
+ mkdir -p ${DESTDIR}${PREFIX}/share/anki
+- cp -av * ${DESTDIR}${PREFIX}/share/anki/
+- cd ${DESTDIR}${PREFIX}/share/anki && (\
+- mv runanki ${DESTDIR}${PREFIX}/local/bin/anki;\
++ cp -av anki aqt designer oldanki tests tools\
++ ${DESTDIR}${PREFIX}/share/anki/
++ cp -av runanki ${DESTDIR}${PREFIX}/bin/anki
++ mkdir -p ${DESTDIR}${PREFIX}/share/anki/locale/
++ mkdir -p qt-locale/ && mv locale/qt* ./qt-locale/
++ cp -av qt-locale/* ${DESTDIR}${PREFIX}/share/anki/locale/
++ mkdir -p ${DESTDIR}${PREFIX}/share/locale/
++ cp -av locale/* ${DESTDIR}${PREFIX}/share/locale/
+ test -d ${DESTDIR}${PREFIX}/share/pixmaps &&\
+- mv anki.xpm anki.png ${DESTDIR}${PREFIX}/share/pixmaps/;\
+- mv anki.desktop ${DESTDIR}${PREFIX}/share/applications;\
+- mv anki.1 ${DESTDIR}${PREFIX}/share/man/man1/)
+- xdg-mime install anki.xml --novendor
+- xdg-mime default anki.desktop application/x-anki
+- xdg-mime default anki.desktop application/x-apkg
++ cp -av anki.xpm anki.png ${DESTDIR}${PREFIX}/share/pixmaps/
++ cp -av anki.desktop ${DESTDIR}${PREFIX}/share/applications
++ mkdir -p ${DESTDIR}${PREFIX}/man/man1/
++ cp -av anki.1 ${DESTDIR}${PREFIX}/man/man1/
++ mkdir -p ${DESTDIR}${PREFIX}/share/mime/packages/
++ cp -av anki.xml ${DESTDIR}${PREFIX}/share/mime/packages/
++# xdg-mime install anki.xml --novendor
++# xdg-mime default anki.desktop application/x-anki
++# xdg-mime default anki.desktop application/x-apkg
+ @echo
+ @echo "Install complete."
+
+ uninstall:
+ rm -rf ${DESTDIR}${PREFIX}/share/anki
+- rm -rf ${DESTDIR}${PREFIX}/local/bin/anki
++ rm -rf ${DESTDIR}${PREFIX}/bin/anki
+ rm -rf ${DESTDIR}${PREFIX}/share/pixmaps/anki.xpm
+ rm -rf ${DESTDIR}${PREFIX}/share/pixmaps/anki.png
+ rm -rf ${DESTDIR}${PREFIX}/share/applications/anki.desktop
diff --git a/games/anki/files/patch-anki__lang.py b/games/anki/files/patch-anki__lang.py
new file mode 100644
index 000000000000..33fcbc323185
--- /dev/null
+++ b/games/anki/files/patch-anki__lang.py
@@ -0,0 +1,11 @@
+--- ./anki/lang.py.orig 2013-10-11 06:12:53.000000000 +0200
++++ ./anki/lang.py 2013-12-12 21:03:11.000000000 +0100
+@@ -76,7 +76,7 @@
+ if not os.path.isdir(dir):
+ dir = os.path.join(os.path.dirname(sys.argv[0]), "locale")
+ if not os.path.isdir(dir):
+- dir = "/usr/share/anki/locale"
++ dir = "/usr/local/share/locale"
+ return dir
+
+ def setLang(lang, local=True):
diff --git a/games/anki/files/patch-runanki b/games/anki/files/patch-runanki
new file mode 100644
index 000000000000..dde2a7f24ce7
--- /dev/null
+++ b/games/anki/files/patch-runanki
@@ -0,0 +1,10 @@
+--- ./runanki.orig 2012-12-21 09:50:41.000000000 +0100
++++ ./runanki 2013-12-12 21:03:11.000000000 +0100
+@@ -1,6 +1,6 @@
+ #!/usr/bin/env python
+
+ import sys
+-sys.path.insert(0, "/usr/share/anki")
++sys.path.insert(0, "/usr/local/share/anki")
+ import aqt
+ aqt.run()
diff --git a/games/anki/pkg-plist b/games/anki/pkg-plist
index fab220c3de7a..0f6e28077810 100644
--- a/games/anki/pkg-plist
+++ b/games/anki/pkg-plist
@@ -512,28 +512,28 @@ man/man1/anki.1.gz
%%DATADIR%%/designer/studydeck.ui
%%DATADIR%%/designer/taglimit.ui
%%DATADIR%%/designer/template.ui
-%%DATADIR%%/locale/qt_ar.qm
-%%DATADIR%%/locale/qt_cs.qm
-%%DATADIR%%/locale/qt_da.qm
-%%DATADIR%%/locale/qt_de.qm
-%%DATADIR%%/locale/qt_es.qm
-%%DATADIR%%/locale/qt_fa.qm
-%%DATADIR%%/locale/qt_fr.qm
-%%DATADIR%%/locale/qt_gl.qm
-%%DATADIR%%/locale/qt_he.qm
-%%DATADIR%%/locale/qt_hu.qm
-%%DATADIR%%/locale/qt_ja.qm
-%%DATADIR%%/locale/qt_ko.qm
-%%DATADIR%%/locale/qt_lt.qm
-%%DATADIR%%/locale/qt_pl.qm
-%%DATADIR%%/locale/qt_pt.qm
-%%DATADIR%%/locale/qt_ru.qm
-%%DATADIR%%/locale/qt_sk.qm
-%%DATADIR%%/locale/qt_sl.qm
-%%DATADIR%%/locale/qt_sv.qm
-%%DATADIR%%/locale/qt_uk.qm
-%%DATADIR%%/locale/qt_zh_CN.qm
-%%DATADIR%%/locale/qt_zh_TW.qm
+%%NLS%%%%DATADIR%%/locale/qt_ar.qm
+%%NLS%%%%DATADIR%%/locale/qt_cs.qm
+%%NLS%%%%DATADIR%%/locale/qt_da.qm
+%%NLS%%%%DATADIR%%/locale/qt_de.qm
+%%NLS%%%%DATADIR%%/locale/qt_es.qm
+%%NLS%%%%DATADIR%%/locale/qt_fa.qm
+%%NLS%%%%DATADIR%%/locale/qt_fr.qm
+%%NLS%%%%DATADIR%%/locale/qt_gl.qm
+%%NLS%%%%DATADIR%%/locale/qt_he.qm
+%%NLS%%%%DATADIR%%/locale/qt_hu.qm
+%%NLS%%%%DATADIR%%/locale/qt_ja.qm
+%%NLS%%%%DATADIR%%/locale/qt_ko.qm
+%%NLS%%%%DATADIR%%/locale/qt_lt.qm
+%%NLS%%%%DATADIR%%/locale/qt_pl.qm
+%%NLS%%%%DATADIR%%/locale/qt_pt.qm
+%%NLS%%%%DATADIR%%/locale/qt_ru.qm
+%%NLS%%%%DATADIR%%/locale/qt_sk.qm
+%%NLS%%%%DATADIR%%/locale/qt_sl.qm
+%%NLS%%%%DATADIR%%/locale/qt_sv.qm
+%%NLS%%%%DATADIR%%/locale/qt_uk.qm
+%%NLS%%%%DATADIR%%/locale/qt_zh_CN.qm
+%%NLS%%%%DATADIR%%/locale/qt_zh_TW.qm
%%DATADIR%%/oldanki/README
%%DATADIR%%/oldanki/__init__.py
%%DATADIR%%/oldanki/__init__.pyc
@@ -705,6 +705,7 @@ share/applications/anki.desktop
%%NLS%%share/locale/gl/LC_MESSAGES/anki.mo
%%NLS%%share/locale/gu/LC_MESSAGES/anki.mo
%%NLS%%share/locale/he/LC_MESSAGES/anki.mo
+%%NLS%%share/locale/hr/LC_MESSAGES/anki.mo
%%NLS%%share/locale/hu/LC_MESSAGES/anki.mo
%%NLS%%share/locale/it/LC_MESSAGES/anki.mo
%%NLS%%share/locale/ja/LC_MESSAGES/anki.mo