aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJason Woodward2010-03-06 21:47:58 -0500
committerJason Woodward2010-03-06 21:47:58 -0500
commit628f103206b684cd00b55bdcb5c7c44254cd4fd5 (patch)
treea00dd60edcf64fd4a42ab3dca161775e25e8667f
parentbcd5f8cb1cb79f794bf51891d746d5394e10673d (diff)
downloadslapt-get-628f103206b684cd00b55bdcb5c7c44254cd4fd5.tar.gz
incorporated a modified version of the patch submitted by Vitaly Chernookiy for making slapt-get cross compile friendly
-rw-r--r--ChangeLog4
-rw-r--r--INSTALL16
-rw-r--r--Makefile22
-rw-r--r--README3
-rw-r--r--default.slapt-getrc.arm17
5 files changed, 52 insertions, 10 deletions
diff --git a/ChangeLog b/ChangeLog
index ceb1f8a..edd9364 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,7 @@
-0.10.2d Jan 18, 2010
+0.10.2d Mar 06, 2010
+ * incorporated a modified version of the patch submitted by
+ Vitaly Chernookiy for making slapt-get cross compile friendly
* removed extraneous / when constructing package source url
0.10.2c Jan 10, 2010
diff --git a/INSTALL b/INSTALL
index 16e4875..6052b28 100644
--- a/INSTALL
+++ b/INSTALL
@@ -30,3 +30,19 @@ See README for more details.
git clone git://software.jaos.org/var/cache/git/slapt-get
+
+- Cross compiling the slapt-get source
+
+You should have the following variables in your environment or
+with the make invocation: CFLAGS, LDFLAGS, ARCH, CC, STRIP, AR, and RANLIB
+
+For example:
+
+ CC=armv7l-unknown-linux-uclibcgnueabi-gcc \
+ AR=armv7l-unknown-linux-uclibcgnueabi-ar \
+ RANLIB=armv7l-unknown-linux-uclibcgnueabi-ranlib \
+ STRIP=armv7l-unknown-linux-uclibcgnueabi-strip \
+ CFLAGS=-Os -pipe \
+ LDFLAGS=-lintl \
+ make
+
diff --git a/Makefile b/Makefile
index 50cec39..6acb49a 100644
--- a/Makefile
+++ b/Makefile
@@ -1,9 +1,12 @@
PACKAGE=slapt-get
VERSION=0.10.2d
-ARCH=$(shell uname -m | sed -e "s/i[3456]86/i386/")
+ARCH?=$(shell uname -m | sed -e "s/i[3456]86/i386/")
LIBDIR=/usr/lib
RELEASE=1
-CC=gcc
+CC?=gcc
+STRIP?=strip
+AR?=ar
+RANLIB?=ranlib
CURLFLAGS=`curl-config --libs`
OBJS=src/common.o src/configuration.o src/package.o src/curl.o src/transaction.o src/action.o src/main.o
LIBOBJS=src/common.o src/configuration.o src/package.o src/curl.o src/transaction.o
@@ -15,7 +18,7 @@ PACKAGE_LOCALE_DIR=/usr/share/locale
SBINDIR=/usr/sbin/
GETTEXT_PACKAGE=$(PACKAGE)
DEFINES=-DPACKAGE="\"$(PACKAGE)\"" -DVERSION="\"$(VERSION)\"" -DRC_LOCATION="\"$(RCDEST)\"" -DENABLE_NLS -DPACKAGE_LOCALE_DIR="\"$(PACKAGE_LOCALE_DIR)\"" -DGETTEXT_PACKAGE="\"$(GETTEXT_PACKAGE)\""
-LDFLAGS=$(CURLFLAGS) -lz
+LDFLAGS+=$(CURLFLAGS) -lz
HAS_GPGME=$(shell gpgme-config --libs 2>&1 >/dev/null && echo 1)
ifeq ($(HAS_GPGME),1)
DEFINES+=-DSLAPT_HAS_GPGME
@@ -24,10 +27,10 @@ ifeq ($(HAS_GPGME),1)
LIBHEADERS+=src/gpgme.h
LDFLAGS+=`gpgme-config --libs`
endif
-CFLAGS=-W -Werror -Wall -O2 -ansi -pedantic $(DEFINES) -fpic
+CFLAGS?=-W -Werror -Wall -O2 -ansi -pedantic
+CFLAGS+=$(DEFINES) -fPIC
ifeq ($(ARCH),x86_64)
LIBDIR=/usr/lib64
- CFLAGS=-W -Werror -Wall -O2 -ansi -pedantic $(DEFINES) -fPIC
endif
default: $(PACKAGE)
@@ -61,7 +64,7 @@ libsinstall: libs
cd $(DESTDIR)$(LIBDIR); ln -s libslapt.so.$(VERSION) libslapt.so
doinstall: libsinstall
- strip --strip-unneeded $(PACKAGE)
+ $(STRIP) --strip-unneeded $(PACKAGE)
if [ ! -d $(DESTDIR)$(SBINDIR) ]; then mkdir -p $(DESTDIR)$(SBINDIR);fi
install $(PACKAGE) $(DESTDIR)$(SBINDIR)
-chown $$(stat --format "%u:%g" /usr/sbin) $(DESTDIR)$(SBINDIR)$(PACKAGE)
@@ -134,7 +137,7 @@ dopkg:
cp $(PACKAGE) ./pkg/$(SBINDIR)
-chown $$(stat --format "%u:%g" /usr/sbin) ./pkg/$(SBINDIR)
-chown $$(stat --format "%u:%g" /usr/sbin) ./pkg/$(SBINDIR)/$(PACKAGE)
- strip ./pkg/$(SBINDIR)/$(PACKAGE)
+ $(STRIP) ./pkg/$(SBINDIR)/$(PACKAGE)
cp $(RCSOURCE) pkg/etc/slapt-get/slapt-getrc.new
mkdir -p ./pkg/usr/doc/$(PACKAGE)-$(VERSION)/
cp default.slapt-getrc.* example.slapt-getrc.* COPYING ChangeLog INSTALL README FAQ FAQ.html TODO ./pkg/usr/doc/$(PACKAGE)-$(VERSION)/
@@ -154,7 +157,7 @@ dopkg:
mkdir -p pkg/usr/include
cp src/slapt.h pkg/usr/include/
cp src/libslapt.a src/libslapt.so.$(VERSION) pkg$(LIBDIR)/
- strip pkg$(LIBDIR)/libslapt.so.$(VERSION)
+ $(STRIP) pkg$(LIBDIR)/libslapt.so.$(VERSION)
( cd pkg$(LIBDIR); ln -s libslapt.so.$(VERSION) libslapt.so )
-( cd pkg; /sbin/makepkg -l y -c n ../$(PACKAGE)-$(VERSION)-$(ARCH)-$(RELEASE).tgz )
@@ -168,7 +171,8 @@ libs: $(OBJS)
touch libs
$(CC) -shared -o src/libslapt.so.$(VERSION) $(LIBOBJS) #-Wl,-soname=libslapt-$(VERSION)
( cd src; if [ -f libslapt.so ]; then rm libslapt.so;fi; ln -s libslapt.so.$(VERSION) libslapt.so )
- ar -r src/libslapt.a $(LIBOBJS)
+ $(AR) -r src/libslapt.a $(LIBOBJS)
+ $(RANLIB) src/libslapt.a
-@echo "#ifndef LIB_SLAPT" > src/slapt.h
-@echo "#define LIB_SLAPT 1" >> src/slapt.h
-@cat $(LIBHEADERS) |grep -v '#include \"' >> src/slapt.h
diff --git a/README b/README
index 5f94ac3..2d59cc5 100644
--- a/README
+++ b/README
@@ -261,3 +261,6 @@ Table of Contents:
Anders F Bjorklund <afb at users dot sourceforge dot net> contributed the
slapt_get_pkg_filelist() support.
+ Vitaly Chernookiy <vitaly.v.ch at gmail dot com> contributed the initial
+ cross compiling support
+
diff --git a/default.slapt-getrc.arm b/default.slapt-getrc.arm
new file mode 100644
index 0000000..f84b2ca
--- /dev/null
+++ b/default.slapt-getrc.arm
@@ -0,0 +1,17 @@
+# Working directory for local storage/cache.
+WORKINGDIR=/var/slapt-get
+
+# Exclude package names and expressions.
+# To exclude pre and beta packages, add this to the exclude:
+# [0-9\_\.\-]{1}pre[0-9\-\.\-]{1}
+EXCLUDE=^aaa_elflibs,^devs,^glibc-.*,^kernel-.*,^udev,.*-[0-9]+dl$,x86_64,i[3456]86
+
+# Base url to directory with a PACKAGES.TXT.
+# This can point to any release, ie: 9.0, 10.0, current, etc.
+SOURCE=ftp://ftp.armedslack.org/armedslack/armedslack-current/:OFFICIAL
+
+# Packages on a CD/DVD.
+# SOURCE=file:///mnt/cdrom/:OFFICIAL
+
+# Home made packages.
+# SOURCE=file:///var/www/packages/:CUSTOM