|
|
@ -151,132 +151,34 @@ read_fm_config() { |
|
|
|
fi |
|
|
|
} |
|
|
|
|
|
|
|
if [ "$1" = "-main" ] ; then |
|
|
|
create_main=1 |
|
|
|
shift |
|
|
|
fi |
|
|
|
|
|
|
|
if [ $# -lt 2 -o $# -gt 2 ] ; then |
|
|
|
cat <<-EEE |
|
|
|
Usage: |
|
|
|
$0 <option> package/repository/packagename freshmeat-package-name |
|
|
|
|
|
|
|
Where <option> may be: |
|
|
|
-main Create a package.conf file with main-function |
|
|
|
|
|
|
|
EEE |
|
|
|
if [ $# -ne 1 ]; then |
|
|
|
echo "Usage: $0 <name>" >&2 |
|
|
|
exit 1 |
|
|
|
elif ! read_fm_config "$1"; then |
|
|
|
echo "$1: not found in freshmeat" >&2 |
|
|
|
exit 1 |
|
|
|
fi |
|
|
|
|
|
|
|
|
|
|
|
dir=${1#package/} ; shift |
|
|
|
package=${dir##*/} |
|
|
|
if [ "$package" = "$dir" ]; then |
|
|
|
echo "failed" |
|
|
|
echo -e "\t$dir must be <rep>/<pkg>!\n" |
|
|
|
exit |
|
|
|
fi |
|
|
|
|
|
|
|
rep="$( echo package/*/$package | cut -d'/' -f 2 )" |
|
|
|
if [ "$rep" != "*" ]; then |
|
|
|
echo "failed" |
|
|
|
echo -e "\tpackage $package belongs to $rep!\n" |
|
|
|
exit |
|
|
|
fi |
|
|
|
|
|
|
|
rep=${dir/\/$package/} |
|
|
|
maintainer='The OpenSDE Community <list@opensde.org>' |
|
|
|
|
|
|
|
echo -n "Creating package/$dir ... " |
|
|
|
if [ -e package/$dir ] ; then |
|
|
|
echo "failed" |
|
|
|
echo -e "\tpackage/$dir already exists!\n" |
|
|
|
exit |
|
|
|
fi |
|
|
|
if mkdir -p package/$dir ; then |
|
|
|
echo "ok" |
|
|
|
else |
|
|
|
echo "failed" |
|
|
|
exit |
|
|
|
fi |
|
|
|
|
|
|
|
cd package/$dir |
|
|
|
rc="ROCK-COPYRIGHT" |
|
|
|
download_file= |
|
|
|
download_url= |
|
|
|
|
|
|
|
if ! read_fm_config $1; then |
|
|
|
echo "Error or wrong freshmeat package name" |
|
|
|
exit 1 |
|
|
|
fi |
|
|
|
|
|
|
|
echo -n "Creating $package.desc ... " |
|
|
|
note=SDE-COPYRIGHT-NOTE |
|
|
|
cat > $package.desc <<EOF |
|
|
|
[COPY] --- $note-BEGIN --- |
|
|
|
[COPY] This copyright note is auto-generated by ./scripts/Create-CopyPatch. |
|
|
|
[COPY] |
|
|
|
[COPY] Filename: package/.../$package/$package.desc |
|
|
|
[COPY] Copyright (C) $( date +%Y ) The OpenSDE Project |
|
|
|
[COPY] |
|
|
|
[COPY] More information can be found in the files COPYING and README. |
|
|
|
[COPY] |
|
|
|
[COPY] This program is free software; you can redistribute it and/or modify |
|
|
|
[COPY] it under the terms of the GNU General Public License as published by |
|
|
|
[COPY] the Free Software Foundation; version 2 of the License. A copy of the |
|
|
|
[COPY] GNU General Public License can be found in the file COPYING. |
|
|
|
[COPY] --- $note-END --- |
|
|
|
|
|
|
|
EOF |
|
|
|
|
|
|
|
# [I] |
|
|
|
title="`echo "$title" | sed 's/^\(.\)/\U\1/ ; s/\.$//'`" |
|
|
|
cat >>$package.desc <<EOF |
|
|
|
[I] ${title:-TODO: Title} |
|
|
|
|
|
|
|
EOF |
|
|
|
[ -z "$title" ] || echo "[I] $title" |
|
|
|
|
|
|
|
# [T] |
|
|
|
desc="`echo "$desc" | sed '1s/^\(.\)/\U\1/ ; s/\. *\(.\)/. \U\1/g'`" |
|
|
|
while read l; do |
|
|
|
echo "[T] $l" >>$package.desc |
|
|
|
done < <(echo ${desc:-TODO: Description} | fmt --width 75) |
|
|
|
|
|
|
|
cat >>$package.desc <<EOF |
|
|
|
|
|
|
|
[U] ${url:-TODO: URL} |
|
|
|
|
|
|
|
[A] $dev_name $dev_mail |
|
|
|
[M] ${maintainer:-TODO: Maintainer} |
|
|
|
|
|
|
|
[C] TODO: Category |
|
|
|
|
|
|
|
[L] ${license:-TODO: License} |
|
|
|
[S] ${status:-TODO: Status} |
|
|
|
[V] ${version:-TODO: Version} |
|
|
|
[P] X -----5---9 800.000 |
|
|
|
EOF |
|
|
|
|
|
|
|
if [ "$download_file" ]; then |
|
|
|
cat >>$package.desc <<-EOF |
|
|
|
|
|
|
|
[D] 0 $download_file $download_url |
|
|
|
EOF |
|
|
|
if [ -n "$desc" ]; then |
|
|
|
echo "$desc" | fmt --width 75 | sed -e 's,^,[T] ,' |
|
|
|
fi |
|
|
|
|
|
|
|
echo "ok" |
|
|
|
echo -n "Creating $package.conf ... " |
|
|
|
|
|
|
|
if [ "$create_main" = "1" ] ; then |
|
|
|
cat >>$package.conf <<-EOF |
|
|
|
${package}_main() { |
|
|
|
: TODO |
|
|
|
} |
|
|
|
|
|
|
|
custmain="${package}_main" |
|
|
|
EOF |
|
|
|
fi |
|
|
|
# [U] |
|
|
|
[ -z "$url" ] || echo "[U] $url" |
|
|
|
# [A] |
|
|
|
[ -z "$dev_name$dev_mail" ] || echo "[A] $dev_name $dev_mail" |
|
|
|
# [L] |
|
|
|
[ -z "$license" ] || echo "[L] $license" |
|
|
|
# [S] |
|
|
|
[ -z "$status" ] || echo "[S] $status" |
|
|
|
# [V] |
|
|
|
[ -z "$version" ] || echo "[S] $version" |
|
|
|
# [D] |
|
|
|
[ -z "$download_file" ] || echo "[D] 0 $download_file $download_url" |
|
|
|
|
|
|
|
echo "ok" |
|
|
|
echo "Remember to fill in the TODO's:" |
|
|
|
cd - |
|
|
|
grep TODO package/$dir/$package.* |
|
|
|
echo |