summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBryan Ischo <bryan@ischo.com>2008-08-09 01:46:30 +0000
committerBryan Ischo <bryan@ischo.com>2008-08-09 01:46:30 +0000
commite22875d4332c48d83219ecc90e13f3786185f038 (patch)
treee908e990c1ba6619bb422385ac37d80e7a161b51
parent79ef8b5a3b74147bdd0b8784776363ed183095b1 (diff)
downloadceph-libs3-e22875d4332c48d83219ecc90e13f3786185f038.tar.gz
* Fixed bug reported by Troy Hakala <troy.hakala@gmail.com>:
Wasn't using URL-encoded key in request URI, so libs3 failed on keys with spaces and other unsafe characters * Updated RPM and DEB packaging to split packages into two: normal and devel
-rw-r--r--ChangeLog8
-rw-r--r--GNUmakefile36
-rw-r--r--debian/control24
-rw-r--r--libs3.spec28
-rw-r--r--src/request.c7
5 files changed, 75 insertions, 28 deletions
diff --git a/ChangeLog b/ChangeLog
index 09bb5f1..e0f0d66 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,11 @@
+Sat Aug 9 13:44:21 NZST 2008 bryan@ischo.com
+ * Fixed bug wherein keys with non-URI-safe characters did not work
+ correctly because they were not being URI-encoded in the request UR
+ * Split RPM and DEB packages into normal and devel packages
+
+Fri Aug 8 22:40:19 NZST 2008 bryan@ischo.com
+ * Branched 0.4
+ * Created RPM and Debian packaging
Tue Aug 5 08:52:33 NZST 2008 bryan@ischo.com
* Bumped version number to 0.3
diff --git a/GNUmakefile b/GNUmakefile
index 091b4e0..969b67f 100644
--- a/GNUmakefile
+++ b/GNUmakefile
@@ -130,9 +130,10 @@ uninstall:
# Debian package target
DEBPKG = $(BUILD)/pkg/libs3_$(LIBS3_VER).deb
+DEBDEVPKG = $(BUILD)/pkg/libs3-dev_$(LIBS3_VER).deb
.PHONY: deb
-deb: $(DEBPKG)
+deb: $(DEBPKG) $(DEBDEVPKG)
$(DEBPKG): DEBARCH = $(shell dpkg-architecture | grep ^DEB_BUILD_ARCH= | \
cut -d '=' -f 2)
@@ -146,6 +147,15 @@ $(DEBPKG): exported $(BUILD)/deb/DEBIAN/control $(BUILD)/deb/DEBIAN/shlibs \
fakeroot dpkg-deb -b $(BUILD)/deb $@
mv $@ $(BUILD)/pkg/libs3_$(LIBS3_VER)_$(DEBARCH).deb
+$(DEBDEVPKG): exported $(BUILD)/deb-dev/DEBIAN/control \
+ $(BUILD)/deb-dev/usr/share/doc/libs3/changelog.gz \
+ $(BUILD)/deb-dev/usr/share/doc/libs3/changelog.Debian.gz \
+ $(BUILD)/deb-dev/usr/share/doc/libs3/copyright
+ DESTDIR=$(BUILD)/deb-dev/usr $(MAKE) install
+ @mkdir -p $(dir $@)
+ fakeroot dpkg-deb -b $(BUILD)/deb $@
+ mv $@ $(BUILD)/pkg/libs3-dev_$(LIBS3_VER)_$(DEBARCH).deb
+
$(BUILD)/deb/DEBIAN/control: debian/control
@mkdir -p $(dir $@)
echo -n "Depends: " > $@
@@ -154,6 +164,13 @@ $(BUILD)/deb/DEBIAN/control: debian/control
< $< | sed -e 's/DEBIAN_ARCHITECTURE/$(DEBARCH)/' | \
grep -v ^Source: >> $@
+$(BUILD)/deb-dev/DEBIAN/control: debian/control.dev
+ @mkdir -p $(dir $@)
+ echo -n "Depends: " > $@
+ dpkg-shlibdeps -O $(BUILD)/bin/s3 | cut -d '=' -f 2- >> $@
+ sed -e 's/LIBS3_VERSION/$(LIBS3_VER)/' \
+ < $< | sed -e 's/DEBIAN_ARCHITECTURE/$(DEBARCH)/' >> $@
+
$(BUILD)/deb/DEBIAN/shlibs:
echo -n "libs3 $(LIBS3_VER_MAJOR) libs3 " > $@
echo "(>= $(LIBS3_VER))" >> $@
@@ -170,14 +187,31 @@ $(BUILD)/deb/usr/share/doc/libs3/copyright: LICENSE
@echo "License version 3 on Debian" >> $@
@echo "systems is /usr/share/common-licenses/GPL-3." >> $@
+$(BUILD)/deb-dev/usr/share/doc/libs3/copyright: LICENSE
+ @mkdir -p $(dir $@)
+ cp $< $@
+ @echo >> $@
+ @echo -n "An alternate location for the GNU General Public " >> $@
+ @echo "License version 3 on Debian" >> $@
+ @echo "systems is /usr/share/common-licenses/GPL-3." >> $@
+
$(BUILD)/deb/usr/share/doc/libs3/changelog.gz: debian/changelog
@mkdir -p $(dir $@)
gzip --best -c $< > $@
+$(BUILD)/deb-dev/usr/share/doc/libs3/changelog.gz: debian/changelog
+ @mkdir -p $(dir $@)
+ gzip --best -c $< > $@
+
$(BUILD)/deb/usr/share/doc/libs3/changelog.Debian.gz: debian/changelog.Debian
@mkdir -p $(dir $@)
gzip --best -c $< > $@
+$(BUILD)/deb-dev/usr/share/doc/libs3/changelog.Debian.gz: \
+ debian/changelog.Debian
+ @mkdir -p $(dir $@)
+ gzip --best -c $< > $@
+
# --------------------------------------------------------------------------
# Compile target patterns
diff --git a/debian/control b/debian/control
index 2b0789c..b249d7d 100644
--- a/debian/control
+++ b/debian/control
@@ -2,25 +2,11 @@ Package: libs3
Source: THIS LINE WILL BE REMOVED, dpkg-shlibdepends NEEDS IT
Version: LIBS3_VERSION
Architecture: DEBIAN_ARCHITECTURE
-Section: devel
+Section: net
Priority: extra
Maintainer: Bryan Ischo <bryan@ischo.com>
Homepage: http://reallibs3.svn.sourceforge.net
-Description: C Library for Amazon S3 Access
- This library provides an API for using Amazon's S3 service (see
- http://s3.amazonaws.com). Its design goals are:
- .
- - To provide a simple and straightforward API for accessing all of S3's
- functionality
- - To not require the developer using libs3 to need to know anything about:
- - HTTP
- - XML
- - SSL
- In other words, this API is meant to stand on its own, without requiring
- any implicit knowledge of how S3 services are accessed using HTTP
- protocols.
- - To be usable from multithreaded code
- - To be usable by code which wants to process multiple S3 requests
- simultaneously from a single thread
- - To be usable in the simple, straightforward way using sequentialized
- blocking requests
+Description: C Library and Tools for Amazon S3 Access
+This package includes the libs3 shared object library, needed to run
+applications compiled against libs3, and additionally contains the s3
+utility for accessing Amazon S3.
diff --git a/libs3.spec b/libs3.spec
index 3788800..95c3678 100644
--- a/libs3.spec
+++ b/libs3.spec
@@ -1,9 +1,9 @@
-Summary: C Library for Amazon S3 Access
+Summary: C Library and Tools for Amazon S3 Access
Name: libs3
Version: trunk
Release: 1
License: GPL
-Group: Development/Tools
+Group: Networking/Utilities
URL: http://sourceforge.net/projects/reallibs3
Source0: libs3-trunk.tar.gz
Buildroot: %{_tmppath}/%{name}-%{version}-%{release}-root
@@ -21,6 +21,16 @@ Requires: openssl
%define debug_package %{nil}
%description
+This package includes the libs3 shared object library, needed to run
+applications compiled against libs3, and additionally contains the s3
+utility for accessing Amazon S3.
+
+%package devel
+Summary: Headers and documentation for libs3
+Group: Development/Libraries
+Requires: %{name} = %{version}-%{release}
+
+%description devel
This library provides an API for using Amazon's S3 service (see
http://s3.amazonaws.com). Its design goals are:
@@ -39,6 +49,7 @@ http://s3.amazonaws.com). Its design goals are:
- To be usable in the simple, straightforward way using sequentialized
blocking requests
+
%prep
%setup -q
@@ -54,10 +65,17 @@ rm -rf $RPM_BUILD_ROOT
%files
%defattr(-,root,root,-)
-/usr/bin/*
-/usr/include/*
-/usr/lib/*
+/usr/bin/s3
+/usr/lib/libs3.so*
+
+%files devel
+%defattr(-,root,root,-)
+/usr/include/libs3.h
+/usr/lib/libs3.a
%changelog
+* Sat Aug 09 2008 <bryan@ischo,com> Bryan Ischo
+- Split into regular and devel packages.
+
* Tue Aug 05 2008 <bryan@ischo,com> Bryan Ischo
- Initial build.
diff --git a/src/request.c b/src/request.c
index 3f3ae15..a64c7ae 100644
--- a/src/request.c
+++ b/src/request.c
@@ -730,7 +730,8 @@ static S3Status compose_auth_header(const RequestParams *params,
// Compose the URI to use for the request given the request parameters
-static S3Status compose_uri(const RequestParams *params, Request *request)
+static S3Status compose_uri(Request *request, const RequestParams *params,
+ const RequestComputedValues *values)
{
int len = 0;
@@ -761,7 +762,7 @@ static S3Status compose_uri(const RequestParams *params, Request *request)
uri_append("%s", "/");
if (params->key && params->key[0]) {
- uri_append("%s", params->key);
+ uri_append("%s", values->urlEncodedKey);
}
if (params->subResource && params->subResource[0]) {
@@ -970,7 +971,7 @@ static S3Status request_get(const RequestParams *params,
request->headers = 0;
// Compute the URL
- if ((status = compose_uri(params, request)) != S3StatusOK) {
+ if ((status = compose_uri(request, params, values)) != S3StatusOK) {
curl_easy_cleanup(request->curl);
free(request);
return status;