sys-apps/utempter: Port to EAPI 6
authorDavid Seifert <soap@gentoo.org>
Sat, 2 Dec 2017 14:49:59 +0000 (15:49 +0100)
committerDavid Seifert <soap@gentoo.org>
Sat, 2 Dec 2017 16:14:26 +0000 (17:14 +0100)
Package-Manager: Portage-2.3.16, Repoman-2.3.6

sys-apps/utempter/Manifest
sys-apps/utempter/files/utempter-0.5.5.6-build.patch [deleted file]
sys-apps/utempter/files/utempter-0.5.5.6-fix-build-system.patch [moved from sys-apps/utempter/files/utempter-0.5.5.6-soname-makefile-fix.patch with 55% similarity]
sys-apps/utempter/files/utempter-0.5.5.6-no_utmpx.patch
sys-apps/utempter/utempter-0.5.5.6.ebuild

index 8b18dda0755beda639649ecc07c991cc69ddebe7..031d8a62a834c89581d0fae2d8b15f268bb6a471 100644 (file)
@@ -1 +1 @@
-DIST utempter-0.5.5-6.src.rpm 21099 SHA256 617c28d579fa54349b8a706e8346c2442f2ef39523db7e0501701a0919651f3c SHA512 81eeac830631922f2d1b2099a559b60bfd21818b38a524d3c5f61aec143b3e70e95a9ccc300f649dd81f515837fe3befaba6b93bb2e22767e71eee7acb711655 WHIRLPOOL 3ae0a32eae886f2ac14dcf36b4e96e4bb8c25966389c6608a83673149a3045b580b35832e5c69836a18a4f88b55e8c20d254470f84424e30f758a820a87ce13a
+DIST utempter-0.5.5-6.src.rpm 21099 BLAKE2B a4a8c53ab31d53ec56d60a16e5c1d3a0a2ec6c73c3c3025c15dfc389da75f969545392b46976017cfcde1d9f9ca974b14786bbf39709aebdda890df13a7866ed SHA512 81eeac830631922f2d1b2099a559b60bfd21818b38a524d3c5f61aec143b3e70e95a9ccc300f649dd81f515837fe3befaba6b93bb2e22767e71eee7acb711655
diff --git a/sys-apps/utempter/files/utempter-0.5.5.6-build.patch b/sys-apps/utempter/files/utempter-0.5.5.6-build.patch
deleted file mode 100644 (file)
index 8fbfb11..0000000
+++ /dev/null
@@ -1,11 +0,0 @@
---- Makefile
-+++ Makefile
-@@ -37,7 +37,7 @@
-       ln -sf $(SHAREDLIB).$(VERSION) $(RPM_BUILD_ROOT)/$(LIBDIR)/$(SHAREDLIB).$(SOMAJOR)
- 
- $(SHAREDLIB): utmpintf.os
--      $(CC) -o $@ -shared -Wl,-soname,$(SONAME) $^ -lc
-+      $(CC) $(LDFLAGS) -o $@ -shared -Wl,-soname,$(SONAME) $^ -lc
- 
- utmpintf.o: utmpintf.c utempter.h
- 
similarity index 55%
rename from sys-apps/utempter/files/utempter-0.5.5.6-soname-makefile-fix.patch
rename to sys-apps/utempter/files/utempter-0.5.5.6-fix-build-system.patch
index 123c77eb357c1c3e95c11044ac32655ef5f6230d..83b41a04b25f93f81aeb9506dd4f8b058d66cf26 100644 (file)
@@ -1,6 +1,6 @@
---- Makefile.orig      2005-04-15 08:54:32.000000000 -0400
-+++ Makefile   2005-04-15 08:56:17.000000000 -0400
-@@ -5,6 +5,10 @@
+--- a/Makefile
++++ b/Makefile
+@@ -5,12 +5,14 @@
  CVSROOT=$(shell cat CVS/Root)
  # major number of the .so lib
  SOMAJOR = 0
  
  SHAREDLIB = lib$(NAME).so
  SONAME = $(SHAREDLIB).$(SOMAJOR)
-@@ -29,6 +33,8 @@
+ 
+-CFLAGS = -Wall $(RPM_OPT_FLAGS)
+-
+ TARGETS = $(NAME) utmp $(SHAREDLIB)
+ 
+ all:  $(TARGETS)
+@@ -19,7 +21,7 @@
+       rm -f *.so utempter utmp *.os
+ 
+ %.os : %.c
+-      $(CC) -c $(CFLAGS) -fPIC $< -o $@
++      $(CC) -c $(CFLAGS) $(CPPFLAGS) -fPIC $< -o $@
+ 
+ install:
+       mkdir -p $(RPM_BUILD_ROOT)/usr/sbin
+@@ -29,9 +31,11 @@
        install -m 644 utempter.h $(RPM_BUILD_ROOT)/usr/include
        install -m 644 $(SHAREDLIB) $(RPM_BUILD_ROOT)/$(LIBDIR)/$(SHAREDLIB).$(VERSION)
        ln -sf $(SHAREDLIB).$(VERSION) $(RPM_BUILD_ROOT)/$(LIBDIR)/$(SHAREDLIB)
@@ -19,4 +34,8 @@
 +      ln -sf $(SHAREDLIB).$(VERSION) $(RPM_BUILD_ROOT)/$(LIBDIR)/$(SHAREDLIB).$(SOMAJOR)
  
  $(SHAREDLIB): utmpintf.os
-       $(CC) -o $@ -shared -Wl,-soname,$(SONAME) $^ -lc
+-      $(CC) -o $@ -shared -Wl,-soname,$(SONAME) $^ -lc
++      $(CC) $(LDFLAGS) -o $@ -shared -Wl,-soname,$(SONAME) $^ -lc $(LIBS)
+ 
+ utmpintf.o: utmpintf.c utempter.h
+ 
index 8644db837f4a5eef2e7c7e559a669cacc4075598..b6fc7ea7d27e5514ace9b9c1eb3225a1b1f4633e 100644 (file)
@@ -1,5 +1,5 @@
---- utempter-0.5.5/utempter.c.mps      2004-12-11 14:54:06.000000000 +0100
-+++ utempter-0.5.5/utempter.c  2004-12-11 14:57:46.000000000 +0100
+--- a/utempter.c
++++ b/utempter.c
 @@ -11,7 +11,9 @@
  #include <sys/stat.h>
  #include <sys/sysmacros.h>
index 4866160d3cd15a6395f90709e3655bcaec8c3759..6fd2931dcb40be36b1f50f2997c636f0dbaa44a3 100644 (file)
@@ -1,10 +1,12 @@
-# Copyright 1999-2015 Gentoo Foundation
+# Copyright 1999-2017 Gentoo Foundation
 # Distributed under the terms of the GNU General Public License v2
 
-inherit rpm eutils user
+EAPI=6
+
+inherit flag-o-matic rpm toolchain-funcs user
 
 MY_P=${P%.*}-${PV##*.}
-S=${WORKDIR}/${P%.*}
+
 DESCRIPTION="App that allows non-privileged apps to write utmp (login) info"
 HOMEPAGE="https://www.redhat.com/"
 SRC_URI="mirror://gentoo/${MY_P}.src.rpm"
@@ -14,43 +16,43 @@ SLOT="0"
 KEYWORDS="alpha amd64 arm hppa ia64 ~mips ppc ppc64 s390 sh sparc x86"
 IUSE=""
 
-RDEPEND="!sys-libs/libutempter
+RDEPEND="
+       !sys-libs/libutempter
        !dev-python/utmp"
 
+S=${WORKDIR}/${P%.*}
+PATCHES=(
+       "${FILESDIR}"/${P}-no_utmpx.patch
+       "${FILESDIR}"/${P}-fix-build-system.patch
+)
+
 pkg_setup() {
        enewgroup utmp 406
 }
 
-src_unpack() {
-       rpm_src_unpack
-       cd "${S}"
-       epatch "${FILESDIR}"/${P}-soname-makefile-fix.patch
-       epatch "${FILESDIR}"/${P}-no_utmpx.patch
-       epatch "${FILESDIR}"/${P}-build.patch
-}
-
-src_compile() {
-       emake RPM_OPT_FLAGS="${CFLAGS} ${CPPFLAGS}" || die
+src_configure() {
+       tc-export CC
+       append-cflags -Wall
 }
 
 src_install() {
        emake \
-               RPM_BUILD_ROOT="${D}" \
+               RPM_BUILD_ROOT="${ED}" \
                LIBDIR=/usr/$(get_libdir) \
-               install || die
-       dobin utmp || die
+               install
+       dobin utmp
 
        fowners root:utmp /usr/sbin/utempter
        fperms 2755 /usr/sbin/utempter
 }
 
 pkg_postinst() {
-       if [ -f "${ROOT}"/var/log/wtmp ] ; then
-               chown root:utmp "${ROOT}"/var/log/wtmp
-               chmod 664 "${ROOT}"/var/log/wtmp
+       if [[ -f "${EROOT%/}"/var/log/wtmp ]] ; then
+               chown root:utmp "${EROOT%/}"/var/log/wtmp
+               chmod 664 "${EROOT%/}"/var/log/wtmp
        fi
-       if [ -f "${ROOT}"/var/run/utmp ] ; then
-               chown root:utmp "${ROOT}"/var/run/utmp
-               chmod 664 "${ROOT}"/var/run/utmp
+       if [[ -f "${EROOT%/}"/var/run/utmp ]] ; then
+               chown root:utmp "${EROOT%/}"/var/run/utmp
+               chmod 664 "${EROOT%/}"/var/run/utmp
        fi
 }