aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSilvio Rhatto <rhatto@riseup.net>2017-09-18 15:33:54 -0300
committerSilvio Rhatto <rhatto@riseup.net>2017-09-18 15:33:54 -0300
commit06ecc56c337c0de3d036dafc1431b7638ad2b908 (patch)
tree9bc883a3988bfe9b5ad425119f685abb7c5a6336
downloadstowpkg-06ecc56c337c0de3d036dafc1431b7638ad2b908.tar.gz
stowpkg-06ecc56c337c0de3d036dafc1431b7638ad2b908.tar.bz2
Initial import
-rw-r--r--.gitignore1
-rw-r--r--README.md103
-rw-r--r--kvmxfile100
-rw-r--r--ports/net/luakit/desc7
-rw-r--r--ports/net/luakit/env5
-rw-r--r--ports/net/luakit/rules3
-rwxr-xr-xstowpkg198
-rw-r--r--tree/.empty0
8 files changed, 417 insertions, 0 deletions
diff --git a/.gitignore b/.gitignore
new file mode 100644
index 0000000..5c62b5a
--- /dev/null
+++ b/.gitignore
@@ -0,0 +1 @@
+tree
diff --git a/README.md b/README.md
new file mode 100644
index 0000000..e74f815
--- /dev/null
+++ b/README.md
@@ -0,0 +1,103 @@
+Stowpkg: ports system based on GNU Stow
+=======================================
+
+A non-conflicting Unix package manager built atop GNU Stow.
+
+Features
+--------
+
+* Non-conflicting with any other package management in use (distro-spefic, npm, pip, etc).
+* Multi-target support: you can keep may isolated and independent software trees.
+* Multi-distro support: works for any GNU/Linux and possible any BSD-variant.
+* Repository signature verification using GnuPG and signed git commits.
+* Small enough so everybody can learn how a package manager works.
+
+Coming features
+---------------
+
+* Automatic patch application.
+* Source code verification using multiple methods (commit hash, checksums, OpenPGP).
+
+Installation
+------------
+
+On a Debian-like system:
+
+ sudo apt install stow build-essential
+
+Usage
+-----
+
+ stowpkg search # list packages available on ports
+ stowpkg install <package> # install packages from source
+
+Coming usage
+------------
+
+ stowpkg list # list packages installed
+ stowpkg remove <package> # remove packages
+ stowpkg purge <package> # purge packages
+ stowpkg update # update ports repository
+ stowpkg upgrade [package] # upgrade packages
+ stowpkg upstream <package> # check packages versions at upstream
+ stowpkg build # simple package builder (./configure && make && make install)
+
+Running installed applications
+------------------------------
+
+Make sure to include stowpkg package tree into your `PATH`, `MANPATH`, `LD_LIBRARY_PATH`, etc.
+
+Params
+------
+
+Passe using environment variables:
+
+* `BASE`: defaults `<stowpkg-repo>/tree/<architecture>`, but can be configured to anything like
+ `/usr/local` with corresponding packages installed `/usr/local/stowpkg`.
+
+Configuration
+-------------
+
+Use `~/.config/stowpkg` do put any default parameters.
+
+Ports layout
+------------
+
+Check the repo for examples :)
+
+Repository layout
+-----------------
+
+Starting from `$BASE` (like `/usr/local`) we have:
+
+ {bin,lib,man,share,etc,src}: usual Unix paths
+ stow
+ package_name-VERSION
+
+Further development
+-------------------
+
+* Per-architecture binary package support using git-annex and GnuPG signatures, including:
+
+ stowpkg pack <package> # pack an installed package
+ stowpkg fetch <package> # fetch package from the repo
+
+What is does
+------------
+
+If you want to do it manually:
+
+ sudo apt install <luakit-depencies>
+ git clone https://github.com/luakit/luakit
+ cd luakit
+ make PREFIX=/usr/local/stow/luakit
+ sudo make PREFIX=/usr/local/stow/luakit install
+ cd /usr/local/stow/
+ sudo stow luakit
+
+References
+----------
+
+* [GNU Stow Docs](http://www.gnu.org/software/stow/manual/html_node/index.html).
+* [Using GNU Stow to manage source installs](http://blog.danieroux.com/2005/08/07/using-gnu-stow-to-manage-source-installs/).
+* [Get rid of stowaway packages with GNU Stow](https://www.linux.com/news/get-rid-stowaway-packages-gnu-stow).
diff --git a/kvmxfile b/kvmxfile
new file mode 100644
index 0000000..a435cdf
--- /dev/null
+++ b/kvmxfile
@@ -0,0 +1,100 @@
+#
+# Sample kvmx file - https://kvmx.fluxo.info
+#
+
+# Which base box you should use. Leave unconfigured to use kvmx-create instead.
+basebox="stretch"
+
+# First user name
+user="user"
+
+# First user password
+password="`head -c ${1:-20} /dev/urandom | base64`"
+
+# Set this is you want to be able to share folders between host and guest.
+shared_folder="."
+shared_folder_mountpoint="/home/$user/code/$VM"
+
+# Folder to sync during provisioning in the format "/host/folder /guest/folder".
+#provision_rsync="$KVMX_BASE/share/provision/ /usr/local/share/kvmx/provision/"
+
+# Options for provision_rsync
+#provision_rsync_opts="--exclude=somefolder"
+
+# Absolute path for a provision script located inside the guest.
+provision_command="/usr/local/share/kvmx/provision/development"
+
+# Graphics
+# See https://wiki.archlinux.org/index.php/QEMU#Graphics
+#graphics="-vga std -nographic -vnc :$GUEST_DISPLAY"
+graphics="-vga qxl"
+
+# VNC Client
+#vnc_client="xtightvncviewer"
+#vnc_client="xvnc4viewer"
+#vnc_client="xvncviewer"
+vnc_client="virt-viewer"
+
+# Set this if you want to attach an spice client when the machine boots.
+run_spice_client="0"
+
+# SPICE client
+spice_client="spicec"
+
+# Set this if you want to start an xpra session when the machine boots.
+run_xpra="0"
+
+# Set this if you want to start an xephyr session when the machine boots.
+run_xephyr="0"
+
+# Set screen resolution
+#resolution="1280x785"
+
+# Set additional hostfwd mappings
+#port_mapping="hostfwd=tcp:127.0.0.1:8080-:80,hostfwd=tcp:127.0.0.1:8443-:443"
+
+# Where the guest image is stored
+#image="$HOME/.local/share/kvmx/$VM/box.img"
+
+# Image size
+size="10G"
+
+# Image format: raw or qcow2
+format="qcow2"
+
+# Bootstrap method: custom or vmdeboostrap
+method="custom"
+
+# Hostname
+hostname="stowpkg"
+
+# Domain
+domain="example.org"
+
+# System arch
+arch="amd64"
+
+# Box distribution when bootstraping a new image
+version="stretch"
+
+# Debian mirror
+mirror="http://http.debian.net/debian/"
+
+# Enables remote administration using SSH. With this configuration enabled,
+# kvmx will be able to administer a running virtual machine using SSH access
+# inside the virtual machine.
+ssh_support="y"
+
+# Use a custom, per-virtual-machine generated SSH keypair. If you disable this
+# configuration but still want guest administration using SSH, the default
+# insecure keypair will be used.
+#
+# Please note that this setting won't take effect if you're using a basebox.
+# In that case the basebox keypair will be used if it exists, otherwise kvmx
+# fallsback to the default insecure keypair.
+#
+# This setting is used during virtual machine bootstrapping by kvmx-create.
+ssh_custom="y"
+
+# Bootloader (used only during bootstrapping by kvmx-create).
+bootloader="grub"
diff --git a/ports/net/luakit/desc b/ports/net/luakit/desc
new file mode 100644
index 0000000..646048b
--- /dev/null
+++ b/ports/net/luakit/desc
@@ -0,0 +1,7 @@
+A fast, extensible, and customizable web browser.
+
+Luakit is a highly configurable browser framework based on the WebKit web
+content engine and the GTK+ toolkit. It is very fast, extensible with Lua, and
+licensed under the GNU GPLv3 license. It is primarily targeted at power users,
+developers and anyone who wants to have fine-grained control over their web
+browser’s behaviour and interface.
diff --git a/ports/net/luakit/env b/ports/net/luakit/env
new file mode 100644
index 0000000..e0f8ae7
--- /dev/null
+++ b/ports/net/luakit/env
@@ -0,0 +1,5 @@
+version="master"
+source_format="git"
+url="https://github.com/luakit/luakit"
+dependencies_stowpkg=""
+dependencies_debian="luakit libwebkit2gtk-4.0-37 libwebkit2gtk-4.0-dev luajit make pkg-config libgtk-3-0 libluajit-5.1-dev lua-dbi-sqlite3-dev sqlite3 libsqlite3-dev"
diff --git a/ports/net/luakit/rules b/ports/net/luakit/rules
new file mode 100644
index 0000000..8d4c893
--- /dev/null
+++ b/ports/net/luakit/rules
@@ -0,0 +1,3 @@
+make clean
+make PREFIX=$PREFIX XDGPREFIX=$PREFIX/etc DEVELOPMENT_PATHS=0
+make PREFIX=$PREFIX XDGPREFIX=$PREFIX/etc install
diff --git a/stowpkg b/stowpkg
new file mode 100755
index 0000000..a0feecd
--- /dev/null
+++ b/stowpkg
@@ -0,0 +1,198 @@
+#!/usr/bin/env sh
+#
+# stowpkg package manager
+#
+# Copyright (C) 2017 Silvio Rhatto - rhatto at riseup.net
+#
+# This program is free software: you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published
+# by the Free Software Foundation, either version 3 of the License,
+# or any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program. If not, see <http://www.gnu.org/licenses/>.
+
+# Parameters
+VERSION="0.0.1"
+DIRNAME="$(cd `dirname $0` && pwd)"
+BASENAME="`basename $0`"
+ACTION="$1"
+
+__stowpkg_initialize () {
+ # Check for stow
+ if ! which stow > /dev/null 2>&1; then
+ echo "$BASENAME: please install stow first"
+ exit 1
+ fi
+
+ # Sudo config
+ if [ "`whoami`" != 'root' ]; then
+ SUDO="sudo"
+ fi
+
+ # Source config file
+ if [ -e "$HOME/.config/stowpkg" ]; then
+ . "$HOME/.config/stowpkg"
+ fi
+
+ # Ports
+ if [ -z "$PORTS" ]; then
+ PORTS="$DIRNAME/ports"
+ fi
+
+ # Set base
+ if [ -z "$BASE" ]; then
+ BASE="$DIRNAME/tree/`uname -m`"
+ fi
+
+ # Sources
+ if [ -z "$SOURCES" ]; then
+ SOURCES="$BASE/src"
+ fi
+
+ # Binaries
+ if [ -z "$BINARIES" ]; then
+ BINARIES="$BASE/stow"
+ fi
+
+ # Ensure folders exists
+ mkdir -p $BASE $PORTS $SOURCES $BINARIES
+
+ # Export
+ export BASE="$BASE"
+ export PORTS="$PORTS"
+ export SOURCES="$SOURCES"
+ export BASE="$BINARIES"
+}
+
+stowpkg_usage () {
+ echo "$BASENAME $VERSION - a package manager"
+ echo ""
+ echo "usage: $BASENAME <action> [options]"
+ echo ""
+ echo "available actions:"
+ echo ""
+ grep "^stowpkg_" $0 | cut -d ' ' -f 1 | sed -e 's/stowpkg_//' | sort | xargs -L 6 | column -t -c 6 | sed -e 's/^/\t/'
+ echo ""
+
+ exit 1
+}
+
+stowpkg_search () {
+ local package="$2"
+
+ if [ ! -z "$package" ]; then
+ stowpkg_search | grep "$package$"
+ else
+ ( cd $PORTS && find -name 'desc' | sed -e 's|^\./||' -e 's|/desc||' )
+ fi
+}
+
+stowpkg_install () {
+ local package="$2"
+
+ if [ -z "$package" ]; then
+ stowpkg_usage
+ fi
+
+ # Find package on ports
+ local location="$PORTS/`$0 search $package`"
+
+ if [ "$location" = "${PORTS}/" ]; then
+ echo "$BASENAME: package not found: $package"
+ exit 1
+ fi
+
+ if [ "`basename $location`" != "$package" ]; then
+ echo "$BASENAME: package not found: $package"
+ exit 1
+ fi
+
+ # Source environment
+ if [ -e "$location/env" ]; then
+ . $location/env
+ fi
+
+ # Set default version
+ if [ -z "$version" ]; then
+ version="latest"
+ fi
+
+ # Set PREFIX
+ if [ -z "$PREFIX" ]; then
+ PREFIX="$BINARIES/${package}-${version}"
+ fi
+
+ # Resolve default dependencies
+ if [ ! -z "$dependencies_stowpkg" ]; then
+ for dependency in $dependencies_stowpkg; do
+ $0 install $dependency
+ done
+ fi
+
+ # Resolve debian dependencies
+ if [ -e "/etc/debian_version" ]; then
+ if [ ! -z "$dependencies_debian" ]; then
+ $SUDO apt install $dependencies_debian
+ fi
+ fi
+
+ # Go to sources folder
+ cd $SOURCES
+
+ # Download sources if needed
+ if [ ! -d "${package}-${version}" ]; then
+ if [ "$source_format" = "git" ]; then
+ git clone $url ${package}-${version}
+ fi
+ fi
+
+ # Go to source folder
+ if [ ! -d "${package}-${version}" ]; then
+ echo "$BASENAME: source not found for package $package"
+ exit 1
+ fi
+
+ cd ${package}-${version}
+
+ # Build
+ if [ -e "$location/rules" ]; then
+ . $location/rules
+ else
+ # Run default rules
+ if [ -e "Makefile" ]; then
+ make clean
+ fi
+
+ if [ -e "configure" ]; then
+ ./configure --prefix=$PREFIX
+ fi
+
+ if [ -e "Makefile" ]; then
+ make PREFIX=$PREFIX
+ make PREFIX=$PREFIX install
+ fi
+ fi
+
+ cd $BINARIES
+
+ if [ -d "${package}-${version}" ]; then
+ stow ${package}-${version} || exit 1
+ else
+ echo "$BASENAME: error building $package"
+ exit 1
+ fi
+}
+
+# Dispatch
+if grep -q "^stowpkg_$ACTION () {$" $0; then
+ __stowpkg_initialize
+ stowpkg_$ACTION $*
+else
+ stowpkg_usage
+fi
diff --git a/tree/.empty b/tree/.empty
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/tree/.empty