Bug 171363 - [MAINTAINER] games/gottet: Makefile simplified
Summary: [MAINTAINER] games/gottet: Makefile simplified
Status: Closed FIXED
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: Normal Affects Only Me
Assignee: Dmitry Marakasov
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-09-06 03:00 UTC by nemysis
Modified: 2012-11-28 23:41 UTC (History)
1 user (show)

See Also:


Attachments
gottet-1.0.4_1.patch (1.43 KB, patch)
2012-09-06 03:00 UTC, nemysis
no flags Details | Diff
gottet.diff (1.89 KB, patch)
2012-09-08 03:43 UTC, nemysis
no flags Details | Diff
gottet.diff (1.04 KB, patch)
2012-10-11 03:10 UTC, nemysis
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description nemysis 2012-09-06 03:00:10 UTC
Makefile simplified

Generated with FreeBSD Port Tools 0.99_6 (mode: change, diff: ports)
Comment 1 Dmitry Marakasov freebsd_committer freebsd_triage 2012-09-08 01:04:57 UTC
Responsible Changed
From-To: freebsd-ports-bugs->amdmi3

I'll take it.
Comment 2 Dmitry Marakasov 2012-09-08 01:46:59 UTC
* nemysis (nemysis@gmx.ch) wrote:

> --- gottet-1.0.4_1.patch begins here ---
> diff -ruN --exclude=CVS /usr/ports/games/gottet/Makefile ./Makefile
> --- /usr/ports/games/gottet/Makefile	2012-08-17 15:24:40.000000000 +0200
> +++ ./Makefile	2012-09-06 03:54:38.000000000 +0200
> @@ -7,21 +7,26 @@
>  
>  PORTNAME=	gottet
>  PORTVERSION=	1.0.4
> +PORTREVISION=	1
>  CATEGORIES=	games
>  MASTER_SITES=	http://gottcode.org/${PORTNAME}/
> -EXTRACT_SUFX=	-src.tar.bz2
> +DISTNAME=	${PORTNAME}-${DISTVERSION}-src
...
> +WRKSRC=		${WRKDIR}/${PORTNAME}-${PORTVERSION}
> +

For the sake of simplicity I suggest to leave the first variant.
To specify EXTRACT_SUFX is simplier that to specify both DISTNAME
and WRKSRC.

> +do-configure:
> +	@cd ${WRKSRC} && ${SETENV} ${CONFIGURE_ENV} \
> +		${QMAKE} PREFIX=${PREFIX} ${WRKSRC}/${PORTNAME}.pro
> +

Don't forget, targets come after all variables. Also, ${QMAKEFLAGS}
for qmake are required to make the port respect systemwide CXX/CXXFLAGS
settings. Full path to .pro is not needed since you've chdir'ed
into WRKSRC already; actually, specifying .pro file is not needed
at all as if there's a single .pro file in the directory, qmake picks it
up automatically.

Finally, you've missed that qmake also installs

share/icons/hicolor/48x48/apps/gottet.png

It'll require too many PLIST_DIRSTRY lines in the Makefile, so I
suggest to switch to pkg-plist.

Modified diff, what do you think:

--- gottet.patch begins here ---
Index: Makefile
===================================================================
--- Makefile	(revision 303845)
+++ Makefile	(working copy)
@@ -7,42 +7,31 @@
 
 PORTNAME=	gottet
 PORTVERSION=	1.0.4
+PORTREVISION=	1
 CATEGORIES=	games
 MASTER_SITES=	http://gottcode.org/${PORTNAME}/
 EXTRACT_SUFX=	-src.tar.bz2
 
 MAINTAINER=	nemysis@gmx.ch
-COMMENT=	A Tetris clone
+COMMENT=	Tetris clone
 
 LICENSE=	GPLv3
 
 USE_BZIP2=	yes
-USE_QT_VER=	4
-QT_COMPONENTS=	moc_build qmake_build rcc_build iconengines imageformats
-USE_GMAKE=	yes
+USE_QT4=	moc_build qmake_build rcc_build iconengines imageformats
 MAKE_JOBS_SAFE=	yes
 
 PORTDOCS=	ChangeLog
 
-PLIST_FILES=	bin/${PORTNAME} \
-		share/applications/${PORTNAME}.desktop \
-		share/pixmaps/${PORTNAME}.png
-PLIST_DIRSTRY=	share/applications
-
 .include <bsd.port.options.mk>
 
 do-configure:
 	@cd ${WRKSRC} && ${SETENV} ${CONFIGURE_ENV} \
-		${QMAKE} ${QMAKEFLAGS}
+		${QMAKE} ${QMAKEFLAGS} PREFIX=${PREFIX}
 
-do-install:
-# Executable
-	${INSTALL_PROGRAM} ${WRKSRC}/${PORTNAME} ${PREFIX}/bin
-
-# Pixmaps and Desktop
+post-install:
+# Pixmaps
 	${INSTALL_DATA} ${WRKSRC}/icons/${PORTNAME}.png ${PREFIX}/share/pixmaps/
-	${MKDIR} ${PREFIX}/share/applications
-	${INSTALL_DATA} ${WRKSRC}/icons/${PORTNAME}.desktop ${PREFIX}/share/applications/
 
 # Documentation
 .if ${PORT_OPTIONS:MDOCS}
Index: pkg-plist
===================================================================
--- pkg-plist	(revision 0)
+++ pkg-plist	(working copy)
@@ -0,0 +1,9 @@
+bin/gottet
+share/applications/gottet.desktop
+share/icons/hicolor/48x48/apps/gottet.png
+share/pixmaps/gottet.png
+@dirrmtry share/icons/hicolor/48x48/apps
+@dirrmtry share/icons/hicolor/48x48
+@dirrmtry share/icons/hicolor
+@dirrmtry share/icons
+@dirrmtry share/applications


-- 
Dmitry Marakasov   .   55B5 0596 FF1E 8D84 5F56  9510 D35A 80DD F9D2 F77D
amdmi3@amdmi3.ru  ..:  jabber: amdmi3@jabber.ru    http://www.amdmi3.ru
Comment 3 Dmitry Marakasov 2012-09-08 02:38:31 UTC
* nemysis (nemysis@gmx.ch) wrote:

> ===> Generating patch
> ===> Viewing diff with more
> diff -ruN --exclude=CVS /usr/ports/games/gottet/Makefile ./Makefile
> --- /usr/ports/games/gottet/Makefile	2012-08-17 15:24:40.000000000 +0200
> +++ ./Makefile	2012-09-08 03:06:57.000000000 +0200
> @@ -7,42 +7,33 @@
>  
>  PORTNAME=	gottet
>  PORTVERSION=	1.0.4
> +PORTREVISION=	1
>  CATEGORIES=	games
>  MASTER_SITES=	http://gottcode.org/${PORTNAME}/
> -EXTRACT_SUFX=	-src.tar.bz2
> +DISTNAME=	${PORTNAME}-${DISTVERSION}-src

Why don't you want to stick with EXTRACT_SUFX to not add extra
WRKSRC?

> +WRKSRC=		${WRKDIR}/${PORTNAME}-${PORTVERSION}

> -PORTDOCS=	ChangeLog
> -
> -PLIST_FILES=	bin/${PORTNAME} \
> -		share/applications/${PORTNAME}.desktop \
> -		share/pixmaps/${PORTNAME}.png
> -PLIST_DIRSTRY=	share/applications
> -
> -.include <bsd.port.options.mk>
> -
>  do-configure:
>  	@cd ${WRKSRC} && ${SETENV} ${CONFIGURE_ENV} \
> -		${QMAKE} ${QMAKEFLAGS}
> +		  ${QMAKE} ${QMAKEFLAGS} PREFIX=${PREFIX} ${WRKSRC}/${PORTNAME}.pro
> +
> +PORTDOCS=	ChangeLog
>  
> -do-install:
> -# Executable
> -	${INSTALL_PROGRAM} ${WRKSRC}/${PORTNAME} ${PREFIX}/bin
> +.include <bsd.port.options.mk>
>  
> -# Pixmaps and Desktop
> +post-install:
> +# Pixmaps
>  	${INSTALL_DATA} ${WRKSRC}/icons/${PORTNAME}.png ${PREFIX}/share/pixmaps/
> -	${MKDIR} ${PREFIX}/share/applications
> -	${INSTALL_DATA} ${WRKSRC}/icons/${PORTNAME}.desktop ${PREFIX}/share/applications/

Order is still incorrect, you define PORTDOCS after do-configure.

-- 
Dmitry Marakasov   .   55B5 0596 FF1E 8D84 5F56  9510 D35A 80DD F9D2 F77D
amdmi3@amdmi3.ru  ..:  jabber: amdmi3@jabber.ru    http://www.amdmi3.ru
Comment 4 Dmitry Marakasov freebsd_committer freebsd_triage 2012-11-28 23:41:29 UTC
State Changed
From-To: open->closed

Committed, with minor changes. Thanks!