# HG changeset patch # User Christophe Lincoln # Date 1245547575 -7200 # Node ID c075da96e08a8b13abc22c4d987d9ac1d11c13dd # Parent 300e77088e0f1907d14f3964233c276704ecb47d Add Tazpkg-web - SliTaz Packages Web interface diff -r 300e77088e0f -r c075da96e08a tazpkg-web/receipt --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/tazpkg-web/receipt Sun Jun 21 03:26:15 2009 +0200 @@ -0,0 +1,53 @@ +# SliTaz package receipt. + +PACKAGE="tazpkg-web" +VERSION="1.0" +CATEGORY="network" +SHORT_DESC="SliTaz packages Web interfaces (http://pkgs.slitaz.org/)." +MAINTAINER="pankso@slitaz.org" +DEPENDS="lighttpd" +WEB_SITE="http://www.slitaz.org/" +CONFIGS="/etc/slitaz/tazpkg-web.conf" + +# Rules to gen a SliTaz package suitable for Tazpkg. +genpkg_rules() +{ + mkdir -p \ + $fs/usr/bin \ + $fs/etc/slitaz \ + $fs/var/lib/tazpkg-web + # Page generator and config file. + cp stuff/tazpkg-web $fs/usr/bin + cp stuff/tazpkg-web.conf $fs/etc/slitaz + # Var libs + for i in html style xml search.cgi + do + cp -a stuff/$i $fs/var/lib/tazpkg-web + done + chmod 755 $fs/usr/bin/* + chown -R root.root $fs +} + +post_install() +{ + # On Tank we have pkgs.slitaz.org virtual host in: /home/slitaz/www + if [ -d $1/home/slitaz/www/pkgs ]; then + # Overwrite existing files. + cp -a $1/var/lib/tazpkg-web/style/* $1/home/slitaz/www/pkgs + cp -a $1/var/lib/tazpkg-web/search.cgi $1/home/slitaz/www/pkgs + sed -i 's|/var/www/vhosts/pkgs|/home/slitaz/www/pkgs|' \ + $1/etc/slitaz/tazpkg-web.conf + else + cat << _EOT_ + +To have Tazpkg-web interface on your local system you can add a vhost +to Lighttp (or Apache) and the hostname to /etc/hosts. And must copy +files from: /var/lib/tazpkg-web. Example: + + # mkdir -p /var/www/vhosts/pkgs && cd /var/lib/tazpkg-web + # cp -a search.cgi style/* /var/www/vhosts/pkgs + # tazpkg-web cooking + +_EOT_ + fi +} diff -r 300e77088e0f -r c075da96e08a tazpkg-web/stuff/README --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/tazpkg-web/stuff/README Sun Jun 21 03:26:15 2009 +0200 @@ -0,0 +1,23 @@ +Tazpkg-web - SliTaz Packages Web interface +=============================================================================== + + +Tazpkg-web package provide the files, scripts and search engine used for SliTaz +packages web interface. It not depends on Tazpkg packages manager or Tazwok but +need a wok with receipt and a packages (*.tazpkg) repository to scan and build +the static xHTML pages. Here is a brief overview of the files provided: + + + * html/ : Splitted xHTML template used to generate the full pages + * style/ : CSS style, pics and favicon + * xml/ : RSS template (will be use when merge tazrss) + * search.cgi : CGI search engine using awk, grep, etc (all xHTML harcoded) + * tazpkg-web : Utility who generate the categories and index's pages. + * tazpkg-web.conf : Tazpkg-web utility configuration file. + + +Online : http://pkgs.slitaz.org/ + + +=============================================================================== + diff -r 300e77088e0f -r c075da96e08a tazpkg-web/stuff/html/catlist.html --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/tazpkg-web/stuff/html/catlist.html Sun Jun 21 03:26:15 2009 +0200 @@ -0,0 +1,18 @@ + + + diff -r 300e77088e0f -r c075da96e08a tazpkg-web/stuff/html/footer.html --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/tazpkg-web/stuff/html/footer.html Sun Jun 21 03:26:15 2009 +0200 @@ -0,0 +1,31 @@ + + +
+
+
+
+ + +
+

+Last modification : _DATE_ - +Top of the page +

+

+Copyright © 2009 SliTaz - +GNU General Public License +

+
+ + +
+

+Valid XHTML 1.0 +

+
+ + + diff -r 300e77088e0f -r c075da96e08a tazpkg-web/stuff/html/header.html --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/tazpkg-web/stuff/html/header.html Sun Jun 21 03:26:15 2009 +0200 @@ -0,0 +1,37 @@ + + + + SliTaz _RELEASE_ Packages - _PAGE_ + + + + + + + + + + + + + + + + + + + diff -r 300e77088e0f -r c075da96e08a tazpkg-web/stuff/html/home.html --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/tazpkg-web/stuff/html/home.html Sun Jun 21 03:26:15 2009 +0200 @@ -0,0 +1,46 @@ + +
+
+ + : + + + +
+

+Stable packages | Cooking packages +

+
+ + +
+

+ Stable + Cooking RSS + Documentation + Package management + Cooking + Development + Tazpkg Manual + Support + Wiki + Cookbook + Labs News + Security + Mailing list + Tazwok Manual + Get LiveCD + Web Boot +

+
diff -r 300e77088e0f -r c075da96e08a tazpkg-web/stuff/html/menu.html --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/tazpkg-web/stuff/html/menu.html Sun Jun 21 03:26:15 2009 +0200 @@ -0,0 +1,23 @@ + + diff -r 300e77088e0f -r c075da96e08a tazpkg-web/stuff/search.cgi --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/tazpkg-web/stuff/search.cgi Sun Jun 21 03:26:15 2009 +0200 @@ -0,0 +1,527 @@ +#!/bin/sh +# Tiny CGI search engine for SliTaz packages on http://pkgs.slitaz.org/ +# Christophe Lincoln +# + +read QUERY_STRING +for i in $(echo $QUERY_STRING | sed 's/&/ /g'); do + eval $i +done +LANG=$lang +SEARCH=$query +SLITAZ_VERSION=$version +OBJECT=$object +DATE=`date +%Y-%m-%d\ \%H:%M:%S` +VERSION=cooking +if [ "$REQUEST_METHOD" = "GET" ]; then + SEARCH="" + for i in $(echo $REQUEST_URI | sed 's/[?&]/ /g'); do + SLITAZ_VERSION=cooking + case "$i" in + lang=*) + LANG=${i#*=};; + file=*) + SEARCH=${i#*=} + OBJECT=File;; + desc=*) + SEARCH=${i#*=} + OBJECT=Desc;; + tags=*) + SEARCH=${i#*=} + OBJECT=Tags;; + receipt=*) + SEARCH=${i#*=} + OBJECT=Receipt;; + filelist=*) + SEARCH=${i#*=} + OBJECT=File_list;; + package=*) + SEARCH=${i#*=} + OBJECT=Package;; + depends=*) + SEARCH=${i#*=} + OBJECT=Depends;; + version=s*|version=2*) + SLITAZ_VERSION=stable;; + version=1*) + SLITAZ_VERSION=1.0;; + esac + done + [ -n "$SEARCH" ] && REQUEST_METHOD="POST" +fi + +case "$OBJECT" in +File) selected_file="selected";; +Desc) selected_desc="selected";; +Tags) selected_tags="selected";; +Receipt) selected_receipt="selected";; +File_list) selected_file_list="selected";; +Depends) selected_depends="selected";; +esac + +case "$SLITAZ_VERSION" in +1.0) selected_1="selected";; +stable) selected_stable="selected";; +esac + +# unescape query +SEARCH="$(echo $SEARCH | sed 's/%2B/+/g' | sed 's/%3A/:/g' | sed 's|%2F|/|g')" + +if [ -z "$LANG" ]; then + for i in $(echo $HTTP_ACCEPT_LANGUAGE | sed 's/[,;]/ /g'); do + case "$i" in + fr|de|pt|cn) + LANG=$i + break;; + esac + done +fi + +package="Package" +file="File" +desc="Description" +tags="Tags" +receipt="Receipt" +file_list="File list" +depends="Depends" +search="Search" +cooking="cooking" +stable="stable" +result="Result for : $SEARCH" +noresult="No package $SEARCH" +deptree="Dependency tree for : $SEARCH" +rdeptree="Reverse dependency tree for : $SEARCH" +charset="ISO-8859-1" + +case "$LANG" in + +fr) package="Paquet" + receipt="Recette" + depends="Dépendances" + search="Recherche" + result="Recherche de : $SEARCH" + noresult="Paquet $SEARCH introuvable" + deptree="Arbre des dépendances de $SEARCH" + rdeptree="Arbre inversé des dépendances de $SEARCH" + file_list="Liste des fichiers" + file="Fichier";; + +de) package="Paket" + depends="Abhängigkeiten" + desc="Beschreibung" + search="Suche" + cooking="Cooking" + stable="Stable" + result="Resultate für : $SEARCH" + noresult="Kein Paket für $SEARCH" + deptree="Abhängigkeiten von: $SEARCH" + rdeptree="Abhängigkeit für: $SEARCH" + file_list="Datei liste" + file="Datei";; + +pt) package="Pacote" + search="Buscar" + cooking="cooking" + stable="stable" + result="Resultado para : $SEARCH" + noresult="Sem resultado: $SEARCH" + deptree="Árvore de dependências para: $SEARCH" + rdeptree="Árvore de dependências reversa para: $SEARCH" + depends="Dependências" + desc="Descrição" + file_list="Arquivo lista" + file="Arquivo";; + +cn) package="软件包:" + cooking="å¼€å‘版" + stable="稳定版" + desc="æè¿°" + tags="标签" + depends="ä¾èµ–" + file="文件" + file_list="文件列表" + search="Search" + result="Result for : $SEARCH" + noresult="No package $SEARCH" + deptree="Dependency tree for : $SEARCH" + rdeptree="Reverse dependency tree for : $SEARCH" + charset="UTF-8";; + +*) LANG="en";; + +esac + +WOK=/home/slitaz/$SLITAZ_VERSION/wok + +echo Content-type: text/html +echo + +# Search form +search_form() +{ + cat << _EOT_ + +
+
+ + + : + + + +
+
+_EOT_ +} + +# xHTML Header. +xhtml_header() +{ + cat << _EOF_ + + + + SliTaz Packages - Search $SEARCH + + + + + + + + + + + + + + + + +_EOF_ +} + +# xHTML Footer. +xhtml_footer() +{ + cat << _EOT_ +
+$(ls /home/slitaz/$SLITAZ_VERSION/wok | wc -l) packages and $(unlzma -c /home/slitaz/$SLITAZ_VERSION/packages/files.list.lzma | wc -l) files in $SLITAZ_VERSION database +
+ + + +
+
+
+
+ + +
+

+Dernière modification : $DATE - +Top of the page +

+

+Copyright © 2009 SliTaz - +GNU General Public License +

+ +
+ + +
+

+Valid XHTML 1.0 +

+
+ + + +_EOT_ +} + +# recursive dependencies scan +dep_scan() +{ +for i in $1; do + case " $ALL_DEPS " in + *\ $i\ *) continue;; + esac + ALL_DEPS="$ALL_DEPS $i" + if [ -n "$2" ]; then + echo -n "$2" + ( + . $WOK/$i/receipt + cat << _EOT_ +$PACKAGE : $SHORT_DESC +_EOT_ + ) + fi + [ -f $WOK/$i/receipt ] || continue + DEPENDS="" + . $WOK/$i/receipt + [ -n "$DEPENDS" ] && dep_scan "$DEPENDS" "$2 " +done +} + +# recursive reverse dependencies scan +rdep_scan() +{ +SEARCH=$1 +case "$SEARCH" in +glibc-base|gcc-lib-base) cat <every packages are supposed to depend on them. +EOT + return;; +esac +for i in $WOK/* ; do + DEPENDS="" + . $i/receipt + echo "$(basename $i) $(echo $DEPENDS)" +done | awk -v search=$SEARCH ' +function show_deps(deps, all_deps, pkg, space) +{ + if (all_deps[pkg] == 1) return + all_deps[pkg] = 1 + if (space != "") printf "%s%s\n",space,pkg + for (i = 1; i <= split(deps[pkg], mydeps, " "); i++) { + show_deps(deps, all_deps, mydeps[i],"////" space) + } +} + +{ + all_deps[$1] = 0 + for (i = 2; i <= NF; i++) + deps[$i] = deps[$i] " " $1 +} + +END { + show_deps(deps, all_deps, search, "") +} +' | while read pkg; do + . $WOK/${pkg##*/}/receipt + cat << _EOT_ +$(echo ${pkg%/*} | sed 's|/| |g') $PACKAGE : $SHORT_DESC +_EOT_ +done +} + +# Check package exists +package_exist() +{ + [ -f $WOK/$1/receipt ] && return 0 + cat << _EOT_ + +

$noresult

+
+_EOT_
+	return 1
+}
+
+# Display search form and result if requested.
+if [ "$REQUEST_METHOD" != "POST" ]; then
+	xhtml_header
+	cat << _EOT_
+
+
+
+
+
+
+ + +
+ + +

$package

+

$search

+_EOT_ + search_form + xhtml_footer +else + xhtml_header + cat << _EOT_ + + +
+
+
+
+ + +
+ + +

$package

+

$search

+_EOT_ + search_form + if [ "$OBJECT" = "Depends" ]; then + if package_exist $SEARCH ; then + cat << _EOT_ + +

$deptree

+
+_EOT_
+			ALL_DEPS=""
+			dep_scan $SEARCH ""
+			SUGGESTED=""
+			. $WOK/$SEARCH/receipt
+			if [ -n "$SUGGESTED" ]; then
+				cat << _EOT_
+
+ +

$deptree (SUGGESTED)

+
+_EOT_
+				ALL_DEPS=""
+				dep_scan "$SUGGESTED" "    "
+			fi
+			cat << _EOT_
+
+ +

$rdeptree

+
+_EOT_
+			ALL_DEPS=""
+			rdep_scan $SEARCH
+		fi
+	elif [ "$OBJECT" = "File" ]; then
+		cat << _EOT_
+
+

$result

+
+_EOT_
+		last=""
+		unlzma -c /home/slitaz/$SLITAZ_VERSION/packages/files.list.lzma \
+		| grep $SEARCH | while read pkg file; do
+			echo "$file" | grep -q $SEARCH || continue
+			if [ "$last" != "${pkg%:}" ]; then
+				last=${pkg%:}
+				(
+				. $WOK/$last/receipt
+				cat << _EOT_
+
+$PACKAGE $SHORT_DESC
+_EOT_
+				)
+			fi
+			echo "    $file"
+		done
+	elif [ "$OBJECT" = "File_list" ]; then
+		package_exist $SEARCH && cat << _EOT_
+
+

$result

+
+_EOT_
+		last=""
+		unlzma -c /home/slitaz/$SLITAZ_VERSION/packages/files.list.lzma \
+		| grep ^$SEARCH: |  sed 's/.*: /    /' | sort
+	elif [ "$OBJECT" = "Desc" ]; then
+		cat << _EOT_
+
+

$result

+
+_EOT_
+		last=""
+		grep -i $SEARCH /home/slitaz/$SLITAZ_VERSION/packages/packages.desc | \
+		sort | while read pkg extras ; do
+				. $WOK/$pkg/receipt
+				cat << _EOT_
+$PACKAGE : $SHORT_DESC
+_EOT_
+			done
+	elif [ "$OBJECT" = "Tags" ]; then
+		cat << _EOT_
+
+

$result

+
+_EOT_
+		last=""
+		grep ^TAGS= $WOK/*/receipt |  grep -i $SEARCH | \
+		sed "s|$WOK/\(.*\)/receipt:.*|\1|" | sort | while read pkg ; do
+				. $WOK/$pkg/receipt
+				cat << _EOT_
+$PACKAGE : $SHORT_DESC
+_EOT_
+			done
+	elif [ "$OBJECT" = "Receipt" ]; then
+		package_exist $SEARCH && cat << _EOT_
+
+

$result

+
+
+$(if [ -f  $WOK/$SEARCH/taz/*/receipt ]; then
+	cat $WOK/$SEARCH/taz/*/receipt
+  else
+    cat $WOK/$SEARCH//receipt
+  fi | sed -e 's/&/\&/g' -e 's//\>/g')
+
+_EOT_ + else + cat << _EOT_ + +

$result

+
+_EOT_
+		for pkg in `ls $WOK | grep $SEARCH`
+		do
+			. $WOK/$pkg/receipt
+			cat << _EOT_
+$PACKAGE : $SHORT_DESC
+_EOT_
+		done
+		equiv=/home/slitaz/$SLITAZ_VERSION/packages/packages.equiv
+		vpkgs="$(cat $equiv | cut -d= -f1 | grep $SEARCH)"
+		for vpkg in $vpkgs ; do
+	cat << _EOT_
+
+ +

$result (package providing $vpkg)

+
+_EOT_
+			for pkg in $(grep $vpkg= $equiv | sed "s/$vpkg=//"); do
+				. $WOK/${pkg#*:}/receipt
+				cat << _EOT_
+$PACKAGE : $SHORT_DESC
+_EOT_
+			done
+		done
+	fi
+	cat << _EOT_
+
+_EOT_ + xhtml_footer +fi + +exit 0 diff -r 300e77088e0f -r c075da96e08a tazpkg-web/stuff/style/favicon.ico Binary file tazpkg-web/stuff/style/favicon.ico has changed diff -r 300e77088e0f -r c075da96e08a tazpkg-web/stuff/style/pics/slitaz.png Binary file tazpkg-web/stuff/style/pics/slitaz.png has changed diff -r 300e77088e0f -r c075da96e08a tazpkg-web/stuff/style/pics/website/content-bl.png Binary file tazpkg-web/stuff/style/pics/website/content-bl.png has changed diff -r 300e77088e0f -r c075da96e08a tazpkg-web/stuff/style/pics/website/content-br.png Binary file tazpkg-web/stuff/style/pics/website/content-br.png has changed diff -r 300e77088e0f -r c075da96e08a tazpkg-web/stuff/style/pics/website/content-tl.png Binary file tazpkg-web/stuff/style/pics/website/content-tl.png has changed diff -r 300e77088e0f -r c075da96e08a tazpkg-web/stuff/style/pics/website/content-tr.png Binary file tazpkg-web/stuff/style/pics/website/content-tr.png has changed diff -r 300e77088e0f -r c075da96e08a tazpkg-web/stuff/style/pics/website/header.png Binary file tazpkg-web/stuff/style/pics/website/header.png has changed diff -r 300e77088e0f -r c075da96e08a tazpkg-web/stuff/style/pics/website/logo.png Binary file tazpkg-web/stuff/style/pics/website/logo.png has changed diff -r 300e77088e0f -r c075da96e08a tazpkg-web/stuff/style/pics/website/nav-bl.png Binary file tazpkg-web/stuff/style/pics/website/nav-bl.png has changed diff -r 300e77088e0f -r c075da96e08a tazpkg-web/stuff/style/pics/website/nav-br.png Binary file tazpkg-web/stuff/style/pics/website/nav-br.png has changed diff -r 300e77088e0f -r c075da96e08a tazpkg-web/stuff/style/pics/website/nav-tl.png Binary file tazpkg-web/stuff/style/pics/website/nav-tl.png has changed diff -r 300e77088e0f -r c075da96e08a tazpkg-web/stuff/style/pics/website/nav-tr.png Binary file tazpkg-web/stuff/style/pics/website/nav-tr.png has changed diff -r 300e77088e0f -r c075da96e08a tazpkg-web/stuff/style/pics/website/xhtml10.png Binary file tazpkg-web/stuff/style/pics/website/xhtml10.png has changed diff -r 300e77088e0f -r c075da96e08a tazpkg-web/stuff/style/slitaz.css --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/tazpkg-web/stuff/style/slitaz.css Sun Jun 21 03:26:15 2009 +0200 @@ -0,0 +1,356 @@ +/* + CSS style for SliTaz GNU/Linux website + www.slitaz.org - (c) 2007 Pankso +*/ + +body { + background: #222222; + color: black; + font: 13px sans-serif, vernada, arial; + margin: 0; + padding-bottom: 100%; +} + +/* Accessibility */ + +#access { + position: absolute; + top: 1px; + right: 6px; + text-align: right; + width: 100%; + margin: 0; + font-size: 12px; + font-weight: bold; +} + +#access a { + background: inherit; + color: white; + text-decoration: none; + padding-left: 2px; +} + +#access a:hover { + background: inherit; + color: #222222; +} + +/* Header and title */ + +#header{ + background: #f0ba08 url(pics/website/header.png) repeat-x top; + color: black; + width: 100%; + height: 50px ; + border-top: 1px solid black; + border-bottom: 1px solid black; + margin-bottom: 30px; +} + +#titre{ + font-size: 16px; + font-weight: bolder ; + margin-left: 232px; + margin-top: 4px; + padding-top: 25px ; +} + +#logo { + position: absolute; + float: left; + margin-left: 32px; + margin-right: 20px; + margin-top: 0px; +} + +/* Navigation */ + +#nav { + position: absolute; + top: 100px; + right: 6px; + background: #eaeaea url(pics/website/nav-tr.png) no-repeat top right; + color: black; + float: right; + width: 152px; + line-height: 1.3em; + text-align: left; + font-size: 12px; + font-weight: bold; +} + +#nav_top { + background: transparent url(pics/website/nav-tl.png) no-repeat top left; + height: 12px; +} + +#nav_bottom { + background: transparent url(pics/website/nav-bl.png) no-repeat bottom left; + height: 12px; +} + +#nav_bottom_img { + background: transparent url(pics/website/nav-br.png) no-repeat bottom right; + height: 12px; +} + +#nav ul{ + list-style-type: none; + margin: 0px 0px 0px 6px; + padding: 3px 2px 3px 2px; +} + +#nav li { + display: inline; +} + +#nav a { + color: #3E1220; + background: inherit; + display: block; + padding: 0.5px; + text-decoration: none; +} + +#nav a:hover { + color: #DF8F06; + text-decoration: none; + display: block; +} + +#nav hr { + margin: 2px 0px 1px 0px; + border: 0px; + border-top: 1px solid #BDBDBD; + +} +/* Page content */ + +#content, #content_bottom, #content_top { + background: white; + color: black; + text-align: justify; +} + +#content_top { + height: 14px; + margin: 0px 100px 0px 100px; +} + +#content { + height: auto; + margin: -6px 100px 0px 100px; + padding: 0px 72px 72px 72px; + /*background: white; + color: #333333;*/ +} + +#content_bottom { + height: 14px; + margin: 0px 100px 0px 100px; + /*clear: both;*/ +} + +#content li { + line-height: 1.5em; + text-align: left; +} + +/* Legal informations */ + +#copy { + font-size: 11px ; + text-align: center ; + background: transparent; + color: #a8a8a8; + padding-top: 10px; +} + +#copy a { + background: inherit; + color: #a8a8a8; +} + +#copy a:hover { + background: inherit; + color: #EDEDED; +} + +/* Footer */ + +#bottom { + float: none; + background: inherit; + color: black; + width: auto; + clear: both; + padding: 0; + margin: 0; + text-align: center; + vertical-align: middle; +} + +#news li { + list-style-type: square; + border-bottom: 1px dotted #BEBEBE; + margin-left: -25px; + padding: 4px 0px 4px 0px; +} + +#gallery { + text-align: center; +} + +#gallery table { + margin: 30px 0px 30px 0px; +} + +/* Clouds */ + +#cloud { + padding: 20px 0px 20px 0px; + line-height: 3em; + text-align: center; +} +#cloud a { padding: 4px; color: #956411; } +#cloud a.tag1 { font-size: 0.7em; font-weight: 100; } +#cloud a.tag2 { font-size: 0.8em; font-weight: 200; } +#cloud a.tag3 { font-size: 0.9em; font-weight: 300; } +#cloud a.tag4 { font-size: 1.0em; font-weight: 400; } +#cloud a.tag5 { font-size: 1.2em; font-weight: 500; } +#cloud a.tag6 { font-size: 1.4em; font-weight: 600; } +#cloud a.tag7 { font-size: 1.6em; font-weight: 700; } +#cloud a.tag8 { font-size: 1.8em; font-weight: 800; } +#cloud a.tag9 { font-size: 2.2em; font-weight: 900; } +#cloud a.tag10 { font-size: 2.5em; font-weight: 900; } + +/* CSS class. */ + +.top_left, .top_right, .bottom_left, .bottom_right { + height: 14px; + width: 14px; + color: white; + background-color: #333333; + background-repeat: no-repeat; +} + +.top_left { + background-image: url(pics/website/content-tl.png); + background-position: left top; + position: absolute; +} + +.top_right { + background-image: url(pics/website/content-tr.png); + float: right; +} + +.bottom_left { + background-image: url(pics/website/content-bl.png); + position: absolute; +} + +.bottom_right { + background-image: url(pics/website/content-br.png); + float: right; +} + +/* HTML styles */ + +h1 { + color: #3E1220; + background: inherit; + text-align: left; + margin: 0px 0px 16px -58px; +} + +h2 { + color: #DF8F06; + border-left: 10px solid #F3F3F3; + padding: 4px 0px 4px 4px; + margin: 0; +} + +h3 { + font-weight: bold; + color: #6c0023; + background: inherit; +} + +a { + text-decoration: underline; + color: #0F314E; + background: inherit; +} + +a:hover { + text-decoration: none; + color: blue; + background: inherit; +} + +code { + font-size: 12px; + color: #669900; + background: inherit; +} + +tt { + color: #15EE15; + background: inherit; +} + +img { + border: 0pt none; +} + +fieldset { + background: #eeeeee; + color: black; + margin-top: 25px; + border: 1px solid black; +} + +legend { + border: 1px solid black; + color: #6c0023; + background: #eaeaea; + font-weight: bold; +} + +pre { + padding: 5px; + color: black; + background: #E1E0B0; +} + +pre.script { + padding: 10px; + color: black; + background: #E8E8E8; + border: 1px inset #606060; +} + +/* Packages pages */ + +.pkg_nav { + border-top: 1px solid black; + margin-top: 10px; + padding-top: 10px; +} + +pre.package { + padding: 0px; + color: black; + background: white; +} + +p.get { + text-align: center; + padding: 10px; + color: black; + background: #F3F3F3; + border: 1px solid #DEDEDE; +} + diff -r 300e77088e0f -r c075da96e08a tazpkg-web/stuff/tazpkg-web --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/tazpkg-web/stuff/tazpkg-web Sun Jun 21 03:26:15 2009 +0200 @@ -0,0 +1,299 @@ +#!/bin/sh +# SliTaz Packages Web interface generator: http://pkgs.slitaz.org/ +# +# (C) 2009 SliTaz project - GNU General Public License v3. +# Christophe Lincoln +# + +. /etc/slitaz/tazpkg-web.conf + +RELEASE="$1" +PAGES_DIR=$WEB_INTERFACE/$RELEASE +DATE=`date +%Y-%m-%d\ \%H:%M:%S` + +status() +{ + local CHECK=$? + echo -en "\033[70G" + if [ $CHECK = 0 ]; then + echo "Done" + else + echo "Failed" + fi + return $CHECK +} + +# Search from option with current version in first so users dont have +# to select the correct one. +search_form_option() +{ + if [ "$RELEASE" == "stable" ]; then + cat << _EOT_ + + + +_EOT_ + else + cat << _EOT_ + + + +_EOT_ + fi +} + +content_top() +{ + cat >> $PAGES_DIR/$page.html << _EOF_ + + +
+
+
+
+ + +
+ + +

Packages $RELEASE

+

$h2

+_EOF_ +} + +# xHTML Header. +xhtml_header() +{ + cat $LIB_DIR/html/header.html > $PAGES_DIR/$page.html + sed -i s/"_RELEASE_"/"$RELEASE"/ $PAGES_DIR/$page.html + sed -i s/"_PAGE_"/"$page"/ $PAGES_DIR/$page.html + sed -i s/"_DATE_"/"$DATE"/ $PAGES_DIR/$page.html +} + +# xHTML Footer. +xhtml_footer() +{ + cat $LIB_DIR/html/footer.html >> $PAGES_DIR/$page.html + sed -i s/"_DATE_"/"$DATE"/ $PAGES_DIR/$page.html +} + +# Index pages with categories and search form. +gen_index_content() +{ + cat >> $PAGES_DIR/$page.html << _EOT_ + +
+
+ + : + + + +
+

+$packages packages - Database generated on: $DATE +

+
+_EOT_ + cat $LIB_DIR/html/catlist.html >> $PAGES_DIR/$page.html +} + +# Packages

and infos in
. Some packages use EXTRAVERSION in
+# the receipt so keep the value or set it to the kernel version.
+pkgs_pages_content()
+{
+	for pkg in $WOK/*
+	do
+		DEPENDS=""
+		DEPENDS_LINKS=""
+		EXTRAVERSION=""
+		. $pkg/receipt
+		[ -z "$EXTRAVERSION" ] && EXTRAVERSION="_$KERNEL"
+		packages=$(($packages+1))
+		cat >> $PAGES_DIR/$CATEGORY.html << _EOT_
+
+
+

$PACKAGE

+
+Version    : $VERSION
+Short desc : $SHORT_DESC
+Web site   : $WEB_SITE
+_EOT_
+		# Extraversion string or not
+		if [ -f "$PACKAGES_REPOSITORY/$PACKAGE-${VERSION}$EXTRAVERSION.tazpkg" ]; then
+			cat >> $PAGES_DIR/$CATEGORY.html << _EOT_
+Download   : $PACKAGE-${VERSION}$EXTRAVERSION.tazpkg
+_EOT_
+			echo '
' >> $PAGES_DIR/$CATEGORY.html + else + # Check if package exist, could be virtual + [ -f "$PACKAGES_REPOSITORY/$PACKAGE-$VERSION.tazpkg" ] && + cat >> $PAGES_DIR/$CATEGORY.html << _EOT_ +Download : $PACKAGE-$VERSION.tazpkg +_EOT_ + echo '
' >> $PAGES_DIR/$CATEGORY.html + # Dependencies with link to the package information using + # category.html#anchor + if [ -n "$DEPENDS" ]; then + for dep in $DEPENDS + do + receipt=$WOK/$dep/receipt + if [ -f "$receipt" ]; then + cat=`grep CATEGORY $receipt | sed s/CATEGORY=\"// | sed s/\"//` + DEPENDS_LINKS=${DEPENDS_LINKS}"$dep " + fi + done + cat >> $PAGES_DIR/$CATEGORY.html << _EOT_ +

Depends : $DEPENDS_LINKS

+_EOT_ + fi + fi + done +} + +# Pages footer +pages_footer() +{ + for page in $CATEGORIES + do + # Gen categories menu/links + echo '' >> $PAGES_DIR/$page.html + echo '

' >> $PAGES_DIR/$page.html + echo 'Categories' >> $PAGES_DIR/$page.html + for i in $CATEGORIES + do + cat >> $PAGES_DIR/$page.html << _EOF_ +| $i +_EOF_ + done + echo '

' >> $PAGES_DIR/$page.html + xhtml_footer + done +} + +# Home page with search form and tag cloud. +home_page() +{ + PAGES_DIR=$WEB_INTERFACE + page="index" + h2="Web interface" + RELEASE="" + xhtml_header + content_top + cat $LIB_DIR/html/home.html >> $PAGES_DIR/$page.html + xhtml_footer +} + +# Generate all categories pages and release index. +gen_all_pages() +{ + # Clean previews files. + rm -rf $PAGES_DIR + mkdir -p $PAGES_DIR + echo -e "\nStarting to build the $RELEASE Web interface... " + echo "================================================================================" + # Packages pages header, menu and content top at first. + echo -n "Generating all pages header..." + for page in $CATEGORIES + do + h2=$page + xhtml_header + cat $LIB_DIR/html/menu.html >> $PAGES_DIR/$page.html + content_top + done + status + # Scan the wok and classify packages by category. + echo -n "Scanning the wok and generating page content..." + pkgs_pages_content + status + # Gen all packages pages footer. + echo -n "Generating all pages footer..." + pages_footer + status + # Stable or Cooking index with categories and home page. + echo -n "Generating the main index..." + page="index" + h2="Categories" + xhtml_header + cat $LIB_DIR/html/menu.html >> $PAGES_DIR/$page.html + content_top + gen_index_content + xhtml_footer + home_page + status + echo "================================================================================" + echo -e "Pages generated: $WEB_INTERFACE\n" +} + +# Prefer the Hg wok in the chroot. On host running Tazbb the wok's +# are updated and copied automaticaly and it conflict with Tazdev +# designed to maintain a local chroot environment without a build bot. + +case "$1" in + stats) + size=`du -sh $WEB_INTERFACE | awk '{ print $1 }'` + pages=`find $WEB_INTERFACE -name *.html | wc -l` + stable=`find $WEB_INTERFACE/stable -name *.html | wc -l` + cooking=`find $WEB_INTERFACE/cooking -name *.html | wc -l` + cat << _EOT_ + +Tazpkg-web statistics +================================================================================ +Web interface : $WEB_INTERFACE ($size) +xHTML pages : $pages (Stable $stable - Cooking $cooking) +Library path : $LIB_DIR +Stable path : $STABLE +Cooking path : $COOKING +================================================================================ + +_EOT_ + ;; + check) + RELEASE=$2 + [ -z "$RELEASE" ] && RELEASE=cooking + echo -e "\nChecking: $WEB_INTERFACE/$RELEASE\n" + for page in `cd $WEB_INTERFACE/$RELEASE && ls *.html` + do + if ! echo "$CATEGORIES index" | grep -qw ${page%.html}; then + echo "Wrong category: ${page%.html}" + fi + done && echo "" ;; + stable) + PACKAGES_REPOSITORY=$STABLE/packages + if [ -d $STABLE/chroot/home/slitaz/hg/wok ]; then + WOK=$STABLE/chroot/home/slitaz/hg/wok + else + WOK=$STABLE/wok + fi + KERNEL=`cat $WOK/linux/receipt | grep ^VERSION= | cut -d '"' -f 2` + gen_all_pages ;; + cooking) + PACKAGES_REPOSITORY=$COOKING/packages + if [ -d $COOKING/chroot/home/slitaz/hg/wok ]; then + WOK=$COOKING/chroot/home/slitaz/hg/wok + else + WOK=$COOKING/wok + fi + KERNEL=`cat $WOK/linux/receipt | grep ^VERSION= | cut -d '"' -f 2` + gen_all_pages ;; + *|usage) + cat << _EOT_ + +Tazpkg-web - SliTaz Packages Web interface generator. +Usage: `basename $0` [slitaz-release|stats|check] + +_EOT_ + ;; +esac + +exit 0 diff -r 300e77088e0f -r c075da96e08a tazpkg-web/stuff/tazpkg-web.conf --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/tazpkg-web/stuff/tazpkg-web.conf Sun Jun 21 03:26:15 2009 +0200 @@ -0,0 +1,29 @@ +# tazpkg-web.conf: SliTaz packages Web interface configuration file. +# + +# Path to the Web interface. +WEB_INTERFACE="/var/www/vhosts/pkgs" + +# Path to xHTML and XML templates. +LIB_DIR="/var/lib/tazpkg-web" + +# Path to each version. +STABLE="/home/slitaz/stable" +COOKING="/home/slitaz/cooking" + +# Packages categoies. +CATEGORIES=" +base-system +x-window +utilities +network +graphics +multimedia +office +development +system-tools +security +games +misc +meta +non-free" diff -r 300e77088e0f -r c075da96e08a tazpkg-web/stuff/xml/rss-header.xml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/tazpkg-web/stuff/xml/rss-header.xml Sun Jun 21 03:26:15 2009 +0200 @@ -0,0 +1,15 @@ + + + + SliTaz _RELEASE_ packages + http://www.slitaz.org/ + _DATE_ + Latest packages releases for SliTaz GNU/Linux + en + Tazpkg-web + + + SliTaz GNU/Linux + ../pics/website/slitaz-spider.png + http://pkgs.slitaz.org/ +