aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-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