3 # This file is part of NIT ( http://www.nitlanguage.org ).
5 # Licensed under the Apache License, Version 2.0 (the "License");
6 # you may not use this file except in compliance with the License.
7 # You may obtain a copy of the License at
9 # http://www.apache.org/licenses/LICENSE-2.0
11 # Unless required by applicable law or agreed to in writing, software
12 # distributed under the License is distributed on an "AS IS" BASIS,
13 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 # See the License for the specific language governing permissions and
15 # limitations under the License.
17 # This shell script creates (or overrides) a package.ini template file in the current directory.
18 # The result must be examined and adapted.
20 # Default values are guessed from git and the file system.
23 maintainer=`git shortlog -esn . | head -n 1 | sed 's/\s*[0-9]*\s*//'`
24 dir=`git rev-parse --show-prefix`
25 git=`git remote get-url origin`
28 # The following values works for Github and Gitlab
32 if [ -n "$dir" ]; then
33 browse=$root/tree/master/$dir
37 # Special cases to override
40 # For projects on the main Nit tree
42 git=https://github.com/nitlang/nit.git
43 homepage=http://nitlanguage.org
44 root=https://github.com/nitlang/nit
45 browse=$root/tree/master/$dir
50 # Generate the `package.ini` file
51 sed '/^$/d' > package.ini <<SUPERCALIFRAGILISTICEXPIALIDOCIOUS
55 maintainer=$maintainer
60 `test -n "$dir" && echo "git.directory=$dir"`
63 SUPERCALIFRAGILISTICEXPIALIDOCIOUS