aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSilvio Rhatto <rhatto@riseup.net>2017-09-18 17:06:42 -0300
committerSilvio Rhatto <rhatto@riseup.net>2017-09-18 17:06:42 -0300
commit3442ee78ec17ad97fc16524480f3f3e4f6a37ee6 (patch)
tree4529d43beb2757a59b0a66f2057872473b504d10
parentdd0a1af2ebb3cbb36cdaf13a4cc6fbb22bb44ec8 (diff)
downloadstowpkg-3442ee78ec17ad97fc16524480f3f3e4f6a37ee6.tar.gz
stowpkg-3442ee78ec17ad97fc16524480f3f3e4f6a37ee6.tar.bz2
Adds stowpkg_build
-rw-r--r--README.md2
-rwxr-xr-xstowpkg24
2 files changed, 19 insertions, 7 deletions
diff --git a/README.md b/README.md
index 538975f..80421c5 100644
--- a/README.md
+++ b/README.md
@@ -39,6 +39,7 @@ Usage
stowpkg search # list packages available on ports
stowpkg install <package> # install packages from source
+ stowpkg build # simple package builder (./configure && make && make install)
Coming usage
------------
@@ -49,7 +50,6 @@ Coming usage
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
------------------------------
diff --git a/stowpkg b/stowpkg
index 8ddc166..33e5eb6 100755
--- a/stowpkg
+++ b/stowpkg
@@ -123,11 +123,6 @@ stowpkg_install () {
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
@@ -166,10 +161,27 @@ stowpkg_install () {
fi
# Build
+ stowpkg_build $package $version
+}
+
+function stowpkg_build () {
+ local package="$1"
+ local version="$2"
+
+ # TODO
+ # Check for package and version
+ # Otherwise try to guess it
+
+ # Set PREFIX
+ if [ -z "$PREFIX" ]; then
+ PREFIX="$BINARIES/${package}-${version}"
+ fi
+
+ # Build
if [ -e "$location/rules" ]; then
. $location/rules
else
- # Run default rules
+ # Try default rules
if [ -e "Makefile" ]; then
make clean
fi