-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathINSTALL
94 lines (77 loc) · 3.54 KB
/
INSTALL
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
Note:
The source for lsucpd is written in C++ and expects (almost) full
compliance with the C++20 standard (from 2020). This means gcc/g++
version 12 is problematic. The problem is the lack of support for
the std::format library. g++ version 13 properly implements std::format.
Currently many distributions still use g++ version 12. This a relatively
common problem and there is a solution. Both g++ version 12 or clang++
version 15 can be supported if the 'libfmt' library is available. On
Debian/Ubuntu use 'apt install libfmt-dev' to install the libfmt library
and its associated header file.
The build can either be with autotools or cmake. The cmake build is
currently experimental.
Autotools
=========
To build:
$ ./autogen.sh
$ ./configure
$ make
To install call:
$ make install
This will most likely need superuser privilege. The executable is placed
in the /usr/local/bin directory while the man page is placed in the
/usr/local/man/man8 directory. The install directory are controlled by
the PREFIX variable in the Makefile. To install executable in the /usr/bin
directory use './configure --prefix=/usr ' instead.
To uninstall the executable and man page call:
$ make uninstall
To clean out object and executable files from the working directory call:
$ make clean
To clean out prior to making a tarball (so ./configure needs to be run
on the target system):
$ make distclean
Rpms are also available. A lsucpd.spec file is included in the tarball
to facilitate building rpms. One way of doing this on a RedHat system
is to place the tarball of the form 'lsucpd-%{version}.tar.gz' in the
/usr/src/redhat/SOURCE directory and the spec file in the
/usr/src/redhat/SPEC directory. Then execute 'rpmbuild -ba lsucpd.spec'
from the "SPEC" directory. [Specifying the
target may help (e.g. 'rpmbuild --target=x86_64 -ba lsucpd.spec') . If
successful that will deposit the binary rpm in the
/usr/src/redhat/RPMS/x86_64 directory and the source rpm in the
/usr/src/redhat/SRPMS directory. Building an rpm on Suse is similar
(although they use their name rather than "redhat" in the above paths).
To build a Linux debian "deb" (binary) package, first untar the tarball,
then change directory to the top level within the lsucpd source. Then:
# chmod +x debian/rules
# dpkg-buildpackage -b -rfakeroot
The binary deb packages will be placed in the parent directory (of
the lsucpd source directory) if all goes well.
There is a build_debian.sh script in the tarball's top level directory
that does the above.
CMAKE
=====
The author is experimenting with cmake with a goal to support _both_
cmake and autotools. This is a relatively simple project with one
a feq source files (some C++ the rest C). It requires a C++20 or
better compiler. There is also a manpage in nroff format. The
sequence of commands to build and install is:
cmake .
cmake --build .
cmake --install .
The last cmake invocation needs root permissions. 'make clean' does
the same thing as it does in autotools. There is no 'make distclean'
so the above sequence leaves a lot of garbage "on the floor".
Rather than the last step (i.e. 'cmake --install . ') this invocation:
cpack .
will build a "deb" package and place it in the current directory.
Root permissions are not required. That package can be installed with:
dpkg -i <package>
and that will require root permissions.
There is no uninstall but after a successful install there is a
install_manifest.txt file that can be used to remove the files
installed like this:
xargs rm < install_manifest.txt
Suggestions welcome.
Douglas Gilbert
13 December 2023