commit:     3cd90654731ff9221ad2b15cb9e3dc01969ace8f
Author:     Andrew Ammerlaan <andrewammerlaan <AT> riseup <DOT> net>
AuthorDate: Tue May  5 09:08:24 2020 +0000
Commit:     Andrew Ammerlaan <andrewammerlaan <AT> riseup <DOT> net>
CommitDate: Tue May  5 09:08:44 2020 +0000
URL:        https://gitweb.gentoo.org/repo/proj/guru.git/commit/?id=3cd90654

dev-libs/octetos-core: simplify ebuilds

you can set the S variable to the location of the source files
instead of symlinking the source files to the default value of S

Also, there is no need to specify the default functions, they
are implemented automatically if nothing is specified

Using MYPV is very helpful as you now only have to change 1 line
to version bump

Package-Manager: Portage-2.3.99, Repoman-2.3.22
Signed-off-by: Andrew Ammerlaan <andrewammerlaan <AT> riseup.net>

 .../octetos-core/octetos-core-1.2.2_beta.ebuild    | 18 ++++++-----------
 .../octetos-core/octetos-core-2.0.0_beta.ebuild    | 22 +++++----------------
 .../octetos-core/octetos-core-2.2.0_beta.ebuild    | 23 +++++-----------------
 .../octetos-core/octetos-core-2.2.1_beta.ebuild    | 23 +++++-----------------
 4 files changed, 21 insertions(+), 65 deletions(-)

diff --git a/dev-libs/octetos-core/octetos-core-1.2.2_beta.ebuild 
b/dev-libs/octetos-core/octetos-core-1.2.2_beta.ebuild
index 6b9289e..076a1c4 100644
--- a/dev-libs/octetos-core/octetos-core-1.2.2_beta.ebuild
+++ b/dev-libs/octetos-core/octetos-core-1.2.2_beta.ebuild
@@ -5,9 +5,11 @@ EAPI=7
 
 inherit autotools
 
+MYPV="${PV/_beta/-br}"
+
 DESCRIPTION="C/C++ library to mainly provide Semantic Versioned implementation"
 HOMEPAGE="https://github.com/azaeldevel/octetos-core";
-SRC_URI="https://github.com/azaeldevel/octetos-core/archive/1.2.2-br.tar.gz";
+SRC_URI="https://github.com/azaeldevel/${PN}/archive/${MYPV}.tar.gz";
 
 LICENSE="GPL-3"
 SLOT="0"
@@ -24,17 +26,9 @@ BDEPEND="
        dev-libs/libconfig
 "
 
-src_unpack() {
-       default
-       ln -s octetos-core-1.2.2-br "${P}"
-}
+S="${WORKDIR}/${PN}-${MYPV}"
 
-src_configure() {
+src_prepare() {
+       default
        eautoreconf -fi
 }
-
-src_compile() {
-       if [ -f Makefile ] || [ -f GNUmakefile ] || [ -f makefile ]; then
-               emake || die "emake failed"
-       fi
-}

diff --git a/dev-libs/octetos-core/octetos-core-2.0.0_beta.ebuild 
b/dev-libs/octetos-core/octetos-core-2.0.0_beta.ebuild
index 76c32d5..c542204 100644
--- a/dev-libs/octetos-core/octetos-core-2.0.0_beta.ebuild
+++ b/dev-libs/octetos-core/octetos-core-2.0.0_beta.ebuild
@@ -5,9 +5,11 @@ EAPI=7
 
 inherit autotools
 
+MYPV="${PV/_beta/-alpha.2}"
+
 DESCRIPTION="C/C++ library to mainly provide Semantic Versioned implementation"
 HOMEPAGE="https://github.com/azaeldevel/octetos-core";
-SRC_URI="https://github.com/azaeldevel/octetos-core/archive/2.0.0-alpha.2.tar.gz";
+SRC_URI="https://github.com/azaeldevel/${PN}/archive/${MYPV}.tar.gz";
 
 LICENSE="GPL-3"
 SLOT="0"
@@ -24,23 +26,9 @@ BDEPEND="
        dev-libs/libconfig
 "
 
-src_unpack() {
-       default
-       ln -s octetos-core-2.0.0-alpha.2 "${P}"
-}
+S="${WORKDIR}/${PN}-${MYPV}"
 
 src_prepare() {
+       default
        eautoreconf -fi
-       eapply_user
-}
-
-src_configure() {
-       if [[ -x ${ECONF_SOURCE:-.}/configure ]] ; then
-               econf
-       fi
-}
-src_compile() {
-       if [ -f Makefile ] || [ -f GNUmakefile ] || [ -f makefile ]; then
-               emake || die "emake failed"
-       fi
 }

diff --git a/dev-libs/octetos-core/octetos-core-2.2.0_beta.ebuild 
b/dev-libs/octetos-core/octetos-core-2.2.0_beta.ebuild
index 380bac2..d4556b7 100644
--- a/dev-libs/octetos-core/octetos-core-2.2.0_beta.ebuild
+++ b/dev-libs/octetos-core/octetos-core-2.2.0_beta.ebuild
@@ -5,9 +5,11 @@ EAPI=7
 
 inherit autotools
 
+MYPV="${PV/_beta/-beta.3}"
+
 DESCRIPTION="C/C++ library to mainly provide Semantic Versioned implementation"
 HOMEPAGE="https://github.com/azaeldevel/octetos-core";
-SRC_URI="https://github.com/azaeldevel/octetos-core/archive/2.2.0-beta.3.tar.gz";
+SRC_URI="https://github.com/azaeldevel/${PN}/archive/${MYPV}.tar.gz";
 
 LICENSE="GPL-3"
 SLOT="0"
@@ -23,24 +25,9 @@ BDEPEND="
        dev-libs/libconfig
 "
 
-src_unpack() {
-       default
-       ln -s octetos-core-2.2.0-beta.3 "${P}"
-}
+S="${WORKDIR}/${PN}-${MYPV}"
 
 src_prepare() {
+       default
        eautoreconf -fi
-       eapply_user
-}
-
-src_configure() {
-       if [[ -x ${ECONF_SOURCE:-.}/configure ]] ; then
-               econf
-       fi
-}
-
-src_compile() {
-       if [ -f Makefile ] || [ -f GNUmakefile ] || [ -f makefile ]; then
-               emake || die "emake failed"
-       fi
 }

diff --git a/dev-libs/octetos-core/octetos-core-2.2.1_beta.ebuild 
b/dev-libs/octetos-core/octetos-core-2.2.1_beta.ebuild
index 77d1004..aa7c1f6 100644
--- a/dev-libs/octetos-core/octetos-core-2.2.1_beta.ebuild
+++ b/dev-libs/octetos-core/octetos-core-2.2.1_beta.ebuild
@@ -5,9 +5,11 @@ EAPI=7
 
 inherit autotools
 
+MYPV="${PV/_beta/-beta.1}"
+
 DESCRIPTION="C/C++ library to mainly provide Semantic Versioned implementation"
 HOMEPAGE="https://github.com/azaeldevel/octetos-core";
-SRC_URI="https://github.com/azaeldevel/octetos-core/archive/2.2.1-beta.1.tar.gz";
+SRC_URI="https://github.com/azaeldevel/${PN}/archive/${MYPV}.tar.gz";
 
 LICENSE="GPL-3"
 SLOT="0"
@@ -23,24 +25,9 @@ BDEPEND="
        dev-libs/libconfig
 "
 
-src_unpack() {
-       default
-       ln -s octetos-core-2.2.1-beta.1 "${P}"
-}
+S="${WORKDIR}/${PN}-${MYPV}"
 
 src_prepare() {
+       default
        eautoreconf -fi
-       eapply_user
-}
-
-src_configure() {
-       if [[ -x ${ECONF_SOURCE:-.}/configure ]] ; then
-               econf
-       fi
-}
-
-src_compile() {
-       if [ -f Makefile ] || [ -f GNUmakefile ] || [ -f makefile ]; then
-               emake || die "emake failed"
-       fi
 }

Reply via email to