3 # Written by Benjamin Schieder <blindcoder@scavenger.homeip.net>
6 # newpackage.sh [-main] <rep>/<pkg> http://www.example.com/down/pkg.tar.bz2
8 # will create <pkg>.desc and <pkg>.conf. .desc will contain the [D] and [COPY]
9 # already filled in. The other tags are mentioned with TODO.
11 # .conf will contain an empty <pkg>_main() { } and custmain="<pkg>_main"
12 # if -main is specified.
14 # --- T2-COPYRIGHT-NOTE-BEGIN ---
15 # This copyright note is auto-generated by ./scripts/Create-CopyPatch.
17 # T2 SDE: misc/archive/newpackage.sh
18 # Copyright (C) 2004 - 2005 The T2 SDE Project
19 # Copyright (C) 1998 - 2003 ROCK Linux Project
21 # More information can be found in the files COPYING and README.
23 # This program is free software; you can redistribute it and/or modify
24 # it under the terms of the GNU General Public License as published by
25 # the Free Software Foundation; version 2 of the License. A copy of the
26 # GNU General Public License can be found in the file COPYING.
27 # --- T2-COPYRIGHT-NOTE-END ---
30 if [ "$1" == "-main" ] ; then
35 if [ $# -lt 2 ] ; then
38 $0 <option> package/repository/packagename Download_1 < Download_2, Download_n >
40 Where <option> may be:
41 -main Create a package.conf file with main-function
48 dir
=${1#package/} ; shift
50 if [ "$package" = "$dir" ]; then
52 echo -e "\t$dir must be <rep>/<pkg>!\n"
56 rep
="$( echo package/*/$package | cut -d'/' -f 2 )"
57 if [ "$rep" != "*" ]; then
59 echo -e "\tpackage $package belongs to $rep!\n"
63 rep
=${dir/\/$package/}
64 confdir
="package/$dir"
65 maintainer
='The T2 Project <t2@t2-project.org>'
67 echo -n "Creating $confdir ... "
68 if [ -e $confdir ] ; then
70 echo -e "\t$confdir already exists!\n"
73 if mkdir
-p $confdir ; then
80 echo -n "Creating $package.desc ... "
81 cat >$confdir/$package.desc
<<EEE
82 [I] TODO: Short Information
84 [T] TODO: Long Expanation
85 [T] TODO: Long Expanation
86 [T] TODO: Long Expanation
87 [T] TODO: Long Expanation
88 [T] TODO: Long Expanation
93 [M] ${maintainer:-TODO: Maintainer}
100 [P] X -----5---9 800.000
106 file=`echo $dl | sed 's,^.*/,,g'`
108 echo [D
] 0 $file $server >> $confdir/$package.desc
110 echo >> $confdir/$package.desc
113 echo -n "Creating $package.conf ... "
115 if [ "$create_main" == "1" ] ; then
116 cat >>$confdir/$package.conf
<<-EEE
121 custmain="${package}_main"
126 echo "Remember to fill in the TODO's:"
127 grep TODO
$confdir/$package.
*