Skip to content

Commit

Permalink
* Added Debian package build target
Browse files Browse the repository at this point in the history
* Updated copyrights to give openssl exception
  • Loading branch information
bji committed Aug 6, 2008
1 parent 14897e3 commit c6741b1
Show file tree
Hide file tree
Showing 30 changed files with 228 additions and 23 deletions.
93 changes: 75 additions & 18 deletions GNUmakefile
Expand Up @@ -8,6 +8,10 @@
# terms of the GNU General Public License as published by the Free Software
# Foundation, version 3 of the License.
#
# In addition, as a special exception, the copyright holders give
# permission to link the code of this library and its programs with the
# OpenSSL library, and distribute linked combinations including the two.
#
# libs3 is distributed in the hope that it will be useful, but WITHOUT ANY
# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
# FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
Expand Down Expand Up @@ -36,6 +40,7 @@

LIBS3_VER_MAJOR := 0
LIBS3_VER_MINOR := 3
LIBS3_VER := $(LIBS3_VER_MAJOR).$(LIBS3_VER_MINOR)


# --------------------------------------------------------------------------
Expand All @@ -46,9 +51,9 @@ endif


# --------------------------------------------------------------------------
# INSTALL directory
ifndef INSTALL
INSTALL := /usr
# DESTDIR directory
ifndef DESTDIR
DESTDIR := /usr
endif


Expand Down Expand Up @@ -94,26 +99,78 @@ exported: libs3 s3 headers

.PHONY: install
install: libs3 s3 headers
install -Dps -m ugo+rx $(BUILD)/bin/s3 $(INSTALL)/bin/s3
install -Dp -m ugo+r $(BUILD)/include/libs3.h $(INSTALL)/include/libs3.h
install -Dps -m ugo+r $(BUILD)/lib/libs3.a $(INSTALL)/lib/libs3.a
install -Dps -m ugo+r \
$(BUILD)/lib/libs3.so.$(LIBS3_VER_MAJOR).$(LIBS3_VER_MINOR) \
$(INSTALL)/lib/libs3.so.$(LIBS3_VER_MAJOR).$(LIBS3_VER_MINOR)
ln -sf libs3.so.$(LIBS3_VER_MAJOR).$(LIBS3_VER_MINOR) \
$(INSTALL)/lib/libs3.so.$(LIBS3_VER_MAJOR)
install -Dps -m u+rwx,go+rx $(BUILD)/bin/s3 $(DESTDIR)/bin/s3
install -Dp -m u+rw,go+r $(BUILD)/include/libs3.h $(DESTDIR)/include/libs3.h
install -Dps -m u+rw,go+r $(BUILD)/lib/libs3.a $(DESTDIR)/lib/libs3.a
install -Dps -m u+rw,go+r $(BUILD)/lib/libs3.so \
$(DESTDIR)/lib/libs3.so
ln -sf libs3.so $(DESTDIR)/lib/libs3.so.$(LIBS3_VER_MAJOR)
ln -sf libs3.so.$(LIBS3_VER_MAJOR) \
$(DESTDIR)/lib/libs3.so.$(LIBS3_VER)


# --------------------------------------------------------------------------
# Uninstall target

.PHONY: uninstall
uninstall:
rm -f $(INSTALL)/bin/s3 \
$(INSTALL)/include/libs3.h \
$(INSTALL)/lib/libs3.a \
$(INSTALL)/lib/libs3.so.$(LIBS3_VER_MAJOR).$(LIBS3_VER_MINOR) \
$(INSTALL)/lib/libs3.so.$(LIBS3_VER_MAJOR)
rm -f $(DESTDIR)/bin/s3 \
$(DESTDIR)/include/libs3.h \
$(DESTDIR)/lib/libs3.a \
$(DESTDIR)/lib/libs3.so \
$(DESTDIR)/lib/libs3.so.$(LIBS3_VER_MAJOR) \
$(DESTDIR)/lib/libs3.so.$(LIBS3_VER) \


# --------------------------------------------------------------------------
# Debian package target

DEBARCH = $(shell dpkg-architecture | grep ^DEB_BUILD_ARCH= | cut -d '=' -f 2)
DEBPKG = $(BUILD)/pkg/libs3_$(LIBS3_VER)_$(DEBARCH).deb

.PHONY: deb
deb: $(DEBPKG)

$(DEBPKG): exported $(BUILD)/deb/DEBIAN/control $(BUILD)/deb/DEBIAN/shlibs \
$(BUILD)/deb/DEBIAN/postinst \
$(BUILD)/deb/usr/share/doc/libs3/changelog.gz \
$(BUILD)/deb/usr/share/doc/libs3/changelog.Debian.gz \
$(BUILD)/deb/usr/share/doc/libs3/copyright
DESTDIR=$(BUILD)/deb/usr $(MAKE) install
@mkdir -p $(dir $@)
fakeroot dpkg-deb -b $(BUILD)/deb $@

$(BUILD)/deb/DEBIAN/control: debian/control
@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)/' | \
grep -v ^Source: >> $@

$(BUILD)/deb/DEBIAN/shlibs: $(BUILD)/bin/s3
echo -n "libs3 $(LIBS3_VER_MAJOR) libs3 " > $@
echo "(>= $(LIBS3_VER))" >> $@

$(BUILD)/deb/DEBIAN/postinst: debian/postinst
@mkdir -p $(dir $@)
cp $< $@

$(BUILD)/deb/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/usr/share/doc/libs3/changelog.Debian.gz: debian/changelog.Debian
@mkdir -p $(dir $@)
gzip --best -c $< > $@


# --------------------------------------------------------------------------
Expand All @@ -131,7 +188,7 @@ $(BUILD)/obj/%.do: src/%.c
# --------------------------------------------------------------------------
# libs3 library targets

LIBS3_SHARED = $(BUILD)/lib/libs3.so.$(LIBS3_VER_MAJOR).$(LIBS3_VER_MINOR)
LIBS3_SHARED = $(BUILD)/lib/libs3.so

.PHONY: libs3
libs3: $(LIBS3_SHARED) $(BUILD)/lib/libs3.a
Expand All @@ -158,7 +215,7 @@ s3: $(BUILD)/bin/s3

$(BUILD)/bin/s3: $(BUILD)/obj/s3.o $(BUILD)/lib/libs3.a
@mkdir -p $(dir $@)
gcc -o $@ $^ $(CURL_LIBS) $(LIBXML2_LIBS) -lpthread -lssl
gcc -o $@ $^ $(CURL_LIBS) $(LIBXML2_LIBS)


# --------------------------------------------------------------------------
Expand Down
14 changes: 11 additions & 3 deletions INSTALL
Expand Up @@ -2,21 +2,29 @@
To install libs3 on a POSIX system (except Microsoft Windows):
--------------------------------------------------------------

*** For RPM-based systems ***
*** For RPM-based systems (Fedora Core, Mandrake, etc) ***

rpmbuild -ta <libs3 archive>
* rpmbuild -ta <libs3 archive>

for example:

rpmbuild -ta libs3-0.3.tar.gz


*** For dpkg-based systems (Debian, Ubuntu, etc) ***

* CFLAGS=-O3 make deb

This will produce a Debian package in the build/pkg directory.


*** For all other systems ***

* CFLAGS=-O3 make install

Note that additionally, the installation directory can be specified:

* CFLAGS=-O3 INSTALL=/usr/local make install
* CFLAGS=-O3 DESTDIR=/usr/local make install


To install libs3 on a Microsoft Windows system:
Expand Down
20 changes: 20 additions & 0 deletions LICENSE
@@ -0,0 +1,20 @@
Copyright 2008 Bryan Ischo <bryan@ischo.com>

libs3 is free software: you can redistribute it and/or modify it under the
terms of the GNU General Public License as published by the Free Software
Foundation, version 3 of the License.

In addition, as a special exception, the copyright holders give
permission to link the code of this library and its programs with the
OpenSSL library, and distribute linked combinations including the two.

libs3 is distributed in the hope that it will be useful, but WITHOUT ANY
WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
details.

You should have received a copy of the GNU General Public License version 3
along with libs3, in a file named COPYING. If not, see
<http://www.gnu.org/licenses/>.


2 changes: 1 addition & 1 deletion README
@@ -1,4 +1,4 @@
This directory contains the libs3 library.

The libs3 library is free software. See the file COPYING for copying
The libs3 library is free software. See the file LICENSE for copying
permission.
5 changes: 5 additions & 0 deletions debian/changelog
@@ -0,0 +1,5 @@
libs3 (all) unstable; urgency=low

* This file is not maintained. See project source code for changes.

-- Bryan Ischo <bryan@ischo.com> Wed, 06 Aug 2008 09:36:43 -0400
2 changes: 2 additions & 0 deletions debian/changelog.Debian
@@ -0,0 +1,2 @@
libs3 Debian maintainer and upstream author are identical.
Therefore see normal changelog file for Debian changes.
26 changes: 26 additions & 0 deletions debian/control
@@ -0,0 +1,26 @@
Package: libs3
Source: THIS LINE WILL BE REMOVED, dpkg-shlibdepends NEEDS IT
Version: LIBS3_VERSION
Architecture: DEBIAN_ARCHITECTURE
Section: devel
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
3 changes: 3 additions & 0 deletions debian/postinst
@@ -0,0 +1,3 @@
#!/bin/sh

ldconfig
4 changes: 4 additions & 0 deletions inc/error_parser.h
Expand Up @@ -9,6 +9,10 @@
* terms of the GNU General Public License as published by the Free Software
* Foundation, version 3 of the License.
*
* In addition, as a special exception, the copyright holders give
* permission to link the code of this library and its programs with the
* OpenSSL library, and distribute linked combinations including the two.
*
* libs3 is distributed in the hope that it will be useful, but WITHOUT ANY
* WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
* FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
Expand Down
4 changes: 4 additions & 0 deletions inc/libs3.h
Expand Up @@ -9,6 +9,10 @@
* terms of the GNU General Public License as published by the Free Software
* Foundation, version 3 of the License.
*
* In addition, as a special exception, the copyright holders give
* permission to link the code of this library and its programs with the
* OpenSSL library, and distribute linked combinations including the two.
*
* libs3 is distributed in the hope that it will be useful, but WITHOUT ANY
* WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
* FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
Expand Down
4 changes: 4 additions & 0 deletions inc/request.h
Expand Up @@ -9,6 +9,10 @@
* terms of the GNU General Public License as published by the Free Software
* Foundation, version 3 of the License.
*
* In addition, as a special exception, the copyright holders give
* permission to link the code of this library and its programs with the
* OpenSSL library, and distribute linked combinations including the two.
*
* libs3 is distributed in the hope that it will be useful, but WITHOUT ANY
* WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
* FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
Expand Down
4 changes: 4 additions & 0 deletions inc/request_context.h
Expand Up @@ -9,6 +9,10 @@
* terms of the GNU General Public License as published by the Free Software
* Foundation, version 3 of the License.
*
* In addition, as a special exception, the copyright holders give
* permission to link the code of this library and its programs with the
* OpenSSL library, and distribute linked combinations including the two.
*
* libs3 is distributed in the hope that it will be useful, but WITHOUT ANY
* WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
* FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
Expand Down
4 changes: 4 additions & 0 deletions inc/response_headers_handler.h
Expand Up @@ -9,6 +9,10 @@
* terms of the GNU General Public License as published by the Free Software
* Foundation, version 3 of the License.
*
* In addition, as a special exception, the copyright holders give
* permission to link the code of this library and its programs with the
* OpenSSL library, and distribute linked combinations including the two.
*
* libs3 is distributed in the hope that it will be useful, but WITHOUT ANY
* WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
* FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
Expand Down
4 changes: 4 additions & 0 deletions inc/simplexml.h
Expand Up @@ -9,6 +9,10 @@
* terms of the GNU General Public License as published by the Free Software
* Foundation, version 3 of the License.
*
* In addition, as a special exception, the copyright holders give
* permission to link the code of this library and its programs with the
* OpenSSL library, and distribute linked combinations including the two.
*
* libs3 is distributed in the hope that it will be useful, but WITHOUT ANY
* WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
* FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
Expand Down
4 changes: 4 additions & 0 deletions inc/string_buffer.h
Expand Up @@ -9,6 +9,10 @@
* terms of the GNU General Public License as published by the Free Software
* Foundation, version 3 of the License.
*
* In addition, as a special exception, the copyright holders give
* permission to link the code of this library and its programs with the
* OpenSSL library, and distribute linked combinations including the two.
*
* libs3 is distributed in the hope that it will be useful, but WITHOUT ANY
* WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
* FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
Expand Down
4 changes: 4 additions & 0 deletions inc/util.h
Expand Up @@ -9,6 +9,10 @@
* terms of the GNU General Public License as published by the Free Software
* Foundation, version 3 of the License.
*
* In addition, as a special exception, the copyright holders give
* permission to link the code of this library and its programs with the
* OpenSSL library, and distribute linked combinations including the two.
*
* libs3 is distributed in the hope that it will be useful, but WITHOUT ANY
* WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
* FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
Expand Down
2 changes: 1 addition & 1 deletion libs3.spec
Expand Up @@ -46,7 +46,7 @@ http://s3.amazonaws.com). Its design goals are:
CFLAGS=-O3 BUILD=$RPM_BUILD_ROOT/build make exported

%install
BUILD=$RPM_BUILD_ROOT/build INSTALL=$RPM_BUILD_ROOT/usr make install
BUILD=$RPM_BUILD_ROOT/build DESTDIR=$RPM_BUILD_ROOT/usr make install
rm -rf $RPM_BUILD_ROOT/build

%clean
Expand Down
4 changes: 4 additions & 0 deletions src/acl.c
Expand Up @@ -9,6 +9,10 @@
* terms of the GNU General Public License as published by the Free Software
* Foundation, version 3 of the License.
*
* In addition, as a special exception, the copyright holders give
* permission to link the code of this library and its programs with the
* OpenSSL library, and distribute linked combinations including the two.
*
* libs3 is distributed in the hope that it will be useful, but WITHOUT ANY
* WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
* FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
Expand Down
4 changes: 4 additions & 0 deletions src/bucket.c
Expand Up @@ -9,6 +9,10 @@
* terms of the GNU General Public License as published by the Free Software
* Foundation, version 3 of the License.
*
* In addition, as a special exception, the copyright holders give
* permission to link the code of this library and its programs with the
* OpenSSL library, and distribute linked combinations including the two.
*
* libs3 is distributed in the hope that it will be useful, but WITHOUT ANY
* WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
* FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
Expand Down
4 changes: 4 additions & 0 deletions src/error_parser.c
Expand Up @@ -9,6 +9,10 @@
* terms of the GNU General Public License as published by the Free Software
* Foundation, version 3 of the License.
*
* In addition, as a special exception, the copyright holders give
* permission to link the code of this library and its programs with the
* OpenSSL library, and distribute linked combinations including the two.
*
* libs3 is distributed in the hope that it will be useful, but WITHOUT ANY
* WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
* FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
Expand Down
4 changes: 4 additions & 0 deletions src/general.c
Expand Up @@ -9,6 +9,10 @@
* terms of the GNU General Public License as published by the Free Software
* Foundation, version 3 of the License.
*
* In addition, as a special exception, the copyright holders give
* permission to link the code of this library and its programs with the
* OpenSSL library, and distribute linked combinations including the two.
*
* libs3 is distributed in the hope that it will be useful, but WITHOUT ANY
* WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
* FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
Expand Down
4 changes: 4 additions & 0 deletions src/object.c
Expand Up @@ -9,6 +9,10 @@
* terms of the GNU General Public License as published by the Free Software
* Foundation, version 3 of the License.
*
* In addition, as a special exception, the copyright holders give
* permission to link the code of this library and its programs with the
* OpenSSL library, and distribute linked combinations including the two.
*
* libs3 is distributed in the hope that it will be useful, but WITHOUT ANY
* WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
* FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
Expand Down

0 comments on commit c6741b1

Please sign in to comment.