--- /dev/null
+#!/bin/bash
+
+# This file is part of NIT ( http://www.nitlanguage.org ).
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+# This shell script creates (or overrides) a package.ini template file in the current directory.
+# The result must be examined and adapted.
+#
+# Default values are guessed from git and the file system.
+
+name=`basename $PWD`
+maintainer=`git shortlog -esn . | head -n 1 | sed 's/\s*[0-9]*\s*//'`
+dir=`git rev-parse --show-prefix`
+git=`git remote get-url origin`
+
+# Setup default keys.
+# The following values works for Github and Gitlab
+root=${git%.git}
+browse=$root
+homepage=$root
+if [ -n "$dir" ]; then
+ browse=$root/tree/master/$dir
+fi
+issues=$root/issues
+
+# Special cases to override
+case "$git" in
+ */nit.git)
+ # For projects on the main Nit tree
+ license=Apache-2.0
+ git=https://github.com/nitlang/nit.git
+ homepage=http://nitlanguage.org
+ root=https://github.com/nitlang/nit
+ browse=$root/tree/master/$dir
+ issues=$root/issues
+ ;;
+esac
+
+# Generate the `package.ini` file
+sed '/^$/d' > package.ini <<SUPERCALIFRAGILISTICEXPIALIDOCIOUS
+[package]
+name=$name
+tags=
+maintainer=$maintainer
+license=$license
+[upstream]
+browse=$browse
+git=$git
+`test -n "$dir" && echo "git.directory=$dir"`
+homepage=$homepage
+issues=$issues
+SUPERCALIFRAGILISTICEXPIALIDOCIOUS