LeoIannacone / npm2deb

tool to help debianize Node.js modules
GNU General Public License v3.0
46 stars 34 forks source link

Provides debian/upstream/metadata #103

Closed guimard closed 5 years ago

guimard commented 6 years ago

Hello, please provide debian/upstream/metadata during creation. It is now required by policy. Regards, Xavier

guimard commented 5 years ago

Here is a simple way to do it (in shell):

#!/bin/sh

set -e

if test -e debian/upstream/metadata; then
        echo "debian/upstream/metadata found" >&2
        exit 1
fi

upstream=`perl -ne 'if(s@.*github.com/([^/]+)/([^/#]+).*$@$1/$2@){print;exit}' debian/copyright`

if test "$upstream" = ""; then
        echo "Trying control" >&2
        upstream=`perl -ne 'if(s@.*github.com/([^/]+)/([^/#]+).*$@$1/$2@){print;exit}' debian/control`
fi
if test "$upstream" = ""; then
        echo Not found >&2
        exit 1
fi

name=${upstream#*/}

mkdir -p debian/upstream
cat >debian/upstream/metadata <<EOF
---
Archive: GitHub
Bug-Database: https://github.com/$upstream/issues
Contact: https://github.com/$upstream/issues
Name: $name
Repository: https://github.com/$upstream.git
Repository-Browse: https://github.com/$upstream
EOF