]> git.ipfire.org Git - thirdparty/rsync.git/blame - INSTALL.md
More tweaks for Actions.
[thirdparty/rsync.git] / INSTALL.md
CommitLineData
e00662f2 1# How to build and install rsync
26c08b6c 2
e00662f2 3When building rsync, you'll want to install various libraries in order to get
93a373f6 4all the features enabled. The configure script will alert you when the
e00662f2
WD
5newest libraries are missing and tell you the appropriate `--disable-LIB`
6option to use if you want to just skip that feature. What follows are various
7support libraries that you may want to install to build rsync with the maximum
8features (the impatient can skip down to the package summary):
9
10## The basic setup
11
12You need to have a C compiler installed and optionally a C++ compiler in order
00e59e01 13to try to build some hardware-accelerated checksum routines. Rsync also needs
b1ae7fc9 14a modern awk, which might be provided via gawk or nawk on some OSes.
e00662f2 15
96ed4b47 16## Autoconf & manpages
b6aa9c5c 17
00e59e01
WD
18If you're installing from the git repo (instead of a release tar file) you'll
19also need the GNU autotools (autoconf & automake) and your choice of 2 python3
96ed4b47 20markdown libraries: cmarkgfm or commonmark (needed to generate the manpages).
e00662f2
WD
21If your OS doesn't provide a python3-cmarkgfm or python3-commonmark package,
22you can run the following to install the commonmark python library for your
23build user (after installing python3's pip package):
24
25dfc2c4 25> python3 -mpip install --user commonmark
e00662f2 26
25dfc2c4 27You can test if you've got it fixed by running (from the rsync checkout):
b6aa9c5c 28
0d8cc260 29> ./md-convert --test rsync-ssl.1.md
b6aa9c5c 30
96ed4b47 31Alternately, you can avoid generating the manpages by fetching the very latest
b6aa9c5c
WD
32versions (that match the latest git source) from the [generated-files][6] dir.
33One way to do that is to run:
34
35> ./prepare-source fetchgen
36
37[6]: https://download.samba.org/pub/rsync/generated-files/
38
e00662f2
WD
39## ACL support
40
41To support copying ACL file information, make sure you have an acl
42development library installed. It also helps to have the helper programs
43installed to manipulate ACLs and to run the rsync testsuite.
44
45## Xattr support
46
b1ae7fc9 47To support copying xattr file information, make sure you have an attr
e00662f2
WD
48development library installed. It also helps to have the helper programs
49installed to manipulate xattrs and to run the rsync testsuite.
50
51## xxhash
52
c3cf174e
WD
53The [xxHash library][1] provides extremely fast checksum functions that can
54make the "rsync algorithm" run much more quickly, especially when matching
55blocks in large files. Installing this development library adds xxhash
25dfc2c4
WD
56checksums as the default checksum algorithm. You'll need at least v0.8.0
57if you want rsync to include the full range of its checksum algorithms.
c3cf174e
WD
58
59[1]: https://cyan4973.github.io/xxHash/
e00662f2
WD
60
61## zstd
62
b1ae7fc9 63The [zstd library][2] compression algorithm that uses less CPU than
c3cf174e
WD
64the default zlib algorithm at the same compression level. Note that you
65need at least version 1.4, so you might need to skip the zstd compression if
66you can only install a 1.3 release. Installing this development library
67adds zstd compression as the default compression algorithm.
68
69[2]: http://facebook.github.io/zstd/
e00662f2
WD
70
71## lz4
72
c3cf174e
WD
73The [lz4 library][3] compression algorithm that uses very little CPU, though
74it also has the smallest compression ratio of other algorithms. Installing
75this development library adds lz4 compression as an available compression
76algorithm.
77
78[3]: https://lz4.github.io/lz4/
e00662f2
WD
79
80## openssl crypto
81
c3cf174e
WD
82The [openssl crypto library][4] provides some hardware accelerated checksum
83algorithms for MD4 and MD5. Installing this development library makes rsync
84use the (potentially) faster checksum routines when computing MD4 & MD5
85checksums.
86
87[4]: https://www.openssl.org/docs/man1.0.2/man3/crypto.html
e00662f2
WD
88
89## Package summary
90
a8f61ba9
WD
91To help you get the libraries installed, here are some package install commands
92for various OSes. The commands are split up to correspond with the above
93items, but feel free to combine the package names into a single install, if you
94like.
e00662f2
WD
95
96 - For Debian and Ubuntu (Debian Buster users may want to briefly(?) enable
97 buster-backports to update zstd from 1.3 to 1.4):
98
00e59e01 99 > sudo apt install -y gcc g++ gawk autoconf automake python3-cmarkgfm
93a373f6
WD
100 > sudo apt install -y acl libacl1-dev
101 > sudo apt install -y attr libattr1-dev
102 > sudo apt install -y libxxhash-dev
103 > sudo apt install -y libzstd-dev
ed6a0dc7 104 > sudo apt install -y liblz4-dev
93a373f6 105 > sudo apt install -y libssl-dev
e00662f2 106
411c4789
AT
107Or run support/install_deps_ubuntu.sh
108
e00662f2
WD
109 - For CentOS (use EPEL for python3-pip):
110
93a373f6 111 > sudo yum -y install epel-release
00e59e01 112 > sudo yum -y install gcc g++ gawk autoconf automake python3-pip
93a373f6
WD
113 > sudo yum -y install acl libacl-devel
114 > sudo yum -y install attr libattr-devel
115 > sudo yum -y install xxhash-devel
116 > sudo yum -y install libzstd-devel
117 > sudo yum -y install lz4-devel
118 > sudo yum -y install openssl-devel
25dfc2c4 119 > python3 -mpip install --user commonmark
e00662f2 120
b1ae7fc9
WD
121 - For Fedora 33:
122
123 > sudo dnf -y install acl libacl-devel
124 > sudo dnf -y install attr libattr-devel
125 > sudo dnf -y install xxhash-devel
126 > sudo dnf -y install libzstd-devel
127 > sudo dnf -y install lz4-devel
128 > sudo dnf -y install openssl-devel
129
e00662f2
WD
130 - For FreeBSD (this assumes that the python3 version is 3.7):
131
93a373f6 132 > sudo pkg install -y autotools python3 py37-CommonMark
e00662f2
WD
133 > sudo pkg install -y xxhash
134 > sudo pkg install -y zstd
135 > sudo pkg install -y liblz4
e00662f2
WD
136
137 - For macOS:
138
139 > brew install automake
140 > brew install xxhash
141 > brew install zstd
142 > brew install lz4
143 > brew install openssl
144
a8f61ba9
WD
145 - For Cygwin (with all cygwin programs stopped, run the appropriate setup program from a cmd shell):
146
1da64c37 147 > setup-x86_64 --quiet-mode -P make,gawk,autoconf,automake,gcc-core,python38,python38-pip
b1ae7fc9
WD
148 > setup-x86_64 --quiet-mode -P attr,libattr-devel
149 > setup-x86_64 --quiet-mode -P libzstd-devel
150 > setup-x86_64 --quiet-mode -P liblz4-devel
151 > setup-x86_64 --quiet-mode -P libssl-devel
a8f61ba9 152
25dfc2c4
WD
153 Sometimes cygwin has commonmark packaged and sometimes it doesn't. Now that
154 its python38 has stabilized, you could install python38-commonmark. Or just
155 avoid the issue by running this from a bash shell as your build user:
26befd9c 156
25dfc2c4 157 > python3 -mpip install --user commonmark
26befd9c 158
e00662f2
WD
159## Build and install
160
161After installing the various libraries, you need to configure, build, and
162install the source:
163
164> ./configure
165> make
166> sudo make install
26c08b6c 167
93a373f6
WD
168The default install path is /usr/local/bin, but you can set the installation
169directory and other parameters using options to ./configure. To see them, use:
26c08b6c 170
e00662f2 171> ./configure --help
26c08b6c 172
36d8d1a6
WD
173Configure tries to figure out if the local system uses group "nobody" or
174"nogroup" by looking in the /etc/group file. (This is only used for the
175default group of an rsync daemon, which attempts to run with "nobody"
176user and group permissions.) You can change the default user and group
177for the daemon by editing the NOBODY_USER and NOBODY_GROUP defines in
178config.h, or just override them in your /etc/rsyncd.conf file.
179
26c08b6c 180As of 2.4.7, rsync uses Eric Troan's popt option-parsing library. A
c9bf436e 181cut-down copy of a recent release is included in the rsync distribution,
3e85237e 182and will be used if there is no popt library on your build host, or if
7f8cf771 183the `--with-included-popt` option is passed to ./configure.
1c47fbd9 184
7f8cf771 185If you configure using `--enable-maintainer-mode`, then rsync will try
c0531332
MP
186to pop up an xterm on DISPLAY=:0 if it crashes. You might find this
187useful, but it should be turned off for production builds.
1c47fbd9 188
95f68303
WD
189If you want to automatically use a separate "build" directory based on
190the current git branch name, start with a pristine git checkout and run
191"mkdir auto-build-save" before you run the first ./configure command.
192That will cause a fresh build dir to spring into existence along with a
193special Makefile symlink that allows you to run "make" and "./configure"
194from the source dir (the "build" dir gets auto switched based on branch).
195This is helpful when using the branch-from-patch and patch-update scripts
196to maintain the official rsync patches. If you ever need to build from
197a "detached head" git position then you'll need to manually chdir into
198the build dir to run make. I also like to create 2 more symlinks in the
7f8cf771 199source dir: `ln -s build/rsync . ; ln -s build/testtmp .`
95f68303 200
e00662f2 201## Make compatibility
c9bf436e
WD
202
203Note that Makefile.in has a rule that uses a wildcard in a prerequisite. If
204your make has a problem with this rule, you will see an error like this:
205
206 Don't know how to make ./*.c
207
e00662f2 208You can change the "proto.h-tstamp" target in Makefile.in to list all the \*.c
6da6b02b 209filenames explicitly in order to avoid this issue.
c9bf436e 210
e00662f2 211## RPM notes
e2bea9eb
PG
212
213Under packaging you will find .spec files for several distributions.
3903928c
PG
214The .spec file in packaging/lsb can be used for Linux systems that
215adhere to the Linux Standards Base (e.g., RedHat and others).
e2bea9eb 216
e00662f2 217## HP-UX notes
1c47fbd9
MP
218
219The HP-UX 10.10 "bundled" C compiler seems not to be able to cope with
220ANSI C. You may see this error message in config.log if ./configure
221fails:
222
e00662f2 223 (Bundled) cc: "configure", line 2162: error 1705: Function prototypes are an ANSI feature.
1c47fbd9
MP
224
225Install gcc or HP's "ANSI/C Compiler".
226
e00662f2 227## Mac OS X notes
ea775255 228
36d8d1a6 229Some versions of Mac OS X (Darwin) seem to have an IPv6 stack, but do
e00662f2 230not completely implement the "New Sockets" API.
ea775255 231
c3cf174e 232[This site][5] says that Apple started to support IPv6 in 10.2 (Jaguar). If
7f8cf771 233your build fails, try again after running configure with `--disable-ipv6`.
c3cf174e
WD
234
235[5]: http://www.ipv6.org/impl/mac.html
ea775255 236
e00662f2 237## IBM AIX notes
ea775255 238
3e85237e 239IBM AIX has a largefile problem with mkstemp. See IBM PR-51921.
e00662f2
WD
240The workaround is to append the following to config.h:
241
242> #ifdef _LARGE_FILES
243> #undef HAVE_SECURE_MKSTEMP
244> #endif