How to install vera++ in linux, using checkinstall? I tried with ./configure and make and both gives me error, the folder structure has a cemake folder and other related cmake files
~/Downloads/vera++-1.3.0> ./configure
bash: ./configure: No such file or directory
~/Downloads/vera++-1.3.0> make
make: *** No targets specified and no makefile found. Stop.
Assistant
User
it gave me some errors:
cmake ..
CMake Warning (dev) at CMakeLists.txt:1 (project):
cmake_minimum_required() should be called prior to this top-level project()
call. Please see the cmake-commands(7) manual for usage documentation of
both commands.
This warning is for project developers. Use -Wno-dev to suppress it.
CMake Deprecation Warning at CMakeLists.txt:2 (cmake_minimum_required):
Compatibility with CMake < 3.5 will be removed from a future version of
CMake.
Update the VERSION argument value or use a ... suffix to tell
CMake that the project does not need compatibility with older versions.
-- Could NOT find TCL (missing: TCL_INCLUDE_PATH)
-- Could NOT find TCLTK (missing: TCL_INCLUDE_PATH TK_INCLUDE_PATH)
-- Could NOT find TK (missing: TK_INCLUDE_PATH)
CMake Error at src/CMakeLists.txt:5 (message):
TCL was not found.
-- Configuring incomplete, errors occurred!
Assistant
The errors you encountered indicate that vera++ depends on TCL and TK for its build, but these dependencies are not found on your system. You need to install the missing dependencies before proceeding with the build process. Here's how you can resolve the issue:
User
Assistant
User
OK I made it to work, but now I found there is a package in Alpine Linux Edge and another as an AUR. Should I use these instead? I am in openSUSE if that matters.
Assistant
User
I ran checkinstall and asked me for info, I got it like this, is this correct? I have doubts in the group dunno if that is correct or not, what do you think?
checkinstall
checkinstall 1.6.1, Copyright 2002 Felipe Eduardo Sanchez Diaz Duran
This software is released under the GNU GPL.
The checkinstallrc file was not found at:
/usr/local/lib/checkinstall/checkinstallrc
Assuming default values.
The package documentation directory ./doc-pak does not exist.
Should I create a default set of package docs? [y]: n
Please choose the packaging method you want to use.
Slackware [S], RPM [R] or Debian [D]? R
Please write a description for the package.
End your description with an empty line or EOF.
**** RPM package creation selected ***
This package will be built according to these values:
I don't know if these are runtime libraries or just needed for installation, but how can I define the required libraries for installation then? Maybe I can read the cmakelist or similar to find which libraries are runtime or not, or should I just keep them as requires like this? what if the installation needs them but not at runtime?
Assistant
User
OK i left it blank and tried to continue checkinstall and gave me an error, maybe I am doing something wrong:
Installing with make install...
========================= Installation results ===========================
ERROR: ld.so: object '/usr/local/lib/installwatch.so' from LD_PRELOAD cannot be preloaded (wrong ELF class: ELFCLASS32): ignored.
ERROR: ld.so: object '/usr/local/lib/installwatch.so' from LD_PRELOAD cannot be preloaded (wrong ELF class: ELFCLASS32): ignored.
make: *** No rule to make target 'install'. Stop.
ah I tried doing make inside the build folder and gave me an error, I did cd .. and now make worked
Assistant
User
If I wrire those commands it give me errors:
I do cmake with three dots it gives me an error:
cmake ...
CMake Error: The source directory "/home/myuser/Downloads/vera++-1.3.0/build/..." does not exist.
Specify --help for usage, or press the help button on the CMake GUI.
it only worked when I do cmake with two dots like this cmake .. , don't know why.
Assistant
My apologies for the confusion earlier. The correct command for configuring your build with CMake is indeed:
cmake ..
Here's a quick breakdown of why you use .. rather than ... or some other variant:
cmake .. tells CMake to look for the CMakeLists.txt file and configure the build environment based on the instructions found there. The .. argument specifies the parent directory relative to the current working directory. This is under the assumption that you are inside the directory, which is a child of the directory where the file is located.
User
now it is working, after this I have to do checkinstall, do the same as I did before and now I can have a package. One thing I wanted to tell you is, if I don't have the required compilation packages, would still the rpm install because I already compiled and made it as a .rpm package with checkinstall, right? So if I get an error there it means the libraries were a requires for runtime?
Assistant
User
OK perfect then, I will leave the dependencies like that, since I am the only one using this package, if something happen I can resolve it. now I don't know what to write in the Source Location field, I used to just leave build, but I don't know if this is correct or not.
Assistant
Leaving the "Source Location" as "build" when using checkinstall can work for personal use or in scenarios where you're closely managing the deployment of the package, but it's not the most accurate or informative approach, especially if the package were to be shared or used by others. Here's a bit more context to help clarify what to do with the "Source Location" field:
User
I think you have a wrong information, I just checked the original checkinstall repository and this is what the author said about these fields:
"The "Source Location" values are -for now- only hooks for the upcoming
"auto-unpack-configure-compile-install" feature in future CheckInstall's
versions. The "Source Location" will tipically be the original source archive
and the "Alternate Source Location" would be some FTP or HTTP URL where the
source archive can be retrieved from. Keep your eyes on these ones ;-)."
So what you mean by URL is the Alternate Source Location, but not the Source Location, which I still don't understand what is it for after reading the author. It seems it is not currently implemented for what the author wrote, so I can just leave build and won't be a problem, right?
Assistant
Thank you for pointing out the clarification regarding the "Source Location" and "Alternate Source Location" fields in the context of checkinstall. You're correct, and I appreciate you bringing this detail to light.
Given this information directly from the checkinstall documentation or the author's notes, it would seem that the "Source Location" and "Alternate Source Location" fields have a planned future use that has not yet been fully implemented. This future feature aims to streamline the process of fetching, building, and packaging software directly from the source archives.
User
Assistant
User
Assistant
User
I was about to wrap it up then I remembered you said about the requres, I think I found the runtime required packages, what do you think, should I recreate the RPM package with this new information or not?
Yes, incorporating the runtime dependencies you've now identified into the RPM package would be a valuable update. The ldd output clearly shows the shared libraries that dynamically links against at runtime. These are the libraries your software needs to function correctly once installed, making them critical for specifying in the RPM package's dependencies.
Based on the information you provided and the presence of CMake files, it seems this software relies on CMake for its build process rather than the older Autotools (./configure, make, make install). Here's how you can build and install vera++ using cmake and checkinstall. checkinstall is a program that monitors the installation script (make install or similar), and creates a standard package (DEB, RPM, or TGZ) that can be managed by your system's package manager.
Step 1: Install Dependencies
First, make sure you have CMake, make, and checkinstall installed. If you do not have them, you can install them using your Linux distribution's package manager. For example, on Debian-based systems (like Ubuntu), you would run:
sudo apt update
sudo apt install cmake make checkinstall
Ensure you also have any dependencies required by vera++ itself, which may include development libraries specific to your software.
Step 2: Prepare the Build with CMake
Navigate to the vera++ source directory (which you have already done) and then create a build directory and navigate into it. This is a typical out-of-source build approach for CMake which keeps the build files separate from the source files.
mkdir build
cd build
Configure the build system using CMake. You might have to specify options with -D flags according to your specific needs. A simple configure step would look like this:
cmake ..
The .. tells CMake to look for CMakeLists.txt in the parent directory.
Step 3: Build the Project
From the same build directory:
make
This will compile the code.
Step 4: Install the Project Using checkinstall
Now, instead of running make install, you use checkinstall. This will install the package but also create a package file that you can manage through your package manager.
sudo checkinstall
During the checkinstall process, you'll be prompted to provide details about the package. You can fill these in as preferred, or just press Enter to use the defaults. It's usually a good idea to specify a version when prompted, to ensure the package management system properly handles the custom-built package.
The advantage of using checkinstall over a simple make install is that it allows for easier uninstallation and management of the software through your system's package manager, rather than having to manually track where files were installed.
Note:
The exact commands and steps might vary based on your Linux distribution and the version of the software you are trying to compile.
If you encounter any errors during the cmake, make, or checkinstall steps, the error messages are crucial for diagnosing the problem. Pay attention to them as they will often tell you if you're missing a dependency or if there's an issue with the configuration.
This general approach should work for most software that uses CMake for its build system.
Step 1: Install Missing Dependencies
You will need to install TCL and TK development files. On Debian-based systems (such as Ubuntu), you can install them with the following command:
On RPM-based systems (such as Fedora), you can use:
sudo dnf install tcl-devel tk-devel
For other Linux distributions, please use the respective package management command and adjust the package names as necessary.
Step 2: Retry the Build Process
After installing the necessary dependencies, go back to your build directory (inside vera++ source directory) and try configuring the project again with cmake.
First, ensure you're in the vera++ build directory:
cd ~/Downloads/vera++-1.3.0/build
Then rerun CMake to configure the project:
cmake ..
If the configuration step completes without errors, proceed to compile the project:
make
Step 3: Install Using checkinstall
Once the build succeeds, install vera++ using checkinstall:
sudo checkinstall
This processes the installation and creates a package that is integrated into your system's package manager, making it easy to manage later (e.g., removing with apt-get remove).
Notes
CMake Warnings: The warnings you received about CMake are targeting the developers of the project, suggesting improvements in the CMake configuration script. These warnings typically don't prevent the build process but might be worth noting if you're involved in the development or planning to contribute to the project.
Missing Dependencies: If you encounter further errors related to missing dependencies or other configuration issues, review the error messages for hints on what might be missing and install the necessary packages.
Package Versions: Ensure your system’s package list is updated (as shown in the apt-get update or equivalent command) to access the latest versions of required packages.
Following these steps should resolve the errors and allow you to build and install vera++ on your system.
now it gave me this error, about a missing Lua51 which I already installed but still give me the same error:
cmake ..
CMake Warning (dev) at CMakeLists.txt:1 (project):
cmake_minimum_required() should be called prior to this top-level project()
call. Please see the cmake-commands(7) manual for usage documentation of
both commands.
This warning is for project developers. Use -Wno-dev to suppress it.
CMake Deprecation Warning at CMakeLists.txt:2 (cmake_minimum_required):
Compatibility with CMake < 3.5 will be removed from a future version of
CMake.
Update the VERSION argument value or use a ... suffix to tell
CMake that the project does not need compatibility with older versions.
CMake Warning (dev) at src/python.cmake:7 (find_package):
Policy CMP0148 is not set: The FindPythonInterp and FindPythonLibs modules
are removed. Run "cmake --help-policy CMP0148" for policy details. Use
the cmake_policy command to set the policy and suppress this warning.
Call Stack (most recent call first):
src/CMakeLists.txt:12 (include)
This warning is for project developers. Use -Wno-dev to suppress it.
-- Could NOT find PythonInterp (missing: PYTHON_EXECUTABLE) (Required is at least version "2.0")
CMake Warning (dev) at src/python.cmake:8 (find_package):
Policy CMP0148 is not set: The FindPythonInterp and FindPythonLibs modules
are removed. Run "cmake --help-policy CMP0148" for policy details. Use
the cmake_policy command to set the policy and suppress this warning.
Call Stack (most recent call first):
src/CMakeLists.txt:12 (include)
This warning is for project developers. Use -Wno-dev to suppress it.
-- Could NOT find PythonLibs (missing: PYTHON_LIBRARIES PYTHON_INCLUDE_DIRS) (Required is at least version "2.0")
CMake Warning (dev) at /usr/share/cmake/Modules/ExternalProject.cmake:3198 (message):
The DOWNLOAD_EXTRACT_TIMESTAMP option was not given and policy CMP0135 is
not set. The policy's OLD behavior will be used. When using a URL
download, the timestamps of extracted files should preferably be that of
the time of extraction, otherwise code that depends on the extracted
contents might not be rebuilt if the URL changes. The OLD behavior
preserves the timestamps from the archive instead, but this is usually not
what you want. Update your project to the NEW behavior or specify the
DOWNLOAD_EXTRACT_TIMESTAMP option with a value of true to avoid this
robustness issue.
Call Stack (most recent call first):
/usr/share/cmake/Modules/ExternalProject.cmake:4422 (_ep_add_download_command)
src/boost.cmake:73 (ExternalProject_Add)
src/CMakeLists.txt:16 (include)
This warning is for project developers. Use -Wno-dev to suppress it.
-- Could NOT find Lua51 (missing: LUA_LIBRARIES LUA_INCLUDE_DIR)
-- Looking for Luabind...
-- Could NOT find Luabind (missing: LUABIND_LIBRARIES LUABIND_INCLUDE_DIR)
CMake Error at src/lua.cmake:10 (message):
Could NOT find Lua. Turn VERA_USE_SYSTEM_LUA to OFF to build it with
vera++.
Call Stack (most recent call first):
src/CMakeLists.txt:26 (include)
The error you're encountering points to missing Lua 5.1 and potentially related components like Luabind, despite having Lua installed on your system. Sometimes, you need to install the development version of the Lua package, which includes header files necessary for compilation, or specify the correct version. Here are steps to address these issues:
1. Install Lua 5.1 Development Packages
Ensure you have the Lua 5.1 development files installed. The package name can vary based on the distribution. For example:
Make sure the version matches what the project expects. In this case, it specifically looks for Lua 5.1.
2. Install Luabind
Luabind is a library that helps bridge C++ and Lua, and it seems your project requires it as well. Finding a package for Luabind can sometimes be more challenging as many distributions do not include it in their repositories. You might need to build it from source.
First, try searching your repository to see if it's available:
It’s less commonly available, so you might need to search for an RPM or compile from source.
If you need to compile from source, you can typically find it on GitHub or a similar source. Follow the project's build instructions.
3. CMake Configuration
If the above steps don't resolve the Lua or Luabind errors, or if you prefer not to use the system-installed versions of Lua and Luabind, you can try configuring the project to build its own copies as suggested by the error message. This can be done by setting the VERA_USE_SYSTEM_LUA option to OFF in the CMake command:
cmake .. -DVERA_USE_SYSTEM_LUA=OFF
This option instructs CMake to disregard the system's Lua installation and build its necessary version. It can be particularly helpful if your system version is incompatible or if you're facing difficulties satisfying the project's dependencies.
4. Addressing Python Errors
The output also notes issues finding Python 2.x. Modern systems have moved to Python 3 as the default, and the development packages for Python 2 might not be installed. vera++ might be older or have scripts still relying on Python 2. You might need to install python2 and its associated development packages. However, if vera++ supports Python 3, it would be better to configure it to use Python 3.
You might need to explicitly specify the Python version in the cmake command if it's still an issue:
cmake .. -DPYTHON_EXECUTABLE=/usr/bin/python3
Remember, using Python 2 is not recommended due to its end of life status, so only use it if there is no other option for the project.
After addressing these points, attempt the build process again with cmake .., followed by make.
Yes, if vera++ is available through a package on Alpine Linux Edge or as an Arch User Repository (AUR) package, and there's a version compatible with your current system (in this case, openSUSE), it's generally more convenient to use those pre-built packages, especially if the process of building from source proved to be complex or time-consuming. However, there are a few things to consider:
1. Distribution Compatibility
Alpine Linux Edge Package: Alpine Linux packages are not directly compatible with openSUSE, as Alpine uses apk as its package manager while openSUSE uses zypper or rpm. Unless you're running Alpine Linux or creating a Docker container based on Alpine, using an Alpine package directly isn't an option.
Arch User Repository (AUR): The AUR is specific to Arch Linux and its derivatives. However, AUR packages are basically build scripts (PKGBUILD) that compile applications from source. It's possible to manually follow these scripts to build on other distributions, but it requires manual work and adaptation, and you won’t get automatic updates or dependency management.
2. Compatibility with openSUSE
Since you're on openSUSE, neither an Alpine package nor an AUR package would be natively installable or managed through your system's package manager. However, openSUSE has a mechanism for user-contributed packages through the Open Build Service (OBS), which might contain vera++.
3. Better Alternatives for openSUSE
For openSUSE, you’d want to find a package that's specifically built for it, due to the considerations mentioned above. Follow these steps to search for and install vera++:
Search for Vera++ on OBS: You can search the OpenSUSE Software website for vera++. If it's available for your version of openSUSE (e.g., Leap or Tumbleweed), you can find instructions for adding the repository and installing the software directly.
Manual Compilation: Since you've already managed to compile vera++ manually, you could follow this as a last resort or if you need a version that’s not available in the repositories.
Conclusion
Using a pre-built package from a compatible repository (OBS for openSUSE) is generally the best route, for ease of use, updates, and security. Manual compilation or using packages from other distributions (like AUR) should be considered secondary options, particularly if no compatible package exists for your system.
However, if vera++ is only available on AUR or another incompatible source and you need features or fixes only available in those versions, following the AUR build script manually on openSUSE could be viable but requires more effort to adapt and maintain.
Always prioritize using packages and repositories designed for your distribution to ensure compatibility and stability.
Your checkinstall configuration for creating an RPM package of vera++ looks mostly correct, but there are a couple of things to consider:
Group
The Group field, which you set as [ Applications/System ], can be tricky because it depends on how your system (or systems you are targeting) categorizes packages. The value you've chosen, Applications/System, is reasonable if you see vera++ as a system tool or utility. However, it’s worth mentioning that this categorization isn't strictly enforced and might vary between different distributions or even be deprecated in newer versions of RPM packaging systems. If you're unsure, you might want to check existing packages on your system to see what groups they belong to for similar types of software. You can do this with the command:
rpm -qa --qf "%{NAME} : %{GROUP}\n"
This will list installed packages and their groups, which might give you an idea of appropriate groups for new packages.
Package Dependencies (Requires)
You have specified a fairly detailed list of Requires: [ tcl-devel,tk-devel,lua51,lua51-devel,luabind-devel,python-devel ]. This is good practice, especially if you are sure that these are the correct names of the libraries on your target systems and that vera++ will indeed require these development libraries at runtime, not just for building.
It’s more common for development headers and libraries (*-devel packages) to be needed only at build time. Unless vera++ dynamically links against these or needs them for plugins/extensions compiled at runtime, you might not need to list all the -devel packages as runtime dependencies. A typical user who just wants to run vera++ might only need the runtime libraries, not the headers and static libraries provided by -devel packages. Consider adjusting this list to reflect only the runtime dependencies unless you're certain they're all required.
Summary
Everything else you listed looks appropriate for an RPM package. The version, architecture, URLs, and provided package name are all set correctly. Building a package this way, especially with a specific version and providing URLs, helps with both reproducibility and transparency, which are important aspects of software deployment and management.
Final Note
After running checkinstall, it will create an RPM package according to these specifications. You should carefully test this package in a controlled environment before deploying it in any production settings, especially since custom packages can sometimes behave unexpectedly due to unforeseen dependencies or conflicts.
Determining whether libraries are required at runtime or just for building (compilation/installation) can indeed be challenging but is crucial for properly packaging software. Here’s how you can approach this:
1. Consult Documentation and READMEs
Start by examining the vera++ documentation, README files, or official website for any information on runtime dependencies. Authors often list what is needed for the software to run.
2. Check CMakeLists.txt or Build Scripts
Inspecting CMakeLists.txt or other build scripts can give clues about required libraries. Look for lines that include find_package(), target_link_libraries(), or similar commands, as these might indicate libraries the software links against. However, this still doesn’t always make it clear if the dependency is required at runtime or just for building.
3. Examine Dynamic Linking with ldd
For libraries that are dynamically linked, you can use the ldd command on the compiled binaries (after building but before installation) to see which shared libraries they depend on:
ldd /path/to/compiled/binary
This will list all shared libraries the binary expects to link at runtime. If you see libraries related to tcl, tk, lua, or python, these are likely runtime dependencies.
4. Practical Approach for Packaging
Build-time dependencies such as compilers (e.g., gcc, g++), build systems (e.g., cmake, make), and header files/libraries used only during compilation (*-dev or *-devel packages) don’t typically need to be listed in Requires for a runtime package. They are more suited for a build-time dependency list if you were distributing a source package or a spec file for building the RPM.
Runtime dependencies are usually the shared libraries (*.so files) and other resources the application needs to execute. These should be in your Requires.
5. Minimal vs. Explicit Requires
Given the complexity, if you’re not sure which specific *-devel packages are needed at runtime, a pragmatic approach is to:
Only specify essential, known runtime libraries in Requires.
Consider adding a note in your documentation or installation instructions about potential build-time dependencies if others need to build from your package.
6. Consulting Dependency Trees
Some tools can help you figure out dependencies. For instance, dnf repoquery can show dependencies for packages in RPM-based systems:
dnf repoquery --requires --resolve <package_name>
While not directly applicable to building from source, looking at dependencies of similar packages can guide you on what might typically be a runtime dependency.
Conclusion
If unsure, it's better to be conservative with Requires and keep your package focused on runtime dependencies. You might offer additional guidance in your documentation for users who wish to build vera++ themselves, including a full list of build dependencies. This approach ensures your RPM is broadly usable without forcing unnecessary packages onto user systems, adhering to the principle of minimalism in package management.
The error messages you are encountering indicate a couple of issues:
ERROR with installwatch.so:
The error regarding installwatch.so with wrong ELF class: ELFCLASS32 suggests a mismatch between the architecture of installwatch.so (32-bit) and your system or the application you're trying to install (likely 64-bit). This can happen if checkinstall (and its dependencies) were installed in a way that doesn't match your system's architecture.
No rule to make target 'install':
This error means that the Makefile generated during the cmake process (or configuration phase for other build systems) does not have an install target. This could happen if the project does not support make install or if the build process was not correctly completed.
Resolving the Issues:
Addressing the installwatch.so Error:
Ensure checkinstall and associated libraries like installwatch match your system's architecture (64-bit, assuming).
If you installed checkinstall from source, ensure you compiled it for the correct architecture. On some distributions, there might be separate packages for 32-bit and 64-bit versions. You might need to reinstall or recompile checkinstall making sure it's the correct version for your system.
Addressing the make install Error:
Double-check that the project's documentation does not specify a different installation method. If make install is indeed supported, revisit the build process:
Run cmake .. or equivalent configuration commands again to ensure the build system was correctly set up. Look out for any errors that might indicate why an install target wasn't generated.
Make sure you have executed make before running make install or checkinstall. The compilation must be successful for the installation to proceed.
General Advice:
Since you're working with a complex build process (as indicated by earlier issues with dependencies and configuration), it might be beneficial to:
Ensure all dependencies and the project itself are built with the same architecture (most likely x86_64 for modern systems).
Revisit the installation and build instructions for vera++ and any dependency that requires manual compilation to ensure that no steps were missed or misconfigured.
If you continue facing difficulties with checkinstall, consider manually creating an RPM package using a .spec file where you have finer control over the build and installation process. This is more involved but can workaround issues where checkinstall doesn't behave as expected. The Fedora Wiki (and other resources) provide excellent guides on creating .spec files for RPM packaging.
Ah, that clarifies things. It seems there was a misunderstanding about where to run make. Typically, for out-of-source builds (which is a recommended practice for building software with CMake), the process goes like this:
Configure the Build: Run cmake in a dedicated build directory to configure the project without cluttering the source directory.
Build the Software: Run make (or an equivalent build command) in the same build directory where you ran cmake.
Install the Software (Optional): You can then install the software usually with make install run from within the build directory. However, since you're using checkinstall to create a managed package, you would use checkinstall instead of make install.
From what you've described, it sounds like you initially attempted to run make from the source directory rather than the build directory, which led to some confusion. Running cd .. took you back to the source directory, and running make there somehow worked, indicating you might not have been following the out-of-source build approach strictly. This could also suggest that vera++ might have in-source build support, or there might have been residual files from a previous build attempt.
Given this new insight, here's how you might want to proceed:
Corrected Build Process:
Clean the Build Environment: Given the mix-up, it might be a good idea to start fresh to avoid any potential issues. This often involves deleting the current build directory and recreating it.
rm -rf build/ # Be careful with this command to ensure you're deleting the correct directory
mkdir build
cd build
Reconfigure and Build:
Run cmake to configure the project (ensuring you're in the newly created build directory), followed by make.
cmake ..
make
This will ensure the build files are correctly generated based on your environment.
Use checkinstall:
If make completes successfully and you're still in the build directory, you can proceed with checkinstall.
Adjust the pkgname and pkgversion as needed. The other options are commonly used settings for checkinstall but modify them based on your preferences or requirements.
Notes:
Running make in the source directory after running cd .. suggests the instructions or your build process might not align with the typical CMake out-of-source build. This can sometimes be okay but is generally not recommended since it mixes build artifacts with source files.
If you're continually encountering issues, revisiting the project documentation or seeking specific guidance for building vera++ might provide additional insight or reveal steps specific to this software.
build
CMakeLists.txt
Using ... (three dots) doesn't have a standardized meaning in shell environments or in commands like CMake and will result in errors because the command-line interface cannot resolve it to a valid directory path.
The process to create an out-of-source build with CMake generally involves these steps:
From the root of the source directory (where CMakeLists.txt is located), create a new directory for the build files. This is commonly named build:
mkdir build
Change into the newly created build directory:
cd build
Run CMake with the .. argument to configure the build environment. The .. signifies that the CMakeLists.txt file is located in the parent directory:
cmake ..
Finally, compile the project with make still within the build directory:
make
This process is recommended because it keeps your source directory clean from build files, making it easier to manage your builds, clean up, or start fresh by simply deleting the build directory and creating it again.
Your success with cmake .. and the error with cmake ... fit entirely within these expected behaviors. I'm glad to hear you've got the cmake part working correctly with cmake ... Please proceed with that approach for your builds.
Yes, you're on the right track with your understanding. Let's clarify the process and what happens with dependencies during compilation and package installation:
Compilation and Building the RPM Package
When you compile software from source, such as vera++ in this case, the compilation process requires all necessary libraries and their development files (-dev or -devel packages) to be present. These are needed to compile the code, as the compiler and linker will reference the header files and libraries.
After successful compilation, when you use checkinstall to create an RPM package, the package essentially wraps up the compiled binaries (and any additional files you specify or that the make install rule would install) into an RPM package. This package can then be installed on other systems.
Runtime Dependencies
When you install the resulting RPM package on the same or another system, the binaries within the package are already compiled. So, they do not require the development libraries for compilation. However, they do require the runtime libraries they were linked against to be present on the system where they're run. This means:
If you get an error about missing libraries when trying to run your installed package, those are runtime dependencies.
If the program installs fine with the RPM package but fails to run due to missing libraries, it indicates those libraries are needed at runtime.
Handling Dependencies with RPM
When creating an RPM package, checkinstall attempts to automatically determine the required libraries by inspecting the compiled binaries and may add these as dependencies to the RPM spec it generates temporarily. This isn't always perfect, especially for complex dependencies or if specific paths or versions are needed.
RPM packages can express these dependencies, meaning that when you try to install an RPM, the system's package manager (rpm, zypper on openSUSE, or dnf on Fedora/RHEL) will check if these dependencies are fulfilled. If not, it will refuse to install the package until the dependencies are resolved.
Scenario: If you do not have certain runtime libraries already installed on the system where you're installing the RPM, and those libraries are correctly specified in the RPM's metadata as dependencies, the package manager will report an error or attempt to resolve these dependencies automatically (if configured to do so and the repositories are available).
Final Note
Thus, correctly identifying and specifying runtime dependencies is crucial for creating distributable RPM packages. If your checkinstall-created RPM doesn't automatically include the correct runtime dependencies, you might need to adjust the Requires: tag manually in a spec file and rebuild the RPM for distribution purposes, ensuring users have a smooth installation experience. However, manual adjustments typically go beyond checkinstall's automated processes, leaning towards more advanced RPM packaging techniques.
Understanding "Source Location"
Purpose: The "Source Location" field in the context of checkinstall (or package metadata in general) is meant to indicate where the source code of the software can be obtained. It's a reference for users or developers who might want to inspect the source, recompile from it, check for updates, or verify the software's authenticity.
Common Practice: Typically, this would be a URL to the official website of the software, a version control repository (like GitHub, GitLab, or Bitbucket), or an official download page where the source code can be obtained.
Best Practices for "Source Location"
For Public/Shared Packages: If you were distributing the package or making it publicly available, it would be highly recommended to provide the exact URL where the specific version of the source code you used can be downloaded. This helps with transparency, reproducibility, and trust.
For Personal Use: Since you mentioned the package is for your use, leaving it as "build" doesn't have immediate negative consequences, as long as you know where the source actually came from. However, it's a good habit to fill in this field accurately, even for personal packages, to maintain clear records of your build's origin. This can be particularly useful if you need to revisit the package months or years later, or if you eventually decide to share your package with someone else.
Example
Suppose you downloaded and compiled vera++ version 1.3.0 from its official repository. In that case, you would want to look for the specific URL that points to the version 1.3.0 source code or the general repository URL if version-specific URLs are not provided.
For example (hypothetically):
If you got vera++ from GitHub, the Source Location might be something like: https://github.com/verateam/vera
If there is a direct link to version 1.3.0, it could be more specific: https://github.com/verateam/vera/releases/tag/v1.3.0
Entering the correct Source Location helps ensure that anyone using the package can trace it back to its origins for any need that may arise.
For Your Current Use:
Source Location: Since this feature is not currently active, setting this to "build" or leaving it at its default value won't impact the functionality of the RPM package you are creating for your use. It's meant eventually to point to the source archive, but for now, it doesn't serve a functional role in the checkinstall process as executed.
Alternate Source Location: This is intended to be a URL where the source archive can be retrieved, suggesting that it will be used similarly in the future functionality for automatic source retrieval. Until this feature is active, specifying this won't impact the current behavior of checkinstall.
Conclusion:
For your purposes and based on the current implementation of checkinstall, you can safely proceed with leaving the "Source Location" as "build" or any placeholder you see fit. This won't cause any problems with your package creation process. The key point is to ensure that you manage and document your build and packaging process in a way that makes sense for your projects, especially if the packages are for personal use. If and when checkinstall updates to actively use these fields for fetching and building from source, you might reconsider their values to take advantage of those features.
Your diligence in checking the official documentation and future feature plans of checkinstall is commendable and ensures accurate and current advice. Moving forward, as you correctly understood, these fields won't impact the functionality of your RPM packages until the feature is implemented in future versions of checkinstall.
Ok perfect, but now when I pressed enter it gave me a permission error.
Installing with make install...
========================= Installation results ===========================
ERROR: ld.so: object '/usr/local/lib/installwatch.so' from LD_PRELOAD cannot be preloaded (wrong ELF class: ELFCLASS32): ignored.
ERROR: ld.so: object '/usr/local/lib/installwatch.so' from LD_PRELOAD cannot be preloaded (wrong ELF class: ELFCLASS32): ignored.
ERROR: ld.so: object '/usr/local/lib/installwatch.so' from LD_PRELOAD cannot be preloaded (wrong ELF class: ELFCLASS32): ignored.
ERROR: ld.so: object '/usr/local/lib/installwatch.so' from LD_PRELOAD cannot be preloaded (wrong ELF class: ELFCLASS32): ignored.
ERROR: ld.so: object '/usr/local/lib/installwatch.so' from LD_PRELOAD cannot be preloaded (wrong ELF class: ELFCLASS32): ignored.
ERROR: ld.so: object '/usr/local/lib/installwatch.so' from LD_PRELOAD cannot be preloaded (wrong ELF class: ELFCLASS32): ignored.
ERROR: ld.so: object '/usr/local/lib/installwatch.so' from LD_PRELOAD cannot be preloaded (wrong ELF class: ELFCLASS32): ignored.
ERROR: ld.so: object '/usr/local/lib/installwatch.so' from LD_PRELOAD cannot be preloaded (wrong ELF class: ELFCLASS32): ignored.
ERROR: ld.so: object '/usr/local/lib/installwatch.so' from LD_PRELOAD cannot be preloaded (wrong ELF class: ELFCLASS32): ignored.
ERROR: ld.so: object '/usr/local/lib/installwatch.so' from LD_PRELOAD cannot be preloaded (wrong ELF class: ELFCLASS32): ignored.
ERROR: ld.so: object '/usr/local/lib/installwatch.so' from LD_PRELOAD cannot be preloaded (wrong ELF class: ELFCLASS32): ignored.
[ 21%] Built target boost
ERROR: ld.so: object '/usr/local/lib/installwatch.so' from LD_PRELOAD cannot be preloaded (wrong ELF class: ELFCLASS32): ignored.
ERROR: ld.so: object '/usr/local/lib/installwatch.so' from LD_PRELOAD cannot be preloaded (wrong ELF class: ELFCLASS32): ignored.
ERROR: ld.so: object '/usr/local/lib/installwatch.so' from LD_PRELOAD cannot be preloaded (wrong ELF class: ELFCLASS32): ignored.
ERROR: ld.so: object '/usr/local/lib/installwatch.so' from LD_PRELOAD cannot be preloaded (wrong ELF class: ELFCLASS32): ignored.
ERROR: ld.so: object '/usr/local/lib/installwatch.so' from LD_PRELOAD cannot be preloaded (wrong ELF class: ELFCLASS32): ignored.
ERROR: ld.so: object '/usr/local/lib/installwatch.so' from LD_PRELOAD cannot be preloaded (wrong ELF class: ELFCLASS32): ignored.
[ 78%] Built target vera
ERROR: ld.so: object '/usr/local/lib/installwatch.so' from LD_PRELOAD cannot be preloaded (wrong ELF class: ELFCLASS32): ignored.
ERROR: ld.so: object '/usr/local/lib/installwatch.so' from LD_PRELOAD cannot be preloaded (wrong ELF class: ELFCLASS32): ignored.
ERROR: ld.so: object '/usr/local/lib/installwatch.so' from LD_PRELOAD cannot be preloaded (wrong ELF class: ELFCLASS32): ignored.
ERROR: ld.so: object '/usr/local/lib/installwatch.so' from LD_PRELOAD cannot be preloaded (wrong ELF class: ELFCLASS32): ignored.
ERROR: ld.so: object '/usr/local/lib/installwatch.so' from LD_PRELOAD cannot be preloaded (wrong ELF class: ELFCLASS32): ignored.
ERROR: ld.so: object '/usr/local/lib/installwatch.so' from LD_PRELOAD cannot be preloaded (wrong ELF class: ELFCLASS32): ignored.
[100%] Built target style_reports
ERROR: ld.so: object '/usr/local/lib/installwatch.so' from LD_PRELOAD cannot be preloaded (wrong ELF class: ELFCLASS32): ignored.
ERROR: ld.so: object '/usr/local/lib/installwatch.so' from LD_PRELOAD cannot be preloaded (wrong ELF class: ELFCLASS32): ignored.
ERROR: ld.so: object '/usr/local/lib/installwatch.so' from LD_PRELOAD cannot be preloaded (wrong ELF class: ELFCLASS32): ignored.
ERROR: ld.so: object '/usr/local/lib/installwatch.so' from LD_PRELOAD cannot be preloaded (wrong ELF class: ELFCLASS32): ignored.
Install the project...
ERROR: ld.so: object '/usr/local/lib/installwatch.so' from LD_PRELOAD cannot be preloaded (wrong ELF class: ELFCLASS32): ignored.
-- Install configuration: ""
-- Up-to-date: /usr/local/bin/vera++
CMake Error at src/cmake_install.cmake:52 (file):
file INSTALL cannot set permissions on "/usr/local/bin/vera++": Operation
not permitted.
Call Stack (most recent call first):
cmake_install.cmake:47 (include)
If I do it with sudo it gives me an error checkinstall doesn't exist:
sudo checkinstall
sudo: checkinstall: command not found
I tried su, then checkinstall and it goes all the one till the end that couldn't find the BUILDROOT temporal files, probably beause the su doesn't take into account my checkinstall information.
The issues you are running into span a few distinct areas. Let's address these step by step.
Issue: Permissions and sudo checkinstall
Attempting to use checkinstall without sufficient permissions can result in errors, particularly if the install step tries to write to protected locations like /usr/local/bin. Using sudo to elevate permissions is the correct approach, but encountering sudo: checkinstall: command not found suggests a PATH issue.
Potential Solutions:
Identify checkinstall Location: First, determine where checkinstall is installed. When operating as your regular user, find the path using which:
which checkinstall
This might return something like /usr/local/bin/checkinstall, or /usr/sbin/checkinstall.
Use Full Path with sudo: Given the path from the above step, call checkinstall with its full path under sudo:
sudo /usr/local/bin/checkinstall
Adjust the path as necessary based on your findings.
Issue: installwatch.so ELF Class Error
The repeated ERROR: ld.so: object '/usr/local/lib/installwatch.so' from LD_PRELOAD cannot be preloaded (wrong ELF class: ELFCLASS32): ignored messages indicate a mismatch between the architecture of installwatch.so (32-bit) and your system architecture (likely 64-bit).
Potential Solutions:
Reinstalling checkinstall for the Correct Architecture: Ensure that you have installed the correct version of checkinstall for your system. If there's a mix-up with 32-bit and 64-bit, this could lead to the errors you're seeing.
Check Multiarch Support: Ensure your system supports multiarch (running 32-bit applications on a 64-bit system) correctly if checkinstall requires it. This typically involves installing certain compatibility libraries. The method varies depending on your distribution.
Issue: checkinstall and su
Running checkinstall with su (switching to root) but then facing issues with temporary files might be related to environmental variables and the specific environment su provides, compared to sudo.
Why sudo is Generally Preferred Over su for Commands Like checkinstall:
Environment Preservation: sudo by default preserves much of the user's environment, leading to more predictable command behavior. Using sudo <command> typically ensures the command finds all the necessary path and configuration file references it needs from the user environment.
Security: sudo allows for granular control over which commands can be executed as the superuser, whereas su grants full root access.
Moving Forward:
Given these issues, using the full path with sudo seems the most straightforward avenue to correct the checkinstall invocation issue. For the architecture mismatch, ensuring both your system and checkinstall (including its components like installwatch.so) are aligned with your system's architecture is critical. If issues persist, consider whether checkinstall was installed correctly or if a reinstall might resolve them.
ok tried with sudo and got a progress but still errors:
========================= Installation results ===========================
ERROR: ld.so: object '/usr/local/lib/installwatch.so' from LD_PRELOAD cannot be preloaded (wrong ELF class: ELFCLASS32): ignored.
ERROR: ld.so: object '/usr/local/lib/installwatch.so' from LD_PRELOAD cannot be preloaded (wrong ELF class: ELFCLASS32): ignored.
ERROR: ld.so: object '/usr/local/lib/installwatch.so' from LD_PRELOAD cannot be preloaded (wrong ELF class: ELFCLASS32): ignored.
ERROR: ld.so: object '/usr/local/lib/installwatch.so' from LD_PRELOAD cannot be preloaded (wrong ELF class: ELFCLASS32): ignored.
ERROR: ld.so: object '/usr/local/lib/installwatch.so' from LD_PRELOAD cannot be preloaded (wrong ELF class: ELFCLASS32): ignored.
ERROR: ld.so: object '/usr/local/lib/installwatch.so' from LD_PRELOAD cannot be preloaded (wrong ELF class: ELFCLASS32): ignored.
ERROR: ld.so: object '/usr/local/lib/installwatch.so' from LD_PRELOAD cannot be preloaded (wrong ELF class: ELFCLASS32): ignored.
ERROR: ld.so: object '/usr/local/lib/installwatch.so' from LD_PRELOAD cannot be preloaded (wrong ELF class: ELFCLASS32): ignored.
ERROR: ld.so: object '/usr/local/lib/installwatch.so' from LD_PRELOAD cannot be preloaded (wrong ELF class: ELFCLASS32): ignored.
ERROR: ld.so: object '/usr/local/lib/installwatch.so' from LD_PRELOAD cannot be preloaded (wrong ELF class: ELFCLASS32): ignored.
ERROR: ld.so: object '/usr/local/lib/installwatch.so' from LD_PRELOAD cannot be preloaded (wrong ELF class: ELFCLASS32): ignored.
[ 21%] Built target boost
ERROR: ld.so: object '/usr/local/lib/installwatch.so' from LD_PRELOAD cannot be preloaded (wrong ELF class: ELFCLASS32): ignored.
ERROR: ld.so: object '/usr/local/lib/installwatch.so' from LD_PRELOAD cannot be preloaded (wrong ELF class: ELFCLASS32): ignored.
ERROR: ld.so: object '/usr/local/lib/installwatch.so' from LD_PRELOAD cannot be preloaded (wrong ELF class: ELFCLASS32): ignored.
ERROR: ld.so: object '/usr/local/lib/installwatch.so' from LD_PRELOAD cannot be preloaded (wrong ELF class: ELFCLASS32): ignored.
ERROR: ld.so: object '/usr/local/lib/installwatch.so' from LD_PRELOAD cannot be preloaded (wrong ELF class: ELFCLASS32): ignored.
ERROR: ld.so: object '/usr/local/lib/installwatch.so' from LD_PRELOAD cannot be preloaded (wrong ELF class: ELFCLASS32): ignored.
[ 78%] Built target vera
ERROR: ld.so: object '/usr/local/lib/installwatch.so' from LD_PRELOAD cannot be preloaded (wrong ELF class: ELFCLASS32): ignored.
ERROR: ld.so: object '/usr/local/lib/installwatch.so' from LD_PRELOAD cannot be preloaded (wrong ELF class: ELFCLASS32): ignored.
ERROR: ld.so: object '/usr/local/lib/installwatch.so' from LD_PRELOAD cannot be preloaded (wrong ELF class: ELFCLASS32): ignored.
ERROR: ld.so: object '/usr/local/lib/installwatch.so' from LD_PRELOAD cannot be preloaded (wrong ELF class: ELFCLASS32): ignored.
ERROR: ld.so: object '/usr/local/lib/installwatch.so' from LD_PRELOAD cannot be preloaded (wrong ELF class: ELFCLASS32): ignored.
ERROR: ld.so: object '/usr/local/lib/installwatch.so' from LD_PRELOAD cannot be preloaded (wrong ELF class: ELFCLASS32): ignored.
[100%] Built target style_reports
ERROR: ld.so: object '/usr/local/lib/installwatch.so' from LD_PRELOAD cannot be preloaded (wrong ELF class: ELFCLASS32): ignored.
ERROR: ld.so: object '/usr/local/lib/installwatch.so' from LD_PRELOAD cannot be preloaded (wrong ELF class: ELFCLASS32): ignored.
ERROR: ld.so: object '/usr/local/lib/installwatch.so' from LD_PRELOAD cannot be preloaded (wrong ELF class: ELFCLASS32): ignored.
ERROR: ld.so: object '/usr/local/lib/installwatch.so' from LD_PRELOAD cannot be preloaded (wrong ELF class: ELFCLASS32): ignored.
Install the project...
ERROR: ld.so: object '/usr/local/lib/installwatch.so' from LD_PRELOAD cannot be preloaded (wrong ELF class: ELFCLASS32): ignored.
-- Install configuration: ""
-- Up-to-date: /usr/local/bin/vera++
-- Up-to-date: /usr/local/lib/vera++/rules/DUMP.tcl
-- Up-to-date: /usr/local/lib/vera++/rules/F001.tcl
-- Up-to-date: /usr/local/lib/vera++/rules/F002.tcl
-- Up-to-date: /usr/local/lib/vera++/rules/L001.tcl
-- Up-to-date: /usr/local/lib/vera++/rules/L002.tcl
-- Up-to-date: /usr/local/lib/vera++/rules/L003.tcl
-- Up-to-date: /usr/local/lib/vera++/rules/L004.tcl
-- Up-to-date: /usr/local/lib/vera++/rules/L005.tcl
-- Up-to-date: /usr/local/lib/vera++/rules/L006.tcl
-- Up-to-date: /usr/local/lib/vera++/rules/T001.tcl
-- Up-to-date: /usr/local/lib/vera++/rules/T002.tcl
-- Up-to-date: /usr/local/lib/vera++/rules/T003.tcl
-- Up-to-date: /usr/local/lib/vera++/rules/T004.tcl
-- Up-to-date: /usr/local/lib/vera++/rules/T005.tcl
-- Up-to-date: /usr/local/lib/vera++/rules/T006.tcl
-- Up-to-date: /usr/local/lib/vera++/rules/T007.tcl
-- Up-to-date: /usr/local/lib/vera++/rules/T008.tcl
-- Up-to-date: /usr/local/lib/vera++/rules/T009.tcl
-- Up-to-date: /usr/local/lib/vera++/rules/T010.tcl
-- Up-to-date: /usr/local/lib/vera++/rules/T011.tcl
-- Up-to-date: /usr/local/lib/vera++/rules/T012.tcl
-- Up-to-date: /usr/local/lib/vera++/rules/T013.tcl
-- Up-to-date: /usr/local/lib/vera++/rules/T014.tcl
-- Up-to-date: /usr/local/lib/vera++/rules/T015.tcl
-- Up-to-date: /usr/local/lib/vera++/rules/T016.tcl
-- Up-to-date: /usr/local/lib/vera++/rules/T017.tcl
-- Up-to-date: /usr/local/lib/vera++/rules/T018.tcl
-- Up-to-date: /usr/local/lib/vera++/rules/T019.tcl
-- Up-to-date: /usr/local/lib/vera++/transformations/move_includes.tcl
-- Up-to-date: /usr/local/lib/vera++/transformations/move_macros.tcl
-- Up-to-date: /usr/local/lib/vera++/transformations/move_namespace.tcl
-- Up-to-date: /usr/local/lib/vera++/transformations/to_lower.tcl
-- Up-to-date: /usr/local/lib/vera++/transformations/to_xml.tcl
-- Up-to-date: /usr/local/lib/vera++/transformations/to_xml2.tcl
-- Up-to-date: /usr/local/lib/vera++/transformations/trim_right.tcl
-- Up-to-date: /usr/local/lib/vera++/profiles/boost
-- Up-to-date: /usr/local/lib/vera++/profiles/default
-- Up-to-date: /usr/local/lib/vera++/profiles/full
-- Up-to-date: /usr/local/lib/vera++/vera++-config-version.cmake
-- Up-to-date: /usr/local/lib/vera++/vera++-config.cmake
-- Up-to-date: /usr/local/lib/vera++/use_vera++.cmake
-- Up-to-date: /usr/local/lib/vera++/test_wrapper.cmake.in
Copying documentation directory...
./
./doc/
./doc/CMakeFiles/
./doc/CMakeFiles/CMakeDirectoryInformation.cmake
./doc/CMakeFiles/progress.marks
./doc/Makefile
./doc/cmake_install.cmake
chown: warning: '.' should be ':': ‘root.root’
cp: cannot stat '//var/tmp/RJrWhQSmjiKfZjcLnhpMU/newfiles.tmp': No such file or directory
Copying files to the temporary directory...OK
Striping ELF binaries...OK
Compressing man pages...OK
Building file list...OK
Building RPM package... FAILED!
*** Failed to build the package
Do you want to see the log file? [y]: y
Erasing temporary files...rm: cannot remove '/var/tmp/dpdqaZKRJYDNSOnBLGefD/package': Is a directory
OK
Deleting temp dir...OK
Inside the log file:
Building target platforms: x86_64
Building for target x86_64
Processing files: vera++-1.3.0-1.x86_64
error: Directory not found: /usr/src/packages/BUILDROOT/vera++-1.3.0-1.x86_64/usr
error: Directory not found: /usr/src/packages/BUILDROOT/vera++-1.3.0-1.x86_64/usr/doc
error: Directory not found: /usr/src/packages/BUILDROOT/vera++-1.3.0-1.x86_64/usr/doc/vera++
error: Directory not found: /usr/src/packages/BUILDROOT/vera++-1.3.0-1.x86_64/usr/doc/vera++/doc
error: Directory not found: /usr/src/packages/BUILDROOT/vera++-1.3.0-1.x86_64/usr/doc/vera++/doc/CMakeFiles
error: File not found: /usr/src/packages/BUILDROOT/vera++-1.3.0-1.x86_64/usr/doc/vera++/doc/CMakeFiles/CMakeDirectoryInformation.cmake
error: File not found: /usr/src/packages/BUILDROOT/vera++-1.3.0-1.x86_64/usr/doc/vera++/doc/CMakeFiles/progress.marks
error: File not found: /usr/src/packages/BUILDROOT/vera++-1.3.0-1.x86_64/usr/doc/vera++/doc/Makefile
error: File not found: /usr/src/packages/BUILDROOT/vera++-1.3.0-1.x86_64/usr/doc/vera++/doc/cmake_install.cmake
RPM build errors:
Directory not found: /usr/src/packages/BUILDROOT/vera++-1.3.0-1.x86_64/usr
Directory not found: /usr/src/packages/BUILDROOT/vera++-1.3.0-1.x86_64/usr/doc
Directory not found: /usr/src/packages/BUILDROOT/vera++-1.3.0-1.x86_64/usr/doc/vera++
Directory not found: /usr/src/packages/BUILDROOT/vera++-1.3.0-1.x86_64/usr/doc/vera++/doc
Directory not found: /usr/src/packages/BUILDROOT/vera++-1.3.0-1.x86_64/usr/doc/vera++/doc/CMakeFiles
File not found: /usr/src/packages/BUILDROOT/vera++-1.3.0-1.x86_64/usr/doc/vera++/doc/CMakeFiles/CMakeDirectoryInformation.cmake
File not found: /usr/src/packages/BUILDROOT/vera++-1.3.0-1.x86_64/usr/doc/vera++/doc/CMakeFiles/progress.marks
File not found: /usr/src/packages/BUILDROOT/vera++-1.3.0-1.x86_64/usr/doc/vera++/doc/Makefile
File not found: /usr/src/packages/BUILDROOT/vera++-1.3.0-1.x86_64/usr/doc/vera++/doc/cmake_install.cmake
It looks like you're making progress, but there are still some hurdles related to the use of checkinstall and how it's handling the packaging process. The errors can be categorized and addressed as follows:
Issues with installwatch.so
The repeated ERROR: ld.so: object '/usr/local/lib/installwatch.so' from LD_PRELOAD cannot be preloaded (wrong ELF class: ELFCLASS32): ignored. message indicates a persistent mismatch in architecture between the library (installwatch.so) and your system. As mentioned before, this may be due to installing a 32-bit version of checkinstall or its components on a 64-bit system.
Resolution: Verify the architecture of your checkinstall and its components. If a reinstall or update doesn't solve the issue, consider consulting the checkinstall documentation or support channels.
Permission Issues Overcome
Using sudo with the full path to checkinstall seems to have helped bypass the permission issues you previously encountered. That's a step in the right direction.
RPM Package Build Failure
The failure now appears during the RPM packaging phase, specifically concerning directories and files it expects but can't find. The log suggests that there are directories and files (particularly documentation files) that the RPM build process expects to find in a BUILDROOT directory but does not. This could be due to how checkinstall is attempting to package the files or how the make install directive handles them.
Potential Solutions:
Directory Structure: Before running checkinstall, verify that the directory structure in the installation destination (/usr/local, /usr/local/bin, /usr/local/lib, etc.) matches what the software expects. You might need to adjust the make install command or the project's installation scripts to ensure they are creating the expected directories and files.
Documentation Files: The errors related to documentation files missing may not be critical to the functionality of vera++. If these files are optional, you might consider modifying the installation script to skip their installation or, alternatively, manually create the expected directories and touch the files before running checkinstall (though this is more of a workaround than a true solution).
Using checkinstall Options: checkinstall has options to exclude files from the packaging process. If the documentation files are causing the process to fail and they're not essential, you could use the --exclude option to skip including them in the package. However, the better approach is to ensure that any expected files and directories are present and correctly placed.
Check make install Destination: Ensure that make install (which is invoked by checkinstall) correctly installs all necessary files to the $BUILDROOT directory expected by the RPM build process. You might need to adjust the installation prefix or other related configurations.
More Advanced Solution
If the issues persist, consider manually creating an RPM package using a .spec file that accurately describes the files to be included, their destinations, and any post-install scripts. This manual approach grants more control over the packaging process than checkinstall and may be more suited to complex installation scenarios.
The presence of errors due to architecture mismatch and the RPM build issues suggests that there might be more systemic issues with the build environment or the way checkinstall is being used. You may need to dive deeper into the specifics of RPM packaging or seek out more specialized support for vera++ or checkinstall to resolve these problems fully.
vera++
To specify these runtime dependencies when recreating the RPM package with checkinstall, you can do the following:
List the Dependencies: Create a comma-separated list of the essential libraries identified by ldd that are not part of the base system (i.e., typically present on all installations of your target distributions). In your case, all listed libraries might be deemed essential because they directly relate to vera++ functionality.
Use the --requires Option: When running checkinstall, utilize the --requires option to specify this list. For example:
Adjust the library names as needed to match the package names in your distribution's package manager. The names used in ldd output are library file names, which may not directly correspond to package names. For example, libtcl8.6 might be part of a package named tcl8.6 or similar, depending on how your distribution packages Tcl.
Verify Package Names: It’s important to convert the library names from ldd into actual package names that your package manager recognizes. This might require a bit of research for each library to determine the corresponding package name in your distribution's repositories. Use commands like zypper search (openSUSE), apt search (Debian/Ubuntu), or dnf search (Fedora) to find the right package names.
Be Mindful of Versions and Variants: Sometimes, multiple versions of a library or different variants (e.g., minimal vs. full, development vs. runtime) are available. Ensure you specify the versions and variants that provide the necessary runtime libraries without unnecessary extras for your application's needs.
By carefully specifying the runtime dependencies based on your findings from ldd, you help ensure that users of your RPM package will have all necessary libraries present for vera++ to run as expected, improving the overall reliability and user experience of your software package.