Kaydet (Commit) 31c44cab authored tarafından Your Name's avatar Your Name

makekagami removed and inary-template improvement

üst b61ca4fc
......@@ -19,7 +19,8 @@ def ctag(tag):
return "{}</{}>".format(("\t"*tab),tag)
import sys, os
sys.path.insert(0,os.getcwd())
from pspec import inary
# pspec başı
print('<?xml version="1.0" ?>')
......@@ -31,6 +32,8 @@ print()
print(otag("Source"))
print(write("Name",inary.source.name))
print(write("Homepage",inary.source.homepage))
if hasattr(inary.source,"rfp"):
print(write("Rfp",inary.source.rfp))
print(otag("Packager"))
print(write("Name",inary.source.packager.name))
print(write("Email",inary.source.packager.email))
......
......@@ -305,6 +305,98 @@ echo "</INARY>"
}
write_pspec_class(){
echo "class inary:"
echo " class source:"
echo " name = \"$name\""
echo " homepage = \"$homepage\""
if [ "$rfp" == "true" ] ; then
echo " rfp= \"$rfpdescription\""
else
echo " #rfp= \"$rfpdescription\""
fi
echo ""
echo " class packager:"
echo " name = \"$packager\""
echo " email = \"$email\""
echo " license = \"$license\""
echo -n " isa = ["
for i in $isa ; do
echo -n "\"$isa\","
done
echo "]"
echo " summary = \"$summary\""
echo " description = \"$description\""
echo -n " archive = ["
for i in $src ; do
echo "(\"FIXME\",\"$i\"),"
echo -n " "
done
echo "]"
echo -n " builddependencies = ["
for i in $bdeps ; do
echo "\"$i\","
done
echo "]"
echo " packages = [\"package\",\"package_docs\" , \"package_devel\","
echo " \"package_pages\", \"package_32bit\"]"
echo ""
echo " class package:"
echo " name = \"$name\""
echo -n " runtimedependencies = ["
for i in $rdeps ; do
echo "\"$i\","
done
echo "]"
echo " files = [(\"config\", \"/etc\"),"
echo " (\"localedata\", \"/usr/share/locale\"),"
echo " (\"info\", \"/usr/share/info\"),"
echo " (\"data\", \"/usr/share\"),"
echo " (\"executable\", \"/usr/bin\"),"
echo " (\"library\", \"/usr/lib\"),"
echo " (\"library\", \"/lib\"),"
echo " (\"library\", \"/usr/libexec\"),"
echo " (\"executable\", \"/bin\")]"
echo ""
echo " class package_docs:"
echo " name = \"${name}-docs\""
echo " runtimedependencies = [\"$name\"]"
echo " files = [(\"library\", \"/usr/share/doc/\")]"
echo ""
echo " class package_pages:"
echo " name = \"${name}-pages\""
echo " runtimedependencies = [\"$name\"]"
echo " files = [(\"library\", \"/usr/share/doc/\")]"
echo ""
echo " class package_32bit:"
echo " name = \"${name}-32bit\""
echo -n " runtimedependencies = ["
for i in $rdeps ; do
echo "\"$i-32bit\","
done
echo "]"
echo " files = [(\"library\", \"/usr/lib32\"),"
echo " (\"library\", \"/lib32\")]"
echo ""
echo " class package_devel:"
echo " name = \"${name}-devel\""
echo -n " runtimedependencies = ["
for i in $rdeps ; do
echo "\"$i-devel\","
done
echo "]"
echo " files = [(\"data\", \"/usr/lib/pkgconfig\"),"
echo " (\"header\", \"/usr/include\")]"
echo ""
echo " class history:"
echo " update = ["
echo " [\"$(date "+%Y-%m-%d")\", \"$ver\", \"First release\","
echo " \"$packager\", \"$email\"],"
echo " ]"
}
write_actions(){
cat << EOF
#!/usr/bin/env python3
......@@ -362,6 +454,7 @@ directory=$(realpath $directory)
mkdir -p $directory
info "Creating" "pspec.xml to $directory/pspec.xml"
write_pspec > $directory/pspec.xml
write_pspec_class > $directory/pspec.py
info "Creating" "actions.py to $directory/actions.py"
write_actions > $directory/actions.py
......
#!/bin/bash
set -e
ataraxia-meson(){
meson setup \
--prefix /usr \
--libexecdir lib \
--sbindir bin \
--buildtype plain \
--auto-features enabled \
--wrap-mode nodownload \
-D b_lto=true \
-D b_pie=true \
"$@"
}
export SRC=$(pwd)/build
export PKG=$(pwd)/install
export CC=gcc
export CXX=g++
source KagamiBuild
[ -d build ] && rm -rf build
[ -d install ] && rm -rf install
[ -d inary ] && rm -rf inary
mkdir -p "$SRC"/$name-$version || true
mkdir inary || true
mkdir -p $PKG || true
cd $SRC
for s in $source
do
if basename $s | grep ".git$" &>/dev/null ; then
git clone $s
else
wget $s
basename $s | grep ".tar.*$" && tar -xf $(basename $s)
fi
done
build
cd $PKG
[ -f ../install.tar.xz ] && rm -f ../install.tar.xz
tar --xz -cf ../install.tar.xz *
echo -e "<Files>" > ../files.xml
find | sed "s|^\./||g" | while read line
do
if [ -f $line ] ; then
echo -e " <File>" >> ../files.xml
echo -e " <Path>$line</Path>" >> ../files.xml
echo -e " <Type>data</Type>" >> ../files.xml
echo -e " <Size>$(du -b $line | awk '{print $1}')</Size>" >> ../files.xml
echo -e " <Uid>0</Uid>" >> ../files.xml
echo -e " <Gid>0</Gid>" >> ../files.xml
echo -e " <Mode>0o755</Mode>" >> ../files.xml
echo -e " <Hash>$(sha1sum $line | awk '{print $1}')</Hash>" >> ../files.xml
echo -e " </File>" >> ../files.xml
fi
done
echo -e "</Files>" >> ../files.xml
cd ..
mv install.tar.xz inary/install.tar.xz
mv files.xml inary/files.xml
export url="$(cat KagamiBuild | grep '# URL:'| head -n 1 | awk '{print $3}')"
export pkgdesc="$(cat KagamiBuild | grep '# Description:'| head -n 1 | sed 's/^# Description://g')"
export depends=($(cat KagamiBuild | grep '# Depends on:'| head -n 1 | sed "s/^# Depends on://g"))
export license="unknown"
export installtarhash="$(sha1sum inary/install.tar.xz | awk '{print $1}')"
{
echo -e "<INARY>"
echo -e " <Source>"
echo -e " <Name>$name</Name>"
echo -e " <Homepage>$url</Homepage>"
echo -e " <Packager>"
echo -e " <Name>Auto generated</Name>"
echo -e " <Email>auto@generat.et</Email>"
echo -e " </Packager>"
echo -e " </Source>"
echo -e " <Package>"
echo -e " <RFP></RFP>"
echo -e " <PartOf>ataraxia</PartOf>"
echo -e " <Name>$name</Name>"
echo -e " <Summary xml:lang=\"en\">$pkgdesc</Summary>"
echo -e " <Description xml:lang=\"en\">$pkgdesc</Description>"
echo -e " <IsA>app</IsA>"
echo -e " <License>$license</License>"
echo -e " <RuntimeDependencies>"
for dep in ${depends[@]}
do
echo -e " <Dependency>$dep</Dependency>"
done
echo -e " </RuntimeDependencies>"
echo -e " <Files>"
echo -e " <Path fileType=\"data\">/usr</Path>"
echo -e " <Path fileType=\"data\">/etc</Path>"
echo -e " <Path fileType=\"data\">/bin</Path>"
echo -e " <Path fileType=\"data\">/var</Path>"
echo -e " <Path fileType=\"data\">/lib</Path>"
echo -e " <Path fileType=\"data\">/boot</Path>"
echo -e " </Files>"
echo -e " <History>"
echo -e " <Update release=\"1\">"
echo -e " <Date>2020-04-24</Date>"
echo -e " <Version>$version</Version>"
echo -e " <Comment>Auto generated.</Comment>"
echo -e " <Name>Auto generated</Name>"
echo -e " <Email>auto@generat.et</Email>"
echo -e " </Update>"
echo -e " </History>"
echo -e " <BuildHost>uludag</BuildHost>"
echo -e " <Distribution>Sulin</Distribution>"
echo -e " <DistributionRelease>2019</DistributionRelease>"
echo -e " <Architecture>x86_64</Architecture>"
echo -e " <InstalledSize>1</InstalledSize>"
echo -e " <InstallTarHash>$installtarhash</InstallTarHash>"
echo -e " <PackageFormat>1.2</PackageFormat>"
echo -e " </Package>"
echo -e "</INARY>"
} > inary/metadata.xml
cd inary
zip -r ../$name-$version-$(uname -m).inary ./*
......@@ -231,7 +231,6 @@ setup(name="inary",
'scripts/revdep-rebuild',
'scripts/sulinstrapt',
'scripts/makepkg',
'scripts/makekagami',
'scripts/mkdeb',
'scripts/revdep-rebuild-devel',
'scripts/inary-sandbox',
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment