forked from please88/protocol-libs3-c
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathINSTALL
More file actions
133 lines (84 loc) · 3.9 KB
/
INSTALL
File metadata and controls
133 lines (84 loc) · 3.9 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
To install libs3 on a POSIX system (except Microsoft Windows):
--------------------------------------------------------------
Note that all POSIX builds have prerequisites, such as development libraries
that libs3 requires and that must be installed at the time that libs3 is
built. The easiest way to find out what those are, is to run the build
command and then observe the results.
*** For RPM-based systems (Fedora Core, Mandrake, etc) ***
* rpmbuild -ta <libs3 archive>
for example:
rpmbuild -ta libs3-0.3.tar.gz
*** For dpkg-based systems (Debian, Ubuntu, etc) ***
* make deb
This will produce a Debian package in the build/pkg directory.
*** For all other systems ***
* make [DESTDIR=destination root] install
DESTDIR defaults to /usr
for example:
Install dependency packages
* sudo apt-get install libxml2
* sudo apt-get install libxml2-dev
* sudo apt-get install libcurl4-openssl-dev
Compile and install library
- cd libs3-folder
- sudo make uninstall (type when want to uninstall old lib)
- sudo make clean
- make
- sudo make install
To install libs3 on a Microsoft Windows system:
-----------------------------------------------
*** Using MingW ***
* libs3 can be built on Windows using the MingW compiler. No other tool
is needed. However, the following libraries are needed to build libs3:
- curl development libraries
- libxml2 development libraries, and the libraries that it requires:
- iconv
- zlib
These projects are independent of libs3, and their release schedule and
means of distribution would make it very difficult to provide links to
the files to download and keep them up-to-date in this file, so no attempt
is made here.
Development libraries and other files can be placed in:
c:\libs3-libs\bin
c:\libs3-libs\include
If the above locations are used, then the GNUmakefile.mingw will work with
no special caveats. If the above locations are not used, then the following
environment variables should be set:
CURL_LIBS should be set to the MingW compiler flags needed to locate and
link in the curl libraries
CURL_CFLAGS should be set to the MingW compiler flags needed to locate and
include the curl headers
LIBXML2_LIBS should be set to the MingW compiler flags needed to locate and
link in the libxml2 libraries
LIBXML2_CFLAGS should be set to the MingW compiler flags needed to locate and
include the libxml2 headers
* mingw32-make [DESTDIR=destination] -f GNUmakefile.mingw install
DESTDIR defaults to libs3-<version>
* DESTDIR can be zipped up into a .zip file for distribution. For best
results, the dependent libraries (curl, openssl, etc) should be included,
along with their licenses.
To execute libs3 command-line on a POSIX system (except Microsoft Windows):
--------------------------------------------------------------
You must set the s3 environment before using command-line:
S3_ACCESS_KEY_ID : S3 access key ID (required)
S3_SECRET_ACCESS_KEY : S3 secret access key (required)
S3_HOSTNAME : specify alternative S3 host (optional)
environment example:
- sudo vim /etc/profile (add command below, then save and close file)
export S3_ACCESS_KEY_ID=cKc863uvDSWJZZkRijts
export S3_SECRET_ACCESS_KEY=TQxnjYQeK3VQpxd4HhjX5r8JO1ma9zrHFOvDUmuz
export S3_HOSTNAME=pub1-bjyt.s3.360.cn
- source /etc/profile (make the configuration valid)
Caution: If the command operation does not reply, you can try adding the -u character to use unencrypted mode.
command example:
Create bucket named "xxxx" in unencrypted mode.
- s3 -u create xxxx
Put object named "mydog" to bucket "nvrbucket".
- s3 -u put nvrbucket/mydog filename=dog.jpeg -s
Generate url for object named "mydog".
- s3 -u gqs nvrbucket/mydog
You can get all S3 protocol details from aws webset:
--------------------------------------------------------------
https://aws.amazon.com
https://docs.aws.amazon.com/index.html
https://docs.aws.amazon.com/s3/