tech-pkg archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: make package run as root



On Thu, Oct 17, 2019 at 11:49:14PM +0200, Manuel Bouyer wrote:
> On Thu, Oct 17, 2019 at 09:31:43PM +0200, Joerg Sonnenberger wrote:
> > On Thu, Oct 17, 2019 at 03:32:31PM +0200, Manuel Bouyer wrote:
> > > Hello,
> > > while working on an upgrade of the sympa package, I'm running into an
> > > issue: make install is run under su as root (as expected, as there is
> > > no full destdir support) but privileges are dropped before 'make package':
> > 
> > What's the value of _MAKE_PACKAGE_AS_ROOT?
> 
> I did check; it's set to yes

Thanks. Please try the attached patch.

Joerg
diff -r 2c0b15620f71 mk/package/package.mk
--- a/mk/package/package.mk	Wed Mar 06 16:02:45 2019 +0100
+++ b/mk/package/package.mk	Fri Oct 18 00:43:58 2019 +0200
@@ -82,12 +82,7 @@
 _PACKAGE_ALL_TARGETS+=	error-check
 
 .PHONY: package-all su-package-all
-.if !empty(_MAKE_PACKAGE_AS_ROOT:M[Yy][Ee][Ss])
-package-all: su-target
-.else
-package-all: su-package-all
-.endif
-su-package-all: ${_PACKAGE_ALL_TARGETS}
+package-all: ${_PACKAGE_ALL_TARGETS}
 
 ######################################################################
 ### package-create (PRIVATE, override)
diff -r 2c0b15620f71 mk/pkgformat/pkg/package.mk
--- a/mk/pkgformat/pkg/package.mk	Wed Mar 06 16:02:45 2019 +0100
+++ b/mk/pkgformat/pkg/package.mk	Fri Oct 18 00:43:58 2019 +0200
@@ -30,8 +30,14 @@
 ######################################################################
 ### stage-package-create creates the binary package for stage install.
 ###
-.PHONY: stage-package-create
-stage-package-create:	stage-install ${STAGE_PKGFILE}
+.PHONY: stage-package-create su-stage-package-create
+stage-package-create:	stage-install
+.if !empty(_MAKE_PACKAGE_AS_ROOT:M[Yy][Ee][Ss])
+stage-package-create: su-target
+.else
+stage-package-create: su-stage-package-create
+.endif
+su-stage-package-create: ${STAGE_PKGFILE}
 
 _PKG_ARGS_PACKAGE+=	${_PKG_CREATE_ARGS}
 _PKG_ARGS_PACKAGE+=	-F ${PKG_COMPRESSION}


Home | Main Index | Thread Index | Old Index