pkg-manifest-generate.pl revision 970
98N/A# Copyright (c) 2010, Oracle and/or its affiliates. All rights reserved. 98N/A# Permission is hereby granted, free of charge, to any person obtaining a 98N/A# copy of this software and associated documentation files (the "Software"), 98N/A# to deal in the Software without restriction, including without limitation 98N/A# the rights to use, copy, modify, merge, publish, distribute, sublicense, 98N/A# and/or sell copies of the Software, and to permit persons to whom the 98N/A# Software is furnished to do so, subject to the following conditions: 98N/A# The above copyright notice and this permission notice (including the next 98N/A# paragraph) shall be included in all copies or substantial portions of the 98N/A# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 98N/A# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 98N/A# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL 98N/A# THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 98N/A# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 98N/A# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER 98N/A# DEALINGS IN THE SOFTWARE. 98N/A# Script to generate a package manifest for use with pkg(5) from a 98N/A# temporary proto area 98N/A# If <manifest input> exists, it is merged into the output. 98N/A# If <manifest input> does not exist, <license file> is included in the output 98N/A# The result is written to <manifest output>, or stdout if not specified 98N/A die (
"Must specify $opt $message\n");
98N/A die (
"Must specify only one value for $opt $message\n");
98N/A# Check if there is an existing manifest to merge with 98N/A open my $
INPUT_MF,
'<', $
mf or die "Cannot open input_manifest $mf: $!\n";
98N/A if ($
im =~ m{^(.*)\\$}) {
# Line continues 98N/A# Generate a manifest header if not merging into an existing file 98N/A (
'manifest_license',
'when not merging with existing manifest.');
98N/A open my $
LICENSE,
'<', $
lf or die "Cannot open manifest_license $lf: $!\n";
'when not merging with existing manifest.');
'value="XXX: Please provide a descriptive paragraph for the package."';
foreach my $
bdir (
glob(
"build-*/$sdir")) {
# First try looking in a README file for a short summary my $
rf =
join(
'/', $
bdir,
'README');
last if $
readme =~ m{^[\-=\s]*$};
# Then try looking in man pages push @
manpage,
glob(
"$bdir/*.man");
# Remove backslashes, such as \- instead of - 'XXX: Please provide a short name for the package';
if (
exists $
options{
'classification'}) {
'value="org.opensolaris.category.2008:',
'with the name used for the subdirectory containing 64-bit objects');
'for files to include in manifest');
# Skip -uninstalled.pc files, since those are only used during build # Convert 64-bit subdirectories to platform-independent form # Don't add duplicates of actions we've already got # Drop file path from file actions, so we always use the path attribute # Drop attributes that will be generated during package build