Opened 8 years ago

Closed 8 years ago

#52277 closed enhancement (fixed)

apache2: packaging support

Reported by: ctreleaven (Craig Treleaven) Owned by: ryandesign (Ryan Carsten Schmidt)
Priority: Normal Milestone:
Component: ports Version: 2.3.4
Keywords: haspatch Cc:
Port: apache2

Description

I'm working on building an installer for mythtv.28. Myth includes a MAMP application (MythWeb) which relies on apache2. However, a MacPorts-produced mpkg or mdmg that includes apache2 will not run properly as daemondo will not be included. Ideally, the following snippet of code should be included in apache2 to fix this issue:

if {[info exists pkg.asroot]} {
	pkg.asroot              yes
}

pre-pkg {
    if {![info exists pkg.asroot]} {
    	ui_error "Packaging ${name} ${version} requires MacPorts 2.3.5 or greater (pkg.asroot support)"
        return -code error "Incompatible MacPorts version"
    }

    # at this point the destroot has been pruned and bin doesn't exist
    xinstall -d -m 0755 ${destroot}${prefix}/bin
    # apache2 needs daemondo; ram a copy into the destroot so it will be packaged
    xinstall -m 0755 ${prefix}/bin/daemondo ${destroot}${prefix}/bin/
}

Note that this relies on 'pkg.asroot yes' which is an unreleased feature of MacPorts base. (Scheduled for 2.3.5.) Packaging will fail if this is run on 2.3.4 or earlier but that is preferable to creating an incomplete pkg.

The above only impacts the 'pkg' phase; there is no change to the files that apache2 normally installs. As such, a rev bump is not even necessary.

Change History (2)

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

Look good, feel free to commit it.

comment:2 Changed 8 years ago by ctreleaven (Craig Treleaven)

Resolution: fixed
Status: newclosed

Done in r152906

Note: See TracTickets for help on using tickets.