From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from lists.gentoo.org (pigeon.gentoo.org [208.92.234.80]) by finch.gentoo.org (Postfix) with ESMTP id 23C0B13820C for ; Thu, 16 Aug 2012 19:37:43 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 95B5021C018; Thu, 16 Aug 2012 19:37:18 +0000 (UTC) Received: from smtp.gentoo.org (smtp.gentoo.org [140.211.166.183]) by pigeon.gentoo.org (Postfix) with ESMTP id 363D921C006 for ; Thu, 16 Aug 2012 19:36:14 +0000 (UTC) Received: from sf (unknown [178.120.49.151]) (using TLSv1 with cipher DHE-RSA-AES128-SHA (128/128 bits)) (No client certificate requested) (Authenticated sender: slyfox) by smtp.gentoo.org (Postfix) with ESMTPSA id BA6D41B4033; Thu, 16 Aug 2012 19:36:12 +0000 (UTC) Date: Thu, 16 Aug 2012 22:41:31 +0300 From: Sergei Trofimovich To: gentoo-dev@lists.gentoo.org Cc: =?UTF-8?B?TWljaGHFgiBHw7Nybnk=?= Subject: [gentoo-dev] new tmpfiles-d.eclass (v2) Message-ID: <20120816224131.6044f5ab@sf> X-Mailer: Claws Mail 3.8.0 (GTK+ 2.24.10; x86_64-pc-linux-gnu) Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-dev@lists.gentoo.org Reply-to: gentoo-dev@lists.gentoo.org Mime-Version: 1.0 Content-Type: multipart/signed; micalg=PGP-SHA1; boundary="Sig_/SzBj2J+.FadF7_5FgnXAWym"; protocol="application/pgp-signature" X-Archives-Salt: df6105bd-fe33-4074-9f96-09f4e47f9008 X-Archives-Hash: 87b4b573b3fda64571fbb51010b97657 --Sig_/SzBj2J+.FadF7_5FgnXAWym Content-Type: multipart/mixed; boundary="MP_/Vr/huLV6jvmqz_Ybwb.6+3M" --MP_/Vr/huLV6jvmqz_Ybwb.6+3M Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: quoted-printable Content-Disposition: inline Second attempt to bring basic tmpfiles.d support to the tree. The first one: http://www.mail-archive.com/gentoo-dev@lists.gentoo.org/msg52059.html Changed since: - eclass tmpfilesd.eclass renamed to tmpfiles-d.eclass - {do,new}tmpfilesd renamed to {do,new}tmpfiles_d - systemd.eclass now uses tmpfiles-d.eclass as it was the donor of one of functions: systemd_dotmpfilesd() { debug-print-function ${FUNCNAME} "${@}" =20 - ( - insinto /usr/lib/tmpfiles.d/ - doins "${@}" - ) + dotmpfiles_d "${@}" } I've found only one user of systemd_dotmpfilesd: media-sound/teamspeak-server-bin which can be just converted to use shorter wrapper if needed. And systemd ebuild does the same by hands (i guess can be converted): # Create /run/lock as required by new baselay/OpenRC compat. insinto /usr/lib/tmpfiles.d doins "${FILESDIR}"/gentoo-run.conf --=20 Sergei --MP_/Vr/huLV6jvmqz_Ybwb.6+3M Content-Type: text/x-patch Content-Transfer-Encoding: quoted-printable Content-Disposition: attachment; filename=tmpfiles-d.eclass.patch Index: eclass/systemd.eclass =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D RCS file: /var/cvsroot/gentoo-x86/eclass/systemd.eclass,v retrieving revision 1.11 diff -u -u -r1.11 systemd.eclass --- eclass/systemd.eclass 7 Jan 2012 17:53:47 -0000 1.11 +++ eclass/systemd.eclass 16 Aug 2012 19:06:21 -0000 @@ -25,6 +25,8 @@ # } # @CODE =20 +inherit tmpfiles-d + case ${EAPI:-0} in 0|1|2|3|4) ;; *) die "${ECLASS}.eclass API in EAPI ${EAPI} not yet established." @@ -89,10 +91,7 @@ systemd_dotmpfilesd() { debug-print-function ${FUNCNAME} "${@}" =20 - ( - insinto /usr/lib/tmpfiles.d/ - doins "${@}" - ) + dotmpfiles_d "${@}" } =20 # @FUNCTION: systemd_enable_service Index: eclass/tmpfiles-d.eclass =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D RCS file: eclass/tmpfiles-d.eclass diff -N eclass/tmpfiles-d.eclass --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ eclass/tmpfiles-d.eclass 16 Aug 2012 19:06:21 -0000 @@ -0,0 +1,57 @@ +# Copyright 1999-2012 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 +# $Header: $ + +# @ECLASS: tmpfilesd.eclass +# @MAINTAINER: +# slyfox@gentoo.org +# @AUTHOR: +# Based on bash-completion-r1.eclass by Micha=C5=82 G=C3=B3rny . +# @BLURB: Helpers to install tmpfiles.d files. +# @DESCRIPTION: +# As described in http://0pointer.de/public/systemd-man/tmpfiles.d.html +# helpers allow installing package's tmpfiles.d into /usr/lib/tmpfiles.d +# @EXAMPLE: +# +# @CODE +# EAPI=3D4 +# +# src_install() { +# default +# +# newtmpfiles_d ${FILESDIR}/tmpfilesd.conf ${PN}.conf +# } +# @CODE + +case ${EAPI:-0} in + 0|1|2|3|4) ;; + *) die "EAPI ${EAPI} is unknown." +esac + +# @FUNCTION: dotmpfiles_d +# @USAGE: file [...] +# @DESCRIPTION: +# Install tmpfiles.d files passed as args. Has EAPI-dependant failure +# behavior (like doins). +dotmpfiles_d() { + debug-print-function ${FUNCNAME} "${@}" + + ( + insinto /usr/lib/tmpfiles.d + doins "${@}" + ) +} + +# @FUNCTION: newtmpfilesd +# @USAGE: file newname +# @DESCRIPTION: +# Install tmpfiles.d file under a new name. Has EAPI-dependant failure +# behavior (like newins). +newtmpfiles_d() { + debug-print-function ${FUNCNAME} "${@}" + + ( + insinto /usr/lib/tmpfiles.d + newins "${@}" + ) +} --- net-ftp/proftpd/proftpd-1.3.4a-r1.ebuild 2012-05-29 20:16:51.806921163 = +0300 +++ net-ftp/proftpd/proftpd-1.3.4a-r2.ebuild 2012-08-16 22:02:41.146331472 = +0300 @@ -3,7 +3,7 @@ # $Header: /var/cvsroot/gentoo-x86/net-ftp/proftpd/proftpd-1.3.4a-r1.ebuil= d,v 1.2 2012/05/13 10:49:47 swift Exp $ =20 EAPI=3D4 -inherit eutils +inherit eutils tmpfiles-d =20 MOD_CASE=3D"0.7" MOD_CLAMAV=3D"0.11rc" @@ -216,6 +216,8 @@ docinto rfc dodoc doc/rfc/*.txt fi + + newtmpfiles_d ${FILESDIR}/tmpfilesd.conf ${PN}.conf } =20 pkg_postinst() { --MP_/Vr/huLV6jvmqz_Ybwb.6+3M-- --Sig_/SzBj2J+.FadF7_5FgnXAWym Content-Type: application/pgp-signature; name=signature.asc Content-Disposition: attachment; filename=signature.asc -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.19 (GNU/Linux) iEYEARECAAYFAlAtTPQACgkQcaHudmEf86oV2wCfazFUv7LNCCrJIbImYS785eRi jYMAn1cSL5vpAQAfrkpXZBAi9V6XQbkz =kPCP -----END PGP SIGNATURE----- --Sig_/SzBj2J+.FadF7_5FgnXAWym--