3 #--- T2-COPYRIGHT-NOTE-BEGIN ---
4 #T2 SDE: scripts/Create-Pkg
5 #Copyright (C) 2004 - 2024 The T2 SDE Project
6 #Copyright (C) 1998 - 2003 ROCK Linux Project
8 #This Copyright note is generated by scripts/Create-CopyPatch,
9 #more information can be found in the files COPYING and README.
11 #This program is free software; you can redistribute it and/or modify
12 #it under the terms of the GNU General Public License version 2.
13 # --- T2-COPYRIGHT-NOTE-END ---
19 $0 [ package/repository/packagename ] url < url-2 ... >
27 info
= text
= url
= author
= category
= license
=GPL status
=Beta code
=
28 maintainer
='The T2 Project <t2@t2-project.org>'
32 dir
=${1#package/}; shift
39 dir
=kde category
=extra
/desktop
/kde author
="KDE Project"
40 code
=". \$base/package/*/*/kde-conf.in"
43 dir
=gnome category
=extra
/desktop
/gnome author
="GNOME Project"
44 code
=". \$base/package/*/*/gnome-conf.in"
47 curl
${1/github.com/api.github.com/repos} > repotmpfile
48 curl
${1/github.com/api.github.com/repos}/releases
> releasetmpfile
51 ver
=$
(jq
-r '.[0].tag_name' releasetmpfile
)
52 info
=$
(jq
-r .description repotmpfile
)
53 author
=$
(jq
-r .owner.login repotmpfile
)
54 license
=$
(jq
-r .license.spdx_id repotmpfile
)
56 [[ "$ver" != 0* ]] && status
=Stable
59 set -- "${url}/archive/${ver}/${url##*/}-${ver/v/}.tar.gz"
60 rm -f repotmpfile releasetmpfile
74 if [ "$pkg" = "$dir" ]; then
76 echo " $dir must be <rep>/<pkg>!"
80 rep
="$(echo package/*/$pkg | cut -d'/' -f 2)"
81 if [ "$rep" != "*" ]; then
83 echo " package $pkg belongs to $rep!"
88 confdir
="package/$dir"
90 echo -n "Creating $confdir ... "
91 if [ -e $confdir ]; then
93 echo " $confdir already exists!"
96 if ! mkdir
-p $confdir; then
101 echo -n "Creating $pkg.desc ... "
102 cat >$confdir/$pkg.desc
<<EOT
118 [P] X -----5---9 400.000
124 " >> $confdir/$pkg.desc
127 echo "[D] 0 ${dl##*/} ${dl%/*}/" >> $confdir/$pkg.desc
130 touch $confdir/$pkg.cache
133 echo "Remember to fill in the TODO's:"
134 grep '^\[.\] $' $confdir/$pkg.desc
136 scripts
/Create-CopyPatch
$confdir/$pkg.desc |
patch -p1
138 scripts
/Config
-oldconfig
139 scripts
/Emerge-Pkg
$pkg