Opened 11 years ago

Closed 11 years ago

#37382 closed submission (fixed)

util-linux @2.22 linux utility programs

Reported by: soulyeller@… Owned by: macports-tickets@…
Priority: Normal Milestone:
Component: ports Version: 2.1.2
Keywords: Cc: ryandesign (Ryan Carsten Schmidt)
Port: util-linux

Description

Some (NOT all) useful linux utilities in the util-linux package are ported to Mac.

Attachments (1)

Portfile (2.5 KB) - added by soulyeller@… 11 years ago.
util-linux portfile

Download all attachments as: .zip

Change History (6)

comment:1 Changed 11 years ago by ryandesign (Ryan Carsten Schmidt)

Cc: ryandesign@… added
Port: util-linux added

Thanks, but there are some lint warnings:

$ port lint --nitpick
--->  Verifying Portfile for util-linux
Warning: Line 9 has trailing whitespace before newline
Warning: Line 21 seems to hardcode the version number, consider using ${version} instead
Warning: Line 22 has trailing whitespace before newline
Warning: Line 22 seems to hardcode the version number, consider using ${version} instead
Warning: Line 48 has trailing whitespace before newline
--->  0 errors and 5 warnings found.

It does not install with the universal variant:

$ sudo port install +universal
--->  Computing dependencies for util-linux
Error: Cannot install util-linux for the arch(s) 'i386 x86_64' because
Error: its dependency binutils does not build for the required arch(s) by default
Error: and does not have a universal variant.
Error: Unable to execute port: architecture mismatch

And there appears to be a conflict with the getopt port:

$ sudo port install -- -universal
--->  Computing dependencies for util-linux
--->  Fetching distfiles for util-linux
--->  Attempting to fetch util-linux-2.22.tar.gz from http://www.kernel.org/pub/linux/utils/util-linux/v2.22/
--->  Verifying checksum(s) for util-linux
--->  Extracting util-linux
--->  Configuring util-linux
--->  Building util-linux
--->  Staging util-linux into destroot
--->  Installing util-linux @2.22_0
--->  Activating util-linux @2.22_0
Error: org.macports.activate for port util-linux returned: Image error: /opt/local/bin/getopt is being used by the active getopt port.  Please deactivate this port first, or use 'port -f activate util-linux' to force the activation.
Please see the log file for port util-linux for details:
    /opt/local/var/macports/logs/_Users_rschmidt_macports_dports_devel_util-linux/util-linux/main.log
To report a bug, follow the instructions in the guide:
    http://guide.macports.org/#project.tickets
Error: Processing of port util-linux failed

There is a problem with the documentation directory; it has been created without execute permission (needs to be mode 755 not 644):

$ ls -l work/destroot/opt/local/share/doc/util-linux/
ls: rev.1: Permission denied

This loop is not correct:

    foreach file {README NEWS ChangeLog COPYING AUTHORS ABOUT-NLS} {
      xinstall -m 644 ${worksrcpath}/${path}.1 ${destroot}${prefix}/share/doc/${name}
    }

You loop for the variable file but then do not use the variable file in the loop. You don't need a loop either; you can use xinstall -W:

    xinstall -m 644 -W ${worksrcpath} README NEWS ChangeLog COPYING AUTHORS ABOUT-NLS ${destroot}${prefix}/share/doc/${name}

comment:2 Changed 11 years ago by ryandesign (Ryan Carsten Schmidt)

For the conflict with getopt, either change the name of the installed file so that it does not conflict, or else declare that the ports do conflict by writing conflicts getopt in this port, and conflicts util-linux in the getopt port.

Changed 11 years ago by soulyeller@…

Attachment: Portfile added

util-linux portfile

comment:3 in reply to:  1 ; Changed 11 years ago by soulyeller@…

Thanks for pointing out the problems for the portfile. I have tried to correct all the problems pointed out by ryandesign. However, I do not know how to create universal-compatible portfile. Since I am very new to macport - only 2 days of experience, I do not know where to find the documentation for creating universal-compatible portfile.

Replying to ryandesign@…:

Thanks, but there are some lint warnings:

$ port lint --nitpick
--->  Verifying Portfile for util-linux
Warning: Line 9 has trailing whitespace before newline
Warning: Line 21 seems to hardcode the version number, consider using ${version} instead
Warning: Line 22 has trailing whitespace before newline
Warning: Line 22 seems to hardcode the version number, consider using ${version} instead
Warning: Line 48 has trailing whitespace before newline
--->  0 errors and 5 warnings found.

It does not install with the universal variant:

$ sudo port install +universal
--->  Computing dependencies for util-linux
Error: Cannot install util-linux for the arch(s) 'i386 x86_64' because
Error: its dependency binutils does not build for the required arch(s) by default
Error: and does not have a universal variant.
Error: Unable to execute port: architecture mismatch

And there appears to be a conflict with the getopt port:

$ sudo port install -- -universal
--->  Computing dependencies for util-linux
--->  Fetching distfiles for util-linux
--->  Attempting to fetch util-linux-2.22.tar.gz from http://www.kernel.org/pub/linux/utils/util-linux/v2.22/
--->  Verifying checksum(s) for util-linux
--->  Extracting util-linux
--->  Configuring util-linux
--->  Building util-linux
--->  Staging util-linux into destroot
--->  Installing util-linux @2.22_0
--->  Activating util-linux @2.22_0
Error: org.macports.activate for port util-linux returned: Image error: /opt/local/bin/getopt is being used by the active getopt port.  Please deactivate this port first, or use 'port -f activate util-linux' to force the activation.
Please see the log file for port util-linux for details:
    /opt/local/var/macports/logs/_Users_rschmidt_macports_dports_devel_util-linux/util-linux/main.log
To report a bug, follow the instructions in the guide:
    http://guide.macports.org/#project.tickets
Error: Processing of port util-linux failed

There is a problem with the documentation directory; it has been created without execute permission (needs to be mode 755 not 644):

$ ls -l work/destroot/opt/local/share/doc/util-linux/
ls: rev.1: Permission denied

This loop is not correct:

    foreach file {README NEWS ChangeLog COPYING AUTHORS ABOUT-NLS} {
      xinstall -m 644 ${worksrcpath}/${path}.1 ${destroot}${prefix}/share/doc/${name}
    }

You loop for the variable file but then do not use the variable file in the loop. You don't need a loop either; you can use xinstall -W:

    xinstall -m 644 -W ${worksrcpath} README NEWS ChangeLog COPYING AUTHORS ABOUT-NLS ${destroot}${prefix}/share/doc/${name}

comment:4 in reply to:  3 Changed 11 years ago by larryv (Lawrence Velázquez)

Replying to soulyeller@…:

However, I do not know how to create universal-compatible portfile. Since I am very new to macport - only 2 days of experience, I do not know where to find the documentation for creating universal-compatible portfile.

The problem is that one of your dependencies, binutils, cannot be installed +universal. You can:

  1. Remove the dependency on binutils. Not having looked at the software you're installing, I don't know whether this is a viable option.
  2. Set universal_variant no in your Portfile. It's not the end of the world if the port can't be installed +universal.

comment:5 Changed 11 years ago by ryandesign (Ryan Carsten Schmidt)

Resolution: fixed
Status: newclosed

Thanks for the changes. Committed in r101422 with these further changes:

  • updated to 2.22.2
  • used smaller xz distfile
  • more specific license (GPL-2+ instead of GPL)
  • gettext and ncurses are library dependencies not just build dependencies
  • diffutils, binutils and zlib don't appear to be used at all (the port built fine when they were deactivated) so I removed them from the build dependencies; removing binutils means the port can now build universal
  • disabled silent build rules to get more verbose information in the build log
  • removed duplicate configure args and sorted remaining args alphabetically
  • fixed permissions of documentation directory (755 not 644)
  • reformatted slightly, including changing a few remaining tabs to spaces
Note: See TracTickets for help on using tickets.