pax_global_header 0000666 0000000 0000000 00000000064 14046377771 0014532 g ustar 00root root 0000000 0000000 52 comment=ed010b9565c7d9668efec4206080009b3c4776f7
unibuild-ed010b9565c7d9668efec4206080009b3c4776f7/ 0000775 0000000 0000000 00000000000 14046377771 0020143 5 ustar 00root root 0000000 0000000 unibuild-ed010b9565c7d9668efec4206080009b3c4776f7/.gitignore 0000664 0000000 0000000 00000000256 14046377771 0022136 0 ustar 00root root 0000000 0000000 # Regex
unibuild-*.tar.*
config.*
# Directories
.deps/
autom4te.cache/
build-aux/
# Files
Makefile.in
configure
configure~
Makefile
unibuild
# Others
aclocal.m4
.dirstamp
unibuild-ed010b9565c7d9668efec4206080009b3c4776f7/LICENSE 0000664 0000000 0000000 00000002456 14046377771 0021157 0 ustar 00root root 0000000 0000000 BSD 2-Clause License
Copyright (c) 2020, sulinos / Sulin Devel
All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
* Redistributions of source code must retain the above copyright notice, this
list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright notice,
this list of conditions and the following disclaimer in the documentation
and/or other materials provided with the distribution.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
unibuild-ed010b9565c7d9668efec4206080009b3c4776f7/Makefile.am 0000664 0000000 0000000 00000000115 14046377771 0022174 0 ustar 00root root 0000000 0000000 SUBDIRS = src
EXTRA_DIST = doc example LICENSE readme.rst unibuild.unibuild
unibuild-ed010b9565c7d9668efec4206080009b3c4776f7/configure.ac 0000664 0000000 0000000 00000000325 14046377771 0022431 0 ustar 00root root 0000000 0000000 AC_INIT([unibuild], [0.1], [bug@example.com])
AC_CONFIG_AUX_DIR([build-aux])
AM_INIT_AUTOMAKE([-Wall foreign])
AC_CONFIG_FILES([src/unibuild:src/unibuild.sh])
AC_CONFIG_FILES([Makefile src/Makefile])
AC_OUTPUT
unibuild-ed010b9565c7d9668efec4206080009b3c4776f7/doc/ 0000775 0000000 0000000 00000000000 14046377771 0020710 5 ustar 00root root 0000000 0000000 unibuild-ed010b9565c7d9668efec4206080009b3c4776f7/doc/building.rst 0000664 0000000 0000000 00000015327 14046377771 0023247 0 ustar 00root root 0000000 0000000 Building with unibuild
======================
**Unibuild** need a build spec. Build spec must be bash script. *name* *version* *release* *summary* *description* variables and *_setup* *_build* *_check* *_install* functions uses. For example:
.. code-block:: shell
#!/bin/bash
name="bash"
version="5.0"
summary="bash shell"
description="The bash shell"
source=(https://ftp.gnu.org/gnu/bash/bash-5.0.tar.gz)
_setup(){
./configure --prefix=/usr
}
_build(){
make
}
_install(){
make install DESTDIR=$INSTALLDIR
}
BUILDDIR
^^^^^^^^
Main directory that uses for all operations. Unibuild create 3 directory for building. **WORKDIR** **INSTALLDIR** **PKGDIR**
All directories in builddir. Unibuild created builddir with **mktemp -d** command.
**1. WORKDIR**
Workdir is building directory. Before running functions, unibuild go workdir. Workdir is changeable variable. If only one source directory in workdir. unibuild automaticaly change workdir as source directory.
**2. INSTALLDIR**
Installdir is package destdir. Spec must store package files in here.
**3. PKGDIR**
Pkgdir is packaging directory required by target packager.
Build functions
^^^^^^^^^^^^^^^
If you dont define functions, unibuild try to detect build method and create automaticaly. Or you can define **BuildType** variable for creating build function as automaticaly. Also you can define **CONFIG_OPTIONS** variable for auto build options. For example:
.. code-block:: shell
#!/bin/bash
name="bash"
version="5.0"
summary="Bash shell"
description="The bash shell"
builddepends=("gcc")
depends=("readline")
license="gplv3"
source=(https://ftp.gnu.org/gnu/bash/bash-5.0.tar.gz)
BuildType="autotools"
This example uses autotools for compiling. autotools define build functions look like this:
.. code-block:: shell
_setup(){
./configure --prefix=/usr $CONFIG_OPTIONS
}
_build(){
make -j$(nproc)
}
_install(){
make install DESTDIR=$INSTALLDIR
}
The gnu bash source code has ./configure script so if you dont define build functions, unibuild detect and set **BuildType** variable.
Function calling order: _setup => _build => _check => _install
Build target and host
^^^^^^^^^^^^^^^^^^^^^
Unibuild is universal builder so supported most of distribution. You can define **TARGET** and **HOST** variables.
======== =================================================
VARIABLE DESCRIPION
======== =================================================
TARGET Package build target: debian, inary, appimage ...
HOST Builder distribution: debian, inary ...
======== =================================================
host and target automaticaly detected if you dont define.
Spec variables
^^^^^^^^^^^^^^
Unibuild spec variables and description avaiable here:
======== ============ ======================================================== =======
OPTIONAL VARIABLE DESCRIPION Type
======== ============ ======================================================== =======
no description Package description. String
no license Source code license. String
no name Package name. String
no source Package source code url or path. Array
no summary Package summary. String
no version Package version. Only can use [0-9] or . or - String
**yes** arch Package architecture. if dont define, auto detected. String
**yes** backup Package backup names. Array
**yes** builddepends Package names that required by compiling. Array
**yes** categories Appilcation categories. Used by appimage String
**yes** checkdepends Package check dependencies. Array
**yes** conflicts Package conflict names. Array
**yes** depends Package runtime dependencies. Array
**yes** email Packager email. String
**yes** executable Package main executable name. Used by appimage String
**yes** groups Package group names. Array
**yes** homepage Project homepage. String
**yes** icon Application icon name or path. Used by appimage String
**yes** isa Package type. Used by inary. Array
**yes** maintainer Package maintainer name. String
**yes** optdepends Package optional dependencies. Array
**yes** partof Package section or component name. String
**yes** PKGS Main and splited package names list. Array
**yes** priority Package priority. String
**yes** provides Package provide names. Array
**yes** release Package release. Used by inary. Integer
**yes** replaces Package replace names. Array
======== ============ ======================================================== =======
Unibuild supported different source types. All known source types:
1. name::git://xxxx.git::branch
2. git+https://xxxxx.git::branch
3. name::https://xxxxx
4. /path/to/name/xxx
5. https://xxxxxx
Split package
^^^^^^^^^^^^^
Unibuild uses **PKGS** array for getting package names. We have *main* package and *splited* packages. Main package is first **PKGS** array item. If you did not define this aray unibuild use **name** value main package name and do not splite.
Unibuild define and create **INSTALLDIR** and **PKGDIR** directories for every *splited* and *main* packages and run **_install** functions.
Unibuild change **package** value when run **_install** function.
You can split package like this:
.. code-block:: shell
PKGS=("main" "splited")
_install(){
if is_pkg "splited" ; then
takedir "main" "/path/to/stuff"
return
fi
make install DESTDIR=$INSTALLDIR
}
**takedir** function move files or directories from main package.
**is_package** function return true if current package is splited package.
**return** for stop function block
unibuild-ed010b9565c7d9668efec4206080009b3c4776f7/doc/development/ 0000775 0000000 0000000 00000000000 14046377771 0023232 5 ustar 00root root 0000000 0000000 unibuild-ed010b9565c7d9668efec4206080009b3c4776f7/doc/development/general.rst 0000664 0000000 0000000 00000002521 14046377771 0025401 0 ustar 00root root 0000000 0000000 MODDIR
=====
Include order : *api -> modules -> unibuild file -> host -> target -> hooks* All imports are alphabeticaly.
Moddir contains unibuild **modules**, **api**, **hooks**, **target** and **host** directories.
Modules
^^^^^
Unibuild modules in here. modules included and called before unibuild files. Defining main functins and detecting target and host functions in here. Also default fallback variables defined here. Unibuild require **_fetch** function for getting sources. Other functions are optional.
Api
^^^
Unibuild helper function defined here. Included before unibuild files. All functions are optional. Modules can use api functions.
You can define **minver** value for required minimum unibuild api version and you can define **maxver** value for required maximum unibuild api version. Default value is current version.
Hooks
^^^^
Hook functions included after unibuild files so override unibuild files. you don't have to define unibuild function or variable in here. All hook functions are optional.
Target
^^^^
Target functions are package manager specific functions. More detail : doc/development/target.rst
Host
^^^^
Host functions are distribution specific functions. More detail : doc/development/host.rst
unibuildrc file
========
Firstly imported file. **$HOME/.unibuildrc**
All unibuild functions override unibuildrc file.
unibuild-ed010b9565c7d9668efec4206080009b3c4776f7/doc/development/host.rst 0000664 0000000 0000000 00000001065 14046377771 0024743 0 ustar 00root root 0000000 0000000 Create new host
=================
Host file must be within **host/** directory. For auto detecting host, you should edit **modules/autohost** file.
Only **_get_build_deps** function needed. We must use **builddepends** array con check and install build dependencies.
for example:
.. code-block:: shell
_get_build_deps(){
needed="" #missing package list
for i in ${builddepends[@]}
do
[ -f /info/$i ] || needed="$needed $i"
done
if [ "$needed" != "" ] ; then
err "Missing: $needed"
.... # package installation command or exit
fi
}
unibuild-ed010b9565c7d9668efec4206080009b3c4776f7/doc/development/target.rst 0000664 0000000 0000000 00000002363 14046377771 0025256 0 ustar 00root root 0000000 0000000 Create new target
=================
Target functions must be within **target/** directory in source code.
For adding automaticaly detecting target you should edit **modules/autotarget** file.
Target functions override unibuild files functions so you don't have to define unibuild function or variable in target file.
We need two functions. **_create_metadata** and **_package**. You can create helper functions.
Target functions run in **$PKGDIR**.
__create_metadata
^^^^^^^^^^^^^^^^^
This function generate package info file. You should write package information and files list.
for example:
.. code-block:: shell
_create_metadata(){
mkdir $PKGDIR/info/
echo "Name: $name" >> $PKGDIR/info/$name
echo "Version: $version" >> $PKGDIR/info/$name
echo "Summary: $summary" >> $PKGDIR/info/$name
echo "Description: $description" >> $PKGDIR/info/$name
cd $INSTALLDIR
find >> $PKGDIR/info/$name.files
}
_package
^^^^^^^^
This function create binary package file. You should compress or archive build files.
Installed files avaiable in **$INSTALLDIR**. You can copy all files in **$INSTALLDIR** to **$PKGDIR**.
for example:
.. code-block:: shell
_package(){
cp -prfv $INSTALLDIR/* $PKGDIR/
cd $PKGDIR
tar -cf $CURDIR/$name-$version.tar *
}
unibuild-ed010b9565c7d9668efec4206080009b3c4776f7/example/ 0000775 0000000 0000000 00000000000 14046377771 0021576 5 ustar 00root root 0000000 0000000 unibuild-ed010b9565c7d9668efec4206080009b3c4776f7/example/example 0000664 0000000 0000000 00000000770 14046377771 0023160 0 ustar 00root root 0000000 0000000 #!/bin/bash
name="unibuild"
version="1.0"
summary="Universal builder"
executable="unibuild"
description="The universal build system for posix"
builddepends=("bash")
depends=("curl" "wget" "bash")
license="gplv3"
release="1"
source=(git+https://gitlab.com/sulinos/devel/unibuild)
_setup(){
# Unibuild has single source mode. so do not do this action
# export WORKDIR=$WORKDIR/unibuild
echo "Setup not needed"
}
_build(){
chmod +x ./install.sh
}
_install(){
DESTDIR=$INSTALLDIR ./install.sh
}
unibuild-ed010b9565c7d9668efec4206080009b3c4776f7/example/example_git 0000664 0000000 0000000 00000000532 14046377771 0024017 0 ustar 00root root 0000000 0000000 #!/bin/bash
name="inary"
version="1.4"
summary="Inary package manager"
executable="inary"
description="Package manager for sulinos"
builddepends=("python3")
depends=("python3" "curl")
license="gplv3"
release="1"
source=(git+https://gitlab.com/sulinos/devel/inary::develop)
_build(){
make build
}
_install(){
make install DESTDIR=$INSTALLDIR
}
unibuild-ed010b9565c7d9668efec4206080009b3c4776f7/example/example_no_functions 0000664 0000000 0000000 00000000375 14046377771 0025745 0 ustar 00root root 0000000 0000000 #!/bin/bash
name="bash"
version="5.0"
summary="Bash shell"
executable="bash"
description="The bash shell"
builddepends=("gcc")
depends=("readline")
license="gplv3"
release="1"
source=(https://ftp.gnu.org/gnu/bash/bash-5.0.tar.gz)
#BuildType="autotools"
unibuild-ed010b9565c7d9668efec4206080009b3c4776f7/install.sh 0000664 0000000 0000000 00000000070 14046377771 0022142 0 ustar 00root root 0000000 0000000 #!/bin/bash
./configure --prefix=/usr
make
make install
unibuild-ed010b9565c7d9668efec4206080009b3c4776f7/netinst.sh 0000664 0000000 0000000 00000000304 14046377771 0022160 0 ustar 00root root 0000000 0000000 tmpdir=$(mktemp -d)
cd $tmpdir
wget https://gitlab.com/sulinos/devel/unibuild/-/archive/master/unibuild-master.tar.gz -O unibuild.tar.gz
tar -xf unibuild.tar.gz
cd unibuild-master
bash install.sh
unibuild-ed010b9565c7d9668efec4206080009b3c4776f7/readme.rst 0000664 0000000 0000000 00000000674 14046377771 0022141 0 ustar 00root root 0000000 0000000 unibuild
========
The universal **build** script system.
Easy install
============
.. code-block:: shell
curl -s https://gitlab.com/sulinos/devel/unibuild/-/raw/master/netinst.sh | bash -s --
for install
===========
DESTDIR=*your_DESTDIR* bash install.sh
Simple usage
============
[TARGET=*your_target*] **unibuild** [*file/url*]
Documentation
=============
Visit https://gitlab.com/sulinos/devel/unibuild/-/blob/master/doc/building.rst
unibuild-ed010b9565c7d9668efec4206080009b3c4776f7/src/ 0000775 0000000 0000000 00000000000 14046377771 0020732 5 ustar 00root root 0000000 0000000 unibuild-ed010b9565c7d9668efec4206080009b3c4776f7/src/Makefile.am 0000664 0000000 0000000 00000000172 14046377771 0022766 0 ustar 00root root 0000000 0000000 unidir = $(pkglibdir)
bin_SCRIPTS = unibuild
nobase_dist_uni_DATA = api/* host/* hooks/* modules/* posthooks/* target/*
unibuild-ed010b9565c7d9668efec4206080009b3c4776f7/src/api/ 0000775 0000000 0000000 00000000000 14046377771 0021503 5 ustar 00root root 0000000 0000000 unibuild-ed010b9565c7d9668efec4206080009b3c4776f7/src/api/00-loggers 0000664 0000000 0000000 00000000346 14046377771 0023310 0 ustar 00root root 0000000 0000000 #!/bin/bash
msg(){
echo -e "\033[32;1m$*\033[;0m"
}
warn(){
echo -e "\033[33;1m$*\033[;0m"
}
err(){
echo -e "\033[31;1m$*\033[;0m" > /dev/stderr
}
info(){
echo -e "\033[34;1m$*\033[;0m"
}
fail_message() {
err "$@"
exit 1
}
unibuild-ed010b9565c7d9668efec4206080009b3c4776f7/src/api/apiversion 0000664 0000000 0000000 00000000130 14046377771 0023577 0 ustar 00root root 0000000 0000000 #!/bin/bash
export minver=${unibuild_api_version}
export maxver=${unibuild_api_version}
unibuild-ed010b9565c7d9668efec4206080009b3c4776f7/src/api/autotools 0000664 0000000 0000000 00000000212 14046377771 0023452 0 ustar 00root root 0000000 0000000 #!/bin/bash
export NOCONFIGURE=1
confmake(){
./configure --prefix=/usr "$@"
make -j$(nproc)
}
conf(){
./configure --prefix=/usr "$@"
}
unibuild-ed010b9565c7d9668efec4206080009b3c4776f7/src/api/clean 0000664 0000000 0000000 00000000453 14046377771 0022512 0 ustar 00root root 0000000 0000000 #!/bin/bash
remove(){
if [ -e "$1" ] ; then
warn "Removing $1"
rm -rf "$1"
fi
}
remove_additional(){
remove $INSTALLDIR/usr/share/man
remove $INSTALLDIR/usr/share/help
remove $INSTALLDIR/usr/share/locale
remove $INSTALLDIR/usr/share/doc
}
remove_devel(){
remove $INSTALLDIR/usr/include
}
unibuild-ed010b9565c7d9668efec4206080009b3c4776f7/src/api/cmaketools 0000664 0000000 0000000 00000000143 14046377771 0023565 0 ustar 00root root 0000000 0000000 #!/bin/bash
cmake_configure(){
mkdir build
cd build
cmake .. -DCMAKE_INSTALL_PREFIX=/usr "$@"
}
unibuild-ed010b9565c7d9668efec4206080009b3c4776f7/src/api/functions 0000664 0000000 0000000 00000000303 14046377771 0023432 0 ustar 00root root 0000000 0000000 #!/bin/bash
fn_exists(){
LC_ALL=C type $1 2>/dev/null | grep -q 'function' &>/dev/null
}
is_target(){
[ "$TARGET" == "$1" ]
}
is_host(){
[ "$HOST" == "$1" ]
}
notnull(){
[ "$1" == "" ]
}
unibuild-ed010b9565c7d9668efec4206080009b3c4776f7/src/api/github 0000664 0000000 0000000 00000000343 14046377771 0022710 0 ustar 00root root 0000000 0000000 #!/bin/bash
github(){
user=$1
project=$2
version=$(curl https://github.com/$user/$project/releases | grep "/.*..tar.gz" | sed "s/.*href=\"//g" | sed "s/\".*//g" | grep "^/" | head -n 1)
echo https://github.com$version
}
unibuild-ed010b9565c7d9668efec4206080009b3c4776f7/src/api/import-source 0000664 0000000 0000000 00000000344 14046377771 0024237 0 ustar 00root root 0000000 0000000 #!/bin/bash
import_source(){
if [ -f "$1" ] || [ "$#" == "0" ] ; then
source <(cat $1)
elif echo "$1" | grep "^.*://" &>/dev/null ; then
source <(curl $1)
else
err "Source not detected or not supported."
exit 1
fi
}
unibuild-ed010b9565c7d9668efec4206080009b3c4776f7/src/api/mesontools 0000664 0000000 0000000 00000000435 14046377771 0023632 0 ustar 00root root 0000000 0000000 #!/bin/bash
unibuild-meson(){
meson setup \
--prefix /usr \
--libexecdir lib \
--sbindir bin \
--buildtype plain \
--auto-features enabled \
--wrap-mode nodownload \
-D b_lto=false \
-D b_pie=true \
"$@"
}
unibuild-ed010b9565c7d9668efec4206080009b3c4776f7/src/api/pkgparser 0000664 0000000 0000000 00000000225 14046377771 0023423 0 ustar 00root root 0000000 0000000 #!/bin/bash
is_pkg(){
[ "$package" == "$1" ]
}
takedir(){
mkdir -p $INSTALLDIR/$(dirname $2)
mv $INSTALLDIR/../../$1/install/$2/ $INSTALLDIR/$2
}
unibuild-ed010b9565c7d9668efec4206080009b3c4776f7/src/api/run-function 0000664 0000000 0000000 00000000257 14046377771 0024061 0 ustar 00root root 0000000 0000000 #!/bin/bash
run_function(){
fnc="$1"
if fn_exists "_$fnc" ; then
cd $WORKDIR
msg ">>> Running $fnc function"
_$fnc || fail_message "Failed to run $fnc function."
fi
}
unibuild-ed010b9565c7d9668efec4206080009b3c4776f7/src/hooks/ 0000775 0000000 0000000 00000000000 14046377771 0022055 5 ustar 00root root 0000000 0000000 unibuild-ed010b9565c7d9668efec4206080009b3c4776f7/src/hooks/00-single-source 0000664 0000000 0000000 00000000352 14046377771 0024774 0 ustar 00root root 0000000 0000000 #!/bin/bash
if [ "$singlesource" == "true" ] ; then
if [ "$(ls -F $WORKDIR | grep \/$ | wc -l)" == "1" ] ; then
export WORKDIR="$WORKDIR/$(ls -F $WORKDIR | grep \/$)"
fi
info "Single source detected: new workdir => $WORKDIR"
fi
unibuild-ed010b9565c7d9668efec4206080009b3c4776f7/src/hooks/01-auto-buildtype 0000664 0000000 0000000 00000000672 14046377771 0025172 0 ustar 00root root 0000000 0000000 #!/bin/bash
if fn_exists "_setup" || fn_exists "_build" || fn_exists "_install" ; then
info "Auto build type detection disabled."
elif [ "$BuildType" != "" ] ; then
info "Build Type found."
elif [ -f "$WORKDIR/meson.build" ] ; then
BuildType="meson"
elif [ -f "$WORKDIR/CMakeLists.txt" ] ; then
BuildType="cmake"
elif [ -f "$WORKDIR/setup.py" ] ; then
BuildType="python"
elif [ -f "$WORKDIR/configure" ] ; then
BuildType="autotools"
fi
unibuild-ed010b9565c7d9668efec4206080009b3c4776f7/src/hooks/01-relations 0000664 0000000 0000000 00000000523 14046377771 0024216 0 ustar 00root root 0000000 0000000 #!/bin/bash
info "Unibuild api version = ${unibuild_api_version}"
if [ ${unibuild_api_version} -lt ${minver} ] ; then
warn "Required minimum version = ${minver}"
err "Please update unibuild."
exit 1
fi
if [ ${unibuild_api_version} -gt ${maxver} ] ; then
warn "Required maximum version = ${maxver}"
err "Building aborted."
exit 1
fi
unibuild-ed010b9565c7d9668efec4206080009b3c4776f7/src/hooks/autotools 0000664 0000000 0000000 00000000375 14046377771 0024036 0 ustar 00root root 0000000 0000000 #!/bin/bash
if [ "$BuildType" == "autotools" ] ; then
_setup(){
if [ -f "./autogen.sh" ] ; then
NOCONFIGURE=1 ./autogen.sh
fi
conf ${CONFIG_OPTIONS[@]}
}
_build(){
make -j$(nproc)
}
_install(){
make install DESTDIR=$INSTALLDIR
}
fi
unibuild-ed010b9565c7d9668efec4206080009b3c4776f7/src/hooks/cmaketools 0000664 0000000 0000000 00000000277 14046377771 0024147 0 ustar 00root root 0000000 0000000 #!/bin/bash
if [ "$BuildType" == "cmake" ] ; then
_setup(){
cmake_configure ${CONFIG_OPTIONS[@]}
}
_build(){
make -j$(nproc)
}
_install(){
make install DESTDIR=$INSTALLDIR
}
fi
unibuild-ed010b9565c7d9668efec4206080009b3c4776f7/src/hooks/mesontools 0000664 0000000 0000000 00000000317 14046377771 0024203 0 ustar 00root root 0000000 0000000 #!/bin/bash
if [ "$BuildType" == "meson" ] ; then
_setup(){
unibuild-meson build ${CONFIG_OPTIONS[@]}
}
_build(){
ninja -C build
}
_install(){
DESTDIR="$INSTALLDIR" meson install -C build
}
fi
unibuild-ed010b9565c7d9668efec4206080009b3c4776f7/src/hooks/pythontools 0000664 0000000 0000000 00000000341 14046377771 0024400 0 ustar 00root root 0000000 0000000 #!/bin/bash
if [ "$BuildType" == "python" ] ; then
_setup(){
info "Setup not needed"
}
_build(){
python3 setup.py build
}
_install(){
python3 setup.py install --root="$INSTALLDIR" --optimize=1 --skip-build
}
fi
unibuild-ed010b9565c7d9668efec4206080009b3c4776f7/src/host/ 0000775 0000000 0000000 00000000000 14046377771 0021707 5 ustar 00root root 0000000 0000000 unibuild-ed010b9565c7d9668efec4206080009b3c4776f7/src/host/arch 0000775 0000000 0000000 00000000403 14046377771 0022547 0 ustar 00root root 0000000 0000000 #!/bin/bash
_get_build_deps(){
needed=""
for i in ${builddepends[@]}
do
pacman -Qs $i > /dev/null || needed="$needed $i"
done
if [ "$needed" != "" ] ; then
err "Missing: $needed"
su -c "pacman -S $needed" || exit 1
fi
} unibuild-ed010b9565c7d9668efec4206080009b3c4776f7/src/host/debian 0000664 0000000 0000000 00000000426 14046377771 0023056 0 ustar 00root root 0000000 0000000 #!/bin/bash
_get_build_deps(){
needed=""
for i in ${builddepends[@]}
do
cat /var/lib/dpkg/status | grep "^Package: $i$" &>/dev/null || needed="$needed $i"
done
if [ "$needed" != "" ] ; then
err "Missing: $needed"
su -c "apt-get install $needed" || exit 1
fi
}
unibuild-ed010b9565c7d9668efec4206080009b3c4776f7/src/host/default 0000664 0000000 0000000 00000000310 14046377771 0023250 0 ustar 00root root 0000000 0000000 #!/bin/bash
_get_build_deps(){
needed=""
for i in ${builddepends[@]}
do
[ -f /info/$i ] || needed="$needed $i"
done
if [ "$needed" != "" ] ; then
err "Missing: $needed"
exit 1
fi
}
unibuild-ed010b9565c7d9668efec4206080009b3c4776f7/src/host/inary 0000664 0000000 0000000 00000000372 14046377771 0022756 0 ustar 00root root 0000000 0000000 #!/bin/bash
_get_build_deps(){
needed=""
for i in ${builddepends[@]}
do
ls /var/lib/inary/package/"$i"-[0-9]* || needed="$needed $i"
done
if [ "$needed" != "" ] ; then
err "Missing: $needed"
su -c "inary it $needed" || exit 1
fi
}
unibuild-ed010b9565c7d9668efec4206080009b3c4776f7/src/modules/ 0000775 0000000 0000000 00000000000 14046377771 0022402 5 ustar 00root root 0000000 0000000 unibuild-ed010b9565c7d9668efec4206080009b3c4776f7/src/modules/autodistro 0000664 0000000 0000000 00000000772 14046377771 0024530 0 ustar 00root root 0000000 0000000 #!/bin/bash
if [ -f "/etc/lsb-release" ] ; then
export DISTRO=$(cat /etc/lsb-release | grep "^DISTRIB_ID=" | head -n 1 | sed "s/.*=//g")
elif [ -f "/etc/os-release" ] ; then
export DISTRO=$(cat /etc/os-release | grep "^NAME=" | head -n 1 | sed "s/.*=//g")
elif [ -d /var/lib/dpkg/ ] ; then
export DISTRO="Debian"
elif [ -d /var/lib/inary ] ; then
export DISTRO="Sulin"
elif [ -d /var/lib/pacman ] ; then
export DISTRO="Arch"
else
export DISTRO="Unknown"
fi
info "Distro=$DISTRO"
info "Type=$(uname)"
unibuild-ed010b9565c7d9668efec4206080009b3c4776f7/src/modules/autohost 0000664 0000000 0000000 00000000400 14046377771 0024165 0 ustar 00root root 0000000 0000000 #!/bin/bash
if [ "$HOST" == "" ] ; then
if [ -d /var/lib/dpkg ] ; then
export HOST=debian
elif [ -d /var/lib/inary ] ; then
export HOST=inary
elif [ -d /var/lib/pacman ] ; then
export HOST=arch
else
export HOST=default
fi
fi
info "Host=$HOST"
unibuild-ed010b9565c7d9668efec4206080009b3c4776f7/src/modules/autotarget 0000664 0000000 0000000 00000001411 14046377771 0024501 0 ustar 00root root 0000000 0000000 #!/bin/bash
if [ "$TARGET" == "" ] ; then
if [ -d /var/lib/dpkg ] ; then
export TARGET=debian
elif [ -d /var/lib/inary ] ; then
export TARGET=inary
elif [ -d /var/lib/pacman ] ; then
export TARGET=arch
else
export TARGET=default
fi
fi
set +e
if [ "$TARGET" == "debian" ] ; then
if [ "$arch" == "" ] ; then
[ "$(uname -m)" == "x86_64" ] && arch="amd64" || true
[ "$(uname -m)" == "i686" ] && arch="i386" || true
[ "$(uname -m)" == "aarch64" ] && arch="arm64" || true
[ "$(uname -m)" == "armhf" ] && arch="arm" || true
fi
elif [ "$TARGET" == "inary" ] ; then
if [ "$arch" == "" ] ; then
arch="$(uname -m)"
fi
elif [ "$TARGET" == "arch" ] ; then
if [ "$arch" == "" ] ; then
arch="$(uname -m)"
fi
fi
set -e
info "Target=$TARGET"
info "Arch=$arch"
unibuild-ed010b9565c7d9668efec4206080009b3c4776f7/src/modules/directories 0000664 0000000 0000000 00000000310 14046377771 0024633 0 ustar 00root root 0000000 0000000 #!/bin/bash
declare -r CURDIR="$(pwd)"
[ "$BUILDDIR" == "" ] && export BUILDDIR=$(mktemp -d)
export WORKDIR=$BUILDDIR/work
mkdir -p $WORKDIR
info "Build Directory=$BUILDDIR"
export singlesource=true
unibuild-ed010b9565c7d9668efec4206080009b3c4776f7/src/modules/fetcher 0000664 0000000 0000000 00000002672 14046377771 0023754 0 ustar 00root root 0000000 0000000 #!/bin/bash
_fetch(){
cd $WORKDIR
for src in ${source[@]} ; do
if [ -f $CURDIR/$src ] ; then
info "Copying: $src"
cp -prfv $CURDIR/$src $WORKDIR/
elif [ -d $CURDIR/$src ] ; then
info "Copying: $src"
cp -prfv $CURDIR/$src $WORKDIR/
elif echo "$src" | grep "git://" &>/dev/null ; then
srcloc=$(echo $src | sed "s|^.*git://|git://|g" | sed "s/::.*//g")
srcname=$(echo $src | sed "s|::git://.*$||g")
branch=$(echo $src | sed "s|^.*::||g")
echo $srcloc $srcname $branch
info "Clonning: $srcloc"
if [ "$branch" == "" ] ; then
[ -d "$srcname" ] || git clone $srcloc $srcname
else
[ -d "$srcname" ] || git clone $srcloc $srcname -b $branch
fi
elif echo "$src" | grep "^git+" &>/dev/null ; then
srcloc=$(echo $src | sed "s|^git+||g" | sed "s/::.*//g")
echo $src | grep "::" &>/dev/null && branch=$(echo $src | sed "s|^.*::||g")
echo $srcloc $srcname $branch
info "Clonning: $srcloc"
if [ "$branch" == "" ] ; then
git clone $srcloc || true
else
git clone $srcloc -b $branch || true
fi
elif echo "$src" | grep "::http" &>/dev/null ; then
srcloc=$(echo $src | sed "s|^.*::||g")
srcname=$(echo $src | sed "s|::http.*$||g")
echo $srcloc
info "Downloading: $srcloc"
wget -c $srcloc -O $srcname
echo $srcname | grep ".tar.*" && tar -xf $srcname
else
info "Downloading: $srcloc"
wget -c $src -O $(basename $src) || true
basename $src | grep ".tar.*" && tar -xf $(basename $src) || true
fi
done
cd $CURDIR
}
unibuild-ed010b9565c7d9668efec4206080009b3c4776f7/src/modules/fuckwsl 0000664 0000000 0000000 00000000222 14046377771 0023777 0 ustar 00root root 0000000 0000000 #!/bin/bash
wsl_block(){
var=$(uname -r)
if [[ "$var" == *Microsoft* || "$var" == "*WSL*" ]]
then
exit 1
fi
}
wsl_block
unibuild-ed010b9565c7d9668efec4206080009b3c4776f7/src/modules/packages 0000664 0000000 0000000 00000000700 14046377771 0024100 0 ustar 00root root 0000000 0000000 #!/bin/bash
export name="unnamed"
export version="1.0"
export release="1"
export homepage="https://example.github.io"
export url="https://gitlab.com/example"
export priority="unknown"
export date="01.01.1970"
if [ -z $maintainer ]; then
export maintainer="packager"
fi
if [ -z $email ]; then
export email="packager@package.org"
fi
export summary="summary missing"
export description="description missing"
export size="31"
export license="gplv3"
unibuild-ed010b9565c7d9668efec4206080009b3c4776f7/src/modules/variables 0000664 0000000 0000000 00000000167 14046377771 0024301 0 ustar 00root root 0000000 0000000 #!/bin/bash
export CC=gcc
export CXX=g++
export CFLAGS="-O3 -s"
export CXXFLAGS="-O3 -s"
export LANG=C
export LC_ALL=C
unibuild-ed010b9565c7d9668efec4206080009b3c4776f7/src/posthooks/ 0000775 0000000 0000000 00000000000 14046377771 0022763 5 ustar 00root root 0000000 0000000 unibuild-ed010b9565c7d9668efec4206080009b3c4776f7/src/posthooks/check-broken 0000664 0000000 0000000 00000000262 14046377771 0025241 0 ustar 00root root 0000000 0000000 #!/bin/bash
[ "$PKGS" == "" ] && PKGS=$name
for package in ${PKGS[@]} ; do
export INSTALLDIR=$BUILDDIR/$package/install
find -L $INSTALLDIR -type l | xargs echo "Broken:"
done
unibuild-ed010b9565c7d9668efec4206080009b3c4776f7/src/posthooks/la-remove 0000664 0000000 0000000 00000000350 14046377771 0024573 0 ustar 00root root 0000000 0000000 #!/bin/bash
[ "$PKGS" == "" ] && PKGS=$name
for package in ${PKGS[@]} ; do
export INSTALLDIR=$BUILDDIR/$package/install
find $INSTALLDIR -type f | grep "*.la" | while read line ; do
msg "Removed: $line"
rm -f $line
done
done
unibuild-ed010b9565c7d9668efec4206080009b3c4776f7/src/posthooks/set-executable-libraries 0000664 0000000 0000000 00000000443 14046377771 0027573 0 ustar 00root root 0000000 0000000 #!/bin/bash
[ "$PKGS" == "" ] && PKGS=$name
for package in ${PKGS[@]} ; do
export INSTALLDIR=$BUILDDIR/$package/install
find $INSTALLDIR -type f | grep "*.so$" | while read line ; do
if [ -f $line ] ; then
msg "Library detected: $(basename "$line")"
chmod +x $line
fi
done
done
unibuild-ed010b9565c7d9668efec4206080009b3c4776f7/src/target/ 0000775 0000000 0000000 00000000000 14046377771 0022220 5 ustar 00root root 0000000 0000000 unibuild-ed010b9565c7d9668efec4206080009b3c4776f7/src/target/appimage 0000664 0000000 0000000 00000005175 14046377771 0023736 0 ustar 00root root 0000000 0000000 #!/bin/bash
_write_AppRun(){
echo "#!/bin/sh"
echo 'SELF=$(readlink -f "$0")'
echo 'HERE=${SELF%/*}'
echo 'export PATH="${HERE}/usr/bin/:${HERE}/usr/sbin/:${HERE}/usr/games/:${HERE}/bin/:${HERE}/sbin/${PATH:+:$PATH}"'
echo 'export LD_LIBRARY_PATH="${HERE}/usr/lib/:${HERE}/usr/lib/i386-linux-gnu/:${HERE}/usr/lib/x86_64-linux-gnu/:${HERE}/usr/lib32/:${HERE}/usr/lib64/:${HERE}/lib/:${HERE}/lib/i386-linux-gnu/:${HERE}/lib/x86_64-linux-gnu/:${HERE}/lib32/:${HERE}/lib64/${LD_LIBRARY_PATH:+:$LD_LIBRARY_PATH}"'
echo 'export PYTHONPATH="${HERE}/usr/share/pyshared/${PYTHONPATH:+:$PYTHONPATH}"'
echo 'export XDG_DATA_DIRS="${HERE}/usr/share/${XDG_DATA_DIRS:+:$XDG_DATA_DIRS}"'
echo 'export PERLLIB="${HERE}/usr/share/perl5/:${HERE}/usr/lib/perl5/${PERLLIB:+:$PERLLIB}"'
echo 'export GSETTINGS_SCHEMA_DIR="${HERE}/usr/share/glib-2.0/schemas/${GSETTINGS_SCHEMA_DIR:+:$GSETTINGS_SCHEMA_DIR}"'
echo 'export QT_PLUGIN_PATH="${HERE}/usr/lib/qt4/plugins/:${HERE}/usr/lib/i386-linux-gnu/qt4/plugins/:${HERE}/usr/lib/x86_64-linux-gnu/qt4/plugins/:${HERE}/usr/lib32/qt4/plugins/:${HERE}/usr/lib64/qt4/plugins/:${HERE}/usr/lib/qt5/plugins/:${HERE}/usr/lib/i386-linux-gnu/qt5/plugins/:${HERE}/usr/lib/x86_64-linux-gnu/qt5/plugins/:${HERE}/usr/lib32/qt5/plugins/:${HERE}/usr/lib64/qt5/plugins/${QT_PLUGIN_PATH:+:$QT_PLUGIN_PATH}"'
echo 'EXEC=$(grep -e "^Exec=.*" "${HERE}"/*.desktop | head -n 1 | cut -d "=" -f 2 | cut -d " " -f 1)'
echo 'exec "${EXEC}" "$@"'
}
_write_desktop(){
echo "[Desktop Entry]"
echo "Type=Application"
echo "Name=$name"
[ "$executable" == "" ] && export executable=$name
echo "Exec=$executable"
echo "Comment=$summary"
[ "$icon" == "" ] && export icon=$name
echo "Icon=$name"
if [ "$categories" == "" ] ; then
echo "Categories=$categories"
fi
echo "Terminal=false"
}
copy_library(){
while read stuff
do
ldd $stuff | grep "=>" | awk '{print $3}' | while read line
do
if [ -f $line ] ; then
mkdir -p $PKGDIR/$line || true
rmdir $PKGDIR/$line || true
cat $line > $PKGDIR/$line || true
cat $(readlink -f $line) > $PKGDIR/$(readlink -f $line)
chmod +x $PKGDIR/$line
fi
done
done
}
_create_metadata(){
cd $PKGDIR
_write_AppRun > $PKGDIR/AppRun
chmod +x $PKGDIR/AppRun
_write_desktop > $PKGDIR/$name.desktop
touch $PKGDIR/$name.png
}
_package(){
# checking appimagekit
if [ ! -f ~/.appimagekit ] ; then
wget -c https://github.com/AppImage/AppImageKit/releases/download/continuous/appimagetool-$(uname -m).AppImage -O ~/.appimagekit
chmod +x ~/.appimagekit
fi
cp -prfv $INSTALLDIR/* $PKGDIR/
[ "${PORTABLE}" == "true" ] && find $INSTALLDIR | copy_library &> /dev/null || true
cd $CURDIR
ARCH=$(uname -m) ~/.appimagekit $PKGDIR
}
unibuild-ed010b9565c7d9668efec4206080009b3c4776f7/src/target/arch 0000775 0000000 0000000 00000005661 14046377771 0023073 0 ustar 00root root 0000000 0000000 #!/bin/bash
SOURCE_DATE_EPOCH=$(date +'%s')
if ! type -p gettext >/dev/null; then
gettext() {
printf "%s\n" "$@"
}
fi
write_kv_pair() {
local key="$1"
shift
for val in "$@"; do
if [[ $val = *$'\n'* ]]; then
error "Invalid value for $key $val"
exit $E_PKGBUILD_ERROR
fi
printf "%s = %s\n" "$key" "$val"
done
}
list_package_files() {
(
export LC_COLLATE=C
shopt -s dotglob globstar
# bash 5.0 only works with combo directory + file globs
printf '%s\0' **/*
)
}
__write_pkginfo() {
#Create .PKGINFO
echo -e "# Generated by unibuild"
echo -e "# using $(fakeroot -v)"
echo -e "pkgname = $name"
echo -e "pkgbase = $name"
echo -e "pkgver = $version-$release"
echo -e "pkgdesc = $description"
echo -e "url = $url"
echo -e "builddate = $SOURCE_DATE_EPOCH"
echo -e "packager = $maintainer"
echo -e "size = $(du -sb $INSTALLDIR | cut -f1)"
echo -e "arch = $arch"
echo -e "license = $license"
write_kv_pair "replaces" "${replaces[@]}"
write_kv_pair "group" "${groups[@]}"
write_kv_pair "conflict" "${conflicts[@]}"
write_kv_pair "provides" "${provides[@]}"
write_kv_pair "backup" "${backup[@]}"
write_kv_pair "depend" "${depends[@]}"
write_kv_pair "optdepend" "${optdepends[@]//+([[:space:]])/ }"
write_kv_pair "makedepend" "${builddepends[@]}"
write_kv_pair "checkdepend" "${checkdepends[@]}"
}
__write_buildinfo() {
#Create .BUILDINFO
echo -e "format = 2" >> $PKGDIR/.BUILDINFO
echo -e "pkgname = $name" >> $PKGDIR/.BUILDINFO
echo -e "pkgbase = $name" >> $PKGDIR/.BUILDINFO
echo -e "pkgver = $version-$release" >> $PKGDIR/.BUILDINFO
echo -e "pkgarch = $arch" >> $PKGDIR/.BUILDINFO
local sum="$(sha256sum "$CURDIR/$unibuild_file")"
sum=${sum%% *}
echo -e "pkgbuild_sha256sum = $sum" >> $PKGDIR/.BUILDINFO
echo -e "packager = $maintainer" >> $PKGDIR/.BUILDINFO
echo -e "builddate = $SOURCE_DATE_EPOCH" >> $PKGDIR/.BUILDINFO
echo -e "builddir = $BUILDDIR" >> $PKGDIR/.BUILDINFO
local pkginfos_parsed=($(LC_ALL=pkexec sh -c "pacman -Qi" | awk -F': ' '\
/^Name .*/ {printf "%s", $2} \
/^Version .*/ {printf "-%s", $2} \
/^Architecture .*/ {print "-"$2} \
'))
write_kv_pair "installed" "${pkginfos_parsed[@]}"
}
__create_install_script() {
if [ -f "$CURDIR/$install" ]; then
cat $CURDIR/$install >> $PKGDIR/.INSTALL
fi
}
_create_metadata(){
__write_pkginfo >> $PKGDIR/.PKGINFO
__write_buildinfo >> $PKGDIR/.BUILDINFO
__create_install_script
}
_package(){
cp -prfv $INSTALLDIR/* $PKGDIR/
cd $PKGDIR
#Create .MTREE
list_package_files | LANG=C bsdtar -cnf - --format=mtree \
--options='!all,use-set,type,uid,gid,mode,time,size,md5,sha256,link' \
--null --files-from - --exclude .MTREE | gzip -c -f -n > .MTREE
if [ -f "$PKGDIR/.INSTALL" ]; then
tar --xz -cf $CURDIR/$name-$version-$release.pkg.tar.xz * .PKGINFO .BUILDINFO .MTREE .INSTALL
else
tar --xz -cf $CURDIR/$name-$version-$release.pkg.tar.xz * .PKGINFO .BUILDINFO .MTREE
fi
}
unibuild-ed010b9565c7d9668efec4206080009b3c4776f7/src/target/debian 0000664 0000000 0000000 00000002414 14046377771 0023366 0 ustar 00root root 0000000 0000000 #!/bin/bash
_write_metadata(){
echo -e "Package: $name"
#echo -e "Source: $source"
echo -e "Version: $version"
notnull $partof && echo -e "Section: $partof"
notnull $priority && echo -e "Priority: $priority"
echo -e "Architecture: $arch"
echo -e "Maintainer: $maintainer <$email>"
echo -e "Installed-Size: $(du -s $INSTALLDIR | cut -f 1)"
if [ "${#depends[@]}" -gt 0 ] ; then
echo -ne "Depends:"
for dep in ${depends[@]}
do
echo -ne " $dep,"
done | sed "s/,$//g" ; echo
fi
echo -e "Homepage: $homepage"
echo -e "Date: $(date +'%d/%m/%Y-%H:%M:%S')"
echo -e "Description: $description\n"
}
_create_metadata(){
mkdir -p $PKGDIR/DEBIAN
if [ -d "$debdir" ]; then
cp -prfv $debdir/* $PKGDIR/DEBIAN
else
_write_metadata > $PKGDIR/DEBIAN/control
fi
find $INSTALLDIR/ -type d | xargs chmod 755
find $INSTALLDIR/ -type f -exec md5sum {} \; > $PKGDIR/md5sums
}
_package(){
if [ -f /var/lib/dpkg/status ] ; then
cp -prf $INSTALLDIR/* $PKGDIR/
dpkg -b $PKGDIR "$CURDIR/${name}_${arch}_${version}.deb"
else
cd $INSTALLDIR
tar --xz -cvf $PKGDIR/data.tar.xz ./*
cd $PKGDIR/DEBIAN
tar --xz -cvf $PKGDIR/control.tar.xz *
echo "2.0" > $PKGDIR/debian-binary
cd $PKGDIR
ar r "$CURDIR/${name}_${arch}_${version}.deb" debian-binary control.tar.xz data.tar.xz
fi
}
unibuild-ed010b9565c7d9668efec4206080009b3c4776f7/src/target/default 0000664 0000000 0000000 00000002370 14046377771 0023571 0 ustar 00root root 0000000 0000000 #!/bin/bash
__write_remove(){
cd $INSTALLDIR
find | sort | while read line
do
if [ -f $line ] ; then
echo "rm -f $line" | sed "s/\.\//\//g"
fi
done
find | sort -r | while read line
do
if [ -d $line ] && [ $line != "." ] ; then
echo "rmdir $line 2>/dev/null" | sed "s/\.\//\//g"
fi
done
echo "rm -f /info/$name"
echo "rm -f /info/$name.remove"
}
_create_metadata(){
mkdir $PKGDIR/info/
echo "----begin----" >> $PKGDIR/info/$name
echo "Build date: $(date)" >> $PKGDIR/info/$name
echo "Maintainer name: $maintainer" >> $PKGDIR/info/$name
echo "Maintainer email: $email" >> $PKGDIR/info/$name
echo "----info----" >> $PKGDIR/info/$name
echo "Name: $name" >> $PKGDIR/info/$name
echo "Version: $version" >> $PKGDIR/info/$name
echo "Summary: $summary" >> $PKGDIR/info/$name
echo "Description: $description" >> $PKGDIR/info/$name
echo "----depends----" >> $PKGDIR/info/$name
for dep in ${depends[@]}
do
echo "$dep" >> $PKGDIR/info/$name
done
echo "----files----" >> $PKGDIR/info/$name
cd $INSTALLDIR
find -type f | xargs md5sum >> $PKGDIR/info/$name
echo "----end----" >> $PKGDIR/info/$name
__write_remove >> $PKGDIR/info/$name.remove
}
_package(){
cp -prfv $INSTALLDIR/* $PKGDIR/
cd $PKGDIR
tar -cf $CURDIR/$name-$version.tar *
}
unibuild-ed010b9565c7d9668efec4206080009b3c4776f7/src/target/inary 0000664 0000000 0000000 00000006501 14046377771 0023267 0 ustar 00root root 0000000 0000000 #!/bin/bash
__write_metadata(){
echo -e ""
echo -e " "
echo -e " "
echo -e " "
if [ ! "$partof" == "" ] ; then
echo -e " $partof"
fi
echo -e " $name"
echo -e " $summary"
echo -e " $description"
if [ ! "${#isa[@]}" == "0" ] ; then
for i in ${isa[@]} ; do
echo -e " $i"
done
fi
echo -e " $license"
echo -e " "
for dep in ${depends[@]}
do
echo -e " $dep"
done
echo -e " "
echo -e " "
echo -e " /usr"
echo -e " /etc"
echo -e " /bin"
echo -e " /var"
echo -e " /lib"
echo -e " /boot"
echo -e " "
echo -e " "
echo -e " "
echo -e " $date"
echo -e " $version"
echo -e " Auto generated."
echo -e " $maintainer"
echo -e " $email"
echo -e " "
echo -e " "
echo -e " uludag"
echo -e " Sulin"
echo -e " 2019"
echo -e " $arch"
echo -e " 1"
echo -e " @tarhash@"
echo -e " 1.2"
echo -e " "
echo -e ""
}
_create_metadata(){
__write_metadata >> $PKGDIR/metadata.xml
}
_package(){
cd $INSTALLDIR
[ -f ../install.tar.xz ] && rm -f ../install.tar.xz
tar --xz -cf ../install.tar.xz *
echo -e "" > ../files.xml
find | sed "s|^\./||g" | while read line
do
if [ -f "$line" ] ; then
echo -e " " >> ../files.xml
echo -e " $line" >> ../files.xml
echo -e " data" >> ../files.xml
echo -e " "$(du -b "$INSTALLDIR/$line" | awk '{print $1}')"" >> ../files.xml
echo -e " 0" >> ../files.xml
echo -e " 0" >> ../files.xml
echo -e " 0o755" >> ../files.xml
echo -e " "$(sha1sum "$INSTALLDIR/$line" | awk '{print $1}')"" >> ../files.xml
echo -e " " >> ../files.xml
fi
done
echo -e "" >> ../files.xml
mv ../files.xml $PKGDIR/files.xml
mv ../install.tar.xz $PKGDIR/install.tar.xz
cd $PKGDIR
export installtarhash="$(sha1sum install.tar.xz | awk '{print $1}')"
sed -i "s/@tarhash@/$installtarhash/g" metadata.xml
zip -r $CURDIR/$name-$version.inary *
}
unibuild-ed010b9565c7d9668efec4206080009b3c4776f7/src/unibuild.sh 0000664 0000000 0000000 00000005747 14046377771 0023116 0 ustar 00root root 0000000 0000000 #!/bin/bash
if [ "$UID" != "0" ] ; then
if which fakeroot &>/dev/null ; then
exec fakeroot $0 $@
else
echo "Fakeroot not found."
echo "Please install fakeroot or use root."
exit 1
fi
fi
export UNIBUILDRC="$HOME/.unibuildrc"
$(env | cut -f 1 -d '=' | grep -v "TARGET" | grep -v "UNIBUILDRC" | grep -v "HOST" | grep -v "DISTRO" | sed "s/^/unset /")
export PATH=/bin:/sbin:/usr/bin:/usr/sbin
export USER=unibuild
export HOME=$(mktemp -d)
export SHELL=/bin/bash
declare -r unibuild_api_version=4
declare -r inittime=$(date +%s%3N)
[ -f "$UNIBUILDRC" ] && source "$UNIBUILDRC"
[ "$MODDIR" == "" ] && export MODDIR=@prefix@/lib/unibuild/modules
set -e
for api in $(ls $MODDIR/../api | sort) ; do
source $MODDIR/../api/$api
done
for mod in $(ls $MODDIR) ; do
source $MODDIR/$mod
done
import_source "$1"
export unibuild_file=$1
source $MODDIR/../target/$TARGET
source $MODDIR/../host/$HOST
declare -r begintime=$(date +%s%3N)
msg ">>> Checking dependencies"
_get_build_deps || warn "Failed to check dependencies."
declare -r checktime=$(date +%s%3N)
cd $BUILDDIR
msg ">>> Getting sources"
_fetch || fail_message "Failed to get sources."
declare -r fetchtime=$(date +%s%3N)
msg ">>> Running hooks"
for hook in $(ls $MODDIR/../hooks | sort) ; do
source $MODDIR/../hooks/$hook
done
run_function setup
declare -r setuptime=$(date +%s%3N)
run_function build
declare -r buildtime=$(date +%s%3N)
run_function check
declare -r buildchecktime=$(date +%s%3N)
[ "$PKGS" == "" ] && PKGS=$name
for package in ${PKGS[@]} ; do
export PKGDIR=$BUILDDIR/$package/package
export INSTALLDIR=$BUILDDIR/$package/install
export DESTDIR=$INSTALLDIR
mkdir -p $PKGDIR $INSTALLDIR
if fn_exists "_install" ; then
cd $WORKDIR
msg ">>> Running install function for $package"
_install || fail_message "Failed to run install function for $package"
fi
done
msg ">>> Running post hooks"
export INSTALLDIR=$BUILDDIR/$package/install
for hook in $(ls $MODDIR/../posthooks | sort) ; do
source $MODDIR/../posthooks/$hook
done
declare -r installtime=$(date +%s%3N)
for package in ${PKGS[@]} ; do
export name=$package
export PKGDIR=$BUILDDIR/$package/package
export INSTALLDIR=$BUILDDIR/$package/install
mkdir -p $PKGDIR $INSTALLDIR
cd $WORKDIR
msg ">>> Generating metadata"
_create_metadata
cd $WORKDIR
msg ">>> Creating package"
_package
done
declare -r packagetime=$(date +%s%3N)
msg ">>> Clearing workdir"
rm -rf $WORKDIR
info ">>> Done"
msg "Unibuild stats (milisec):"
info " Unibuild init: $(($begintime-$inittime))"
info " Package Checking: $(($checktime-$begintime))"
info " Source fetching: $(($fetchtime-$checktime))"
info " Setup functions: $(($setuptime-$fetchtime))"
info " Source Building: $(($buildtime-$setuptime))"
info " Build Checking: $(($buildchecktime-$buildtime))"
info " Source installing: $(($installtime-$buildchecktime))"
info " Package generating: $(($packagetime-$installtime))"
info " Total time: $(($packagetime-$inittime))"
unibuild-ed010b9565c7d9668efec4206080009b3c4776f7/unibuild.unibuild 0000664 0000000 0000000 00000000443 14046377771 0023514 0 ustar 00root root 0000000 0000000 name=unibuild
version=$(cat src/unibuild.sh | grep "unibuild_api_version" | sed "s/.*=//g")
release=1
summary="Universal builder"
description="The universal builder system for different package types"
source=(./*)
_install(){
./configure --prefix=/usr
DESTDIR=$INSTALLDIR make install
}
unibuild-ed010b9565c7d9668efec4206080009b3c4776f7/uninstall.sh 0000664 0000000 0000000 00000000065 14046377771 0022511 0 ustar 00root root 0000000 0000000 #!/bin/bash
./configure --prefix=/usr
make uninstall
unibuild-ed010b9565c7d9668efec4206080009b3c4776f7/upgrade.sh 0000664 0000000 0000000 00000000034 14046377771 0022123 0 ustar 00root root 0000000 0000000 #!/bin/bash
bash install.sh