public inbox for gentoo-commits@lists.gentoo.org
 help / color / mirror / Atom feed
* [gentoo-commits] repo/gentoo:master commit in: games-action/supermariowar/, games-action/supermariowar/files/
@ 2017-09-17 21:59 Patrice Clement
  0 siblings, 0 replies; 2+ messages in thread
From: Patrice Clement @ 2017-09-17 21:59 UTC (permalink / raw
  To: gentoo-commits

commit:     464d7d2c9ff5ba9e81a2b9cf5ba0b256c93e84ca
Author:     Patrice Clement <monsieurp <AT> gentoo <DOT> org>
AuthorDate: Sun Sep 17 21:56:44 2017 +0000
Commit:     Patrice Clement <monsieurp <AT> gentoo <DOT> org>
CommitDate: Sun Sep 17 21:59:10 2017 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=464d7d2c

games-action/supermariowar: new package.

Super Mario War is a fan-made multiplayer Super Mario Bros. style
deathmatch game.

See: http://supermariowar.supersanctuary.net
See: https://github.com/mmatyas/supermariowar

Package-Manager: Portage-2.3.6, Repoman-2.3.1

 games-action/supermariowar/Manifest                |   1 +
 games-action/supermariowar/files/smwd.initd        |  39 ++++++++
 .../supermariowar-2.0_beta1-yaml-cpp-config.cmake  |  21 ++++
 games-action/supermariowar/metadata.xml            |  14 +++
 .../supermariowar/supermariowar-2.0_beta1.ebuild   | 110 +++++++++++++++++++++
 5 files changed, 185 insertions(+)

diff --git a/games-action/supermariowar/Manifest b/games-action/supermariowar/Manifest
new file mode 100644
index 00000000000..5c4d64c56a3
--- /dev/null
+++ b/games-action/supermariowar/Manifest
@@ -0,0 +1 @@
+DIST supermariowar-2.0_beta1.tar.gz 13545366 SHA256 7b1197cd9dd99f1470c9118f7fe78489cd6ade3ecbb444e336e86fc87c0c8a08 SHA512 0849d23ea613d69f32c184dd5f470815a4c68b15836e46e40c30c5a3a6ea2216d4d3305f356e8fdd5b42f4008d9b07f0b9fac84b9f801a4b9f888ba188c56e0b WHIRLPOOL eadca1a65bca8280a8b10f8a5da3c47217fe67c375a3aca3730b7e81e8f6b4fc2fe1d8530ad30912263febea89eb517a6f59018c0e68273b94a6b3dcf261a308

diff --git a/games-action/supermariowar/files/smwd.initd b/games-action/supermariowar/files/smwd.initd
new file mode 100644
index 00000000000..6aa83cc3e1b
--- /dev/null
+++ b/games-action/supermariowar/files/smwd.initd
@@ -0,0 +1,39 @@
+#!/sbin/openrc-run
+# Copyright 1999-2017 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+command="/usr/sbin/smw-server"
+command_background="true"
+pidfile="/var/run/${RC_SVCNAME}.pid"
+name="Super Mario War server"
+description="The Super Mario War server process is in charge of hosting Super Mario War games"
+smw_server_dir="/usr/share/supermariowar-2.0_beta1/server"
+
+depend() {
+    use net
+    before logger
+}
+
+start() {
+    if [[ ! -d "${smw_server_dir}" ]]; then
+        eerror "Cannot cd into ${smw_server_dir}"
+        return 1
+    fi
+    cd "${smw_server_dir}" || return 1
+    ebegin "Starting ${name}"
+    start-stop-daemon \
+        --start \
+        --background \
+        --pidfile ${pidfile} \
+        --make-pidfile \
+        --exec ${command}
+    eend $?
+}
+
+stop() {
+    ebegin "Stopping ${name}"
+    start-stop-daemon \
+        --stop \
+        --pidfile ${pidfile}
+    eend $?
+}

diff --git a/games-action/supermariowar/files/supermariowar-2.0_beta1-yaml-cpp-config.cmake b/games-action/supermariowar/files/supermariowar-2.0_beta1-yaml-cpp-config.cmake
new file mode 100644
index 00000000000..03fb190aad6
--- /dev/null
+++ b/games-action/supermariowar/files/supermariowar-2.0_beta1-yaml-cpp-config.cmake
@@ -0,0 +1,21 @@
+find_package(PkgConfig REQUIRED)
+pkg_check_modules(YAML-CPP REQUIRED yaml-cpp)
+find_path(YAML-CPP_INCLUDE_DIRECTORY
+    NAMES yaml.h
+    PATHS ${YAML-CPP_INCLUDE_DIRS} /usr/include/yaml-cpp
+)
+find_library(YAML-CPP_LIBRARY
+    NAMES yaml-cpp
+    PATHS ${YAML-CPP_LIBRARY_DIRS})
+
+include(FindPackageHandleStandardArgs)
+find_package_handle_standard_args(yaml-cpp 
+    FOUND_VAR yaml-cpp_FOUND
+    REQUIRED_VARS YAML-CPP_LIBRARY YAML-CPP_INCLUDE_DIRECTORY
+)
+
+if (yaml-cpp_FOUND)
+    set(yaml-cpp_INCLUDE_DIRS ${YAML-CPP_INCLUDE_DIRECTORY})
+    set(yaml-cpp_LIBRARIES ${YAML-CPP_LIBRARY})
+endif ()
+mark_as_advanced(YAML-CPP_INCLUDE_DIRECTORY YAML-CPP_LIBRARY)

diff --git a/games-action/supermariowar/metadata.xml b/games-action/supermariowar/metadata.xml
new file mode 100644
index 00000000000..30f464f613a
--- /dev/null
+++ b/games-action/supermariowar/metadata.xml
@@ -0,0 +1,14 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+	<maintainer type="project">
+		<email>monsieurp@gentoo.org</email>
+		<name>Patrice Clement</name>
+	</maintainer>
+	<use>
+		<flag name="server">Compile and install Super Mario War server files</flag>
+	</use>
+	<upstream>
+		<remote-id type="github">mmatyas/supermariowar</remote-id>
+	</upstream>
+</pkgmetadata>

diff --git a/games-action/supermariowar/supermariowar-2.0_beta1.ebuild b/games-action/supermariowar/supermariowar-2.0_beta1.ebuild
new file mode 100644
index 00000000000..dd6d11b97dd
--- /dev/null
+++ b/games-action/supermariowar/supermariowar-2.0_beta1.ebuild
@@ -0,0 +1,110 @@
+# Copyright 1999-2017 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=6
+
+inherit eutils cmake-utils versionator
+
+MY_PV=$(replace_version_separator 2 '-')
+MY_PV="${MY_PV/beta1/beta.1}"
+MY_PN="smw"
+
+DESCRIPTION="Fan-made multiplayer Super Mario Bros. style deathmatch game"
+HOMEPAGE="https://github.com/mmatyas/supermariowar"
+SRC_URI="https://github.com/mmatyas/${PN}/archive/v${MY_PV}.tar.gz -> ${P}.tar.gz"
+
+KEYWORDS="~amd64 ~x86"
+LICENSE="GPL-2"
+SLOT="0"
+
+IUSE="+server"
+
+RDEPEND="
+	sys-libs/zlib
+	dev-cpp/yaml-cpp
+	net-libs/enet:1.3=
+	media-libs/sdl-mixer
+	media-libs/sdl-image"
+
+DEPEND="
+	${RDEPEND}
+	virtual/pkgconfig"
+
+S="${WORKDIR}/${PN}-${MY_PV}"
+
+src_unpack() {
+	unpack ${A}
+	cd "${S}" || die
+	unpack ./data.zip
+}
+
+src_prepare() {
+	default
+	einfo "Copying Findyaml-cpp.cmake"
+	cp "${FILESDIR}/${P}-yaml-cpp-config.cmake" cmake/Findyaml-cpp.cmake || die
+	eend $?
+}
+
+src_configure() {
+	local mycmakeargs=(
+		-DBUILD_STATIC_LIBS=OFF
+	    -DCMAKE_INSTALL_PREFIX="${EPREFIX%/}/usr"
+	    -DSMW_BINDIR="${EPREFIX%/}/usr/bin"
+	    -DSMW_DATADIR="${EPREFIX%/}/usr/share/${PF}"
+	)
+
+	cmake-utils_src_configure
+}
+
+src_compile() {
+	cmake-utils_src_compile
+}
+
+src_install() {
+	cmake-utils_src_install
+
+	local bin base_bin
+	for bin in "${ED}/usr/bin"/*; do
+		base_bin=$(basename "${bin}")
+		chmod 0755 "${bin}" || die
+	done
+
+	local smw_datadir="usr/share/${PF}"
+	local smw_bindir="${smw_datadir}/bin"
+	mkdir -p "${ED}/${smw_bindir}" || die
+
+	einfo "Moving ${PN} binary files to /${smw_bindir}"
+	mv "${ED}/usr/bin"/* "${ED}/${smw_bindir}" || die
+	eend $?
+
+	for bin in "${ED}/${smw_bindir}"/*; do
+		base_bin=$(basename "${bin}")
+		einfo "Creating launcher in /usr/bin for ${base_bin}"
+		cat << EOF > "${base_bin}" || die
+#!/usr/bin/env bash
+# Copyright 1999-2017 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# ${PF} launcher: ${base_bin}
+exec /${smw_bindir}/${base_bin} /${smw_datadir}
+EOF
+		dobin "${base_bin}"
+		eend $?
+	done
+
+	if use server; then
+		local smw_server="${BUILD_DIR}/Binaries/Release/${MY_PN}-server"
+		local smw_serverdir="/${smw_datadir}/server"
+
+		einfo "Installing ${MY_PN}-server files"
+		dosbin "${smw_server}"
+
+		dodir "${smw_serverdir}"
+		insinto "${smw_serverdir}"
+		doins "${S}/src/server/serverconfig"
+
+		dosym "${smw_serverdir}/serverconfig" "/etc/${MY_PN}.conf"
+
+		newinitd "${FILESDIR}/smwd.initd" "${MY_PN}d"
+		eend $?
+	fi
+}


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* [gentoo-commits] repo/gentoo:master commit in: games-action/supermariowar/, games-action/supermariowar/files/
@ 2017-09-18 19:42 Patrice Clement
  0 siblings, 0 replies; 2+ messages in thread
From: Patrice Clement @ 2017-09-18 19:42 UTC (permalink / raw
  To: gentoo-commits

commit:     1e485b1e96c060fd46cd02337575f49e59eb40db
Author:     Patrice Clement <monsieurp <AT> gentoo <DOT> org>
AuthorDate: Mon Sep 18 19:38:38 2017 +0000
Commit:     Patrice Clement <monsieurp <AT> gentoo <DOT> org>
CommitDate: Mon Sep 18 19:42:37 2017 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=1e485b1e

games-action/supermariowar: improvements.

This commit:
* enables png and jpeg USE flags on media-libs/sdl-image
* enables vorbis USE flag on media-libs/sdl-mixer
* modifies dynamically the smw_serverdir variable in swmd init script.

Package-Manager: Portage-2.3.6, Repoman-2.3.1

 games-action/supermariowar/files/smwd.initd        |   8 +-
 .../supermariowar-2.0_beta1-r1.ebuild              | 110 +++++++++++++++++++++
 2 files changed, 114 insertions(+), 4 deletions(-)

diff --git a/games-action/supermariowar/files/smwd.initd b/games-action/supermariowar/files/smwd.initd
index 6aa83cc3e1b..da4fa9a87ee 100644
--- a/games-action/supermariowar/files/smwd.initd
+++ b/games-action/supermariowar/files/smwd.initd
@@ -7,7 +7,7 @@ command_background="true"
 pidfile="/var/run/${RC_SVCNAME}.pid"
 name="Super Mario War server"
 description="The Super Mario War server process is in charge of hosting Super Mario War games"
-smw_server_dir="/usr/share/supermariowar-2.0_beta1/server"
+smw_serverdir="@SMW_SERVERDIR@"
 
 depend() {
     use net
@@ -15,11 +15,11 @@ depend() {
 }
 
 start() {
-    if [[ ! -d "${smw_server_dir}" ]]; then
-        eerror "Cannot cd into ${smw_server_dir}"
+    if [[ ! -d "${smw_serverdir}" ]]; then
+        eerror "Cannot cd into ${smw_serverdir}"
         return 1
     fi
-    cd "${smw_server_dir}" || return 1
+    cd "${smw_serverdir}" || return 1
     ebegin "Starting ${name}"
     start-stop-daemon \
         --start \

diff --git a/games-action/supermariowar/supermariowar-2.0_beta1-r1.ebuild b/games-action/supermariowar/supermariowar-2.0_beta1-r1.ebuild
new file mode 100644
index 00000000000..c42de90ce2a
--- /dev/null
+++ b/games-action/supermariowar/supermariowar-2.0_beta1-r1.ebuild
@@ -0,0 +1,110 @@
+# Copyright 1999-2017 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=6
+
+inherit eutils cmake-utils versionator
+
+MY_PV=$(replace_version_separator 2 '-')
+MY_PV="${MY_PV/beta1/beta.1}"
+MY_PN="smw"
+
+DESCRIPTION="Fan-made multiplayer Super Mario Bros. style deathmatch game"
+HOMEPAGE="https://github.com/mmatyas/supermariowar"
+SRC_URI="https://github.com/mmatyas/${PN}/archive/v${MY_PV}.tar.gz -> ${P}.tar.gz"
+
+KEYWORDS="~amd64 ~x86"
+LICENSE="GPL-2"
+SLOT="0"
+
+IUSE="+server"
+
+RDEPEND="
+	sys-libs/zlib
+	dev-cpp/yaml-cpp
+	net-libs/enet:1.3=
+	media-libs/sdl-mixer[vorbis]
+	media-libs/sdl-image[png,jpeg]"
+
+DEPEND="
+	${RDEPEND}
+	app-arch/unzip
+	virtual/pkgconfig"
+
+S="${WORKDIR}/${PN}-${MY_PV}"
+
+src_unpack() {
+	unpack ${A}
+	cd "${S}" || die
+	unpack ./data.zip
+}
+
+src_prepare() {
+	default
+	einfo "Copying Findyaml-cpp.cmake"
+	cp "${FILESDIR}/${P}-yaml-cpp-config.cmake" cmake/Findyaml-cpp.cmake || die
+	eend $?
+}
+
+src_configure() {
+	local mycmakeargs=(
+		-DBUILD_STATIC_LIBS=OFF
+		-DCMAKE_INSTALL_PREFIX="${EPREFIX%/}/usr"
+		-DSMW_BINDIR="${EPREFIX%/}/usr/bin"
+		-DSMW_DATADIR="${EPREFIX%/}/usr/share/${PF}"
+	)
+
+	cmake-utils_src_configure
+}
+
+src_install() {
+	cmake-utils_src_install
+
+	local bin
+	for bin in "${ED}/usr/bin"/*; do
+		chmod 0755 "${bin}" || die
+	done
+
+	local smw_datadir="usr/share/${PF}"
+	local smw_bindir="${smw_datadir}/bin"
+	mkdir -p "${ED}/${smw_bindir}" || die
+
+	einfo "Moving ${PN} binary files to /${smw_bindir}"
+	mv "${ED}/usr/bin"/* "${ED}/${smw_bindir}" || die
+	eend $?
+
+	local base_bin
+	for bin in "${ED}/${smw_bindir}"/*; do
+		base_bin=$(basename "${bin}")
+		einfo "Creating ${base_bin} launcher in /usr/bin"
+		cat << EOF > "${base_bin}" || die
+#!/usr/bin/env bash
+# Copyright 1999-2017 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# ${PF} launcher: ${base_bin}
+exec /${smw_bindir}/${base_bin} /${smw_datadir}
+EOF
+		dobin "${base_bin}"
+		eend $?
+	done
+
+	if use server; then
+		local smw_server="${BUILD_DIR}/Binaries/Release/${MY_PN}-server"
+		local smw_serverdir="/${smw_datadir}/server"
+
+		einfo "Installing ${MY_PN}-server files"
+		dosbin "${smw_server}"
+
+		dodir "${smw_serverdir}"
+		insinto "${smw_serverdir}"
+		doins "${S}/src/server/serverconfig"
+
+		dosym "${smw_serverdir}/serverconfig" "/etc/${MY_PN}d.conf"
+
+		newinitd "${FILESDIR}/smwd.initd" "${MY_PN}d"
+		sed -i -e \
+			"s#@SMW_SERVERDIR@#${smw_serverdir}#g;" \
+			"${ED}/etc/init.d/${MY_PN}d" || die
+		eend $?
+	fi
+}


^ permalink raw reply related	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2017-09-18 19:42 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-09-18 19:42 [gentoo-commits] repo/gentoo:master commit in: games-action/supermariowar/, games-action/supermariowar/files/ Patrice Clement
  -- strict thread matches above, loose matches on Subject: below --
2017-09-17 21:59 Patrice Clement

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox