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.
28 echo "nit-makepackage: creates a package.ini in the current directory"
29 echo "There is no option (yet)"
33 echo >&2 "nit-makepackage does not accept options yet"
41 maintainer=`git shortlog -esn . | head -n 1 | sed 's/\s*[0-9]*\s*//'`
42 dir=`git rev-parse --show-prefix`
43 git=`git remote get-url origin`
46 # The following values works for Github and Gitlab
50 if [ -n "$dir" ]; then
51 browse=$root/tree/master/$dir
55 # Special cases to override
58 # For projects on the main Nit tree
60 git=https://github.com/nitlang/nit.git
61 homepage=http://nitlanguage.org
62 root=https://github.com/nitlang/nit
63 browse=$root/tree/master/$dir
68 # Generate the `package.ini` file
69 sed '/^$/d' > package.ini <<SUPERCALIFRAGILISTICEXPIALIDOCIOUS
73 maintainer=$maintainer
78 `test -n "$dir" && echo "git.directory=$dir"`
81 SUPERCALIFRAGILISTICEXPIALIDOCIOUS