summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--Makefile10
-rwxr-xr-xapplets/install.sh17
-rw-r--r--busybox.spec10
-rw-r--r--examples/busybox.spec10
-rwxr-xr-xinstall.sh17
5 files changed, 41 insertions, 23 deletions
diff --git a/Makefile b/Makefile
index ddf356f..678f19e 100644
--- a/Makefile
+++ b/Makefile
@@ -48,10 +48,9 @@ else
endif
-ifndef $(prefix)
- prefix=`pwd`
+ifndef $(PREFIX)
+ PREFIX=`pwd`/busybox_install
endif
-BINDIR=$(prefix)
LIBRARIES=
OBJECTS=$(shell ./busybox.sh)
@@ -69,6 +68,7 @@ busybox.links:
clean:
- rm -f $(PROG) busybox.links *~ *.o core
+ - rm -rf busybox_install
distclean: clean
- rm -f $(PROG)
@@ -77,8 +77,8 @@ force:
$(OBJECTS): busybox.def.h internal.h Makefile
-install: $(PROG)
- install.sh $(BINDIR)
+install: busybox
+ install.sh $(PREFIX)
whichversion:
@echo $(VERSION)
diff --git a/applets/install.sh b/applets/install.sh
new file mode 100755
index 0000000..4a0b832
--- /dev/null
+++ b/applets/install.sh
@@ -0,0 +1,17 @@
+#!/bin/sh
+
+if [ "$1" == "" ]; then
+ echo "No installation directory. aborting."
+ exit 1;
+fi
+
+h=`cat busybox.links`
+
+mkdir -p $1/bin
+for i in $h ; do
+ mkdir -p $1/`echo $i | sed -e 's/\(^.*\/\)\(.*\)/\1/g' `
+ (cd $1/bin ; ln -s busybox `echo $i | sed -e 's/\(^.*\/\)\(.*\)/\2/g' ` )
+done
+rm -f $1/bin/busybox
+install -m 755 busybox $1/bin/busybox
+
diff --git a/busybox.spec b/busybox.spec
index 5e6befb..e3fbb6d 100644
--- a/busybox.spec
+++ b/busybox.spec
@@ -25,15 +25,7 @@ make
%Install
rm -rf $RPM_BUILD_ROOT
-mkdir -p $RPM_BUILD_ROOT/bin
-h=`cat busybox.links`
-
-for i in $h ; do
- mkdir -p $RPM_BUILD_ROOT/`echo $i | sed -e 's/\(^.*\/\)\(.*\)/\1/g' `
- (cd $RPM_BUILD_ROOT/bin ; ln -s busybox `echo $i | sed -e 's/\(^.*\/\)\(.*\)/\2/g' ` );
-done
-rm -f $RPM_BUILD_ROOT/bin/busybox
-install -m 755 busybox $RPM_BUILD_ROOT/bin/busybox
+make PREFIX=$RPM_BUILD_ROOT install
%Clean
rm -rf $RPM_BUILD_ROOT
diff --git a/examples/busybox.spec b/examples/busybox.spec
index 5e6befb..e3fbb6d 100644
--- a/examples/busybox.spec
+++ b/examples/busybox.spec
@@ -25,15 +25,7 @@ make
%Install
rm -rf $RPM_BUILD_ROOT
-mkdir -p $RPM_BUILD_ROOT/bin
-h=`cat busybox.links`
-
-for i in $h ; do
- mkdir -p $RPM_BUILD_ROOT/`echo $i | sed -e 's/\(^.*\/\)\(.*\)/\1/g' `
- (cd $RPM_BUILD_ROOT/bin ; ln -s busybox `echo $i | sed -e 's/\(^.*\/\)\(.*\)/\2/g' ` );
-done
-rm -f $RPM_BUILD_ROOT/bin/busybox
-install -m 755 busybox $RPM_BUILD_ROOT/bin/busybox
+make PREFIX=$RPM_BUILD_ROOT install
%Clean
rm -rf $RPM_BUILD_ROOT
diff --git a/install.sh b/install.sh
new file mode 100755
index 0000000..4a0b832
--- /dev/null
+++ b/install.sh
@@ -0,0 +1,17 @@
+#!/bin/sh
+
+if [ "$1" == "" ]; then
+ echo "No installation directory. aborting."
+ exit 1;
+fi
+
+h=`cat busybox.links`
+
+mkdir -p $1/bin
+for i in $h ; do
+ mkdir -p $1/`echo $i | sed -e 's/\(^.*\/\)\(.*\)/\1/g' `
+ (cd $1/bin ; ln -s busybox `echo $i | sed -e 's/\(^.*\/\)\(.*\)/\2/g' ` )
+done
+rm -f $1/bin/busybox
+install -m 755 busybox $1/bin/busybox
+