mtree violation

classic Classic list List threaded Threaded
7 messages Options
Reply | Threaded
Open this post in threaded view
|

mtree violation

macports-2
I'm trying to local install jdupes with my own test fixes, but i cannot destroot/activate due to more violation.

how can i - without patching the Makefile, specify /opt/local as destination?

logextract:
-----------
# port install jdupes
--->  Fetching distfiles for jdupes
--->  Attempting to fetch jdupes-1.9.tar.gz from https://distfiles.macports.org/jdupes
--->  Attempting to fetch jdupes-1.9.tar.gz from http://lil.fr.distfiles.macports.org/jdupes
--->  Attempting to fetch jdupes-1.9.tar.gz from http://mse.uk.distfiles.macports.org/sites/distfiles.macports.org/jdupes
--->  Attempting to fetch jdupes-1.9.tar.gz from http://nue.de.distfiles.macports.org/jdupes
--->  Attempting to fetch jdupes-1.9.tar.gz from http://fco.it.distfiles.macports.org/mirrors/macports-distfiles/jdupes
--->  Attempting to fetch jdupes-1.9.tar.gz from https://github.com/jbruchon/jdupes/tarball/v1.9
--->  Verifying checksums for jdupes
--->  Extracting jdupes
--->  Configuring jdupes
--->  Building jdupes
--->  Staging jdupes into destroot
Warning: violation by /usr
Warning: jdupes violates the layout of the ports-filesystems!
Warning: Please fix or indicate this misbehavior (if it is intended), it will be an error in future releases!
--->  Installing jdupes @1.9_0
--->  Activating jdupes @1.9_0
Error: Failed to activate jdupes: error renaming "/opt/local/var/macports/software/jdupes/mpextract6qgNCRhA/usr/bin/jdupes" to "/usr/bin/jdupes": not owner
Error: See /opt/local/var/macports/logs/_Users_paul_Develop_macports_jdupes_sysutils_jdupes/jdupes/main.log for details.
Error: Follow https://guide.macports.org/#project.tickets to report a bug.
Error: Processing of port jdupes failed

Portfile:
---------
# -*- coding: utf-8; mode: tcl; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- vim:fenc=utf-8:ft=tcl:et:sw=4:ts=4:sts=4
PortSystem          1.0
PortGroup           github 1.0
github.setup        jbruchon jdupes 1.9 v
categories          sysutils
platforms           darwin
license             MIT
maintainers         nomaintainer
description         A powerful duplicate file finder and an enhanced fork of 'fdupes'.
long_description    ${description}
checksums           rmd160 abe9c903f401a48e8fc13c7631947dc6ba534856 \
                    sha256 689ce2f560b8ec015fda23f8c9f04738321d90293118165f9b0d96c97630d6f2
use_configure        no

fragment of original Makefile:
------------------------------
# PREFIX determines where files will be installed. Common examples
# include "/usr" or "/usr/local".
PREFIX = /usr
(...)
# PROGRAM_NAME determines the installation name and manual page name
PROGRAM_NAME = jdupes
# BIN_DIR indicates directory where program is to be installed.
# Suggested value is "$(PREFIX)/bin"
BIN_DIR = $(PREFIX)/bin
# MAN_DIR indicates directory where the jdupes man page is to be
# installed. Suggested value is "$(PREFIX)/man/man1"
MAN_BASE_DIR = $(PREFIX)/share/man
MAN_DIR = $(MAN_BASE_DIR)/man1
MAN_EXT = 1
(...)
install: jdupes installdirs
  $(INSTALL_PROGRAM)  $(PROGRAM_NAME)   $(DESTDIR)$(BIN_DIR)/$(PROGRAM_NAME)
  $(INSTALL_DATA)   $(PROGRAM_NAME).1 $(DESTDIR)$(MAN_DIR)/$(PROGRAM_NAME).$(MAN_EXT)
(...)

thanks,
pdv.
Reply | Threaded
Open this post in threaded view
|

Re: mtree violation

Ken Cunningham

On 2018-03-06, at 7:01 AM, [hidden email] wrote:

> I'm trying to local install jdupes with my own test fixes, but i cannot destroot/activate due to more violation.

> Warning: violation by /usr


> fragment of original Makefile:
> ------------------------------
> # PREFIX determines where files will be installed. Common examples
> # include "/usr" or "/usr/local".
> PREFIX = /usr


This Makefile hardcodes the install prefix, and expects you to hand edit it prior to installation.

You need to patch it to something like this:


PREFIX=@@PREFIX@@


and then in the portfile, before building, do a reinplace on @@PREFIX@@ to set it to ${prefix}

Ken

Reply | Threaded
Open this post in threaded view
|

Re: mtree violation

macports-2

> On 2018-03-06, at 16:07, Ken Cunningham <[hidden email]> wrote:
>
>
> On 2018-03-06, at 7:01 AM, [hidden email] wrote:
>
>> I'm trying to local install jdupes with my own test fixes, but i cannot destroot/activate due to more violation.
>
>> Warning: violation by /usr
>
>
>> fragment of original Makefile:
>> ------------------------------
>> # PREFIX determines where files will be installed. Common examples
>> # include "/usr" or "/usr/local".
>> PREFIX = /usr
>
>
> This Makefile hardcodes the install prefix, and expects you to hand edit it prior to installation.
>
> You need to patch it to something like this:
>
>
> PREFIX=@@PREFIX@@
>
>
> and then in the portfile, before building, do a reinplace on @@PREFIX@@ to set it to ${prefix}
>
> Ken

this worked fine:

post-patch {
    reinplace       "s|@@PREFIX@@|${prefix}|" ${worksrcpath}/Makefile
}

thanks!
pdv.
Reply | Threaded
Open this post in threaded view
|

Re: mtree violation

Ryan Schmidt-24
In reply to this post by macports-2

On Mar 6, 2018, at 09:01, pdv wrote:

> I'm trying to local install jdupes with my own test fixes, but i cannot destroot/activate due to more violation.
>
> how can i - without patching the Makefile, specify /opt/local as destination?
>
> logextract:
> -----------
> # port install jdupes
> --->  Fetching distfiles for jdupes
> --->  Attempting to fetch jdupes-1.9.tar.gz from https://distfiles.macports.org/jdupes
> --->  Attempting to fetch jdupes-1.9.tar.gz from http://lil.fr.distfiles.macports.org/jdupes
> --->  Attempting to fetch jdupes-1.9.tar.gz from http://mse.uk.distfiles.macports.org/sites/distfiles.macports.org/jdupes
> --->  Attempting to fetch jdupes-1.9.tar.gz from http://nue.de.distfiles.macports.org/jdupes
> --->  Attempting to fetch jdupes-1.9.tar.gz from http://fco.it.distfiles.macports.org/mirrors/macports-distfiles/jdupes
> --->  Attempting to fetch jdupes-1.9.tar.gz from https://github.com/jbruchon/jdupes/tarball/v1.9
> --->  Verifying checksums for jdupes
> --->  Extracting jdupes
> --->  Configuring jdupes
> --->  Building jdupes
> --->  Staging jdupes into destroot
> Warning: violation by /usr
> Warning: jdupes violates the layout of the ports-filesystems!
> Warning: Please fix or indicate this misbehavior (if it is intended), it will be an error in future releases!
> --->  Installing jdupes @1.9_0
> --->  Activating jdupes @1.9_0
> Error: Failed to activate jdupes: error renaming "/opt/local/var/macports/software/jdupes/mpextract6qgNCRhA/usr/bin/jdupes" to "/usr/bin/jdupes": not owner
> Error: See /opt/local/var/macports/logs/_Users_paul_Develop_macports_jdupes_sysutils_jdupes/jdupes/main.log for details.
> Error: Follow https://guide.macports.org/#project.tickets to report a bug.
> Error: Processing of port jdupes failed
>
> Portfile:
> ---------
> # -*- coding: utf-8; mode: tcl; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- vim:fenc=utf-8:ft=tcl:et:sw=4:ts=4:sts=4
> PortSystem          1.0
> PortGroup           github 1.0
> github.setup        jbruchon jdupes 1.9 v
> categories          sysutils
> platforms           darwin
> license             MIT
> maintainers         nomaintainer
> description         A powerful duplicate file finder and an enhanced fork of 'fdupes'.
> long_description    ${description}
> checksums           rmd160 abe9c903f401a48e8fc13c7631947dc6ba534856 \
>                    sha256 689ce2f560b8ec015fda23f8c9f04738321d90293118165f9b0d96c97630d6f2
> use_configure        no
>
> fragment of original Makefile:
> ------------------------------
> # PREFIX determines where files will be installed. Common examples
> # include "/usr" or "/usr/local".
> PREFIX = /usr
> (...)
> # PROGRAM_NAME determines the installation name and manual page name
> PROGRAM_NAME = jdupes
> # BIN_DIR indicates directory where program is to be installed.
> # Suggested value is "$(PREFIX)/bin"
> BIN_DIR = $(PREFIX)/bin
> # MAN_DIR indicates directory where the jdupes man page is to be
> # installed. Suggested value is "$(PREFIX)/man/man1"
> MAN_BASE_DIR = $(PREFIX)/share/man
> MAN_DIR = $(MAN_BASE_DIR)/man1
> MAN_EXT = 1
> (...)
> install: jdupes installdirs
>  $(INSTALL_PROGRAM)  $(PROGRAM_NAME)   $(DESTDIR)$(BIN_DIR)/$(PROGRAM_NAME)
>  $(INSTALL_DATA)   $(PROGRAM_NAME).1 $(DESTDIR)$(MAN_DIR)/$(PROGRAM_NAME).$(MAN_EXT)
> (...)

Presumably, you're meant to specify PREFIX=/opt/local in build.args.


Reply | Threaded
Open this post in threaded view
|

Re: mtree violation

macports-2
oops: different answers, which is best?

On 2018-03-06, at 16:07, Ken Cunningham <[hidden email]> wrote:

This Makefile hardcodes the install prefix, and expects you to hand edit it prior to installation.
You need to patch it to something like this:
PREFIX=@@PREFIX@@
and then in the portfile, before building, do a reinplace on @@PREFIX@@ to set it to ${prefix}

Understood, advantage in using ${prefix}, works.

On 2018-03-07, at 12:16, Ryan Schmidt <[hidden email]> wrote:

Presumably, you're meant to specify PREFIX=/opt/local in build.args.

The advantage is not making a patch for Makefile.



combined:
---------

pre-build {
  build.args        PREFIX=${prefix}
}

:debug:build build phase started at Wed Mar  7 17:17:19 CET 2018
:notice:build --->  Building jdupes
:debug:build Executing proc-pre-org.macports.build-build-0
:debug:build Executing org.macports.build (jdupes)
:debug:build Environment:
:debug:build CC_PRINT_OPTIONS='YES'
:debug:build CC_PRINT_OPTIONS_FILE='/opt/local/var/macports/build/_Users_paul_Develop_macports_jdupes_sysutils_jdupes/jdupes/wor
k/.CC_PRINT_OPTIONS'
:debug:build CPATH='/opt/local/include'
:debug:build LIBRARY_PATH='/opt/local/lib'
:debug:build MACOSX_DEPLOYMENT_TARGET='10.11'
:info:build Executing:  cd "/opt/local/var/macports/build/_Users_paul_Develop_macports_jdupes_sysutils_jdupes/jdupes/work/jdupes
-1.9" && /usr/bin/make -j8 -w all PREFIX=/opt/local
(...)
:debug:destroot checking for mtree violations
:warn:destroot violation by /usr
:warn:destroot jdupes violates the layout of the ports-filesystems!

but it fails. it seems that build.args doesn not overwrite PREIX in Makefile.
Reply | Threaded
Open this post in threaded view
|

Re: mtree violation

Ryan Schmidt-24

On Mar 7, 2018, at 10:24, [hidden email] wrote:

> oops: different answers, which is best?

Using the API offered by the build system is best. In this case, the API is to set the PREFIX argument.

If a Makefile didn't offer a variable for changing the prefix, then you'd have to patch. But since this one does offer a variable, you don't.


> On 2018-03-07, at 12:16, Ryan Schmidt wrote:

>
>> Presumably, you're meant to specify PREFIX=/opt/local in build.args.
>
> The advantage is not making a patch for Makefile.

Yes.


> combined:
> ---------
>
> pre-build {
>   build.args        PREFIX=${prefix}
> }
>
> :debug:build build phase started at Wed Mar  7 17:17:19 CET 2018
> :notice:build --->  Building jdupes
> :debug:build Executing proc-pre-org.macports.build-build-0
> :debug:build Executing org.macports.build (jdupes)
> :debug:build Environment:
> :debug:build CC_PRINT_OPTIONS='YES'
> :debug:build CC_PRINT_OPTIONS_FILE='/opt/local/var/macports/build/_Users_paul_Develop_macports_jdupes_sysutils_jdupes/jdupes/wor
> k/.CC_PRINT_OPTIONS'
> :debug:build CPATH='/opt/local/include'
> :debug:build LIBRARY_PATH='/opt/local/lib'
> :debug:build MACOSX_DEPLOYMENT_TARGET='10.11'
> :info:build Executing:  cd "/opt/local/var/macports/build/_Users_paul_Develop_macports_jdupes_sysutils_jdupes/jdupes/work/jdupes
> -1.9" && /usr/bin/make -j8 -w all PREFIX=/opt/local
> (...)
> :debug:destroot checking for mtree violations
> :warn:destroot violation by /usr
> :warn:destroot jdupes violates the layout of the ports-filesystems!
>
> but it fails. it seems that build.args doesn not overwrite PREIX in Makefile.

It does, but it turns out the makefile doesn't use PREFIX during the build phase. It only seems to use it during the destroot phase. So use:

destroot.args       PREFIX=${prefix}

No need to put it inside a pre-destroot block.

Reply | Threaded
Open this post in threaded view
|

Re: mtree violation

macports-2

On 2018-03-07, at 20:40, Ryan Schmidt <[hidden email]> wrote:
(...)
but it fails. it seems that build.args doesn not overwrite PREIX in Makefile.

It does, but it turns out the makefile doesn't use PREFIX during the build phase. It only seems to use it during the destroot phase. So use:

destroot.args       PREFIX=${prefix}

No need to put it inside a pre-destroot block.

worked ok.

thanks,
pdv.